bundle.js 1.3 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716
  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__(34);
  54. var _reactDom2 = _interopRequireDefault(_reactDom);
  55. var _app = __webpack_require__(180);
  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. */
  79. 'use strict';
  80. var _assign = __webpack_require__(6);
  81. var ReactChildren = __webpack_require__(7);
  82. var ReactComponent = __webpack_require__(20);
  83. var ReactPureComponent = __webpack_require__(23);
  84. var ReactClass = __webpack_require__(24);
  85. var ReactDOMFactories = __webpack_require__(26);
  86. var ReactElement = __webpack_require__(11);
  87. var ReactPropTypes = __webpack_require__(31);
  88. var ReactVersion = __webpack_require__(32);
  89. var onlyChild = __webpack_require__(33);
  90. var warning = __webpack_require__(13);
  91. var createElement = ReactElement.createElement;
  92. var createFactory = ReactElement.createFactory;
  93. var cloneElement = ReactElement.cloneElement;
  94. if (process.env.NODE_ENV !== 'production') {
  95. var ReactElementValidator = __webpack_require__(27);
  96. createElement = ReactElementValidator.createElement;
  97. createFactory = ReactElementValidator.createFactory;
  98. cloneElement = ReactElementValidator.cloneElement;
  99. }
  100. var __spread = _assign;
  101. if (process.env.NODE_ENV !== 'production') {
  102. var warned = false;
  103. __spread = function () {
  104. 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;
  105. warned = true;
  106. return _assign.apply(null, arguments);
  107. };
  108. }
  109. var React = {
  110. // Modern
  111. Children: {
  112. map: ReactChildren.map,
  113. forEach: ReactChildren.forEach,
  114. count: ReactChildren.count,
  115. toArray: ReactChildren.toArray,
  116. only: onlyChild
  117. },
  118. Component: ReactComponent,
  119. PureComponent: ReactPureComponent,
  120. createElement: createElement,
  121. cloneElement: cloneElement,
  122. isValidElement: ReactElement.isValidElement,
  123. // Classic
  124. PropTypes: ReactPropTypes,
  125. createClass: ReactClass.createClass,
  126. createFactory: createFactory,
  127. createMixin: function (mixin) {
  128. // Currently a noop. Will be used to validate and trace mixins.
  129. return mixin;
  130. },
  131. // This looks DOM specific but these are actually isomorphic helpers
  132. // since they are just generating DOM strings.
  133. DOM: ReactDOMFactories,
  134. version: ReactVersion,
  135. // Deprecated hook for JSX spread, don't use this for anything.
  136. __spread: __spread
  137. };
  138. module.exports = React;
  139. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  140. /***/ },
  141. /* 5 */
  142. /***/ function(module, exports) {
  143. // shim for using process in browser
  144. var process = module.exports = {};
  145. // cached from whatever global is present so that test runners that stub it
  146. // don't break things. But we need to wrap it in a try catch in case it is
  147. // wrapped in strict mode code which doesn't define any globals. It's inside a
  148. // function because try/catches deoptimize in certain engines.
  149. var cachedSetTimeout;
  150. var cachedClearTimeout;
  151. function defaultSetTimout() {
  152. throw new Error('setTimeout has not been defined');
  153. }
  154. function defaultClearTimeout () {
  155. throw new Error('clearTimeout has not been defined');
  156. }
  157. (function () {
  158. try {
  159. if (typeof setTimeout === 'function') {
  160. cachedSetTimeout = setTimeout;
  161. } else {
  162. cachedSetTimeout = defaultSetTimout;
  163. }
  164. } catch (e) {
  165. cachedSetTimeout = defaultSetTimout;
  166. }
  167. try {
  168. if (typeof clearTimeout === 'function') {
  169. cachedClearTimeout = clearTimeout;
  170. } else {
  171. cachedClearTimeout = defaultClearTimeout;
  172. }
  173. } catch (e) {
  174. cachedClearTimeout = defaultClearTimeout;
  175. }
  176. } ())
  177. function runTimeout(fun) {
  178. if (cachedSetTimeout === setTimeout) {
  179. //normal enviroments in sane situations
  180. return setTimeout(fun, 0);
  181. }
  182. // if setTimeout wasn't available but was latter defined
  183. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  184. cachedSetTimeout = setTimeout;
  185. return setTimeout(fun, 0);
  186. }
  187. try {
  188. // when when somebody has screwed with setTimeout but no I.E. maddness
  189. return cachedSetTimeout(fun, 0);
  190. } catch(e){
  191. try {
  192. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  193. return cachedSetTimeout.call(null, fun, 0);
  194. } catch(e){
  195. // 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
  196. return cachedSetTimeout.call(this, fun, 0);
  197. }
  198. }
  199. }
  200. function runClearTimeout(marker) {
  201. if (cachedClearTimeout === clearTimeout) {
  202. //normal enviroments in sane situations
  203. return clearTimeout(marker);
  204. }
  205. // if clearTimeout wasn't available but was latter defined
  206. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  207. cachedClearTimeout = clearTimeout;
  208. return clearTimeout(marker);
  209. }
  210. try {
  211. // when when somebody has screwed with setTimeout but no I.E. maddness
  212. return cachedClearTimeout(marker);
  213. } catch (e){
  214. try {
  215. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  216. return cachedClearTimeout.call(null, marker);
  217. } catch (e){
  218. // 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.
  219. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  220. return cachedClearTimeout.call(this, marker);
  221. }
  222. }
  223. }
  224. var queue = [];
  225. var draining = false;
  226. var currentQueue;
  227. var queueIndex = -1;
  228. function cleanUpNextTick() {
  229. if (!draining || !currentQueue) {
  230. return;
  231. }
  232. draining = false;
  233. if (currentQueue.length) {
  234. queue = currentQueue.concat(queue);
  235. } else {
  236. queueIndex = -1;
  237. }
  238. if (queue.length) {
  239. drainQueue();
  240. }
  241. }
  242. function drainQueue() {
  243. if (draining) {
  244. return;
  245. }
  246. var timeout = runTimeout(cleanUpNextTick);
  247. draining = true;
  248. var len = queue.length;
  249. while(len) {
  250. currentQueue = queue;
  251. queue = [];
  252. while (++queueIndex < len) {
  253. if (currentQueue) {
  254. currentQueue[queueIndex].run();
  255. }
  256. }
  257. queueIndex = -1;
  258. len = queue.length;
  259. }
  260. currentQueue = null;
  261. draining = false;
  262. runClearTimeout(timeout);
  263. }
  264. process.nextTick = function (fun) {
  265. var args = new Array(arguments.length - 1);
  266. if (arguments.length > 1) {
  267. for (var i = 1; i < arguments.length; i++) {
  268. args[i - 1] = arguments[i];
  269. }
  270. }
  271. queue.push(new Item(fun, args));
  272. if (queue.length === 1 && !draining) {
  273. runTimeout(drainQueue);
  274. }
  275. };
  276. // v8 likes predictible objects
  277. function Item(fun, array) {
  278. this.fun = fun;
  279. this.array = array;
  280. }
  281. Item.prototype.run = function () {
  282. this.fun.apply(null, this.array);
  283. };
  284. process.title = 'browser';
  285. process.browser = true;
  286. process.env = {};
  287. process.argv = [];
  288. process.version = ''; // empty string to avoid regexp issues
  289. process.versions = {};
  290. function noop() {}
  291. process.on = noop;
  292. process.addListener = noop;
  293. process.once = noop;
  294. process.off = noop;
  295. process.removeListener = noop;
  296. process.removeAllListeners = noop;
  297. process.emit = noop;
  298. process.binding = function (name) {
  299. throw new Error('process.binding is not supported');
  300. };
  301. process.cwd = function () { return '/' };
  302. process.chdir = function (dir) {
  303. throw new Error('process.chdir is not supported');
  304. };
  305. process.umask = function() { return 0; };
  306. /***/ },
  307. /* 6 */
  308. /***/ function(module, exports) {
  309. /*
  310. object-assign
  311. (c) Sindre Sorhus
  312. @license MIT
  313. */
  314. 'use strict';
  315. /* eslint-disable no-unused-vars */
  316. var getOwnPropertySymbols = Object.getOwnPropertySymbols;
  317. var hasOwnProperty = Object.prototype.hasOwnProperty;
  318. var propIsEnumerable = Object.prototype.propertyIsEnumerable;
  319. function toObject(val) {
  320. if (val === null || val === undefined) {
  321. throw new TypeError('Object.assign cannot be called with null or undefined');
  322. }
  323. return Object(val);
  324. }
  325. function shouldUseNative() {
  326. try {
  327. if (!Object.assign) {
  328. return false;
  329. }
  330. // Detect buggy property enumeration order in older V8 versions.
  331. // https://bugs.chromium.org/p/v8/issues/detail?id=4118
  332. var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
  333. test1[5] = 'de';
  334. if (Object.getOwnPropertyNames(test1)[0] === '5') {
  335. return false;
  336. }
  337. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  338. var test2 = {};
  339. for (var i = 0; i < 10; i++) {
  340. test2['_' + String.fromCharCode(i)] = i;
  341. }
  342. var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
  343. return test2[n];
  344. });
  345. if (order2.join('') !== '0123456789') {
  346. return false;
  347. }
  348. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  349. var test3 = {};
  350. 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
  351. test3[letter] = letter;
  352. });
  353. if (Object.keys(Object.assign({}, test3)).join('') !==
  354. 'abcdefghijklmnopqrst') {
  355. return false;
  356. }
  357. return true;
  358. } catch (err) {
  359. // We don't expect any of the above to throw, but better to be safe.
  360. return false;
  361. }
  362. }
  363. module.exports = shouldUseNative() ? Object.assign : function (target, source) {
  364. var from;
  365. var to = toObject(target);
  366. var symbols;
  367. for (var s = 1; s < arguments.length; s++) {
  368. from = Object(arguments[s]);
  369. for (var key in from) {
  370. if (hasOwnProperty.call(from, key)) {
  371. to[key] = from[key];
  372. }
  373. }
  374. if (getOwnPropertySymbols) {
  375. symbols = getOwnPropertySymbols(from);
  376. for (var i = 0; i < symbols.length; i++) {
  377. if (propIsEnumerable.call(from, symbols[i])) {
  378. to[symbols[i]] = from[symbols[i]];
  379. }
  380. }
  381. }
  382. }
  383. return to;
  384. };
  385. /***/ },
  386. /* 7 */
  387. /***/ function(module, exports, __webpack_require__) {
  388. /**
  389. * Copyright 2013-present, Facebook, Inc.
  390. * All rights reserved.
  391. *
  392. * This source code is licensed under the BSD-style license found in the
  393. * LICENSE file in the root directory of this source tree. An additional grant
  394. * of patent rights can be found in the PATENTS file in the same directory.
  395. *
  396. */
  397. 'use strict';
  398. var PooledClass = __webpack_require__(8);
  399. var ReactElement = __webpack_require__(11);
  400. var emptyFunction = __webpack_require__(14);
  401. var traverseAllChildren = __webpack_require__(17);
  402. var twoArgumentPooler = PooledClass.twoArgumentPooler;
  403. var fourArgumentPooler = PooledClass.fourArgumentPooler;
  404. var userProvidedKeyEscapeRegex = /\/+/g;
  405. function escapeUserProvidedKey(text) {
  406. return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
  407. }
  408. /**
  409. * PooledClass representing the bookkeeping associated with performing a child
  410. * traversal. Allows avoiding binding callbacks.
  411. *
  412. * @constructor ForEachBookKeeping
  413. * @param {!function} forEachFunction Function to perform traversal with.
  414. * @param {?*} forEachContext Context to perform context with.
  415. */
  416. function ForEachBookKeeping(forEachFunction, forEachContext) {
  417. this.func = forEachFunction;
  418. this.context = forEachContext;
  419. this.count = 0;
  420. }
  421. ForEachBookKeeping.prototype.destructor = function () {
  422. this.func = null;
  423. this.context = null;
  424. this.count = 0;
  425. };
  426. PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
  427. function forEachSingleChild(bookKeeping, child, name) {
  428. var func = bookKeeping.func,
  429. context = bookKeeping.context;
  430. func.call(context, child, bookKeeping.count++);
  431. }
  432. /**
  433. * Iterates through children that are typically specified as `props.children`.
  434. *
  435. * See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach
  436. *
  437. * The provided forEachFunc(child, index) will be called for each
  438. * leaf child.
  439. *
  440. * @param {?*} children Children tree container.
  441. * @param {function(*, int)} forEachFunc
  442. * @param {*} forEachContext Context for forEachContext.
  443. */
  444. function forEachChildren(children, forEachFunc, forEachContext) {
  445. if (children == null) {
  446. return children;
  447. }
  448. var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
  449. traverseAllChildren(children, forEachSingleChild, traverseContext);
  450. ForEachBookKeeping.release(traverseContext);
  451. }
  452. /**
  453. * PooledClass representing the bookkeeping associated with performing a child
  454. * mapping. Allows avoiding binding callbacks.
  455. *
  456. * @constructor MapBookKeeping
  457. * @param {!*} mapResult Object containing the ordered map of results.
  458. * @param {!function} mapFunction Function to perform mapping with.
  459. * @param {?*} mapContext Context to perform mapping with.
  460. */
  461. function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
  462. this.result = mapResult;
  463. this.keyPrefix = keyPrefix;
  464. this.func = mapFunction;
  465. this.context = mapContext;
  466. this.count = 0;
  467. }
  468. MapBookKeeping.prototype.destructor = function () {
  469. this.result = null;
  470. this.keyPrefix = null;
  471. this.func = null;
  472. this.context = null;
  473. this.count = 0;
  474. };
  475. PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler);
  476. function mapSingleChildIntoContext(bookKeeping, child, childKey) {
  477. var result = bookKeeping.result,
  478. keyPrefix = bookKeeping.keyPrefix,
  479. func = bookKeeping.func,
  480. context = bookKeeping.context;
  481. var mappedChild = func.call(context, child, bookKeeping.count++);
  482. if (Array.isArray(mappedChild)) {
  483. mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
  484. } else if (mappedChild != null) {
  485. if (ReactElement.isValidElement(mappedChild)) {
  486. mappedChild = ReactElement.cloneAndReplaceKey(mappedChild,
  487. // Keep both the (mapped) and old keys if they differ, just as
  488. // traverseAllChildren used to do for objects as children
  489. keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
  490. }
  491. result.push(mappedChild);
  492. }
  493. }
  494. function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
  495. var escapedPrefix = '';
  496. if (prefix != null) {
  497. escapedPrefix = escapeUserProvidedKey(prefix) + '/';
  498. }
  499. var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
  500. traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
  501. MapBookKeeping.release(traverseContext);
  502. }
  503. /**
  504. * Maps children that are typically specified as `props.children`.
  505. *
  506. * See https://facebook.github.io/react/docs/top-level-api.html#react.children.map
  507. *
  508. * The provided mapFunction(child, key, index) will be called for each
  509. * leaf child.
  510. *
  511. * @param {?*} children Children tree container.
  512. * @param {function(*, int)} func The map function.
  513. * @param {*} context Context for mapFunction.
  514. * @return {object} Object containing the ordered map of results.
  515. */
  516. function mapChildren(children, func, context) {
  517. if (children == null) {
  518. return children;
  519. }
  520. var result = [];
  521. mapIntoWithKeyPrefixInternal(children, result, null, func, context);
  522. return result;
  523. }
  524. function forEachSingleChildDummy(traverseContext, child, name) {
  525. return null;
  526. }
  527. /**
  528. * Count the number of children that are typically specified as
  529. * `props.children`.
  530. *
  531. * See https://facebook.github.io/react/docs/top-level-api.html#react.children.count
  532. *
  533. * @param {?*} children Children tree container.
  534. * @return {number} The number of children.
  535. */
  536. function countChildren(children, context) {
  537. return traverseAllChildren(children, forEachSingleChildDummy, null);
  538. }
  539. /**
  540. * Flatten a children object (typically specified as `props.children`) and
  541. * return an array with appropriately re-keyed children.
  542. *
  543. * See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray
  544. */
  545. function toArray(children) {
  546. var result = [];
  547. mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
  548. return result;
  549. }
  550. var ReactChildren = {
  551. forEach: forEachChildren,
  552. map: mapChildren,
  553. mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
  554. count: countChildren,
  555. toArray: toArray
  556. };
  557. module.exports = ReactChildren;
  558. /***/ },
  559. /* 8 */
  560. /***/ function(module, exports, __webpack_require__) {
  561. /* WEBPACK VAR INJECTION */(function(process) {/**
  562. * Copyright 2013-present, Facebook, Inc.
  563. * All rights reserved.
  564. *
  565. * This source code is licensed under the BSD-style license found in the
  566. * LICENSE file in the root directory of this source tree. An additional grant
  567. * of patent rights can be found in the PATENTS file in the same directory.
  568. *
  569. *
  570. */
  571. 'use strict';
  572. var _prodInvariant = __webpack_require__(9);
  573. var invariant = __webpack_require__(10);
  574. /**
  575. * Static poolers. Several custom versions for each potential number of
  576. * arguments. A completely generic pooler is easy to implement, but would
  577. * require accessing the `arguments` object. In each of these, `this` refers to
  578. * the Class itself, not an instance. If any others are needed, simply add them
  579. * here, or in their own files.
  580. */
  581. var oneArgumentPooler = function (copyFieldsFrom) {
  582. var Klass = this;
  583. if (Klass.instancePool.length) {
  584. var instance = Klass.instancePool.pop();
  585. Klass.call(instance, copyFieldsFrom);
  586. return instance;
  587. } else {
  588. return new Klass(copyFieldsFrom);
  589. }
  590. };
  591. var twoArgumentPooler = function (a1, a2) {
  592. var Klass = this;
  593. if (Klass.instancePool.length) {
  594. var instance = Klass.instancePool.pop();
  595. Klass.call(instance, a1, a2);
  596. return instance;
  597. } else {
  598. return new Klass(a1, a2);
  599. }
  600. };
  601. var threeArgumentPooler = function (a1, a2, a3) {
  602. var Klass = this;
  603. if (Klass.instancePool.length) {
  604. var instance = Klass.instancePool.pop();
  605. Klass.call(instance, a1, a2, a3);
  606. return instance;
  607. } else {
  608. return new Klass(a1, a2, a3);
  609. }
  610. };
  611. var fourArgumentPooler = function (a1, a2, a3, a4) {
  612. var Klass = this;
  613. if (Klass.instancePool.length) {
  614. var instance = Klass.instancePool.pop();
  615. Klass.call(instance, a1, a2, a3, a4);
  616. return instance;
  617. } else {
  618. return new Klass(a1, a2, a3, a4);
  619. }
  620. };
  621. var standardReleaser = function (instance) {
  622. var Klass = this;
  623. !(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;
  624. instance.destructor();
  625. if (Klass.instancePool.length < Klass.poolSize) {
  626. Klass.instancePool.push(instance);
  627. }
  628. };
  629. var DEFAULT_POOL_SIZE = 10;
  630. var DEFAULT_POOLER = oneArgumentPooler;
  631. /**
  632. * Augments `CopyConstructor` to be a poolable class, augmenting only the class
  633. * itself (statically) not adding any prototypical fields. Any CopyConstructor
  634. * you give this may have a `poolSize` property, and will look for a
  635. * prototypical `destructor` on instances.
  636. *
  637. * @param {Function} CopyConstructor Constructor that can be used to reset.
  638. * @param {Function} pooler Customizable pooler.
  639. */
  640. var addPoolingTo = function (CopyConstructor, pooler) {
  641. // Casting as any so that flow ignores the actual implementation and trusts
  642. // it to match the type we declared
  643. var NewKlass = CopyConstructor;
  644. NewKlass.instancePool = [];
  645. NewKlass.getPooled = pooler || DEFAULT_POOLER;
  646. if (!NewKlass.poolSize) {
  647. NewKlass.poolSize = DEFAULT_POOL_SIZE;
  648. }
  649. NewKlass.release = standardReleaser;
  650. return NewKlass;
  651. };
  652. var PooledClass = {
  653. addPoolingTo: addPoolingTo,
  654. oneArgumentPooler: oneArgumentPooler,
  655. twoArgumentPooler: twoArgumentPooler,
  656. threeArgumentPooler: threeArgumentPooler,
  657. fourArgumentPooler: fourArgumentPooler
  658. };
  659. module.exports = PooledClass;
  660. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  661. /***/ },
  662. /* 9 */
  663. /***/ function(module, exports) {
  664. /**
  665. * Copyright (c) 2013-present, Facebook, Inc.
  666. * All rights reserved.
  667. *
  668. * This source code is licensed under the BSD-style license found in the
  669. * LICENSE file in the root directory of this source tree. An additional grant
  670. * of patent rights can be found in the PATENTS file in the same directory.
  671. *
  672. *
  673. */
  674. 'use strict';
  675. /**
  676. * WARNING: DO NOT manually require this module.
  677. * This is a replacement for `invariant(...)` used by the error code system
  678. * and will _only_ be required by the corresponding babel pass.
  679. * It always throws.
  680. */
  681. function reactProdInvariant(code) {
  682. var argCount = arguments.length - 1;
  683. var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;
  684. for (var argIdx = 0; argIdx < argCount; argIdx++) {
  685. message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
  686. }
  687. message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
  688. var error = new Error(message);
  689. error.name = 'Invariant Violation';
  690. error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
  691. throw error;
  692. }
  693. module.exports = reactProdInvariant;
  694. /***/ },
  695. /* 10 */
  696. /***/ function(module, exports, __webpack_require__) {
  697. /* WEBPACK VAR INJECTION */(function(process) {/**
  698. * Copyright (c) 2013-present, Facebook, Inc.
  699. * All rights reserved.
  700. *
  701. * This source code is licensed under the BSD-style license found in the
  702. * LICENSE file in the root directory of this source tree. An additional grant
  703. * of patent rights can be found in the PATENTS file in the same directory.
  704. *
  705. */
  706. 'use strict';
  707. /**
  708. * Use invariant() to assert state which your program assumes to be true.
  709. *
  710. * Provide sprintf-style format (only %s is supported) and arguments
  711. * to provide information about what broke and what you were
  712. * expecting.
  713. *
  714. * The invariant message will be stripped in production, but the invariant
  715. * will remain to ensure logic does not differ in production.
  716. */
  717. var validateFormat = function validateFormat(format) {};
  718. if (process.env.NODE_ENV !== 'production') {
  719. validateFormat = function validateFormat(format) {
  720. if (format === undefined) {
  721. throw new Error('invariant requires an error message argument');
  722. }
  723. };
  724. }
  725. function invariant(condition, format, a, b, c, d, e, f) {
  726. validateFormat(format);
  727. if (!condition) {
  728. var error;
  729. if (format === undefined) {
  730. error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
  731. } else {
  732. var args = [a, b, c, d, e, f];
  733. var argIndex = 0;
  734. error = new Error(format.replace(/%s/g, function () {
  735. return args[argIndex++];
  736. }));
  737. error.name = 'Invariant Violation';
  738. }
  739. error.framesToPop = 1; // we don't care about invariant's own frame
  740. throw error;
  741. }
  742. }
  743. module.exports = invariant;
  744. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  745. /***/ },
  746. /* 11 */
  747. /***/ function(module, exports, __webpack_require__) {
  748. /* WEBPACK VAR INJECTION */(function(process) {/**
  749. * Copyright 2014-present, Facebook, Inc.
  750. * All rights reserved.
  751. *
  752. * This source code is licensed under the BSD-style license found in the
  753. * LICENSE file in the root directory of this source tree. An additional grant
  754. * of patent rights can be found in the PATENTS file in the same directory.
  755. *
  756. */
  757. 'use strict';
  758. var _assign = __webpack_require__(6);
  759. var ReactCurrentOwner = __webpack_require__(12);
  760. var warning = __webpack_require__(13);
  761. var canDefineProperty = __webpack_require__(15);
  762. var hasOwnProperty = Object.prototype.hasOwnProperty;
  763. var REACT_ELEMENT_TYPE = __webpack_require__(16);
  764. var RESERVED_PROPS = {
  765. key: true,
  766. ref: true,
  767. __self: true,
  768. __source: true
  769. };
  770. var specialPropKeyWarningShown, specialPropRefWarningShown;
  771. function hasValidRef(config) {
  772. if (process.env.NODE_ENV !== 'production') {
  773. if (hasOwnProperty.call(config, 'ref')) {
  774. var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
  775. if (getter && getter.isReactWarning) {
  776. return false;
  777. }
  778. }
  779. }
  780. return config.ref !== undefined;
  781. }
  782. function hasValidKey(config) {
  783. if (process.env.NODE_ENV !== 'production') {
  784. if (hasOwnProperty.call(config, 'key')) {
  785. var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
  786. if (getter && getter.isReactWarning) {
  787. return false;
  788. }
  789. }
  790. }
  791. return config.key !== undefined;
  792. }
  793. function defineKeyPropWarningGetter(props, displayName) {
  794. var warnAboutAccessingKey = function () {
  795. if (!specialPropKeyWarningShown) {
  796. specialPropKeyWarningShown = true;
  797. 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;
  798. }
  799. };
  800. warnAboutAccessingKey.isReactWarning = true;
  801. Object.defineProperty(props, 'key', {
  802. get: warnAboutAccessingKey,
  803. configurable: true
  804. });
  805. }
  806. function defineRefPropWarningGetter(props, displayName) {
  807. var warnAboutAccessingRef = function () {
  808. if (!specialPropRefWarningShown) {
  809. specialPropRefWarningShown = true;
  810. 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;
  811. }
  812. };
  813. warnAboutAccessingRef.isReactWarning = true;
  814. Object.defineProperty(props, 'ref', {
  815. get: warnAboutAccessingRef,
  816. configurable: true
  817. });
  818. }
  819. /**
  820. * Factory method to create a new React element. This no longer adheres to
  821. * the class pattern, so do not use new to call it. Also, no instanceof check
  822. * will work. Instead test $$typeof field against Symbol.for('react.element') to check
  823. * if something is a React Element.
  824. *
  825. * @param {*} type
  826. * @param {*} key
  827. * @param {string|object} ref
  828. * @param {*} self A *temporary* helper to detect places where `this` is
  829. * different from the `owner` when React.createElement is called, so that we
  830. * can warn. We want to get rid of owner and replace string `ref`s with arrow
  831. * functions, and as long as `this` and owner are the same, there will be no
  832. * change in behavior.
  833. * @param {*} source An annotation object (added by a transpiler or otherwise)
  834. * indicating filename, line number, and/or other information.
  835. * @param {*} owner
  836. * @param {*} props
  837. * @internal
  838. */
  839. var ReactElement = function (type, key, ref, self, source, owner, props) {
  840. var element = {
  841. // This tag allow us to uniquely identify this as a React Element
  842. $$typeof: REACT_ELEMENT_TYPE,
  843. // Built-in properties that belong on the element
  844. type: type,
  845. key: key,
  846. ref: ref,
  847. props: props,
  848. // Record the component responsible for creating this element.
  849. _owner: owner
  850. };
  851. if (process.env.NODE_ENV !== 'production') {
  852. // The validation flag is currently mutative. We put it on
  853. // an external backing store so that we can freeze the whole object.
  854. // This can be replaced with a WeakMap once they are implemented in
  855. // commonly used development environments.
  856. element._store = {};
  857. // To make comparing ReactElements easier for testing purposes, we make
  858. // the validation flag non-enumerable (where possible, which should
  859. // include every environment we run tests in), so the test framework
  860. // ignores it.
  861. if (canDefineProperty) {
  862. Object.defineProperty(element._store, 'validated', {
  863. configurable: false,
  864. enumerable: false,
  865. writable: true,
  866. value: false
  867. });
  868. // self and source are DEV only properties.
  869. Object.defineProperty(element, '_self', {
  870. configurable: false,
  871. enumerable: false,
  872. writable: false,
  873. value: self
  874. });
  875. // Two elements created in two different places should be considered
  876. // equal for testing purposes and therefore we hide it from enumeration.
  877. Object.defineProperty(element, '_source', {
  878. configurable: false,
  879. enumerable: false,
  880. writable: false,
  881. value: source
  882. });
  883. } else {
  884. element._store.validated = false;
  885. element._self = self;
  886. element._source = source;
  887. }
  888. if (Object.freeze) {
  889. Object.freeze(element.props);
  890. Object.freeze(element);
  891. }
  892. }
  893. return element;
  894. };
  895. /**
  896. * Create and return a new ReactElement of the given type.
  897. * See https://facebook.github.io/react/docs/top-level-api.html#react.createelement
  898. */
  899. ReactElement.createElement = function (type, config, children) {
  900. var propName;
  901. // Reserved names are extracted
  902. var props = {};
  903. var key = null;
  904. var ref = null;
  905. var self = null;
  906. var source = null;
  907. if (config != null) {
  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. if (process.env.NODE_ENV !== 'production') {
  934. if (Object.freeze) {
  935. Object.freeze(childArray);
  936. }
  937. }
  938. props.children = childArray;
  939. }
  940. // Resolve default props
  941. if (type && type.defaultProps) {
  942. var defaultProps = type.defaultProps;
  943. for (propName in defaultProps) {
  944. if (props[propName] === undefined) {
  945. props[propName] = defaultProps[propName];
  946. }
  947. }
  948. }
  949. if (process.env.NODE_ENV !== 'production') {
  950. if (key || ref) {
  951. if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {
  952. var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
  953. if (key) {
  954. defineKeyPropWarningGetter(props, displayName);
  955. }
  956. if (ref) {
  957. defineRefPropWarningGetter(props, displayName);
  958. }
  959. }
  960. }
  961. }
  962. return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
  963. };
  964. /**
  965. * Return a function that produces ReactElements of a given type.
  966. * See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory
  967. */
  968. ReactElement.createFactory = function (type) {
  969. var factory = ReactElement.createElement.bind(null, type);
  970. // Expose the type on the factory and the prototype so that it can be
  971. // easily accessed on elements. E.g. `<Foo />.type === Foo`.
  972. // This should not be named `constructor` since this may not be the function
  973. // that created the element, and it may not even be a constructor.
  974. // Legacy hook TODO: Warn if this is accessed
  975. factory.type = type;
  976. return factory;
  977. };
  978. ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
  979. var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
  980. return newElement;
  981. };
  982. /**
  983. * Clone and return a new ReactElement using element as the starting point.
  984. * See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement
  985. */
  986. ReactElement.cloneElement = function (element, config, children) {
  987. var propName;
  988. // Original props are copied
  989. var props = _assign({}, element.props);
  990. // Reserved names are extracted
  991. var key = element.key;
  992. var ref = element.ref;
  993. // Self is preserved since the owner is preserved.
  994. var self = element._self;
  995. // Source is preserved since cloneElement is unlikely to be targeted by a
  996. // transpiler, and the original source is probably a better indicator of the
  997. // true owner.
  998. var source = element._source;
  999. // Owner will be preserved, unless ref is overridden
  1000. var owner = element._owner;
  1001. if (config != null) {
  1002. if (hasValidRef(config)) {
  1003. // Silently steal the ref from the parent.
  1004. ref = config.ref;
  1005. owner = ReactCurrentOwner.current;
  1006. }
  1007. if (hasValidKey(config)) {
  1008. key = '' + config.key;
  1009. }
  1010. // Remaining properties override existing props
  1011. var defaultProps;
  1012. if (element.type && element.type.defaultProps) {
  1013. defaultProps = element.type.defaultProps;
  1014. }
  1015. for (propName in config) {
  1016. if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
  1017. if (config[propName] === undefined && defaultProps !== undefined) {
  1018. // Resolve default props
  1019. props[propName] = defaultProps[propName];
  1020. } else {
  1021. props[propName] = config[propName];
  1022. }
  1023. }
  1024. }
  1025. }
  1026. // Children can be more than one argument, and those are transferred onto
  1027. // the newly allocated props object.
  1028. var childrenLength = arguments.length - 2;
  1029. if (childrenLength === 1) {
  1030. props.children = children;
  1031. } else if (childrenLength > 1) {
  1032. var childArray = Array(childrenLength);
  1033. for (var i = 0; i < childrenLength; i++) {
  1034. childArray[i] = arguments[i + 2];
  1035. }
  1036. props.children = childArray;
  1037. }
  1038. return ReactElement(element.type, key, ref, self, source, owner, props);
  1039. };
  1040. /**
  1041. * Verifies the object is a ReactElement.
  1042. * See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement
  1043. * @param {?object} object
  1044. * @return {boolean} True if `object` is a valid component.
  1045. * @final
  1046. */
  1047. ReactElement.isValidElement = function (object) {
  1048. return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
  1049. };
  1050. module.exports = ReactElement;
  1051. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  1052. /***/ },
  1053. /* 12 */
  1054. /***/ function(module, exports) {
  1055. /**
  1056. * Copyright 2013-present, Facebook, Inc.
  1057. * All rights reserved.
  1058. *
  1059. * This source code is licensed under the BSD-style license found in the
  1060. * LICENSE file in the root directory of this source tree. An additional grant
  1061. * of patent rights can be found in the PATENTS file in the same directory.
  1062. *
  1063. *
  1064. */
  1065. 'use strict';
  1066. /**
  1067. * Keeps track of the current owner.
  1068. *
  1069. * The current owner is the component who should own any components that are
  1070. * currently being constructed.
  1071. */
  1072. var ReactCurrentOwner = {
  1073. /**
  1074. * @internal
  1075. * @type {ReactComponent}
  1076. */
  1077. current: null
  1078. };
  1079. module.exports = ReactCurrentOwner;
  1080. /***/ },
  1081. /* 13 */
  1082. /***/ function(module, exports, __webpack_require__) {
  1083. /* WEBPACK VAR INJECTION */(function(process) {/**
  1084. * Copyright 2014-2015, Facebook, Inc.
  1085. * All rights reserved.
  1086. *
  1087. * This source code is licensed under the BSD-style license found in the
  1088. * LICENSE file in the root directory of this source tree. An additional grant
  1089. * of patent rights can be found in the PATENTS file in the same directory.
  1090. *
  1091. */
  1092. 'use strict';
  1093. var emptyFunction = __webpack_require__(14);
  1094. /**
  1095. * Similar to invariant but only logs a warning if the condition is not met.
  1096. * This can be used to log issues in development environments in critical
  1097. * paths. Removing the logging code for production environments will keep the
  1098. * same logic and follow the same code paths.
  1099. */
  1100. var warning = emptyFunction;
  1101. if (process.env.NODE_ENV !== 'production') {
  1102. (function () {
  1103. var printWarning = function printWarning(format) {
  1104. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  1105. args[_key - 1] = arguments[_key];
  1106. }
  1107. var argIndex = 0;
  1108. var message = 'Warning: ' + format.replace(/%s/g, function () {
  1109. return args[argIndex++];
  1110. });
  1111. if (typeof console !== 'undefined') {
  1112. console.error(message);
  1113. }
  1114. try {
  1115. // --- Welcome to debugging React ---
  1116. // This error was thrown as a convenience so that you can use this stack
  1117. // to find the callsite that caused this warning to fire.
  1118. throw new Error(message);
  1119. } catch (x) {}
  1120. };
  1121. warning = function warning(condition, format) {
  1122. if (format === undefined) {
  1123. throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
  1124. }
  1125. if (format.indexOf('Failed Composite propType: ') === 0) {
  1126. return; // Ignore CompositeComponent proptype check.
  1127. }
  1128. if (!condition) {
  1129. for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
  1130. args[_key2 - 2] = arguments[_key2];
  1131. }
  1132. printWarning.apply(undefined, [format].concat(args));
  1133. }
  1134. };
  1135. })();
  1136. }
  1137. module.exports = warning;
  1138. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  1139. /***/ },
  1140. /* 14 */
  1141. /***/ function(module, exports) {
  1142. "use strict";
  1143. /**
  1144. * Copyright (c) 2013-present, Facebook, Inc.
  1145. * All rights reserved.
  1146. *
  1147. * This source code is licensed under the BSD-style license found in the
  1148. * LICENSE file in the root directory of this source tree. An additional grant
  1149. * of patent rights can be found in the PATENTS file in the same directory.
  1150. *
  1151. *
  1152. */
  1153. function makeEmptyFunction(arg) {
  1154. return function () {
  1155. return arg;
  1156. };
  1157. }
  1158. /**
  1159. * This function accepts and discards inputs; it has no side effects. This is
  1160. * primarily useful idiomatically for overridable function endpoints which
  1161. * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
  1162. */
  1163. var emptyFunction = function emptyFunction() {};
  1164. emptyFunction.thatReturns = makeEmptyFunction;
  1165. emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
  1166. emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
  1167. emptyFunction.thatReturnsNull = makeEmptyFunction(null);
  1168. emptyFunction.thatReturnsThis = function () {
  1169. return this;
  1170. };
  1171. emptyFunction.thatReturnsArgument = function (arg) {
  1172. return arg;
  1173. };
  1174. module.exports = emptyFunction;
  1175. /***/ },
  1176. /* 15 */
  1177. /***/ function(module, exports, __webpack_require__) {
  1178. /* WEBPACK VAR INJECTION */(function(process) {/**
  1179. * Copyright 2013-present, Facebook, Inc.
  1180. * All rights reserved.
  1181. *
  1182. * This source code is licensed under the BSD-style license found in the
  1183. * LICENSE file in the root directory of this source tree. An additional grant
  1184. * of patent rights can be found in the PATENTS file in the same directory.
  1185. *
  1186. *
  1187. */
  1188. 'use strict';
  1189. var canDefineProperty = false;
  1190. if (process.env.NODE_ENV !== 'production') {
  1191. try {
  1192. // $FlowFixMe https://github.com/facebook/flow/issues/285
  1193. Object.defineProperty({}, 'x', { get: function () {} });
  1194. canDefineProperty = true;
  1195. } catch (x) {
  1196. // IE will fail on defineProperty
  1197. }
  1198. }
  1199. module.exports = canDefineProperty;
  1200. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  1201. /***/ },
  1202. /* 16 */
  1203. /***/ function(module, exports) {
  1204. /**
  1205. * Copyright 2014-present, Facebook, Inc.
  1206. * All rights reserved.
  1207. *
  1208. * This source code is licensed under the BSD-style license found in the
  1209. * LICENSE file in the root directory of this source tree. An additional grant
  1210. * of patent rights can be found in the PATENTS file in the same directory.
  1211. *
  1212. *
  1213. */
  1214. 'use strict';
  1215. // The Symbol used to tag the ReactElement type. If there is no native Symbol
  1216. // nor polyfill, then a plain number is used for performance.
  1217. var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
  1218. module.exports = REACT_ELEMENT_TYPE;
  1219. /***/ },
  1220. /* 17 */
  1221. /***/ function(module, exports, __webpack_require__) {
  1222. /* WEBPACK VAR INJECTION */(function(process) {/**
  1223. * Copyright 2013-present, Facebook, Inc.
  1224. * All rights reserved.
  1225. *
  1226. * This source code is licensed under the BSD-style license found in the
  1227. * LICENSE file in the root directory of this source tree. An additional grant
  1228. * of patent rights can be found in the PATENTS file in the same directory.
  1229. *
  1230. */
  1231. 'use strict';
  1232. var _prodInvariant = __webpack_require__(9);
  1233. var ReactCurrentOwner = __webpack_require__(12);
  1234. var REACT_ELEMENT_TYPE = __webpack_require__(16);
  1235. var getIteratorFn = __webpack_require__(18);
  1236. var invariant = __webpack_require__(10);
  1237. var KeyEscapeUtils = __webpack_require__(19);
  1238. var warning = __webpack_require__(13);
  1239. var SEPARATOR = '.';
  1240. var SUBSEPARATOR = ':';
  1241. /**
  1242. * This is inlined from ReactElement since this file is shared between
  1243. * isomorphic and renderers. We could extract this to a
  1244. *
  1245. */
  1246. /**
  1247. * TODO: Test that a single child and an array with one item have the same key
  1248. * pattern.
  1249. */
  1250. var didWarnAboutMaps = false;
  1251. /**
  1252. * Generate a key string that identifies a component within a set.
  1253. *
  1254. * @param {*} component A component that could contain a manual key.
  1255. * @param {number} index Index that is used if a manual key is not provided.
  1256. * @return {string}
  1257. */
  1258. function getComponentKey(component, index) {
  1259. // Do some typechecking here since we call this blindly. We want to ensure
  1260. // that we don't block potential future ES APIs.
  1261. if (component && typeof component === 'object' && component.key != null) {
  1262. // Explicit key
  1263. return KeyEscapeUtils.escape(component.key);
  1264. }
  1265. // Implicit key determined by the index in the set
  1266. return index.toString(36);
  1267. }
  1268. /**
  1269. * @param {?*} children Children tree container.
  1270. * @param {!string} nameSoFar Name of the key path so far.
  1271. * @param {!function} callback Callback to invoke with each child found.
  1272. * @param {?*} traverseContext Used to pass information throughout the traversal
  1273. * process.
  1274. * @return {!number} The number of children in this subtree.
  1275. */
  1276. function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
  1277. var type = typeof children;
  1278. if (type === 'undefined' || type === 'boolean') {
  1279. // All of the above are perceived as null.
  1280. children = null;
  1281. }
  1282. if (children === null || type === 'string' || type === 'number' ||
  1283. // The following is inlined from ReactElement. This means we can optimize
  1284. // some checks. React Fiber also inlines this logic for similar purposes.
  1285. type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) {
  1286. callback(traverseContext, children,
  1287. // If it's the only child, treat the name as if it was wrapped in an array
  1288. // so that it's consistent if the number of children grows.
  1289. nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
  1290. return 1;
  1291. }
  1292. var child;
  1293. var nextName;
  1294. var subtreeCount = 0; // Count of children found in the current subtree.
  1295. var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
  1296. if (Array.isArray(children)) {
  1297. for (var i = 0; i < children.length; i++) {
  1298. child = children[i];
  1299. nextName = nextNamePrefix + getComponentKey(child, i);
  1300. subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
  1301. }
  1302. } else {
  1303. var iteratorFn = getIteratorFn(children);
  1304. if (iteratorFn) {
  1305. var iterator = iteratorFn.call(children);
  1306. var step;
  1307. if (iteratorFn !== children.entries) {
  1308. var ii = 0;
  1309. while (!(step = iterator.next()).done) {
  1310. child = step.value;
  1311. nextName = nextNamePrefix + getComponentKey(child, ii++);
  1312. subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
  1313. }
  1314. } else {
  1315. if (process.env.NODE_ENV !== 'production') {
  1316. var mapsAsChildrenAddendum = '';
  1317. if (ReactCurrentOwner.current) {
  1318. var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName();
  1319. if (mapsAsChildrenOwnerName) {
  1320. mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.';
  1321. }
  1322. }
  1323. 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;
  1324. didWarnAboutMaps = true;
  1325. }
  1326. // Iterator will provide entry [k,v] tuples rather than values.
  1327. while (!(step = iterator.next()).done) {
  1328. var entry = step.value;
  1329. if (entry) {
  1330. child = entry[1];
  1331. nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
  1332. subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
  1333. }
  1334. }
  1335. }
  1336. } else if (type === 'object') {
  1337. var addendum = '';
  1338. if (process.env.NODE_ENV !== 'production') {
  1339. 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.';
  1340. if (children._isReactElement) {
  1341. 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.';
  1342. }
  1343. if (ReactCurrentOwner.current) {
  1344. var name = ReactCurrentOwner.current.getName();
  1345. if (name) {
  1346. addendum += ' Check the render method of `' + name + '`.';
  1347. }
  1348. }
  1349. }
  1350. var childrenString = String(children);
  1351. 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;
  1352. }
  1353. }
  1354. return subtreeCount;
  1355. }
  1356. /**
  1357. * Traverses children that are typically specified as `props.children`, but
  1358. * might also be specified through attributes:
  1359. *
  1360. * - `traverseAllChildren(this.props.children, ...)`
  1361. * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
  1362. *
  1363. * The `traverseContext` is an optional argument that is passed through the
  1364. * entire traversal. It can be used to store accumulations or anything else that
  1365. * the callback might find relevant.
  1366. *
  1367. * @param {?*} children Children tree object.
  1368. * @param {!function} callback To invoke upon traversing each child.
  1369. * @param {?*} traverseContext Context for traversal.
  1370. * @return {!number} The number of children in this subtree.
  1371. */
  1372. function traverseAllChildren(children, callback, traverseContext) {
  1373. if (children == null) {
  1374. return 0;
  1375. }
  1376. return traverseAllChildrenImpl(children, '', callback, traverseContext);
  1377. }
  1378. module.exports = traverseAllChildren;
  1379. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  1380. /***/ },
  1381. /* 18 */
  1382. /***/ function(module, exports) {
  1383. /**
  1384. * Copyright 2013-present, Facebook, Inc.
  1385. * All rights reserved.
  1386. *
  1387. * This source code is licensed under the BSD-style license found in the
  1388. * LICENSE file in the root directory of this source tree. An additional grant
  1389. * of patent rights can be found in the PATENTS file in the same directory.
  1390. *
  1391. *
  1392. */
  1393. 'use strict';
  1394. /* global Symbol */
  1395. var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
  1396. var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
  1397. /**
  1398. * Returns the iterator method function contained on the iterable object.
  1399. *
  1400. * Be sure to invoke the function with the iterable as context:
  1401. *
  1402. * var iteratorFn = getIteratorFn(myIterable);
  1403. * if (iteratorFn) {
  1404. * var iterator = iteratorFn.call(myIterable);
  1405. * ...
  1406. * }
  1407. *
  1408. * @param {?object} maybeIterable
  1409. * @return {?function}
  1410. */
  1411. function getIteratorFn(maybeIterable) {
  1412. var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
  1413. if (typeof iteratorFn === 'function') {
  1414. return iteratorFn;
  1415. }
  1416. }
  1417. module.exports = getIteratorFn;
  1418. /***/ },
  1419. /* 19 */
  1420. /***/ function(module, exports) {
  1421. /**
  1422. * Copyright 2013-present, Facebook, Inc.
  1423. * All rights reserved.
  1424. *
  1425. * This source code is licensed under the BSD-style license found in the
  1426. * LICENSE file in the root directory of this source tree. An additional grant
  1427. * of patent rights can be found in the PATENTS file in the same directory.
  1428. *
  1429. *
  1430. */
  1431. 'use strict';
  1432. /**
  1433. * Escape and wrap key so it is safe to use as a reactid
  1434. *
  1435. * @param {string} key to be escaped.
  1436. * @return {string} the escaped key.
  1437. */
  1438. function escape(key) {
  1439. var escapeRegex = /[=:]/g;
  1440. var escaperLookup = {
  1441. '=': '=0',
  1442. ':': '=2'
  1443. };
  1444. var escapedString = ('' + key).replace(escapeRegex, function (match) {
  1445. return escaperLookup[match];
  1446. });
  1447. return '$' + escapedString;
  1448. }
  1449. /**
  1450. * Unescape and unwrap key for human-readable display
  1451. *
  1452. * @param {string} key to unescape.
  1453. * @return {string} the unescaped key.
  1454. */
  1455. function unescape(key) {
  1456. var unescapeRegex = /(=0|=2)/g;
  1457. var unescaperLookup = {
  1458. '=0': '=',
  1459. '=2': ':'
  1460. };
  1461. var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);
  1462. return ('' + keySubstring).replace(unescapeRegex, function (match) {
  1463. return unescaperLookup[match];
  1464. });
  1465. }
  1466. var KeyEscapeUtils = {
  1467. escape: escape,
  1468. unescape: unescape
  1469. };
  1470. module.exports = KeyEscapeUtils;
  1471. /***/ },
  1472. /* 20 */
  1473. /***/ function(module, exports, __webpack_require__) {
  1474. /* WEBPACK VAR INJECTION */(function(process) {/**
  1475. * Copyright 2013-present, Facebook, Inc.
  1476. * All rights reserved.
  1477. *
  1478. * This source code is licensed under the BSD-style license found in the
  1479. * LICENSE file in the root directory of this source tree. An additional grant
  1480. * of patent rights can be found in the PATENTS file in the same directory.
  1481. *
  1482. */
  1483. 'use strict';
  1484. var _prodInvariant = __webpack_require__(9);
  1485. var ReactNoopUpdateQueue = __webpack_require__(21);
  1486. var canDefineProperty = __webpack_require__(15);
  1487. var emptyObject = __webpack_require__(22);
  1488. var invariant = __webpack_require__(10);
  1489. var warning = __webpack_require__(13);
  1490. /**
  1491. * Base class helpers for the updating state of a component.
  1492. */
  1493. function ReactComponent(props, context, updater) {
  1494. this.props = props;
  1495. this.context = context;
  1496. this.refs = emptyObject;
  1497. // We initialize the default updater but the real one gets injected by the
  1498. // renderer.
  1499. this.updater = updater || ReactNoopUpdateQueue;
  1500. }
  1501. ReactComponent.prototype.isReactComponent = {};
  1502. /**
  1503. * Sets a subset of the state. Always use this to mutate
  1504. * state. You should treat `this.state` as immutable.
  1505. *
  1506. * There is no guarantee that `this.state` will be immediately updated, so
  1507. * accessing `this.state` after calling this method may return the old value.
  1508. *
  1509. * There is no guarantee that calls to `setState` will run synchronously,
  1510. * as they may eventually be batched together. You can provide an optional
  1511. * callback that will be executed when the call to setState is actually
  1512. * completed.
  1513. *
  1514. * When a function is provided to setState, it will be called at some point in
  1515. * the future (not synchronously). It will be called with the up to date
  1516. * component arguments (state, props, context). These values can be different
  1517. * from this.* because your function may be called after receiveProps but before
  1518. * shouldComponentUpdate, and this new state, props, and context will not yet be
  1519. * assigned to this.
  1520. *
  1521. * @param {object|function} partialState Next partial state or function to
  1522. * produce next partial state to be merged with current state.
  1523. * @param {?function} callback Called after state is updated.
  1524. * @final
  1525. * @protected
  1526. */
  1527. ReactComponent.prototype.setState = function (partialState, callback) {
  1528. !(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;
  1529. this.updater.enqueueSetState(this, partialState);
  1530. if (callback) {
  1531. this.updater.enqueueCallback(this, callback, 'setState');
  1532. }
  1533. };
  1534. /**
  1535. * Forces an update. This should only be invoked when it is known with
  1536. * certainty that we are **not** in a DOM transaction.
  1537. *
  1538. * You may want to call this when you know that some deeper aspect of the
  1539. * component's state has changed but `setState` was not called.
  1540. *
  1541. * This will not invoke `shouldComponentUpdate`, but it will invoke
  1542. * `componentWillUpdate` and `componentDidUpdate`.
  1543. *
  1544. * @param {?function} callback Called after update is complete.
  1545. * @final
  1546. * @protected
  1547. */
  1548. ReactComponent.prototype.forceUpdate = function (callback) {
  1549. this.updater.enqueueForceUpdate(this);
  1550. if (callback) {
  1551. this.updater.enqueueCallback(this, callback, 'forceUpdate');
  1552. }
  1553. };
  1554. /**
  1555. * Deprecated APIs. These APIs used to exist on classic React classes but since
  1556. * we would like to deprecate them, we're not going to move them over to this
  1557. * modern base class. Instead, we define a getter that warns if it's accessed.
  1558. */
  1559. if (process.env.NODE_ENV !== 'production') {
  1560. var deprecatedAPIs = {
  1561. isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
  1562. replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
  1563. };
  1564. var defineDeprecationWarning = function (methodName, info) {
  1565. if (canDefineProperty) {
  1566. Object.defineProperty(ReactComponent.prototype, methodName, {
  1567. get: function () {
  1568. process.env.NODE_ENV !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : void 0;
  1569. return undefined;
  1570. }
  1571. });
  1572. }
  1573. };
  1574. for (var fnName in deprecatedAPIs) {
  1575. if (deprecatedAPIs.hasOwnProperty(fnName)) {
  1576. defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
  1577. }
  1578. }
  1579. }
  1580. module.exports = ReactComponent;
  1581. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  1582. /***/ },
  1583. /* 21 */
  1584. /***/ function(module, exports, __webpack_require__) {
  1585. /* WEBPACK VAR INJECTION */(function(process) {/**
  1586. * Copyright 2015-present, Facebook, Inc.
  1587. * All rights reserved.
  1588. *
  1589. * This source code is licensed under the BSD-style license found in the
  1590. * LICENSE file in the root directory of this source tree. An additional grant
  1591. * of patent rights can be found in the PATENTS file in the same directory.
  1592. *
  1593. */
  1594. 'use strict';
  1595. var warning = __webpack_require__(13);
  1596. function warnNoop(publicInstance, callerName) {
  1597. if (process.env.NODE_ENV !== 'production') {
  1598. var constructor = publicInstance.constructor;
  1599. 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;
  1600. }
  1601. }
  1602. /**
  1603. * This is the abstract API for an update queue.
  1604. */
  1605. var ReactNoopUpdateQueue = {
  1606. /**
  1607. * Checks whether or not this composite component is mounted.
  1608. * @param {ReactClass} publicInstance The instance we want to test.
  1609. * @return {boolean} True if mounted, false otherwise.
  1610. * @protected
  1611. * @final
  1612. */
  1613. isMounted: function (publicInstance) {
  1614. return false;
  1615. },
  1616. /**
  1617. * Enqueue a callback that will be executed after all the pending updates
  1618. * have processed.
  1619. *
  1620. * @param {ReactClass} publicInstance The instance to use as `this` context.
  1621. * @param {?function} callback Called after state is updated.
  1622. * @internal
  1623. */
  1624. enqueueCallback: function (publicInstance, callback) {},
  1625. /**
  1626. * Forces an update. This should only be invoked when it is known with
  1627. * certainty that we are **not** in a DOM transaction.
  1628. *
  1629. * You may want to call this when you know that some deeper aspect of the
  1630. * component's state has changed but `setState` was not called.
  1631. *
  1632. * This will not invoke `shouldComponentUpdate`, but it will invoke
  1633. * `componentWillUpdate` and `componentDidUpdate`.
  1634. *
  1635. * @param {ReactClass} publicInstance The instance that should rerender.
  1636. * @internal
  1637. */
  1638. enqueueForceUpdate: function (publicInstance) {
  1639. warnNoop(publicInstance, 'forceUpdate');
  1640. },
  1641. /**
  1642. * Replaces all of the state. Always use this or `setState` to mutate state.
  1643. * You should treat `this.state` as immutable.
  1644. *
  1645. * There is no guarantee that `this.state` will be immediately updated, so
  1646. * accessing `this.state` after calling this method may return the old value.
  1647. *
  1648. * @param {ReactClass} publicInstance The instance that should rerender.
  1649. * @param {object} completeState Next state.
  1650. * @internal
  1651. */
  1652. enqueueReplaceState: function (publicInstance, completeState) {
  1653. warnNoop(publicInstance, 'replaceState');
  1654. },
  1655. /**
  1656. * Sets a subset of the state. This only exists because _pendingState is
  1657. * internal. This provides a merging strategy that is not available to deep
  1658. * properties which is confusing. TODO: Expose pendingState or don't use it
  1659. * during the merge.
  1660. *
  1661. * @param {ReactClass} publicInstance The instance that should rerender.
  1662. * @param {object} partialState Next partial state to be merged with state.
  1663. * @internal
  1664. */
  1665. enqueueSetState: function (publicInstance, partialState) {
  1666. warnNoop(publicInstance, 'setState');
  1667. }
  1668. };
  1669. module.exports = ReactNoopUpdateQueue;
  1670. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  1671. /***/ },
  1672. /* 22 */
  1673. /***/ function(module, exports, __webpack_require__) {
  1674. /* WEBPACK VAR INJECTION */(function(process) {/**
  1675. * Copyright (c) 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. */
  1683. 'use strict';
  1684. var emptyObject = {};
  1685. if (process.env.NODE_ENV !== 'production') {
  1686. Object.freeze(emptyObject);
  1687. }
  1688. module.exports = emptyObject;
  1689. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  1690. /***/ },
  1691. /* 23 */
  1692. /***/ function(module, exports, __webpack_require__) {
  1693. /**
  1694. * Copyright 2013-present, Facebook, Inc.
  1695. * All rights reserved.
  1696. *
  1697. * This source code is licensed under the BSD-style license found in the
  1698. * LICENSE file in the root directory of this source tree. An additional grant
  1699. * of patent rights can be found in the PATENTS file in the same directory.
  1700. *
  1701. */
  1702. 'use strict';
  1703. var _assign = __webpack_require__(6);
  1704. var ReactComponent = __webpack_require__(20);
  1705. var ReactNoopUpdateQueue = __webpack_require__(21);
  1706. var emptyObject = __webpack_require__(22);
  1707. /**
  1708. * Base class helpers for the updating state of a component.
  1709. */
  1710. function ReactPureComponent(props, context, updater) {
  1711. // Duplicated from ReactComponent.
  1712. this.props = props;
  1713. this.context = context;
  1714. this.refs = emptyObject;
  1715. // We initialize the default updater but the real one gets injected by the
  1716. // renderer.
  1717. this.updater = updater || ReactNoopUpdateQueue;
  1718. }
  1719. function ComponentDummy() {}
  1720. ComponentDummy.prototype = ReactComponent.prototype;
  1721. ReactPureComponent.prototype = new ComponentDummy();
  1722. ReactPureComponent.prototype.constructor = ReactPureComponent;
  1723. // Avoid an extra prototype jump for these methods.
  1724. _assign(ReactPureComponent.prototype, ReactComponent.prototype);
  1725. ReactPureComponent.prototype.isPureReactComponent = true;
  1726. module.exports = ReactPureComponent;
  1727. /***/ },
  1728. /* 24 */
  1729. /***/ function(module, exports, __webpack_require__) {
  1730. /* WEBPACK VAR INJECTION */(function(process) {/**
  1731. * Copyright 2013-present, Facebook, Inc.
  1732. * All rights reserved.
  1733. *
  1734. * This source code is licensed under the BSD-style license found in the
  1735. * LICENSE file in the root directory of this source tree. An additional grant
  1736. * of patent rights can be found in the PATENTS file in the same directory.
  1737. *
  1738. */
  1739. 'use strict';
  1740. var _prodInvariant = __webpack_require__(9),
  1741. _assign = __webpack_require__(6);
  1742. var ReactComponent = __webpack_require__(20);
  1743. var ReactElement = __webpack_require__(11);
  1744. var ReactPropTypeLocationNames = __webpack_require__(25);
  1745. var ReactNoopUpdateQueue = __webpack_require__(21);
  1746. var emptyObject = __webpack_require__(22);
  1747. var invariant = __webpack_require__(10);
  1748. var warning = __webpack_require__(13);
  1749. var MIXINS_KEY = 'mixins';
  1750. // Helper function to allow the creation of anonymous functions which do not
  1751. // have .name set to the name of the variable being assigned to.
  1752. function identity(fn) {
  1753. return fn;
  1754. }
  1755. /**
  1756. * Policies that describe methods in `ReactClassInterface`.
  1757. */
  1758. var injectedMixins = [];
  1759. /**
  1760. * Composite components are higher-level components that compose other composite
  1761. * or host components.
  1762. *
  1763. * To create a new type of `ReactClass`, pass a specification of
  1764. * your new class to `React.createClass`. The only requirement of your class
  1765. * specification is that you implement a `render` method.
  1766. *
  1767. * var MyComponent = React.createClass({
  1768. * render: function() {
  1769. * return <div>Hello World</div>;
  1770. * }
  1771. * });
  1772. *
  1773. * The class specification supports a specific protocol of methods that have
  1774. * special meaning (e.g. `render`). See `ReactClassInterface` for
  1775. * more the comprehensive protocol. Any other properties and methods in the
  1776. * class specification will be available on the prototype.
  1777. *
  1778. * @interface ReactClassInterface
  1779. * @internal
  1780. */
  1781. var ReactClassInterface = {
  1782. /**
  1783. * An array of Mixin objects to include when defining your component.
  1784. *
  1785. * @type {array}
  1786. * @optional
  1787. */
  1788. mixins: 'DEFINE_MANY',
  1789. /**
  1790. * An object containing properties and methods that should be defined on
  1791. * the component's constructor instead of its prototype (static methods).
  1792. *
  1793. * @type {object}
  1794. * @optional
  1795. */
  1796. statics: 'DEFINE_MANY',
  1797. /**
  1798. * Definition of prop types for this component.
  1799. *
  1800. * @type {object}
  1801. * @optional
  1802. */
  1803. propTypes: 'DEFINE_MANY',
  1804. /**
  1805. * Definition of context types for this component.
  1806. *
  1807. * @type {object}
  1808. * @optional
  1809. */
  1810. contextTypes: 'DEFINE_MANY',
  1811. /**
  1812. * Definition of context types this component sets for its children.
  1813. *
  1814. * @type {object}
  1815. * @optional
  1816. */
  1817. childContextTypes: 'DEFINE_MANY',
  1818. // ==== Definition methods ====
  1819. /**
  1820. * Invoked when the component is mounted. Values in the mapping will be set on
  1821. * `this.props` if that prop is not specified (i.e. using an `in` check).
  1822. *
  1823. * This method is invoked before `getInitialState` and therefore cannot rely
  1824. * on `this.state` or use `this.setState`.
  1825. *
  1826. * @return {object}
  1827. * @optional
  1828. */
  1829. getDefaultProps: 'DEFINE_MANY_MERGED',
  1830. /**
  1831. * Invoked once before the component is mounted. The return value will be used
  1832. * as the initial value of `this.state`.
  1833. *
  1834. * getInitialState: function() {
  1835. * return {
  1836. * isOn: false,
  1837. * fooBaz: new BazFoo()
  1838. * }
  1839. * }
  1840. *
  1841. * @return {object}
  1842. * @optional
  1843. */
  1844. getInitialState: 'DEFINE_MANY_MERGED',
  1845. /**
  1846. * @return {object}
  1847. * @optional
  1848. */
  1849. getChildContext: 'DEFINE_MANY_MERGED',
  1850. /**
  1851. * Uses props from `this.props` and state from `this.state` to render the
  1852. * structure of the component.
  1853. *
  1854. * No guarantees are made about when or how often this method is invoked, so
  1855. * it must not have side effects.
  1856. *
  1857. * render: function() {
  1858. * var name = this.props.name;
  1859. * return <div>Hello, {name}!</div>;
  1860. * }
  1861. *
  1862. * @return {ReactComponent}
  1863. * @nosideeffects
  1864. * @required
  1865. */
  1866. render: 'DEFINE_ONCE',
  1867. // ==== Delegate methods ====
  1868. /**
  1869. * Invoked when the component is initially created and about to be mounted.
  1870. * This may have side effects, but any external subscriptions or data created
  1871. * by this method must be cleaned up in `componentWillUnmount`.
  1872. *
  1873. * @optional
  1874. */
  1875. componentWillMount: 'DEFINE_MANY',
  1876. /**
  1877. * Invoked when the component has been mounted and has a DOM representation.
  1878. * However, there is no guarantee that the DOM node is in the document.
  1879. *
  1880. * Use this as an opportunity to operate on the DOM when the component has
  1881. * been mounted (initialized and rendered) for the first time.
  1882. *
  1883. * @param {DOMElement} rootNode DOM element representing the component.
  1884. * @optional
  1885. */
  1886. componentDidMount: 'DEFINE_MANY',
  1887. /**
  1888. * Invoked before the component receives new props.
  1889. *
  1890. * Use this as an opportunity to react to a prop transition by updating the
  1891. * state using `this.setState`. Current props are accessed via `this.props`.
  1892. *
  1893. * componentWillReceiveProps: function(nextProps, nextContext) {
  1894. * this.setState({
  1895. * likesIncreasing: nextProps.likeCount > this.props.likeCount
  1896. * });
  1897. * }
  1898. *
  1899. * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
  1900. * transition may cause a state change, but the opposite is not true. If you
  1901. * need it, you are probably looking for `componentWillUpdate`.
  1902. *
  1903. * @param {object} nextProps
  1904. * @optional
  1905. */
  1906. componentWillReceiveProps: 'DEFINE_MANY',
  1907. /**
  1908. * Invoked while deciding if the component should be updated as a result of
  1909. * receiving new props, state and/or context.
  1910. *
  1911. * Use this as an opportunity to `return false` when you're certain that the
  1912. * transition to the new props/state/context will not require a component
  1913. * update.
  1914. *
  1915. * shouldComponentUpdate: function(nextProps, nextState, nextContext) {
  1916. * return !equal(nextProps, this.props) ||
  1917. * !equal(nextState, this.state) ||
  1918. * !equal(nextContext, this.context);
  1919. * }
  1920. *
  1921. * @param {object} nextProps
  1922. * @param {?object} nextState
  1923. * @param {?object} nextContext
  1924. * @return {boolean} True if the component should update.
  1925. * @optional
  1926. */
  1927. shouldComponentUpdate: 'DEFINE_ONCE',
  1928. /**
  1929. * Invoked when the component is about to update due to a transition from
  1930. * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
  1931. * and `nextContext`.
  1932. *
  1933. * Use this as an opportunity to perform preparation before an update occurs.
  1934. *
  1935. * NOTE: You **cannot** use `this.setState()` in this method.
  1936. *
  1937. * @param {object} nextProps
  1938. * @param {?object} nextState
  1939. * @param {?object} nextContext
  1940. * @param {ReactReconcileTransaction} transaction
  1941. * @optional
  1942. */
  1943. componentWillUpdate: 'DEFINE_MANY',
  1944. /**
  1945. * Invoked when the component's DOM representation has been updated.
  1946. *
  1947. * Use this as an opportunity to operate on the DOM when the component has
  1948. * been updated.
  1949. *
  1950. * @param {object} prevProps
  1951. * @param {?object} prevState
  1952. * @param {?object} prevContext
  1953. * @param {DOMElement} rootNode DOM element representing the component.
  1954. * @optional
  1955. */
  1956. componentDidUpdate: 'DEFINE_MANY',
  1957. /**
  1958. * Invoked when the component is about to be removed from its parent and have
  1959. * its DOM representation destroyed.
  1960. *
  1961. * Use this as an opportunity to deallocate any external resources.
  1962. *
  1963. * NOTE: There is no `componentDidUnmount` since your component will have been
  1964. * destroyed by that point.
  1965. *
  1966. * @optional
  1967. */
  1968. componentWillUnmount: 'DEFINE_MANY',
  1969. // ==== Advanced methods ====
  1970. /**
  1971. * Updates the component's currently mounted DOM representation.
  1972. *
  1973. * By default, this implements React's rendering and reconciliation algorithm.
  1974. * Sophisticated clients may wish to override this.
  1975. *
  1976. * @param {ReactReconcileTransaction} transaction
  1977. * @internal
  1978. * @overridable
  1979. */
  1980. updateComponent: 'OVERRIDE_BASE'
  1981. };
  1982. /**
  1983. * Mapping from class specification keys to special processing functions.
  1984. *
  1985. * Although these are declared like instance properties in the specification
  1986. * when defining classes using `React.createClass`, they are actually static
  1987. * and are accessible on the constructor instead of the prototype. Despite
  1988. * being static, they must be defined outside of the "statics" key under
  1989. * which all other static methods are defined.
  1990. */
  1991. var RESERVED_SPEC_KEYS = {
  1992. displayName: function (Constructor, displayName) {
  1993. Constructor.displayName = displayName;
  1994. },
  1995. mixins: function (Constructor, mixins) {
  1996. if (mixins) {
  1997. for (var i = 0; i < mixins.length; i++) {
  1998. mixSpecIntoComponent(Constructor, mixins[i]);
  1999. }
  2000. }
  2001. },
  2002. childContextTypes: function (Constructor, childContextTypes) {
  2003. if (process.env.NODE_ENV !== 'production') {
  2004. validateTypeDef(Constructor, childContextTypes, 'childContext');
  2005. }
  2006. Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
  2007. },
  2008. contextTypes: function (Constructor, contextTypes) {
  2009. if (process.env.NODE_ENV !== 'production') {
  2010. validateTypeDef(Constructor, contextTypes, 'context');
  2011. }
  2012. Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes);
  2013. },
  2014. /**
  2015. * Special case getDefaultProps which should move into statics but requires
  2016. * automatic merging.
  2017. */
  2018. getDefaultProps: function (Constructor, getDefaultProps) {
  2019. if (Constructor.getDefaultProps) {
  2020. Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
  2021. } else {
  2022. Constructor.getDefaultProps = getDefaultProps;
  2023. }
  2024. },
  2025. propTypes: function (Constructor, propTypes) {
  2026. if (process.env.NODE_ENV !== 'production') {
  2027. validateTypeDef(Constructor, propTypes, 'prop');
  2028. }
  2029. Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
  2030. },
  2031. statics: function (Constructor, statics) {
  2032. mixStaticSpecIntoComponent(Constructor, statics);
  2033. },
  2034. autobind: function () {} };
  2035. function validateTypeDef(Constructor, typeDef, location) {
  2036. for (var propName in typeDef) {
  2037. if (typeDef.hasOwnProperty(propName)) {
  2038. // use a warning instead of an invariant so components
  2039. // don't show up in prod but only in __DEV__
  2040. 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;
  2041. }
  2042. }
  2043. }
  2044. function validateMethodOverride(isAlreadyDefined, name) {
  2045. var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
  2046. // Disallow overriding of base class methods unless explicitly allowed.
  2047. if (ReactClassMixin.hasOwnProperty(name)) {
  2048. !(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;
  2049. }
  2050. // Disallow defining methods more than once unless explicitly allowed.
  2051. if (isAlreadyDefined) {
  2052. !(specPolicy === 'DEFINE_MANY' || 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;
  2053. }
  2054. }
  2055. /**
  2056. * Mixin helper which handles policy validation and reserved
  2057. * specification keys when building React classes.
  2058. */
  2059. function mixSpecIntoComponent(Constructor, spec) {
  2060. if (!spec) {
  2061. if (process.env.NODE_ENV !== 'production') {
  2062. var typeofSpec = typeof spec;
  2063. var isMixinValid = typeofSpec === 'object' && spec !== null;
  2064. 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;
  2065. }
  2066. return;
  2067. }
  2068. !(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;
  2069. !!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;
  2070. var proto = Constructor.prototype;
  2071. var autoBindPairs = proto.__reactAutoBindPairs;
  2072. // By handling mixins before any other properties, we ensure the same
  2073. // chaining order is applied to methods with DEFINE_MANY policy, whether
  2074. // mixins are listed before or after these methods in the spec.
  2075. if (spec.hasOwnProperty(MIXINS_KEY)) {
  2076. RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
  2077. }
  2078. for (var name in spec) {
  2079. if (!spec.hasOwnProperty(name)) {
  2080. continue;
  2081. }
  2082. if (name === MIXINS_KEY) {
  2083. // We have already handled mixins in a special case above.
  2084. continue;
  2085. }
  2086. var property = spec[name];
  2087. var isAlreadyDefined = proto.hasOwnProperty(name);
  2088. validateMethodOverride(isAlreadyDefined, name);
  2089. if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
  2090. RESERVED_SPEC_KEYS[name](Constructor, property);
  2091. } else {
  2092. // Setup methods on prototype:
  2093. // The following member methods should not be automatically bound:
  2094. // 1. Expected ReactClass methods (in the "interface").
  2095. // 2. Overridden methods (that were mixed in).
  2096. var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
  2097. var isFunction = typeof property === 'function';
  2098. var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
  2099. if (shouldAutoBind) {
  2100. autoBindPairs.push(name, property);
  2101. proto[name] = property;
  2102. } else {
  2103. if (isAlreadyDefined) {
  2104. var specPolicy = ReactClassInterface[name];
  2105. // These cases should already be caught by validateMethodOverride.
  2106. !(isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || 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;
  2107. // For methods which are defined more than once, call the existing
  2108. // methods before calling the new property, merging if appropriate.
  2109. if (specPolicy === 'DEFINE_MANY_MERGED') {
  2110. proto[name] = createMergedResultFunction(proto[name], property);
  2111. } else if (specPolicy === 'DEFINE_MANY') {
  2112. proto[name] = createChainedFunction(proto[name], property);
  2113. }
  2114. } else {
  2115. proto[name] = property;
  2116. if (process.env.NODE_ENV !== 'production') {
  2117. // Add verbose displayName to the function, which helps when looking
  2118. // at profiling tools.
  2119. if (typeof property === 'function' && spec.displayName) {
  2120. proto[name].displayName = spec.displayName + '_' + name;
  2121. }
  2122. }
  2123. }
  2124. }
  2125. }
  2126. }
  2127. }
  2128. function mixStaticSpecIntoComponent(Constructor, statics) {
  2129. if (!statics) {
  2130. return;
  2131. }
  2132. for (var name in statics) {
  2133. var property = statics[name];
  2134. if (!statics.hasOwnProperty(name)) {
  2135. continue;
  2136. }
  2137. var isReserved = name in RESERVED_SPEC_KEYS;
  2138. !!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;
  2139. var isInherited = name in Constructor;
  2140. !!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;
  2141. Constructor[name] = property;
  2142. }
  2143. }
  2144. /**
  2145. * Merge two objects, but throw if both contain the same key.
  2146. *
  2147. * @param {object} one The first object, which is mutated.
  2148. * @param {object} two The second object
  2149. * @return {object} one after it has been mutated to contain everything in two.
  2150. */
  2151. function mergeIntoWithNoDuplicateKeys(one, two) {
  2152. !(one && two && typeof one === 'object' && typeof two === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : _prodInvariant('80') : void 0;
  2153. for (var key in two) {
  2154. if (two.hasOwnProperty(key)) {
  2155. !(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;
  2156. one[key] = two[key];
  2157. }
  2158. }
  2159. return one;
  2160. }
  2161. /**
  2162. * Creates a function that invokes two functions and merges their return values.
  2163. *
  2164. * @param {function} one Function to invoke first.
  2165. * @param {function} two Function to invoke second.
  2166. * @return {function} Function that invokes the two argument functions.
  2167. * @private
  2168. */
  2169. function createMergedResultFunction(one, two) {
  2170. return function mergedResult() {
  2171. var a = one.apply(this, arguments);
  2172. var b = two.apply(this, arguments);
  2173. if (a == null) {
  2174. return b;
  2175. } else if (b == null) {
  2176. return a;
  2177. }
  2178. var c = {};
  2179. mergeIntoWithNoDuplicateKeys(c, a);
  2180. mergeIntoWithNoDuplicateKeys(c, b);
  2181. return c;
  2182. };
  2183. }
  2184. /**
  2185. * Creates a function that invokes two functions and ignores their return vales.
  2186. *
  2187. * @param {function} one Function to invoke first.
  2188. * @param {function} two Function to invoke second.
  2189. * @return {function} Function that invokes the two argument functions.
  2190. * @private
  2191. */
  2192. function createChainedFunction(one, two) {
  2193. return function chainedFunction() {
  2194. one.apply(this, arguments);
  2195. two.apply(this, arguments);
  2196. };
  2197. }
  2198. /**
  2199. * Binds a method to the component.
  2200. *
  2201. * @param {object} component Component whose method is going to be bound.
  2202. * @param {function} method Method to be bound.
  2203. * @return {function} The bound method.
  2204. */
  2205. function bindAutoBindMethod(component, method) {
  2206. var boundMethod = method.bind(component);
  2207. if (process.env.NODE_ENV !== 'production') {
  2208. boundMethod.__reactBoundContext = component;
  2209. boundMethod.__reactBoundMethod = method;
  2210. boundMethod.__reactBoundArguments = null;
  2211. var componentName = component.constructor.displayName;
  2212. var _bind = boundMethod.bind;
  2213. boundMethod.bind = function (newThis) {
  2214. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  2215. args[_key - 1] = arguments[_key];
  2216. }
  2217. // User is trying to bind() an autobound method; we effectively will
  2218. // ignore the value of "this" that the user is trying to use, so
  2219. // let's warn.
  2220. if (newThis !== component && newThis !== null) {
  2221. process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0;
  2222. } else if (!args.length) {
  2223. 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;
  2224. return boundMethod;
  2225. }
  2226. var reboundMethod = _bind.apply(boundMethod, arguments);
  2227. reboundMethod.__reactBoundContext = component;
  2228. reboundMethod.__reactBoundMethod = method;
  2229. reboundMethod.__reactBoundArguments = args;
  2230. return reboundMethod;
  2231. };
  2232. }
  2233. return boundMethod;
  2234. }
  2235. /**
  2236. * Binds all auto-bound methods in a component.
  2237. *
  2238. * @param {object} component Component whose method is going to be bound.
  2239. */
  2240. function bindAutoBindMethods(component) {
  2241. var pairs = component.__reactAutoBindPairs;
  2242. for (var i = 0; i < pairs.length; i += 2) {
  2243. var autoBindKey = pairs[i];
  2244. var method = pairs[i + 1];
  2245. component[autoBindKey] = bindAutoBindMethod(component, method);
  2246. }
  2247. }
  2248. /**
  2249. * Add more to the ReactClass base class. These are all legacy features and
  2250. * therefore not already part of the modern ReactComponent.
  2251. */
  2252. var ReactClassMixin = {
  2253. /**
  2254. * TODO: This will be deprecated because state should always keep a consistent
  2255. * type signature and the only use case for this, is to avoid that.
  2256. */
  2257. replaceState: function (newState, callback) {
  2258. this.updater.enqueueReplaceState(this, newState);
  2259. if (callback) {
  2260. this.updater.enqueueCallback(this, callback, 'replaceState');
  2261. }
  2262. },
  2263. /**
  2264. * Checks whether or not this composite component is mounted.
  2265. * @return {boolean} True if mounted, false otherwise.
  2266. * @protected
  2267. * @final
  2268. */
  2269. isMounted: function () {
  2270. return this.updater.isMounted(this);
  2271. }
  2272. };
  2273. var ReactClassComponent = function () {};
  2274. _assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);
  2275. /**
  2276. * Module for creating composite components.
  2277. *
  2278. * @class ReactClass
  2279. */
  2280. var ReactClass = {
  2281. /**
  2282. * Creates a composite component class given a class specification.
  2283. * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
  2284. *
  2285. * @param {object} spec Class specification (which must define `render`).
  2286. * @return {function} Component constructor function.
  2287. * @public
  2288. */
  2289. createClass: function (spec) {
  2290. // To keep our warnings more understandable, we'll use a little hack here to
  2291. // ensure that Constructor.name !== 'Constructor'. This makes sure we don't
  2292. // unnecessarily identify a class without displayName as 'Constructor'.
  2293. var Constructor = identity(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. /* 25 */
  2366. /***/ function(module, exports, __webpack_require__) {
  2367. /* WEBPACK VAR INJECTION */(function(process) {/**
  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. *
  2376. */
  2377. 'use strict';
  2378. var ReactPropTypeLocationNames = {};
  2379. if (process.env.NODE_ENV !== 'production') {
  2380. ReactPropTypeLocationNames = {
  2381. prop: 'prop',
  2382. context: 'context',
  2383. childContext: 'child context'
  2384. };
  2385. }
  2386. module.exports = ReactPropTypeLocationNames;
  2387. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  2388. /***/ },
  2389. /* 26 */
  2390. /***/ function(module, exports, __webpack_require__) {
  2391. /* WEBPACK VAR INJECTION */(function(process) {/**
  2392. * Copyright 2013-present, Facebook, Inc.
  2393. * All rights reserved.
  2394. *
  2395. * This source code is licensed under the BSD-style license found in the
  2396. * LICENSE file in the root directory of this source tree. An additional grant
  2397. * of patent rights can be found in the PATENTS file in the same directory.
  2398. *
  2399. */
  2400. 'use strict';
  2401. var ReactElement = __webpack_require__(11);
  2402. /**
  2403. * Create a factory that creates HTML tag elements.
  2404. *
  2405. * @private
  2406. */
  2407. var createDOMFactory = ReactElement.createFactory;
  2408. if (process.env.NODE_ENV !== 'production') {
  2409. var ReactElementValidator = __webpack_require__(27);
  2410. createDOMFactory = ReactElementValidator.createFactory;
  2411. }
  2412. /**
  2413. * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
  2414. * This is also accessible via `React.DOM`.
  2415. *
  2416. * @public
  2417. */
  2418. var ReactDOMFactories = {
  2419. a: createDOMFactory('a'),
  2420. abbr: createDOMFactory('abbr'),
  2421. address: createDOMFactory('address'),
  2422. area: createDOMFactory('area'),
  2423. article: createDOMFactory('article'),
  2424. aside: createDOMFactory('aside'),
  2425. audio: createDOMFactory('audio'),
  2426. b: createDOMFactory('b'),
  2427. base: createDOMFactory('base'),
  2428. bdi: createDOMFactory('bdi'),
  2429. bdo: createDOMFactory('bdo'),
  2430. big: createDOMFactory('big'),
  2431. blockquote: createDOMFactory('blockquote'),
  2432. body: createDOMFactory('body'),
  2433. br: createDOMFactory('br'),
  2434. button: createDOMFactory('button'),
  2435. canvas: createDOMFactory('canvas'),
  2436. caption: createDOMFactory('caption'),
  2437. cite: createDOMFactory('cite'),
  2438. code: createDOMFactory('code'),
  2439. col: createDOMFactory('col'),
  2440. colgroup: createDOMFactory('colgroup'),
  2441. data: createDOMFactory('data'),
  2442. datalist: createDOMFactory('datalist'),
  2443. dd: createDOMFactory('dd'),
  2444. del: createDOMFactory('del'),
  2445. details: createDOMFactory('details'),
  2446. dfn: createDOMFactory('dfn'),
  2447. dialog: createDOMFactory('dialog'),
  2448. div: createDOMFactory('div'),
  2449. dl: createDOMFactory('dl'),
  2450. dt: createDOMFactory('dt'),
  2451. em: createDOMFactory('em'),
  2452. embed: createDOMFactory('embed'),
  2453. fieldset: createDOMFactory('fieldset'),
  2454. figcaption: createDOMFactory('figcaption'),
  2455. figure: createDOMFactory('figure'),
  2456. footer: createDOMFactory('footer'),
  2457. form: createDOMFactory('form'),
  2458. h1: createDOMFactory('h1'),
  2459. h2: createDOMFactory('h2'),
  2460. h3: createDOMFactory('h3'),
  2461. h4: createDOMFactory('h4'),
  2462. h5: createDOMFactory('h5'),
  2463. h6: createDOMFactory('h6'),
  2464. head: createDOMFactory('head'),
  2465. header: createDOMFactory('header'),
  2466. hgroup: createDOMFactory('hgroup'),
  2467. hr: createDOMFactory('hr'),
  2468. html: createDOMFactory('html'),
  2469. i: createDOMFactory('i'),
  2470. iframe: createDOMFactory('iframe'),
  2471. img: createDOMFactory('img'),
  2472. input: createDOMFactory('input'),
  2473. ins: createDOMFactory('ins'),
  2474. kbd: createDOMFactory('kbd'),
  2475. keygen: createDOMFactory('keygen'),
  2476. label: createDOMFactory('label'),
  2477. legend: createDOMFactory('legend'),
  2478. li: createDOMFactory('li'),
  2479. link: createDOMFactory('link'),
  2480. main: createDOMFactory('main'),
  2481. map: createDOMFactory('map'),
  2482. mark: createDOMFactory('mark'),
  2483. menu: createDOMFactory('menu'),
  2484. menuitem: createDOMFactory('menuitem'),
  2485. meta: createDOMFactory('meta'),
  2486. meter: createDOMFactory('meter'),
  2487. nav: createDOMFactory('nav'),
  2488. noscript: createDOMFactory('noscript'),
  2489. object: createDOMFactory('object'),
  2490. ol: createDOMFactory('ol'),
  2491. optgroup: createDOMFactory('optgroup'),
  2492. option: createDOMFactory('option'),
  2493. output: createDOMFactory('output'),
  2494. p: createDOMFactory('p'),
  2495. param: createDOMFactory('param'),
  2496. picture: createDOMFactory('picture'),
  2497. pre: createDOMFactory('pre'),
  2498. progress: createDOMFactory('progress'),
  2499. q: createDOMFactory('q'),
  2500. rp: createDOMFactory('rp'),
  2501. rt: createDOMFactory('rt'),
  2502. ruby: createDOMFactory('ruby'),
  2503. s: createDOMFactory('s'),
  2504. samp: createDOMFactory('samp'),
  2505. script: createDOMFactory('script'),
  2506. section: createDOMFactory('section'),
  2507. select: createDOMFactory('select'),
  2508. small: createDOMFactory('small'),
  2509. source: createDOMFactory('source'),
  2510. span: createDOMFactory('span'),
  2511. strong: createDOMFactory('strong'),
  2512. style: createDOMFactory('style'),
  2513. sub: createDOMFactory('sub'),
  2514. summary: createDOMFactory('summary'),
  2515. sup: createDOMFactory('sup'),
  2516. table: createDOMFactory('table'),
  2517. tbody: createDOMFactory('tbody'),
  2518. td: createDOMFactory('td'),
  2519. textarea: createDOMFactory('textarea'),
  2520. tfoot: createDOMFactory('tfoot'),
  2521. th: createDOMFactory('th'),
  2522. thead: createDOMFactory('thead'),
  2523. time: createDOMFactory('time'),
  2524. title: createDOMFactory('title'),
  2525. tr: createDOMFactory('tr'),
  2526. track: createDOMFactory('track'),
  2527. u: createDOMFactory('u'),
  2528. ul: createDOMFactory('ul'),
  2529. 'var': createDOMFactory('var'),
  2530. video: createDOMFactory('video'),
  2531. wbr: createDOMFactory('wbr'),
  2532. // SVG
  2533. circle: createDOMFactory('circle'),
  2534. clipPath: createDOMFactory('clipPath'),
  2535. defs: createDOMFactory('defs'),
  2536. ellipse: createDOMFactory('ellipse'),
  2537. g: createDOMFactory('g'),
  2538. image: createDOMFactory('image'),
  2539. line: createDOMFactory('line'),
  2540. linearGradient: createDOMFactory('linearGradient'),
  2541. mask: createDOMFactory('mask'),
  2542. path: createDOMFactory('path'),
  2543. pattern: createDOMFactory('pattern'),
  2544. polygon: createDOMFactory('polygon'),
  2545. polyline: createDOMFactory('polyline'),
  2546. radialGradient: createDOMFactory('radialGradient'),
  2547. rect: createDOMFactory('rect'),
  2548. stop: createDOMFactory('stop'),
  2549. svg: createDOMFactory('svg'),
  2550. text: createDOMFactory('text'),
  2551. tspan: createDOMFactory('tspan')
  2552. };
  2553. module.exports = ReactDOMFactories;
  2554. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  2555. /***/ },
  2556. /* 27 */
  2557. /***/ function(module, exports, __webpack_require__) {
  2558. /* WEBPACK VAR INJECTION */(function(process) {/**
  2559. * Copyright 2014-present, Facebook, Inc.
  2560. * All rights reserved.
  2561. *
  2562. * This source code is licensed under the BSD-style license found in the
  2563. * LICENSE file in the root directory of this source tree. An additional grant
  2564. * of patent rights can be found in the PATENTS file in the same directory.
  2565. *
  2566. */
  2567. /**
  2568. * ReactElementValidator provides a wrapper around a element factory
  2569. * which validates the props passed to the element. This is intended to be
  2570. * used only in DEV and could be replaced by a static type checker for languages
  2571. * that support it.
  2572. */
  2573. 'use strict';
  2574. var ReactCurrentOwner = __webpack_require__(12);
  2575. var ReactComponentTreeHook = __webpack_require__(28);
  2576. var ReactElement = __webpack_require__(11);
  2577. var checkReactTypeSpec = __webpack_require__(29);
  2578. var canDefineProperty = __webpack_require__(15);
  2579. var getIteratorFn = __webpack_require__(18);
  2580. var warning = __webpack_require__(13);
  2581. function getDeclarationErrorAddendum() {
  2582. if (ReactCurrentOwner.current) {
  2583. var name = ReactCurrentOwner.current.getName();
  2584. if (name) {
  2585. return ' Check the render method of `' + name + '`.';
  2586. }
  2587. }
  2588. return '';
  2589. }
  2590. /**
  2591. * Warn if there's no key explicitly set on dynamic arrays of children or
  2592. * object keys are not valid. This allows us to keep track of children between
  2593. * updates.
  2594. */
  2595. var ownerHasKeyUseWarning = {};
  2596. function getCurrentComponentErrorInfo(parentType) {
  2597. var info = getDeclarationErrorAddendum();
  2598. if (!info) {
  2599. var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
  2600. if (parentName) {
  2601. info = ' Check the top-level render call using <' + parentName + '>.';
  2602. }
  2603. }
  2604. return info;
  2605. }
  2606. /**
  2607. * Warn if the element doesn't have an explicit key assigned to it.
  2608. * This element is in an array. The array could grow and shrink or be
  2609. * reordered. All children that haven't already been validated are required to
  2610. * have a "key" property assigned to it. Error statuses are cached so a warning
  2611. * will only be shown once.
  2612. *
  2613. * @internal
  2614. * @param {ReactElement} element Element that requires a key.
  2615. * @param {*} parentType element's parent's type.
  2616. */
  2617. function validateExplicitKey(element, parentType) {
  2618. if (!element._store || element._store.validated || element.key != null) {
  2619. return;
  2620. }
  2621. element._store.validated = true;
  2622. var memoizer = ownerHasKeyUseWarning.uniqueKey || (ownerHasKeyUseWarning.uniqueKey = {});
  2623. var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
  2624. if (memoizer[currentComponentErrorInfo]) {
  2625. return;
  2626. }
  2627. memoizer[currentComponentErrorInfo] = true;
  2628. // Usually the current owner is the offender, but if it accepts children as a
  2629. // property, it may be the creator of the child that's responsible for
  2630. // assigning it a key.
  2631. var childOwner = '';
  2632. if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
  2633. // Give the component that originally created this child.
  2634. childOwner = ' It was passed a child from ' + element._owner.getName() + '.';
  2635. }
  2636. 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;
  2637. }
  2638. /**
  2639. * Ensure that every element either is passed in a static location, in an
  2640. * array with an explicit keys property defined, or in an object literal
  2641. * with valid key property.
  2642. *
  2643. * @internal
  2644. * @param {ReactNode} node Statically passed child of any type.
  2645. * @param {*} parentType node's parent's type.
  2646. */
  2647. function validateChildKeys(node, parentType) {
  2648. if (typeof node !== 'object') {
  2649. return;
  2650. }
  2651. if (Array.isArray(node)) {
  2652. for (var i = 0; i < node.length; i++) {
  2653. var child = node[i];
  2654. if (ReactElement.isValidElement(child)) {
  2655. validateExplicitKey(child, parentType);
  2656. }
  2657. }
  2658. } else if (ReactElement.isValidElement(node)) {
  2659. // This element was passed in a valid location.
  2660. if (node._store) {
  2661. node._store.validated = true;
  2662. }
  2663. } else if (node) {
  2664. var iteratorFn = getIteratorFn(node);
  2665. // Entry iterators provide implicit keys.
  2666. if (iteratorFn) {
  2667. if (iteratorFn !== node.entries) {
  2668. var iterator = iteratorFn.call(node);
  2669. var step;
  2670. while (!(step = iterator.next()).done) {
  2671. if (ReactElement.isValidElement(step.value)) {
  2672. validateExplicitKey(step.value, parentType);
  2673. }
  2674. }
  2675. }
  2676. }
  2677. }
  2678. }
  2679. /**
  2680. * Given an element, validate that its props follow the propTypes definition,
  2681. * provided by the type.
  2682. *
  2683. * @param {ReactElement} element
  2684. */
  2685. function validatePropTypes(element) {
  2686. var componentClass = element.type;
  2687. if (typeof componentClass !== 'function') {
  2688. return;
  2689. }
  2690. var name = componentClass.displayName || componentClass.name;
  2691. if (componentClass.propTypes) {
  2692. checkReactTypeSpec(componentClass.propTypes, element.props, 'prop', name, element, null);
  2693. }
  2694. if (typeof componentClass.getDefaultProps === 'function') {
  2695. 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;
  2696. }
  2697. }
  2698. var ReactElementValidator = {
  2699. createElement: function (type, props, children) {
  2700. var validType = typeof type === 'string' || typeof type === 'function';
  2701. // We warn in this case but don't throw. We expect the element creation to
  2702. // succeed and there will likely be errors in render.
  2703. if (!validType) {
  2704. if (typeof type !== 'function' && typeof type !== 'string') {
  2705. var info = '';
  2706. if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
  2707. info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.';
  2708. }
  2709. info += getDeclarationErrorAddendum();
  2710. process.env.NODE_ENV !== 'production' ? warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info) : void 0;
  2711. }
  2712. }
  2713. var element = ReactElement.createElement.apply(this, arguments);
  2714. // The result can be nullish if a mock or a custom function is used.
  2715. // TODO: Drop this when these are no longer allowed as the type argument.
  2716. if (element == null) {
  2717. return element;
  2718. }
  2719. // Skip key warning if the type isn't valid since our key validation logic
  2720. // doesn't expect a non-string/function type and can throw confusing errors.
  2721. // We don't want exception behavior to differ between dev and prod.
  2722. // (Rendering will throw with a helpful message and as soon as the type is
  2723. // fixed, the key warnings will appear.)
  2724. if (validType) {
  2725. for (var i = 2; i < arguments.length; i++) {
  2726. validateChildKeys(arguments[i], type);
  2727. }
  2728. }
  2729. validatePropTypes(element);
  2730. return element;
  2731. },
  2732. createFactory: function (type) {
  2733. var validatedFactory = ReactElementValidator.createElement.bind(null, type);
  2734. // Legacy hook TODO: Warn if this is accessed
  2735. validatedFactory.type = type;
  2736. if (process.env.NODE_ENV !== 'production') {
  2737. if (canDefineProperty) {
  2738. Object.defineProperty(validatedFactory, 'type', {
  2739. enumerable: false,
  2740. get: function () {
  2741. process.env.NODE_ENV !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : void 0;
  2742. Object.defineProperty(this, 'type', {
  2743. value: type
  2744. });
  2745. return type;
  2746. }
  2747. });
  2748. }
  2749. }
  2750. return validatedFactory;
  2751. },
  2752. cloneElement: function (element, props, children) {
  2753. var newElement = ReactElement.cloneElement.apply(this, arguments);
  2754. for (var i = 2; i < arguments.length; i++) {
  2755. validateChildKeys(arguments[i], newElement.type);
  2756. }
  2757. validatePropTypes(newElement);
  2758. return newElement;
  2759. }
  2760. };
  2761. module.exports = ReactElementValidator;
  2762. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  2763. /***/ },
  2764. /* 28 */
  2765. /***/ function(module, exports, __webpack_require__) {
  2766. /* WEBPACK VAR INJECTION */(function(process) {/**
  2767. * Copyright 2016-present, Facebook, Inc.
  2768. * All rights reserved.
  2769. *
  2770. * This source code is licensed under the BSD-style license found in the
  2771. * LICENSE file in the root directory of this source tree. An additional grant
  2772. * of patent rights can be found in the PATENTS file in the same directory.
  2773. *
  2774. *
  2775. */
  2776. 'use strict';
  2777. var _prodInvariant = __webpack_require__(9);
  2778. var ReactCurrentOwner = __webpack_require__(12);
  2779. var invariant = __webpack_require__(10);
  2780. var warning = __webpack_require__(13);
  2781. function isNative(fn) {
  2782. // Based on isNative() from Lodash
  2783. var funcToString = Function.prototype.toString;
  2784. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2785. var reIsNative = RegExp('^' + funcToString
  2786. // Take an example native function source for comparison
  2787. .call(hasOwnProperty)
  2788. // Strip regex characters so we can use it for regex
  2789. .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
  2790. // Remove hasOwnProperty from the template to make it generic
  2791. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
  2792. try {
  2793. var source = funcToString.call(fn);
  2794. return reIsNative.test(source);
  2795. } catch (err) {
  2796. return false;
  2797. }
  2798. }
  2799. var canUseCollections =
  2800. // Array.from
  2801. typeof Array.from === 'function' &&
  2802. // Map
  2803. typeof Map === 'function' && isNative(Map) &&
  2804. // Map.prototype.keys
  2805. Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
  2806. // Set
  2807. typeof Set === 'function' && isNative(Set) &&
  2808. // Set.prototype.keys
  2809. Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
  2810. var setItem;
  2811. var getItem;
  2812. var removeItem;
  2813. var getItemIDs;
  2814. var addRoot;
  2815. var removeRoot;
  2816. var getRootIDs;
  2817. if (canUseCollections) {
  2818. var itemMap = new Map();
  2819. var rootIDSet = new Set();
  2820. setItem = function (id, item) {
  2821. itemMap.set(id, item);
  2822. };
  2823. getItem = function (id) {
  2824. return itemMap.get(id);
  2825. };
  2826. removeItem = function (id) {
  2827. itemMap['delete'](id);
  2828. };
  2829. getItemIDs = function () {
  2830. return Array.from(itemMap.keys());
  2831. };
  2832. addRoot = function (id) {
  2833. rootIDSet.add(id);
  2834. };
  2835. removeRoot = function (id) {
  2836. rootIDSet['delete'](id);
  2837. };
  2838. getRootIDs = function () {
  2839. return Array.from(rootIDSet.keys());
  2840. };
  2841. } else {
  2842. var itemByKey = {};
  2843. var rootByKey = {};
  2844. // Use non-numeric keys to prevent V8 performance issues:
  2845. // https://github.com/facebook/react/pull/7232
  2846. var getKeyFromID = function (id) {
  2847. return '.' + id;
  2848. };
  2849. var getIDFromKey = function (key) {
  2850. return parseInt(key.substr(1), 10);
  2851. };
  2852. setItem = function (id, item) {
  2853. var key = getKeyFromID(id);
  2854. itemByKey[key] = item;
  2855. };
  2856. getItem = function (id) {
  2857. var key = getKeyFromID(id);
  2858. return itemByKey[key];
  2859. };
  2860. removeItem = function (id) {
  2861. var key = getKeyFromID(id);
  2862. delete itemByKey[key];
  2863. };
  2864. getItemIDs = function () {
  2865. return Object.keys(itemByKey).map(getIDFromKey);
  2866. };
  2867. addRoot = function (id) {
  2868. var key = getKeyFromID(id);
  2869. rootByKey[key] = true;
  2870. };
  2871. removeRoot = function (id) {
  2872. var key = getKeyFromID(id);
  2873. delete rootByKey[key];
  2874. };
  2875. getRootIDs = function () {
  2876. return Object.keys(rootByKey).map(getIDFromKey);
  2877. };
  2878. }
  2879. var unmountedIDs = [];
  2880. function purgeDeep(id) {
  2881. var item = getItem(id);
  2882. if (item) {
  2883. var childIDs = item.childIDs;
  2884. removeItem(id);
  2885. childIDs.forEach(purgeDeep);
  2886. }
  2887. }
  2888. function describeComponentFrame(name, source, ownerName) {
  2889. return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
  2890. }
  2891. function getDisplayName(element) {
  2892. if (element == null) {
  2893. return '#empty';
  2894. } else if (typeof element === 'string' || typeof element === 'number') {
  2895. return '#text';
  2896. } else if (typeof element.type === 'string') {
  2897. return element.type;
  2898. } else {
  2899. return element.type.displayName || element.type.name || 'Unknown';
  2900. }
  2901. }
  2902. function describeID(id) {
  2903. var name = ReactComponentTreeHook.getDisplayName(id);
  2904. var element = ReactComponentTreeHook.getElement(id);
  2905. var ownerID = ReactComponentTreeHook.getOwnerID(id);
  2906. var ownerName;
  2907. if (ownerID) {
  2908. ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
  2909. }
  2910. process.env.NODE_ENV !== 'production' ? warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id) : void 0;
  2911. return describeComponentFrame(name, element && element._source, ownerName);
  2912. }
  2913. var ReactComponentTreeHook = {
  2914. onSetChildren: function (id, nextChildIDs) {
  2915. var item = getItem(id);
  2916. !item ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0;
  2917. item.childIDs = nextChildIDs;
  2918. for (var i = 0; i < nextChildIDs.length; i++) {
  2919. var nextChildID = nextChildIDs[i];
  2920. var nextChild = getItem(nextChildID);
  2921. !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;
  2922. !(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;
  2923. !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;
  2924. if (nextChild.parentID == null) {
  2925. nextChild.parentID = id;
  2926. // TODO: This shouldn't be necessary but mounting a new root during in
  2927. // componentWillMount currently causes not-yet-mounted components to
  2928. // be purged from our tree data so their parent id is missing.
  2929. }
  2930. !(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;
  2931. }
  2932. },
  2933. onBeforeMountComponent: function (id, element, parentID) {
  2934. var item = {
  2935. element: element,
  2936. parentID: parentID,
  2937. text: null,
  2938. childIDs: [],
  2939. isMounted: false,
  2940. updateCount: 0
  2941. };
  2942. setItem(id, item);
  2943. },
  2944. onBeforeUpdateComponent: function (id, element) {
  2945. var item = getItem(id);
  2946. if (!item || !item.isMounted) {
  2947. // We may end up here as a result of setState() in componentWillUnmount().
  2948. // In this case, ignore the element.
  2949. return;
  2950. }
  2951. item.element = element;
  2952. },
  2953. onMountComponent: function (id) {
  2954. var item = getItem(id);
  2955. !item ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0;
  2956. item.isMounted = true;
  2957. var isRoot = item.parentID === 0;
  2958. if (isRoot) {
  2959. addRoot(id);
  2960. }
  2961. },
  2962. onUpdateComponent: function (id) {
  2963. var item = getItem(id);
  2964. if (!item || !item.isMounted) {
  2965. // We may end up here as a result of setState() in componentWillUnmount().
  2966. // In this case, ignore the element.
  2967. return;
  2968. }
  2969. item.updateCount++;
  2970. },
  2971. onUnmountComponent: function (id) {
  2972. var item = getItem(id);
  2973. if (item) {
  2974. // We need to check if it exists.
  2975. // `item` might not exist if it is inside an error boundary, and a sibling
  2976. // error boundary child threw while mounting. Then this instance never
  2977. // got a chance to mount, but it still gets an unmounting event during
  2978. // the error boundary cleanup.
  2979. item.isMounted = false;
  2980. var isRoot = item.parentID === 0;
  2981. if (isRoot) {
  2982. removeRoot(id);
  2983. }
  2984. }
  2985. unmountedIDs.push(id);
  2986. },
  2987. purgeUnmountedComponents: function () {
  2988. if (ReactComponentTreeHook._preventPurging) {
  2989. // Should only be used for testing.
  2990. return;
  2991. }
  2992. for (var i = 0; i < unmountedIDs.length; i++) {
  2993. var id = unmountedIDs[i];
  2994. purgeDeep(id);
  2995. }
  2996. unmountedIDs.length = 0;
  2997. },
  2998. isMounted: function (id) {
  2999. var item = getItem(id);
  3000. return item ? item.isMounted : false;
  3001. },
  3002. getCurrentStackAddendum: function (topElement) {
  3003. var info = '';
  3004. if (topElement) {
  3005. var name = getDisplayName(topElement);
  3006. var owner = topElement._owner;
  3007. info += describeComponentFrame(name, topElement._source, owner && owner.getName());
  3008. }
  3009. var currentOwner = ReactCurrentOwner.current;
  3010. var id = currentOwner && currentOwner._debugID;
  3011. info += ReactComponentTreeHook.getStackAddendumByID(id);
  3012. return info;
  3013. },
  3014. getStackAddendumByID: function (id) {
  3015. var info = '';
  3016. while (id) {
  3017. info += describeID(id);
  3018. id = ReactComponentTreeHook.getParentID(id);
  3019. }
  3020. return info;
  3021. },
  3022. getChildIDs: function (id) {
  3023. var item = getItem(id);
  3024. return item ? item.childIDs : [];
  3025. },
  3026. getDisplayName: function (id) {
  3027. var element = ReactComponentTreeHook.getElement(id);
  3028. if (!element) {
  3029. return null;
  3030. }
  3031. return getDisplayName(element);
  3032. },
  3033. getElement: function (id) {
  3034. var item = getItem(id);
  3035. return item ? item.element : null;
  3036. },
  3037. getOwnerID: function (id) {
  3038. var element = ReactComponentTreeHook.getElement(id);
  3039. if (!element || !element._owner) {
  3040. return null;
  3041. }
  3042. return element._owner._debugID;
  3043. },
  3044. getParentID: function (id) {
  3045. var item = getItem(id);
  3046. return item ? item.parentID : null;
  3047. },
  3048. getSource: function (id) {
  3049. var item = getItem(id);
  3050. var element = item ? item.element : null;
  3051. var source = element != null ? element._source : null;
  3052. return source;
  3053. },
  3054. getText: function (id) {
  3055. var element = ReactComponentTreeHook.getElement(id);
  3056. if (typeof element === 'string') {
  3057. return element;
  3058. } else if (typeof element === 'number') {
  3059. return '' + element;
  3060. } else {
  3061. return null;
  3062. }
  3063. },
  3064. getUpdateCount: function (id) {
  3065. var item = getItem(id);
  3066. return item ? item.updateCount : 0;
  3067. },
  3068. getRootIDs: getRootIDs,
  3069. getRegisteredIDs: getItemIDs
  3070. };
  3071. module.exports = ReactComponentTreeHook;
  3072. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  3073. /***/ },
  3074. /* 29 */
  3075. /***/ function(module, exports, __webpack_require__) {
  3076. /* WEBPACK VAR INJECTION */(function(process) {/**
  3077. * Copyright 2013-present, Facebook, Inc.
  3078. * All rights reserved.
  3079. *
  3080. * This source code is licensed under the BSD-style license found in the
  3081. * LICENSE file in the root directory of this source tree. An additional grant
  3082. * of patent rights can be found in the PATENTS file in the same directory.
  3083. *
  3084. */
  3085. 'use strict';
  3086. var _prodInvariant = __webpack_require__(9);
  3087. var ReactPropTypeLocationNames = __webpack_require__(25);
  3088. var ReactPropTypesSecret = __webpack_require__(30);
  3089. var invariant = __webpack_require__(10);
  3090. var warning = __webpack_require__(13);
  3091. var ReactComponentTreeHook;
  3092. if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
  3093. // Temporary hack.
  3094. // Inline requires don't work well with Jest:
  3095. // https://github.com/facebook/react/issues/7240
  3096. // Remove the inline requires when we don't need them anymore:
  3097. // https://github.com/facebook/react/pull/7178
  3098. ReactComponentTreeHook = __webpack_require__(28);
  3099. }
  3100. var loggedTypeFailures = {};
  3101. /**
  3102. * Assert that the values match with the type specs.
  3103. * Error messages are memorized and will only be shown once.
  3104. *
  3105. * @param {object} typeSpecs Map of name to a ReactPropType
  3106. * @param {object} values Runtime values that need to be type-checked
  3107. * @param {string} location e.g. "prop", "context", "child context"
  3108. * @param {string} componentName Name of the component for error messages.
  3109. * @param {?object} element The React element that is being type-checked
  3110. * @param {?number} debugID The React component instance that is being type-checked
  3111. * @private
  3112. */
  3113. function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) {
  3114. for (var typeSpecName in typeSpecs) {
  3115. if (typeSpecs.hasOwnProperty(typeSpecName)) {
  3116. var error;
  3117. // Prop type validation may throw. In case they do, we don't want to
  3118. // fail the render phase where it didn't fail before. So we log it.
  3119. // After these have been cleaned up, we'll let them throw.
  3120. try {
  3121. // This is intentionally an invariant that gets caught. It's the same
  3122. // behavior as without this statement except with a better message.
  3123. !(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;
  3124. error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
  3125. } catch (ex) {
  3126. error = ex;
  3127. }
  3128. 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;
  3129. if (error instanceof Error && !(error.message in loggedTypeFailures)) {
  3130. // Only monitor this failure once because there tends to be a lot of the
  3131. // same error.
  3132. loggedTypeFailures[error.message] = true;
  3133. var componentStackInfo = '';
  3134. if (process.env.NODE_ENV !== 'production') {
  3135. if (!ReactComponentTreeHook) {
  3136. ReactComponentTreeHook = __webpack_require__(28);
  3137. }
  3138. if (debugID !== null) {
  3139. componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID);
  3140. } else if (element !== null) {
  3141. componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element);
  3142. }
  3143. }
  3144. process.env.NODE_ENV !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0;
  3145. }
  3146. }
  3147. }
  3148. }
  3149. module.exports = checkReactTypeSpec;
  3150. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  3151. /***/ },
  3152. /* 30 */
  3153. /***/ function(module, exports) {
  3154. /**
  3155. * Copyright 2013-present, Facebook, Inc.
  3156. * All rights reserved.
  3157. *
  3158. * This source code is licensed under the BSD-style license found in the
  3159. * LICENSE file in the root directory of this source tree. An additional grant
  3160. * of patent rights can be found in the PATENTS file in the same directory.
  3161. *
  3162. *
  3163. */
  3164. 'use strict';
  3165. var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
  3166. module.exports = ReactPropTypesSecret;
  3167. /***/ },
  3168. /* 31 */
  3169. /***/ function(module, exports, __webpack_require__) {
  3170. /* WEBPACK VAR INJECTION */(function(process) {/**
  3171. * Copyright 2013-present, Facebook, Inc.
  3172. * All rights reserved.
  3173. *
  3174. * This source code is licensed under the BSD-style license found in the
  3175. * LICENSE file in the root directory of this source tree. An additional grant
  3176. * of patent rights can be found in the PATENTS file in the same directory.
  3177. *
  3178. */
  3179. 'use strict';
  3180. var ReactElement = __webpack_require__(11);
  3181. var ReactPropTypeLocationNames = __webpack_require__(25);
  3182. var ReactPropTypesSecret = __webpack_require__(30);
  3183. var emptyFunction = __webpack_require__(14);
  3184. var getIteratorFn = __webpack_require__(18);
  3185. var warning = __webpack_require__(13);
  3186. /**
  3187. * Collection of methods that allow declaration and validation of props that are
  3188. * supplied to React components. Example usage:
  3189. *
  3190. * var Props = require('ReactPropTypes');
  3191. * var MyArticle = React.createClass({
  3192. * propTypes: {
  3193. * // An optional string prop named "description".
  3194. * description: Props.string,
  3195. *
  3196. * // A required enum prop named "category".
  3197. * category: Props.oneOf(['News','Photos']).isRequired,
  3198. *
  3199. * // A prop named "dialog" that requires an instance of Dialog.
  3200. * dialog: Props.instanceOf(Dialog).isRequired
  3201. * },
  3202. * render: function() { ... }
  3203. * });
  3204. *
  3205. * A more formal specification of how these methods are used:
  3206. *
  3207. * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
  3208. * decl := ReactPropTypes.{type}(.isRequired)?
  3209. *
  3210. * Each and every declaration produces a function with the same signature. This
  3211. * allows the creation of custom validation functions. For example:
  3212. *
  3213. * var MyLink = React.createClass({
  3214. * propTypes: {
  3215. * // An optional string or URI prop named "href".
  3216. * href: function(props, propName, componentName) {
  3217. * var propValue = props[propName];
  3218. * if (propValue != null && typeof propValue !== 'string' &&
  3219. * !(propValue instanceof URI)) {
  3220. * return new Error(
  3221. * 'Expected a string or an URI for ' + propName + ' in ' +
  3222. * componentName
  3223. * );
  3224. * }
  3225. * }
  3226. * },
  3227. * render: function() {...}
  3228. * });
  3229. *
  3230. * @internal
  3231. */
  3232. var ANONYMOUS = '<<anonymous>>';
  3233. var ReactPropTypes = {
  3234. array: createPrimitiveTypeChecker('array'),
  3235. bool: createPrimitiveTypeChecker('boolean'),
  3236. func: createPrimitiveTypeChecker('function'),
  3237. number: createPrimitiveTypeChecker('number'),
  3238. object: createPrimitiveTypeChecker('object'),
  3239. string: createPrimitiveTypeChecker('string'),
  3240. symbol: createPrimitiveTypeChecker('symbol'),
  3241. any: createAnyTypeChecker(),
  3242. arrayOf: createArrayOfTypeChecker,
  3243. element: createElementTypeChecker(),
  3244. instanceOf: createInstanceTypeChecker,
  3245. node: createNodeChecker(),
  3246. objectOf: createObjectOfTypeChecker,
  3247. oneOf: createEnumTypeChecker,
  3248. oneOfType: createUnionTypeChecker,
  3249. shape: createShapeTypeChecker
  3250. };
  3251. /**
  3252. * inlined Object.is polyfill to avoid requiring consumers ship their own
  3253. * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
  3254. */
  3255. /*eslint-disable no-self-compare*/
  3256. function is(x, y) {
  3257. // SameValue algorithm
  3258. if (x === y) {
  3259. // Steps 1-5, 7-10
  3260. // Steps 6.b-6.e: +0 != -0
  3261. return x !== 0 || 1 / x === 1 / y;
  3262. } else {
  3263. // Step 6.a: NaN == NaN
  3264. return x !== x && y !== y;
  3265. }
  3266. }
  3267. /*eslint-enable no-self-compare*/
  3268. /**
  3269. * We use an Error-like object for backward compatibility as people may call
  3270. * PropTypes directly and inspect their output. However we don't use real
  3271. * Errors anymore. We don't inspect their stack anyway, and creating them
  3272. * is prohibitively expensive if they are created too often, such as what
  3273. * happens in oneOfType() for any type before the one that matched.
  3274. */
  3275. function PropTypeError(message) {
  3276. this.message = message;
  3277. this.stack = '';
  3278. }
  3279. // Make `instanceof Error` still work for returned errors.
  3280. PropTypeError.prototype = Error.prototype;
  3281. function createChainableTypeChecker(validate) {
  3282. if (process.env.NODE_ENV !== 'production') {
  3283. var manualPropTypeCallCache = {};
  3284. }
  3285. function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
  3286. componentName = componentName || ANONYMOUS;
  3287. propFullName = propFullName || propName;
  3288. if (process.env.NODE_ENV !== 'production') {
  3289. if (secret !== ReactPropTypesSecret && typeof console !== 'undefined') {
  3290. var cacheKey = componentName + ':' + propName;
  3291. if (!manualPropTypeCallCache[cacheKey]) {
  3292. 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 production with 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;
  3293. manualPropTypeCallCache[cacheKey] = true;
  3294. }
  3295. }
  3296. }
  3297. if (props[propName] == null) {
  3298. var locationName = ReactPropTypeLocationNames[location];
  3299. if (isRequired) {
  3300. if (props[propName] === null) {
  3301. return new PropTypeError('The ' + locationName + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
  3302. }
  3303. return new PropTypeError('The ' + locationName + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
  3304. }
  3305. return null;
  3306. } else {
  3307. return validate(props, propName, componentName, location, propFullName);
  3308. }
  3309. }
  3310. var chainedCheckType = checkType.bind(null, false);
  3311. chainedCheckType.isRequired = checkType.bind(null, true);
  3312. return chainedCheckType;
  3313. }
  3314. function createPrimitiveTypeChecker(expectedType) {
  3315. function validate(props, propName, componentName, location, propFullName, secret) {
  3316. var propValue = props[propName];
  3317. var propType = getPropType(propValue);
  3318. if (propType !== expectedType) {
  3319. var locationName = ReactPropTypeLocationNames[location];
  3320. // `propValue` being instance of, say, date/regexp, pass the 'object'
  3321. // check, but we can offer a more precise error message here rather than
  3322. // 'of type `object`'.
  3323. var preciseType = getPreciseType(propValue);
  3324. return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
  3325. }
  3326. return null;
  3327. }
  3328. return createChainableTypeChecker(validate);
  3329. }
  3330. function createAnyTypeChecker() {
  3331. return createChainableTypeChecker(emptyFunction.thatReturns(null));
  3332. }
  3333. function createArrayOfTypeChecker(typeChecker) {
  3334. function validate(props, propName, componentName, location, propFullName) {
  3335. if (typeof typeChecker !== 'function') {
  3336. return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
  3337. }
  3338. var propValue = props[propName];
  3339. if (!Array.isArray(propValue)) {
  3340. var locationName = ReactPropTypeLocationNames[location];
  3341. var propType = getPropType(propValue);
  3342. return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
  3343. }
  3344. for (var i = 0; i < propValue.length; i++) {
  3345. var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
  3346. if (error instanceof Error) {
  3347. return error;
  3348. }
  3349. }
  3350. return null;
  3351. }
  3352. return createChainableTypeChecker(validate);
  3353. }
  3354. function createElementTypeChecker() {
  3355. function validate(props, propName, componentName, location, propFullName) {
  3356. var propValue = props[propName];
  3357. if (!ReactElement.isValidElement(propValue)) {
  3358. var locationName = ReactPropTypeLocationNames[location];
  3359. var propType = getPropType(propValue);
  3360. return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
  3361. }
  3362. return null;
  3363. }
  3364. return createChainableTypeChecker(validate);
  3365. }
  3366. function createInstanceTypeChecker(expectedClass) {
  3367. function validate(props, propName, componentName, location, propFullName) {
  3368. if (!(props[propName] instanceof expectedClass)) {
  3369. var locationName = ReactPropTypeLocationNames[location];
  3370. var expectedClassName = expectedClass.name || ANONYMOUS;
  3371. var actualClassName = getClassName(props[propName]);
  3372. return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
  3373. }
  3374. return null;
  3375. }
  3376. return createChainableTypeChecker(validate);
  3377. }
  3378. function createEnumTypeChecker(expectedValues) {
  3379. if (!Array.isArray(expectedValues)) {
  3380. process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
  3381. return emptyFunction.thatReturnsNull;
  3382. }
  3383. function validate(props, propName, componentName, location, propFullName) {
  3384. var propValue = props[propName];
  3385. for (var i = 0; i < expectedValues.length; i++) {
  3386. if (is(propValue, expectedValues[i])) {
  3387. return null;
  3388. }
  3389. }
  3390. var locationName = ReactPropTypeLocationNames[location];
  3391. var valuesString = JSON.stringify(expectedValues);
  3392. return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
  3393. }
  3394. return createChainableTypeChecker(validate);
  3395. }
  3396. function createObjectOfTypeChecker(typeChecker) {
  3397. function validate(props, propName, componentName, location, propFullName) {
  3398. if (typeof typeChecker !== 'function') {
  3399. return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
  3400. }
  3401. var propValue = props[propName];
  3402. var propType = getPropType(propValue);
  3403. if (propType !== 'object') {
  3404. var locationName = ReactPropTypeLocationNames[location];
  3405. return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
  3406. }
  3407. for (var key in propValue) {
  3408. if (propValue.hasOwnProperty(key)) {
  3409. var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
  3410. if (error instanceof Error) {
  3411. return error;
  3412. }
  3413. }
  3414. }
  3415. return null;
  3416. }
  3417. return createChainableTypeChecker(validate);
  3418. }
  3419. function createUnionTypeChecker(arrayOfTypeCheckers) {
  3420. if (!Array.isArray(arrayOfTypeCheckers)) {
  3421. process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
  3422. return emptyFunction.thatReturnsNull;
  3423. }
  3424. function validate(props, propName, componentName, location, propFullName) {
  3425. for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
  3426. var checker = arrayOfTypeCheckers[i];
  3427. if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
  3428. return null;
  3429. }
  3430. }
  3431. var locationName = ReactPropTypeLocationNames[location];
  3432. return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
  3433. }
  3434. return createChainableTypeChecker(validate);
  3435. }
  3436. function createNodeChecker() {
  3437. function validate(props, propName, componentName, location, propFullName) {
  3438. if (!isNode(props[propName])) {
  3439. var locationName = ReactPropTypeLocationNames[location];
  3440. return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
  3441. }
  3442. return null;
  3443. }
  3444. return createChainableTypeChecker(validate);
  3445. }
  3446. function createShapeTypeChecker(shapeTypes) {
  3447. function validate(props, propName, componentName, location, propFullName) {
  3448. var propValue = props[propName];
  3449. var propType = getPropType(propValue);
  3450. if (propType !== 'object') {
  3451. var locationName = ReactPropTypeLocationNames[location];
  3452. return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
  3453. }
  3454. for (var key in shapeTypes) {
  3455. var checker = shapeTypes[key];
  3456. if (!checker) {
  3457. continue;
  3458. }
  3459. var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
  3460. if (error) {
  3461. return error;
  3462. }
  3463. }
  3464. return null;
  3465. }
  3466. return createChainableTypeChecker(validate);
  3467. }
  3468. function isNode(propValue) {
  3469. switch (typeof propValue) {
  3470. case 'number':
  3471. case 'string':
  3472. case 'undefined':
  3473. return true;
  3474. case 'boolean':
  3475. return !propValue;
  3476. case 'object':
  3477. if (Array.isArray(propValue)) {
  3478. return propValue.every(isNode);
  3479. }
  3480. if (propValue === null || ReactElement.isValidElement(propValue)) {
  3481. return true;
  3482. }
  3483. var iteratorFn = getIteratorFn(propValue);
  3484. if (iteratorFn) {
  3485. var iterator = iteratorFn.call(propValue);
  3486. var step;
  3487. if (iteratorFn !== propValue.entries) {
  3488. while (!(step = iterator.next()).done) {
  3489. if (!isNode(step.value)) {
  3490. return false;
  3491. }
  3492. }
  3493. } else {
  3494. // Iterator will provide entry [k,v] tuples rather than values.
  3495. while (!(step = iterator.next()).done) {
  3496. var entry = step.value;
  3497. if (entry) {
  3498. if (!isNode(entry[1])) {
  3499. return false;
  3500. }
  3501. }
  3502. }
  3503. }
  3504. } else {
  3505. return false;
  3506. }
  3507. return true;
  3508. default:
  3509. return false;
  3510. }
  3511. }
  3512. function isSymbol(propType, propValue) {
  3513. // Native Symbol.
  3514. if (propType === 'symbol') {
  3515. return true;
  3516. }
  3517. // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
  3518. if (propValue['@@toStringTag'] === 'Symbol') {
  3519. return true;
  3520. }
  3521. // Fallback for non-spec compliant Symbols which are polyfilled.
  3522. if (typeof Symbol === 'function' && propValue instanceof Symbol) {
  3523. return true;
  3524. }
  3525. return false;
  3526. }
  3527. // Equivalent of `typeof` but with special handling for array and regexp.
  3528. function getPropType(propValue) {
  3529. var propType = typeof propValue;
  3530. if (Array.isArray(propValue)) {
  3531. return 'array';
  3532. }
  3533. if (propValue instanceof RegExp) {
  3534. // Old webkits (at least until Android 4.0) return 'function' rather than
  3535. // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
  3536. // passes PropTypes.object.
  3537. return 'object';
  3538. }
  3539. if (isSymbol(propType, propValue)) {
  3540. return 'symbol';
  3541. }
  3542. return propType;
  3543. }
  3544. // This handles more types than `getPropType`. Only used for error messages.
  3545. // See `createPrimitiveTypeChecker`.
  3546. function getPreciseType(propValue) {
  3547. var propType = getPropType(propValue);
  3548. if (propType === 'object') {
  3549. if (propValue instanceof Date) {
  3550. return 'date';
  3551. } else if (propValue instanceof RegExp) {
  3552. return 'regexp';
  3553. }
  3554. }
  3555. return propType;
  3556. }
  3557. // Returns class name of the object, if any.
  3558. function getClassName(propValue) {
  3559. if (!propValue.constructor || !propValue.constructor.name) {
  3560. return ANONYMOUS;
  3561. }
  3562. return propValue.constructor.name;
  3563. }
  3564. module.exports = ReactPropTypes;
  3565. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  3566. /***/ },
  3567. /* 32 */
  3568. /***/ function(module, exports) {
  3569. /**
  3570. * Copyright 2013-present, Facebook, Inc.
  3571. * All rights reserved.
  3572. *
  3573. * This source code is licensed under the BSD-style license found in the
  3574. * LICENSE file in the root directory of this source tree. An additional grant
  3575. * of patent rights can be found in the PATENTS file in the same directory.
  3576. *
  3577. */
  3578. 'use strict';
  3579. module.exports = '15.4.2';
  3580. /***/ },
  3581. /* 33 */
  3582. /***/ function(module, exports, __webpack_require__) {
  3583. /* WEBPACK VAR INJECTION */(function(process) {/**
  3584. * Copyright 2013-present, Facebook, Inc.
  3585. * All rights reserved.
  3586. *
  3587. * This source code is licensed under the BSD-style license found in the
  3588. * LICENSE file in the root directory of this source tree. An additional grant
  3589. * of patent rights can be found in the PATENTS file in the same directory.
  3590. *
  3591. */
  3592. 'use strict';
  3593. var _prodInvariant = __webpack_require__(9);
  3594. var ReactElement = __webpack_require__(11);
  3595. var invariant = __webpack_require__(10);
  3596. /**
  3597. * Returns the first child in a collection of children and verifies that there
  3598. * is only one child in the collection.
  3599. *
  3600. * See https://facebook.github.io/react/docs/top-level-api.html#react.children.only
  3601. *
  3602. * The current implementation of this function assumes that a single child gets
  3603. * passed without a wrapper, but the purpose of this helper function is to
  3604. * abstract away the particular structure of children.
  3605. *
  3606. * @param {?object} children Child collection structure.
  3607. * @return {ReactElement} The first and only `ReactElement` contained in the
  3608. * structure.
  3609. */
  3610. function onlyChild(children) {
  3611. !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;
  3612. return children;
  3613. }
  3614. module.exports = onlyChild;
  3615. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  3616. /***/ },
  3617. /* 34 */
  3618. /***/ function(module, exports, __webpack_require__) {
  3619. 'use strict';
  3620. module.exports = __webpack_require__(35);
  3621. /***/ },
  3622. /* 35 */
  3623. /***/ function(module, exports, __webpack_require__) {
  3624. /* WEBPACK VAR INJECTION */(function(process) {/**
  3625. * Copyright 2013-present, Facebook, Inc.
  3626. * All rights reserved.
  3627. *
  3628. * This source code is licensed under the BSD-style license found in the
  3629. * LICENSE file in the root directory of this source tree. An additional grant
  3630. * of patent rights can be found in the PATENTS file in the same directory.
  3631. *
  3632. */
  3633. /* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/
  3634. 'use strict';
  3635. var ReactDOMComponentTree = __webpack_require__(36);
  3636. var ReactDefaultInjection = __webpack_require__(40);
  3637. var ReactMount = __webpack_require__(168);
  3638. var ReactReconciler = __webpack_require__(61);
  3639. var ReactUpdates = __webpack_require__(58);
  3640. var ReactVersion = __webpack_require__(173);
  3641. var findDOMNode = __webpack_require__(174);
  3642. var getHostComponentFromComposite = __webpack_require__(175);
  3643. var renderSubtreeIntoContainer = __webpack_require__(176);
  3644. var warning = __webpack_require__(13);
  3645. ReactDefaultInjection.inject();
  3646. var ReactDOM = {
  3647. findDOMNode: findDOMNode,
  3648. render: ReactMount.render,
  3649. unmountComponentAtNode: ReactMount.unmountComponentAtNode,
  3650. version: ReactVersion,
  3651. /* eslint-disable camelcase */
  3652. unstable_batchedUpdates: ReactUpdates.batchedUpdates,
  3653. unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer
  3654. };
  3655. // Inject the runtime into a devtools global hook regardless of browser.
  3656. // Allows for debugging when the hook is injected on the page.
  3657. if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
  3658. __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
  3659. ComponentTree: {
  3660. getClosestInstanceFromNode: ReactDOMComponentTree.getClosestInstanceFromNode,
  3661. getNodeFromInstance: function (inst) {
  3662. // inst is an internal instance (but could be a composite)
  3663. if (inst._renderedComponent) {
  3664. inst = getHostComponentFromComposite(inst);
  3665. }
  3666. if (inst) {
  3667. return ReactDOMComponentTree.getNodeFromInstance(inst);
  3668. } else {
  3669. return null;
  3670. }
  3671. }
  3672. },
  3673. Mount: ReactMount,
  3674. Reconciler: ReactReconciler
  3675. });
  3676. }
  3677. if (process.env.NODE_ENV !== 'production') {
  3678. var ExecutionEnvironment = __webpack_require__(50);
  3679. if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
  3680. // First check if devtools is not installed
  3681. if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
  3682. // If we're in Chrome or Firefox, provide a download link if not installed.
  3683. if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
  3684. // Firefox does not have the issue with devtools loaded over file://
  3685. var showFileUrlMessage = window.location.protocol.indexOf('http') === -1 && navigator.userAgent.indexOf('Firefox') === -1;
  3686. 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');
  3687. }
  3688. }
  3689. var testFunc = function testFn() {};
  3690. 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;
  3691. // If we're in IE8, check to see if we are in compatibility mode and provide
  3692. // information on preventing compatibility mode
  3693. var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
  3694. 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;
  3695. var expectedFeatures = [
  3696. // shims
  3697. Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.trim];
  3698. for (var i = 0; i < expectedFeatures.length; i++) {
  3699. if (!expectedFeatures[i]) {
  3700. 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;
  3701. break;
  3702. }
  3703. }
  3704. }
  3705. }
  3706. if (process.env.NODE_ENV !== 'production') {
  3707. var ReactInstrumentation = __webpack_require__(64);
  3708. var ReactDOMUnknownPropertyHook = __webpack_require__(177);
  3709. var ReactDOMNullInputValuePropHook = __webpack_require__(178);
  3710. var ReactDOMInvalidARIAHook = __webpack_require__(179);
  3711. ReactInstrumentation.debugTool.addHook(ReactDOMUnknownPropertyHook);
  3712. ReactInstrumentation.debugTool.addHook(ReactDOMNullInputValuePropHook);
  3713. ReactInstrumentation.debugTool.addHook(ReactDOMInvalidARIAHook);
  3714. }
  3715. module.exports = ReactDOM;
  3716. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  3717. /***/ },
  3718. /* 36 */
  3719. /***/ function(module, exports, __webpack_require__) {
  3720. /* WEBPACK VAR INJECTION */(function(process) {/**
  3721. * Copyright 2013-present, Facebook, Inc.
  3722. * All rights reserved.
  3723. *
  3724. * This source code is licensed under the BSD-style license found in the
  3725. * LICENSE file in the root directory of this source tree. An additional grant
  3726. * of patent rights can be found in the PATENTS file in the same directory.
  3727. *
  3728. */
  3729. 'use strict';
  3730. var _prodInvariant = __webpack_require__(37);
  3731. var DOMProperty = __webpack_require__(38);
  3732. var ReactDOMComponentFlags = __webpack_require__(39);
  3733. var invariant = __webpack_require__(10);
  3734. var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
  3735. var Flags = ReactDOMComponentFlags;
  3736. var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2);
  3737. /**
  3738. * Check if a given node should be cached.
  3739. */
  3740. function shouldPrecacheNode(node, nodeID) {
  3741. return node.nodeType === 1 && node.getAttribute(ATTR_NAME) === String(nodeID) || node.nodeType === 8 && node.nodeValue === ' react-text: ' + nodeID + ' ' || node.nodeType === 8 && node.nodeValue === ' react-empty: ' + nodeID + ' ';
  3742. }
  3743. /**
  3744. * Drill down (through composites and empty components) until we get a host or
  3745. * host text component.
  3746. *
  3747. * This is pretty polymorphic but unavoidable with the current structure we have
  3748. * for `_renderedChildren`.
  3749. */
  3750. function getRenderedHostOrTextFromComponent(component) {
  3751. var rendered;
  3752. while (rendered = component._renderedComponent) {
  3753. component = rendered;
  3754. }
  3755. return component;
  3756. }
  3757. /**
  3758. * Populate `_hostNode` on the rendered host/text component with the given
  3759. * DOM node. The passed `inst` can be a composite.
  3760. */
  3761. function precacheNode(inst, node) {
  3762. var hostInst = getRenderedHostOrTextFromComponent(inst);
  3763. hostInst._hostNode = node;
  3764. node[internalInstanceKey] = hostInst;
  3765. }
  3766. function uncacheNode(inst) {
  3767. var node = inst._hostNode;
  3768. if (node) {
  3769. delete node[internalInstanceKey];
  3770. inst._hostNode = null;
  3771. }
  3772. }
  3773. /**
  3774. * Populate `_hostNode` on each child of `inst`, assuming that the children
  3775. * match up with the DOM (element) children of `node`.
  3776. *
  3777. * We cache entire levels at once to avoid an n^2 problem where we access the
  3778. * children of a node sequentially and have to walk from the start to our target
  3779. * node every time.
  3780. *
  3781. * Since we update `_renderedChildren` and the actual DOM at (slightly)
  3782. * different times, we could race here and see a newer `_renderedChildren` than
  3783. * the DOM nodes we see. To avoid this, ReactMultiChild calls
  3784. * `prepareToManageChildren` before we change `_renderedChildren`, at which
  3785. * time the container's child nodes are always cached (until it unmounts).
  3786. */
  3787. function precacheChildNodes(inst, node) {
  3788. if (inst._flags & Flags.hasCachedChildNodes) {
  3789. return;
  3790. }
  3791. var children = inst._renderedChildren;
  3792. var childNode = node.firstChild;
  3793. outer: for (var name in children) {
  3794. if (!children.hasOwnProperty(name)) {
  3795. continue;
  3796. }
  3797. var childInst = children[name];
  3798. var childID = getRenderedHostOrTextFromComponent(childInst)._domID;
  3799. if (childID === 0) {
  3800. // We're currently unmounting this child in ReactMultiChild; skip it.
  3801. continue;
  3802. }
  3803. // We assume the child nodes are in the same order as the child instances.
  3804. for (; childNode !== null; childNode = childNode.nextSibling) {
  3805. if (shouldPrecacheNode(childNode, childID)) {
  3806. precacheNode(childInst, childNode);
  3807. continue outer;
  3808. }
  3809. }
  3810. // We reached the end of the DOM children without finding an ID match.
  3811. true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;
  3812. }
  3813. inst._flags |= Flags.hasCachedChildNodes;
  3814. }
  3815. /**
  3816. * Given a DOM node, return the closest ReactDOMComponent or
  3817. * ReactDOMTextComponent instance ancestor.
  3818. */
  3819. function getClosestInstanceFromNode(node) {
  3820. if (node[internalInstanceKey]) {
  3821. return node[internalInstanceKey];
  3822. }
  3823. // Walk up the tree until we find an ancestor whose instance we have cached.
  3824. var parents = [];
  3825. while (!node[internalInstanceKey]) {
  3826. parents.push(node);
  3827. if (node.parentNode) {
  3828. node = node.parentNode;
  3829. } else {
  3830. // Top of the tree. This node must not be part of a React tree (or is
  3831. // unmounted, potentially).
  3832. return null;
  3833. }
  3834. }
  3835. var closest;
  3836. var inst;
  3837. for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) {
  3838. closest = inst;
  3839. if (parents.length) {
  3840. precacheChildNodes(inst, node);
  3841. }
  3842. }
  3843. return closest;
  3844. }
  3845. /**
  3846. * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
  3847. * instance, or null if the node was not rendered by this React.
  3848. */
  3849. function getInstanceFromNode(node) {
  3850. var inst = getClosestInstanceFromNode(node);
  3851. if (inst != null && inst._hostNode === node) {
  3852. return inst;
  3853. } else {
  3854. return null;
  3855. }
  3856. }
  3857. /**
  3858. * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
  3859. * DOM node.
  3860. */
  3861. function getNodeFromInstance(inst) {
  3862. // Without this first invariant, passing a non-DOM-component triggers the next
  3863. // invariant for a missing parent, which is super confusing.
  3864. !(inst._hostNode !== undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
  3865. if (inst._hostNode) {
  3866. return inst._hostNode;
  3867. }
  3868. // Walk up the tree until we find an ancestor whose DOM node we have cached.
  3869. var parents = [];
  3870. while (!inst._hostNode) {
  3871. parents.push(inst);
  3872. !inst._hostParent ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React DOM tree root should always have a node reference.') : _prodInvariant('34') : void 0;
  3873. inst = inst._hostParent;
  3874. }
  3875. // Now parents contains each ancestor that does *not* have a cached native
  3876. // node, and `inst` is the deepest ancestor that does.
  3877. for (; parents.length; inst = parents.pop()) {
  3878. precacheChildNodes(inst, inst._hostNode);
  3879. }
  3880. return inst._hostNode;
  3881. }
  3882. var ReactDOMComponentTree = {
  3883. getClosestInstanceFromNode: getClosestInstanceFromNode,
  3884. getInstanceFromNode: getInstanceFromNode,
  3885. getNodeFromInstance: getNodeFromInstance,
  3886. precacheChildNodes: precacheChildNodes,
  3887. precacheNode: precacheNode,
  3888. uncacheNode: uncacheNode
  3889. };
  3890. module.exports = ReactDOMComponentTree;
  3891. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  3892. /***/ },
  3893. /* 37 */
  3894. /***/ function(module, exports) {
  3895. /**
  3896. * Copyright (c) 2013-present, Facebook, Inc.
  3897. * All rights reserved.
  3898. *
  3899. * This source code is licensed under the BSD-style license found in the
  3900. * LICENSE file in the root directory of this source tree. An additional grant
  3901. * of patent rights can be found in the PATENTS file in the same directory.
  3902. *
  3903. *
  3904. */
  3905. 'use strict';
  3906. /**
  3907. * WARNING: DO NOT manually require this module.
  3908. * This is a replacement for `invariant(...)` used by the error code system
  3909. * and will _only_ be required by the corresponding babel pass.
  3910. * It always throws.
  3911. */
  3912. function reactProdInvariant(code) {
  3913. var argCount = arguments.length - 1;
  3914. var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;
  3915. for (var argIdx = 0; argIdx < argCount; argIdx++) {
  3916. message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
  3917. }
  3918. message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
  3919. var error = new Error(message);
  3920. error.name = 'Invariant Violation';
  3921. error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
  3922. throw error;
  3923. }
  3924. module.exports = reactProdInvariant;
  3925. /***/ },
  3926. /* 38 */
  3927. /***/ function(module, exports, __webpack_require__) {
  3928. /* WEBPACK VAR INJECTION */(function(process) {/**
  3929. * Copyright 2013-present, Facebook, Inc.
  3930. * All rights reserved.
  3931. *
  3932. * This source code is licensed under the BSD-style license found in the
  3933. * LICENSE file in the root directory of this source tree. An additional grant
  3934. * of patent rights can be found in the PATENTS file in the same directory.
  3935. *
  3936. */
  3937. 'use strict';
  3938. var _prodInvariant = __webpack_require__(37);
  3939. var invariant = __webpack_require__(10);
  3940. function checkMask(value, bitmask) {
  3941. return (value & bitmask) === bitmask;
  3942. }
  3943. var DOMPropertyInjection = {
  3944. /**
  3945. * Mapping from normalized, camelcased property names to a configuration that
  3946. * specifies how the associated DOM property should be accessed or rendered.
  3947. */
  3948. MUST_USE_PROPERTY: 0x1,
  3949. HAS_BOOLEAN_VALUE: 0x4,
  3950. HAS_NUMERIC_VALUE: 0x8,
  3951. HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8,
  3952. HAS_OVERLOADED_BOOLEAN_VALUE: 0x20,
  3953. /**
  3954. * Inject some specialized knowledge about the DOM. This takes a config object
  3955. * with the following properties:
  3956. *
  3957. * isCustomAttribute: function that given an attribute name will return true
  3958. * if it can be inserted into the DOM verbatim. Useful for data-* or aria-*
  3959. * attributes where it's impossible to enumerate all of the possible
  3960. * attribute names,
  3961. *
  3962. * Properties: object mapping DOM property name to one of the
  3963. * DOMPropertyInjection constants or null. If your attribute isn't in here,
  3964. * it won't get written to the DOM.
  3965. *
  3966. * DOMAttributeNames: object mapping React attribute name to the DOM
  3967. * attribute name. Attribute names not specified use the **lowercase**
  3968. * normalized name.
  3969. *
  3970. * DOMAttributeNamespaces: object mapping React attribute name to the DOM
  3971. * attribute namespace URL. (Attribute names not specified use no namespace.)
  3972. *
  3973. * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.
  3974. * Property names not specified use the normalized name.
  3975. *
  3976. * DOMMutationMethods: Properties that require special mutation methods. If
  3977. * `value` is undefined, the mutation method should unset the property.
  3978. *
  3979. * @param {object} domPropertyConfig the config as described above.
  3980. */
  3981. injectDOMPropertyConfig: function (domPropertyConfig) {
  3982. var Injection = DOMPropertyInjection;
  3983. var Properties = domPropertyConfig.Properties || {};
  3984. var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};
  3985. var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
  3986. var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};
  3987. var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
  3988. if (domPropertyConfig.isCustomAttribute) {
  3989. DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute);
  3990. }
  3991. for (var propName in Properties) {
  3992. !!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;
  3993. var lowerCased = propName.toLowerCase();
  3994. var propConfig = Properties[propName];
  3995. var propertyInfo = {
  3996. attributeName: lowerCased,
  3997. attributeNamespace: null,
  3998. propertyName: propName,
  3999. mutationMethod: null,
  4000. mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),
  4001. hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),
  4002. hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),
  4003. hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),
  4004. hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE)
  4005. };
  4006. !(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;
  4007. if (process.env.NODE_ENV !== 'production') {
  4008. DOMProperty.getPossibleStandardName[lowerCased] = propName;
  4009. }
  4010. if (DOMAttributeNames.hasOwnProperty(propName)) {
  4011. var attributeName = DOMAttributeNames[propName];
  4012. propertyInfo.attributeName = attributeName;
  4013. if (process.env.NODE_ENV !== 'production') {
  4014. DOMProperty.getPossibleStandardName[attributeName] = propName;
  4015. }
  4016. }
  4017. if (DOMAttributeNamespaces.hasOwnProperty(propName)) {
  4018. propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];
  4019. }
  4020. if (DOMPropertyNames.hasOwnProperty(propName)) {
  4021. propertyInfo.propertyName = DOMPropertyNames[propName];
  4022. }
  4023. if (DOMMutationMethods.hasOwnProperty(propName)) {
  4024. propertyInfo.mutationMethod = DOMMutationMethods[propName];
  4025. }
  4026. DOMProperty.properties[propName] = propertyInfo;
  4027. }
  4028. }
  4029. };
  4030. /* eslint-disable max-len */
  4031. 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';
  4032. /* eslint-enable max-len */
  4033. /**
  4034. * DOMProperty exports lookup objects that can be used like functions:
  4035. *
  4036. * > DOMProperty.isValid['id']
  4037. * true
  4038. * > DOMProperty.isValid['foobar']
  4039. * undefined
  4040. *
  4041. * Although this may be confusing, it performs better in general.
  4042. *
  4043. * @see http://jsperf.com/key-exists
  4044. * @see http://jsperf.com/key-missing
  4045. */
  4046. var DOMProperty = {
  4047. ID_ATTRIBUTE_NAME: 'data-reactid',
  4048. ROOT_ATTRIBUTE_NAME: 'data-reactroot',
  4049. ATTRIBUTE_NAME_START_CHAR: ATTRIBUTE_NAME_START_CHAR,
  4050. ATTRIBUTE_NAME_CHAR: ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040',
  4051. /**
  4052. * Map from property "standard name" to an object with info about how to set
  4053. * the property in the DOM. Each object contains:
  4054. *
  4055. * attributeName:
  4056. * Used when rendering markup or with `*Attribute()`.
  4057. * attributeNamespace
  4058. * propertyName:
  4059. * Used on DOM node instances. (This includes properties that mutate due to
  4060. * external factors.)
  4061. * mutationMethod:
  4062. * If non-null, used instead of the property or `setAttribute()` after
  4063. * initial render.
  4064. * mustUseProperty:
  4065. * Whether the property must be accessed and mutated as an object property.
  4066. * hasBooleanValue:
  4067. * Whether the property should be removed when set to a falsey value.
  4068. * hasNumericValue:
  4069. * Whether the property must be numeric or parse as a numeric and should be
  4070. * removed when set to a falsey value.
  4071. * hasPositiveNumericValue:
  4072. * Whether the property must be positive numeric or parse as a positive
  4073. * numeric and should be removed when set to a falsey value.
  4074. * hasOverloadedBooleanValue:
  4075. * Whether the property can be used as a flag as well as with a value.
  4076. * Removed when strictly equal to false; present without a value when
  4077. * strictly equal to true; present with a value otherwise.
  4078. */
  4079. properties: {},
  4080. /**
  4081. * Mapping from lowercase property names to the properly cased version, used
  4082. * to warn in the case of missing properties. Available only in __DEV__.
  4083. *
  4084. * autofocus is predefined, because adding it to the property whitelist
  4085. * causes unintended side effects.
  4086. *
  4087. * @type {Object}
  4088. */
  4089. getPossibleStandardName: process.env.NODE_ENV !== 'production' ? { autofocus: 'autoFocus' } : null,
  4090. /**
  4091. * All of the isCustomAttribute() functions that have been injected.
  4092. */
  4093. _isCustomAttributeFunctions: [],
  4094. /**
  4095. * Checks whether a property name is a custom attribute.
  4096. * @method
  4097. */
  4098. isCustomAttribute: function (attributeName) {
  4099. for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
  4100. var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
  4101. if (isCustomAttributeFn(attributeName)) {
  4102. return true;
  4103. }
  4104. }
  4105. return false;
  4106. },
  4107. injection: DOMPropertyInjection
  4108. };
  4109. module.exports = DOMProperty;
  4110. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  4111. /***/ },
  4112. /* 39 */
  4113. /***/ function(module, exports) {
  4114. /**
  4115. * Copyright 2015-present, Facebook, Inc.
  4116. * All rights reserved.
  4117. *
  4118. * This source code is licensed under the BSD-style license found in the
  4119. * LICENSE file in the root directory of this source tree. An additional grant
  4120. * of patent rights can be found in the PATENTS file in the same directory.
  4121. *
  4122. */
  4123. 'use strict';
  4124. var ReactDOMComponentFlags = {
  4125. hasCachedChildNodes: 1 << 0
  4126. };
  4127. module.exports = ReactDOMComponentFlags;
  4128. /***/ },
  4129. /* 40 */
  4130. /***/ function(module, exports, __webpack_require__) {
  4131. /**
  4132. * Copyright 2013-present, Facebook, Inc.
  4133. * All rights reserved.
  4134. *
  4135. * This source code is licensed under the BSD-style license found in the
  4136. * LICENSE file in the root directory of this source tree. An additional grant
  4137. * of patent rights can be found in the PATENTS file in the same directory.
  4138. *
  4139. */
  4140. 'use strict';
  4141. var ARIADOMPropertyConfig = __webpack_require__(41);
  4142. var BeforeInputEventPlugin = __webpack_require__(42);
  4143. var ChangeEventPlugin = __webpack_require__(57);
  4144. var DefaultEventPluginOrder = __webpack_require__(74);
  4145. var EnterLeaveEventPlugin = __webpack_require__(75);
  4146. var HTMLDOMPropertyConfig = __webpack_require__(80);
  4147. var ReactComponentBrowserEnvironment = __webpack_require__(81);
  4148. var ReactDOMComponent = __webpack_require__(94);
  4149. var ReactDOMComponentTree = __webpack_require__(36);
  4150. var ReactDOMEmptyComponent = __webpack_require__(139);
  4151. var ReactDOMTreeTraversal = __webpack_require__(140);
  4152. var ReactDOMTextComponent = __webpack_require__(141);
  4153. var ReactDefaultBatchingStrategy = __webpack_require__(142);
  4154. var ReactEventListener = __webpack_require__(143);
  4155. var ReactInjection = __webpack_require__(146);
  4156. var ReactReconcileTransaction = __webpack_require__(147);
  4157. var SVGDOMPropertyConfig = __webpack_require__(155);
  4158. var SelectEventPlugin = __webpack_require__(156);
  4159. var SimpleEventPlugin = __webpack_require__(157);
  4160. var alreadyInjected = false;
  4161. function inject() {
  4162. if (alreadyInjected) {
  4163. // TODO: This is currently true because these injections are shared between
  4164. // the client and the server package. They should be built independently
  4165. // and not share any injection state. Then this problem will be solved.
  4166. return;
  4167. }
  4168. alreadyInjected = true;
  4169. ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener);
  4170. /**
  4171. * Inject modules for resolving DOM hierarchy and plugin ordering.
  4172. */
  4173. ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder);
  4174. ReactInjection.EventPluginUtils.injectComponentTree(ReactDOMComponentTree);
  4175. ReactInjection.EventPluginUtils.injectTreeTraversal(ReactDOMTreeTraversal);
  4176. /**
  4177. * Some important event plugins included by default (without having to require
  4178. * them).
  4179. */
  4180. ReactInjection.EventPluginHub.injectEventPluginsByName({
  4181. SimpleEventPlugin: SimpleEventPlugin,
  4182. EnterLeaveEventPlugin: EnterLeaveEventPlugin,
  4183. ChangeEventPlugin: ChangeEventPlugin,
  4184. SelectEventPlugin: SelectEventPlugin,
  4185. BeforeInputEventPlugin: BeforeInputEventPlugin
  4186. });
  4187. ReactInjection.HostComponent.injectGenericComponentClass(ReactDOMComponent);
  4188. ReactInjection.HostComponent.injectTextComponentClass(ReactDOMTextComponent);
  4189. ReactInjection.DOMProperty.injectDOMPropertyConfig(ARIADOMPropertyConfig);
  4190. ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
  4191. ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
  4192. ReactInjection.EmptyComponent.injectEmptyComponentFactory(function (instantiate) {
  4193. return new ReactDOMEmptyComponent(instantiate);
  4194. });
  4195. ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction);
  4196. ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy);
  4197. ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
  4198. }
  4199. module.exports = {
  4200. inject: inject
  4201. };
  4202. /***/ },
  4203. /* 41 */
  4204. /***/ function(module, exports) {
  4205. /**
  4206. * Copyright 2013-present, Facebook, Inc.
  4207. * All rights reserved.
  4208. *
  4209. * This source code is licensed under the BSD-style license found in the
  4210. * LICENSE file in the root directory of this source tree. An additional grant
  4211. * of patent rights can be found in the PATENTS file in the same directory.
  4212. *
  4213. */
  4214. 'use strict';
  4215. var ARIADOMPropertyConfig = {
  4216. Properties: {
  4217. // Global States and Properties
  4218. 'aria-current': 0, // state
  4219. 'aria-details': 0,
  4220. 'aria-disabled': 0, // state
  4221. 'aria-hidden': 0, // state
  4222. 'aria-invalid': 0, // state
  4223. 'aria-keyshortcuts': 0,
  4224. 'aria-label': 0,
  4225. 'aria-roledescription': 0,
  4226. // Widget Attributes
  4227. 'aria-autocomplete': 0,
  4228. 'aria-checked': 0,
  4229. 'aria-expanded': 0,
  4230. 'aria-haspopup': 0,
  4231. 'aria-level': 0,
  4232. 'aria-modal': 0,
  4233. 'aria-multiline': 0,
  4234. 'aria-multiselectable': 0,
  4235. 'aria-orientation': 0,
  4236. 'aria-placeholder': 0,
  4237. 'aria-pressed': 0,
  4238. 'aria-readonly': 0,
  4239. 'aria-required': 0,
  4240. 'aria-selected': 0,
  4241. 'aria-sort': 0,
  4242. 'aria-valuemax': 0,
  4243. 'aria-valuemin': 0,
  4244. 'aria-valuenow': 0,
  4245. 'aria-valuetext': 0,
  4246. // Live Region Attributes
  4247. 'aria-atomic': 0,
  4248. 'aria-busy': 0,
  4249. 'aria-live': 0,
  4250. 'aria-relevant': 0,
  4251. // Drag-and-Drop Attributes
  4252. 'aria-dropeffect': 0,
  4253. 'aria-grabbed': 0,
  4254. // Relationship Attributes
  4255. 'aria-activedescendant': 0,
  4256. 'aria-colcount': 0,
  4257. 'aria-colindex': 0,
  4258. 'aria-colspan': 0,
  4259. 'aria-controls': 0,
  4260. 'aria-describedby': 0,
  4261. 'aria-errormessage': 0,
  4262. 'aria-flowto': 0,
  4263. 'aria-labelledby': 0,
  4264. 'aria-owns': 0,
  4265. 'aria-posinset': 0,
  4266. 'aria-rowcount': 0,
  4267. 'aria-rowindex': 0,
  4268. 'aria-rowspan': 0,
  4269. 'aria-setsize': 0
  4270. },
  4271. DOMAttributeNames: {},
  4272. DOMPropertyNames: {}
  4273. };
  4274. module.exports = ARIADOMPropertyConfig;
  4275. /***/ },
  4276. /* 42 */
  4277. /***/ function(module, exports, __webpack_require__) {
  4278. /**
  4279. * Copyright 2013-present Facebook, Inc.
  4280. * All rights reserved.
  4281. *
  4282. * This source code is licensed under the BSD-style license found in the
  4283. * LICENSE file in the root directory of this source tree. An additional grant
  4284. * of patent rights can be found in the PATENTS file in the same directory.
  4285. *
  4286. */
  4287. 'use strict';
  4288. var EventPropagators = __webpack_require__(43);
  4289. var ExecutionEnvironment = __webpack_require__(50);
  4290. var FallbackCompositionState = __webpack_require__(51);
  4291. var SyntheticCompositionEvent = __webpack_require__(54);
  4292. var SyntheticInputEvent = __webpack_require__(56);
  4293. var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
  4294. var START_KEYCODE = 229;
  4295. var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window;
  4296. var documentMode = null;
  4297. if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {
  4298. documentMode = document.documentMode;
  4299. }
  4300. // Webkit offers a very useful `textInput` event that can be used to
  4301. // directly represent `beforeInput`. The IE `textinput` event is not as
  4302. // useful, so we don't use it.
  4303. var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto();
  4304. // In IE9+, we have access to composition events, but the data supplied
  4305. // by the native compositionend event may be incorrect. Japanese ideographic
  4306. // spaces, for instance (\u3000) are not recorded correctly.
  4307. var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
  4308. /**
  4309. * Opera <= 12 includes TextEvent in window, but does not fire
  4310. * text input events. Rely on keypress instead.
  4311. */
  4312. function isPresto() {
  4313. var opera = window.opera;
  4314. return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;
  4315. }
  4316. var SPACEBAR_CODE = 32;
  4317. var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
  4318. // Events and their corresponding property names.
  4319. var eventTypes = {
  4320. beforeInput: {
  4321. phasedRegistrationNames: {
  4322. bubbled: 'onBeforeInput',
  4323. captured: 'onBeforeInputCapture'
  4324. },
  4325. dependencies: ['topCompositionEnd', 'topKeyPress', 'topTextInput', 'topPaste']
  4326. },
  4327. compositionEnd: {
  4328. phasedRegistrationNames: {
  4329. bubbled: 'onCompositionEnd',
  4330. captured: 'onCompositionEndCapture'
  4331. },
  4332. dependencies: ['topBlur', 'topCompositionEnd', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']
  4333. },
  4334. compositionStart: {
  4335. phasedRegistrationNames: {
  4336. bubbled: 'onCompositionStart',
  4337. captured: 'onCompositionStartCapture'
  4338. },
  4339. dependencies: ['topBlur', 'topCompositionStart', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']
  4340. },
  4341. compositionUpdate: {
  4342. phasedRegistrationNames: {
  4343. bubbled: 'onCompositionUpdate',
  4344. captured: 'onCompositionUpdateCapture'
  4345. },
  4346. dependencies: ['topBlur', 'topCompositionUpdate', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']
  4347. }
  4348. };
  4349. // Track whether we've ever handled a keypress on the space key.
  4350. var hasSpaceKeypress = false;
  4351. /**
  4352. * Return whether a native keypress event is assumed to be a command.
  4353. * This is required because Firefox fires `keypress` events for key commands
  4354. * (cut, copy, select-all, etc.) even though no character is inserted.
  4355. */
  4356. function isKeypressCommand(nativeEvent) {
  4357. return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
  4358. // ctrlKey && altKey is equivalent to AltGr, and is not a command.
  4359. !(nativeEvent.ctrlKey && nativeEvent.altKey);
  4360. }
  4361. /**
  4362. * Translate native top level events into event types.
  4363. *
  4364. * @param {string} topLevelType
  4365. * @return {object}
  4366. */
  4367. function getCompositionEventType(topLevelType) {
  4368. switch (topLevelType) {
  4369. case 'topCompositionStart':
  4370. return eventTypes.compositionStart;
  4371. case 'topCompositionEnd':
  4372. return eventTypes.compositionEnd;
  4373. case 'topCompositionUpdate':
  4374. return eventTypes.compositionUpdate;
  4375. }
  4376. }
  4377. /**
  4378. * Does our fallback best-guess model think this event signifies that
  4379. * composition has begun?
  4380. *
  4381. * @param {string} topLevelType
  4382. * @param {object} nativeEvent
  4383. * @return {boolean}
  4384. */
  4385. function isFallbackCompositionStart(topLevelType, nativeEvent) {
  4386. return topLevelType === 'topKeyDown' && nativeEvent.keyCode === START_KEYCODE;
  4387. }
  4388. /**
  4389. * Does our fallback mode think that this event is the end of composition?
  4390. *
  4391. * @param {string} topLevelType
  4392. * @param {object} nativeEvent
  4393. * @return {boolean}
  4394. */
  4395. function isFallbackCompositionEnd(topLevelType, nativeEvent) {
  4396. switch (topLevelType) {
  4397. case 'topKeyUp':
  4398. // Command keys insert or clear IME input.
  4399. return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
  4400. case 'topKeyDown':
  4401. // Expect IME keyCode on each keydown. If we get any other
  4402. // code we must have exited earlier.
  4403. return nativeEvent.keyCode !== START_KEYCODE;
  4404. case 'topKeyPress':
  4405. case 'topMouseDown':
  4406. case 'topBlur':
  4407. // Events are not possible without cancelling IME.
  4408. return true;
  4409. default:
  4410. return false;
  4411. }
  4412. }
  4413. /**
  4414. * Google Input Tools provides composition data via a CustomEvent,
  4415. * with the `data` property populated in the `detail` object. If this
  4416. * is available on the event object, use it. If not, this is a plain
  4417. * composition event and we have nothing special to extract.
  4418. *
  4419. * @param {object} nativeEvent
  4420. * @return {?string}
  4421. */
  4422. function getDataFromCustomEvent(nativeEvent) {
  4423. var detail = nativeEvent.detail;
  4424. if (typeof detail === 'object' && 'data' in detail) {
  4425. return detail.data;
  4426. }
  4427. return null;
  4428. }
  4429. // Track the current IME composition fallback object, if any.
  4430. var currentComposition = null;
  4431. /**
  4432. * @return {?object} A SyntheticCompositionEvent.
  4433. */
  4434. function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  4435. var eventType;
  4436. var fallbackData;
  4437. if (canUseCompositionEvent) {
  4438. eventType = getCompositionEventType(topLevelType);
  4439. } else if (!currentComposition) {
  4440. if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
  4441. eventType = eventTypes.compositionStart;
  4442. }
  4443. } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
  4444. eventType = eventTypes.compositionEnd;
  4445. }
  4446. if (!eventType) {
  4447. return null;
  4448. }
  4449. if (useFallbackCompositionData) {
  4450. // The current composition is stored statically and must not be
  4451. // overwritten while composition continues.
  4452. if (!currentComposition && eventType === eventTypes.compositionStart) {
  4453. currentComposition = FallbackCompositionState.getPooled(nativeEventTarget);
  4454. } else if (eventType === eventTypes.compositionEnd) {
  4455. if (currentComposition) {
  4456. fallbackData = currentComposition.getData();
  4457. }
  4458. }
  4459. }
  4460. var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);
  4461. if (fallbackData) {
  4462. // Inject data generated from fallback path into the synthetic event.
  4463. // This matches the property of native CompositionEventInterface.
  4464. event.data = fallbackData;
  4465. } else {
  4466. var customData = getDataFromCustomEvent(nativeEvent);
  4467. if (customData !== null) {
  4468. event.data = customData;
  4469. }
  4470. }
  4471. EventPropagators.accumulateTwoPhaseDispatches(event);
  4472. return event;
  4473. }
  4474. /**
  4475. * @param {string} topLevelType Record from `EventConstants`.
  4476. * @param {object} nativeEvent Native browser event.
  4477. * @return {?string} The string corresponding to this `beforeInput` event.
  4478. */
  4479. function getNativeBeforeInputChars(topLevelType, nativeEvent) {
  4480. switch (topLevelType) {
  4481. case 'topCompositionEnd':
  4482. return getDataFromCustomEvent(nativeEvent);
  4483. case 'topKeyPress':
  4484. /**
  4485. * If native `textInput` events are available, our goal is to make
  4486. * use of them. However, there is a special case: the spacebar key.
  4487. * In Webkit, preventing default on a spacebar `textInput` event
  4488. * cancels character insertion, but it *also* causes the browser
  4489. * to fall back to its default spacebar behavior of scrolling the
  4490. * page.
  4491. *
  4492. * Tracking at:
  4493. * https://code.google.com/p/chromium/issues/detail?id=355103
  4494. *
  4495. * To avoid this issue, use the keypress event as if no `textInput`
  4496. * event is available.
  4497. */
  4498. var which = nativeEvent.which;
  4499. if (which !== SPACEBAR_CODE) {
  4500. return null;
  4501. }
  4502. hasSpaceKeypress = true;
  4503. return SPACEBAR_CHAR;
  4504. case 'topTextInput':
  4505. // Record the characters to be added to the DOM.
  4506. var chars = nativeEvent.data;
  4507. // If it's a spacebar character, assume that we have already handled
  4508. // it at the keypress level and bail immediately. Android Chrome
  4509. // doesn't give us keycodes, so we need to blacklist it.
  4510. if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
  4511. return null;
  4512. }
  4513. return chars;
  4514. default:
  4515. // For other native event types, do nothing.
  4516. return null;
  4517. }
  4518. }
  4519. /**
  4520. * For browsers that do not provide the `textInput` event, extract the
  4521. * appropriate string to use for SyntheticInputEvent.
  4522. *
  4523. * @param {string} topLevelType Record from `EventConstants`.
  4524. * @param {object} nativeEvent Native browser event.
  4525. * @return {?string} The fallback string for this `beforeInput` event.
  4526. */
  4527. function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
  4528. // If we are currently composing (IME) and using a fallback to do so,
  4529. // try to extract the composed characters from the fallback object.
  4530. // If composition event is available, we extract a string only at
  4531. // compositionevent, otherwise extract it at fallback events.
  4532. if (currentComposition) {
  4533. if (topLevelType === 'topCompositionEnd' || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {
  4534. var chars = currentComposition.getData();
  4535. FallbackCompositionState.release(currentComposition);
  4536. currentComposition = null;
  4537. return chars;
  4538. }
  4539. return null;
  4540. }
  4541. switch (topLevelType) {
  4542. case 'topPaste':
  4543. // If a paste event occurs after a keypress, throw out the input
  4544. // chars. Paste events should not lead to BeforeInput events.
  4545. return null;
  4546. case 'topKeyPress':
  4547. /**
  4548. * As of v27, Firefox may fire keypress events even when no character
  4549. * will be inserted. A few possibilities:
  4550. *
  4551. * - `which` is `0`. Arrow keys, Esc key, etc.
  4552. *
  4553. * - `which` is the pressed key code, but no char is available.
  4554. * Ex: 'AltGr + d` in Polish. There is no modified character for
  4555. * this key combination and no character is inserted into the
  4556. * document, but FF fires the keypress for char code `100` anyway.
  4557. * No `input` event will occur.
  4558. *
  4559. * - `which` is the pressed key code, but a command combination is
  4560. * being used. Ex: `Cmd+C`. No character is inserted, and no
  4561. * `input` event will occur.
  4562. */
  4563. if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
  4564. return String.fromCharCode(nativeEvent.which);
  4565. }
  4566. return null;
  4567. case 'topCompositionEnd':
  4568. return useFallbackCompositionData ? null : nativeEvent.data;
  4569. default:
  4570. return null;
  4571. }
  4572. }
  4573. /**
  4574. * Extract a SyntheticInputEvent for `beforeInput`, based on either native
  4575. * `textInput` or fallback behavior.
  4576. *
  4577. * @return {?object} A SyntheticInputEvent.
  4578. */
  4579. function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  4580. var chars;
  4581. if (canUseTextInputEvent) {
  4582. chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
  4583. } else {
  4584. chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
  4585. }
  4586. // If no characters are being inserted, no BeforeInput event should
  4587. // be fired.
  4588. if (!chars) {
  4589. return null;
  4590. }
  4591. var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);
  4592. event.data = chars;
  4593. EventPropagators.accumulateTwoPhaseDispatches(event);
  4594. return event;
  4595. }
  4596. /**
  4597. * Create an `onBeforeInput` event to match
  4598. * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
  4599. *
  4600. * This event plugin is based on the native `textInput` event
  4601. * available in Chrome, Safari, Opera, and IE. This event fires after
  4602. * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
  4603. *
  4604. * `beforeInput` is spec'd but not implemented in any browsers, and
  4605. * the `input` event does not provide any useful information about what has
  4606. * actually been added, contrary to the spec. Thus, `textInput` is the best
  4607. * available event to identify the characters that have actually been inserted
  4608. * into the target node.
  4609. *
  4610. * This plugin is also responsible for emitting `composition` events, thus
  4611. * allowing us to share composition fallback code for both `beforeInput` and
  4612. * `composition` event types.
  4613. */
  4614. var BeforeInputEventPlugin = {
  4615. eventTypes: eventTypes,
  4616. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  4617. return [extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget)];
  4618. }
  4619. };
  4620. module.exports = BeforeInputEventPlugin;
  4621. /***/ },
  4622. /* 43 */
  4623. /***/ function(module, exports, __webpack_require__) {
  4624. /* WEBPACK VAR INJECTION */(function(process) {/**
  4625. * Copyright 2013-present, Facebook, Inc.
  4626. * All rights reserved.
  4627. *
  4628. * This source code is licensed under the BSD-style license found in the
  4629. * LICENSE file in the root directory of this source tree. An additional grant
  4630. * of patent rights can be found in the PATENTS file in the same directory.
  4631. *
  4632. */
  4633. 'use strict';
  4634. var EventPluginHub = __webpack_require__(44);
  4635. var EventPluginUtils = __webpack_require__(46);
  4636. var accumulateInto = __webpack_require__(48);
  4637. var forEachAccumulated = __webpack_require__(49);
  4638. var warning = __webpack_require__(13);
  4639. var getListener = EventPluginHub.getListener;
  4640. /**
  4641. * Some event types have a notion of different registration names for different
  4642. * "phases" of propagation. This finds listeners by a given phase.
  4643. */
  4644. function listenerAtPhase(inst, event, propagationPhase) {
  4645. var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
  4646. return getListener(inst, registrationName);
  4647. }
  4648. /**
  4649. * Tags a `SyntheticEvent` with dispatched listeners. Creating this function
  4650. * here, allows us to not have to bind or create functions for each event.
  4651. * Mutating the event's members allows us to not have to create a wrapping
  4652. * "dispatch" object that pairs the event with the listener.
  4653. */
  4654. function accumulateDirectionalDispatches(inst, phase, event) {
  4655. if (process.env.NODE_ENV !== 'production') {
  4656. process.env.NODE_ENV !== 'production' ? warning(inst, 'Dispatching inst must not be null') : void 0;
  4657. }
  4658. var listener = listenerAtPhase(inst, event, phase);
  4659. if (listener) {
  4660. event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
  4661. event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
  4662. }
  4663. }
  4664. /**
  4665. * Collect dispatches (must be entirely collected before dispatching - see unit
  4666. * tests). Lazily allocate the array to conserve memory. We must loop through
  4667. * each event and perform the traversal for each one. We cannot perform a
  4668. * single traversal for the entire collection of events because each event may
  4669. * have a different target.
  4670. */
  4671. function accumulateTwoPhaseDispatchesSingle(event) {
  4672. if (event && event.dispatchConfig.phasedRegistrationNames) {
  4673. EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
  4674. }
  4675. }
  4676. /**
  4677. * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.
  4678. */
  4679. function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
  4680. if (event && event.dispatchConfig.phasedRegistrationNames) {
  4681. var targetInst = event._targetInst;
  4682. var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;
  4683. EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);
  4684. }
  4685. }
  4686. /**
  4687. * Accumulates without regard to direction, does not look for phased
  4688. * registration names. Same as `accumulateDirectDispatchesSingle` but without
  4689. * requiring that the `dispatchMarker` be the same as the dispatched ID.
  4690. */
  4691. function accumulateDispatches(inst, ignoredDirection, event) {
  4692. if (event && event.dispatchConfig.registrationName) {
  4693. var registrationName = event.dispatchConfig.registrationName;
  4694. var listener = getListener(inst, registrationName);
  4695. if (listener) {
  4696. event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
  4697. event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
  4698. }
  4699. }
  4700. }
  4701. /**
  4702. * Accumulates dispatches on an `SyntheticEvent`, but only for the
  4703. * `dispatchMarker`.
  4704. * @param {SyntheticEvent} event
  4705. */
  4706. function accumulateDirectDispatchesSingle(event) {
  4707. if (event && event.dispatchConfig.registrationName) {
  4708. accumulateDispatches(event._targetInst, null, event);
  4709. }
  4710. }
  4711. function accumulateTwoPhaseDispatches(events) {
  4712. forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
  4713. }
  4714. function accumulateTwoPhaseDispatchesSkipTarget(events) {
  4715. forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);
  4716. }
  4717. function accumulateEnterLeaveDispatches(leave, enter, from, to) {
  4718. EventPluginUtils.traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
  4719. }
  4720. function accumulateDirectDispatches(events) {
  4721. forEachAccumulated(events, accumulateDirectDispatchesSingle);
  4722. }
  4723. /**
  4724. * A small set of propagation patterns, each of which will accept a small amount
  4725. * of information, and generate a set of "dispatch ready event objects" - which
  4726. * are sets of events that have already been annotated with a set of dispatched
  4727. * listener functions/ids. The API is designed this way to discourage these
  4728. * propagation strategies from actually executing the dispatches, since we
  4729. * always want to collect the entire set of dispatches before executing event a
  4730. * single one.
  4731. *
  4732. * @constructor EventPropagators
  4733. */
  4734. var EventPropagators = {
  4735. accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
  4736. accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,
  4737. accumulateDirectDispatches: accumulateDirectDispatches,
  4738. accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches
  4739. };
  4740. module.exports = EventPropagators;
  4741. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  4742. /***/ },
  4743. /* 44 */
  4744. /***/ function(module, exports, __webpack_require__) {
  4745. /* WEBPACK VAR INJECTION */(function(process) {/**
  4746. * Copyright 2013-present, Facebook, Inc.
  4747. * All rights reserved.
  4748. *
  4749. * This source code is licensed under the BSD-style license found in the
  4750. * LICENSE file in the root directory of this source tree. An additional grant
  4751. * of patent rights can be found in the PATENTS file in the same directory.
  4752. *
  4753. */
  4754. 'use strict';
  4755. var _prodInvariant = __webpack_require__(37);
  4756. var EventPluginRegistry = __webpack_require__(45);
  4757. var EventPluginUtils = __webpack_require__(46);
  4758. var ReactErrorUtils = __webpack_require__(47);
  4759. var accumulateInto = __webpack_require__(48);
  4760. var forEachAccumulated = __webpack_require__(49);
  4761. var invariant = __webpack_require__(10);
  4762. /**
  4763. * Internal store for event listeners
  4764. */
  4765. var listenerBank = {};
  4766. /**
  4767. * Internal queue of events that have accumulated their dispatches and are
  4768. * waiting to have their dispatches executed.
  4769. */
  4770. var eventQueue = null;
  4771. /**
  4772. * Dispatches an event and releases it back into the pool, unless persistent.
  4773. *
  4774. * @param {?object} event Synthetic event to be dispatched.
  4775. * @param {boolean} simulated If the event is simulated (changes exn behavior)
  4776. * @private
  4777. */
  4778. var executeDispatchesAndRelease = function (event, simulated) {
  4779. if (event) {
  4780. EventPluginUtils.executeDispatchesInOrder(event, simulated);
  4781. if (!event.isPersistent()) {
  4782. event.constructor.release(event);
  4783. }
  4784. }
  4785. };
  4786. var executeDispatchesAndReleaseSimulated = function (e) {
  4787. return executeDispatchesAndRelease(e, true);
  4788. };
  4789. var executeDispatchesAndReleaseTopLevel = function (e) {
  4790. return executeDispatchesAndRelease(e, false);
  4791. };
  4792. var getDictionaryKey = function (inst) {
  4793. // Prevents V8 performance issue:
  4794. // https://github.com/facebook/react/pull/7232
  4795. return '.' + inst._rootNodeID;
  4796. };
  4797. function isInteractive(tag) {
  4798. return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
  4799. }
  4800. function shouldPreventMouseEvent(name, type, props) {
  4801. switch (name) {
  4802. case 'onClick':
  4803. case 'onClickCapture':
  4804. case 'onDoubleClick':
  4805. case 'onDoubleClickCapture':
  4806. case 'onMouseDown':
  4807. case 'onMouseDownCapture':
  4808. case 'onMouseMove':
  4809. case 'onMouseMoveCapture':
  4810. case 'onMouseUp':
  4811. case 'onMouseUpCapture':
  4812. return !!(props.disabled && isInteractive(type));
  4813. default:
  4814. return false;
  4815. }
  4816. }
  4817. /**
  4818. * This is a unified interface for event plugins to be installed and configured.
  4819. *
  4820. * Event plugins can implement the following properties:
  4821. *
  4822. * `extractEvents` {function(string, DOMEventTarget, string, object): *}
  4823. * Required. When a top-level event is fired, this method is expected to
  4824. * extract synthetic events that will in turn be queued and dispatched.
  4825. *
  4826. * `eventTypes` {object}
  4827. * Optional, plugins that fire events must publish a mapping of registration
  4828. * names that are used to register listeners. Values of this mapping must
  4829. * be objects that contain `registrationName` or `phasedRegistrationNames`.
  4830. *
  4831. * `executeDispatch` {function(object, function, string)}
  4832. * Optional, allows plugins to override how an event gets dispatched. By
  4833. * default, the listener is simply invoked.
  4834. *
  4835. * Each plugin that is injected into `EventsPluginHub` is immediately operable.
  4836. *
  4837. * @public
  4838. */
  4839. var EventPluginHub = {
  4840. /**
  4841. * Methods for injecting dependencies.
  4842. */
  4843. injection: {
  4844. /**
  4845. * @param {array} InjectedEventPluginOrder
  4846. * @public
  4847. */
  4848. injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,
  4849. /**
  4850. * @param {object} injectedNamesToPlugins Map from names to plugin modules.
  4851. */
  4852. injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName
  4853. },
  4854. /**
  4855. * Stores `listener` at `listenerBank[registrationName][key]`. Is idempotent.
  4856. *
  4857. * @param {object} inst The instance, which is the source of events.
  4858. * @param {string} registrationName Name of listener (e.g. `onClick`).
  4859. * @param {function} listener The callback to store.
  4860. */
  4861. putListener: function (inst, registrationName, listener) {
  4862. !(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;
  4863. var key = getDictionaryKey(inst);
  4864. var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {});
  4865. bankForRegistrationName[key] = listener;
  4866. var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
  4867. if (PluginModule && PluginModule.didPutListener) {
  4868. PluginModule.didPutListener(inst, registrationName, listener);
  4869. }
  4870. },
  4871. /**
  4872. * @param {object} inst The instance, which is the source of events.
  4873. * @param {string} registrationName Name of listener (e.g. `onClick`).
  4874. * @return {?function} The stored callback.
  4875. */
  4876. getListener: function (inst, registrationName) {
  4877. // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not
  4878. // live here; needs to be moved to a better place soon
  4879. var bankForRegistrationName = listenerBank[registrationName];
  4880. if (shouldPreventMouseEvent(registrationName, inst._currentElement.type, inst._currentElement.props)) {
  4881. return null;
  4882. }
  4883. var key = getDictionaryKey(inst);
  4884. return bankForRegistrationName && bankForRegistrationName[key];
  4885. },
  4886. /**
  4887. * Deletes a listener from the registration bank.
  4888. *
  4889. * @param {object} inst The instance, which is the source of events.
  4890. * @param {string} registrationName Name of listener (e.g. `onClick`).
  4891. */
  4892. deleteListener: function (inst, registrationName) {
  4893. var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
  4894. if (PluginModule && PluginModule.willDeleteListener) {
  4895. PluginModule.willDeleteListener(inst, registrationName);
  4896. }
  4897. var bankForRegistrationName = listenerBank[registrationName];
  4898. // TODO: This should never be null -- when is it?
  4899. if (bankForRegistrationName) {
  4900. var key = getDictionaryKey(inst);
  4901. delete bankForRegistrationName[key];
  4902. }
  4903. },
  4904. /**
  4905. * Deletes all listeners for the DOM element with the supplied ID.
  4906. *
  4907. * @param {object} inst The instance, which is the source of events.
  4908. */
  4909. deleteAllListeners: function (inst) {
  4910. var key = getDictionaryKey(inst);
  4911. for (var registrationName in listenerBank) {
  4912. if (!listenerBank.hasOwnProperty(registrationName)) {
  4913. continue;
  4914. }
  4915. if (!listenerBank[registrationName][key]) {
  4916. continue;
  4917. }
  4918. var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
  4919. if (PluginModule && PluginModule.willDeleteListener) {
  4920. PluginModule.willDeleteListener(inst, registrationName);
  4921. }
  4922. delete listenerBank[registrationName][key];
  4923. }
  4924. },
  4925. /**
  4926. * Allows registered plugins an opportunity to extract events from top-level
  4927. * native browser events.
  4928. *
  4929. * @return {*} An accumulation of synthetic events.
  4930. * @internal
  4931. */
  4932. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  4933. var events;
  4934. var plugins = EventPluginRegistry.plugins;
  4935. for (var i = 0; i < plugins.length; i++) {
  4936. // Not every plugin in the ordering may be loaded at runtime.
  4937. var possiblePlugin = plugins[i];
  4938. if (possiblePlugin) {
  4939. var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
  4940. if (extractedEvents) {
  4941. events = accumulateInto(events, extractedEvents);
  4942. }
  4943. }
  4944. }
  4945. return events;
  4946. },
  4947. /**
  4948. * Enqueues a synthetic event that should be dispatched when
  4949. * `processEventQueue` is invoked.
  4950. *
  4951. * @param {*} events An accumulation of synthetic events.
  4952. * @internal
  4953. */
  4954. enqueueEvents: function (events) {
  4955. if (events) {
  4956. eventQueue = accumulateInto(eventQueue, events);
  4957. }
  4958. },
  4959. /**
  4960. * Dispatches all synthetic events on the event queue.
  4961. *
  4962. * @internal
  4963. */
  4964. processEventQueue: function (simulated) {
  4965. // Set `eventQueue` to null before processing it so that we can tell if more
  4966. // events get enqueued while processing.
  4967. var processingEventQueue = eventQueue;
  4968. eventQueue = null;
  4969. if (simulated) {
  4970. forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
  4971. } else {
  4972. forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
  4973. }
  4974. !!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;
  4975. // This would be a good time to rethrow if any of the event handlers threw.
  4976. ReactErrorUtils.rethrowCaughtError();
  4977. },
  4978. /**
  4979. * These are needed for tests only. Do not use!
  4980. */
  4981. __purge: function () {
  4982. listenerBank = {};
  4983. },
  4984. __getListenerBank: function () {
  4985. return listenerBank;
  4986. }
  4987. };
  4988. module.exports = EventPluginHub;
  4989. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  4990. /***/ },
  4991. /* 45 */
  4992. /***/ function(module, exports, __webpack_require__) {
  4993. /* WEBPACK VAR INJECTION */(function(process) {/**
  4994. * Copyright 2013-present, Facebook, Inc.
  4995. * All rights reserved.
  4996. *
  4997. * This source code is licensed under the BSD-style license found in the
  4998. * LICENSE file in the root directory of this source tree. An additional grant
  4999. * of patent rights can be found in the PATENTS file in the same directory.
  5000. *
  5001. *
  5002. */
  5003. 'use strict';
  5004. var _prodInvariant = __webpack_require__(37);
  5005. var invariant = __webpack_require__(10);
  5006. /**
  5007. * Injectable ordering of event plugins.
  5008. */
  5009. var eventPluginOrder = null;
  5010. /**
  5011. * Injectable mapping from names to event plugin modules.
  5012. */
  5013. var namesToPlugins = {};
  5014. /**
  5015. * Recomputes the plugin list using the injected plugins and plugin ordering.
  5016. *
  5017. * @private
  5018. */
  5019. function recomputePluginOrdering() {
  5020. if (!eventPluginOrder) {
  5021. // Wait until an `eventPluginOrder` is injected.
  5022. return;
  5023. }
  5024. for (var pluginName in namesToPlugins) {
  5025. var pluginModule = namesToPlugins[pluginName];
  5026. var pluginIndex = eventPluginOrder.indexOf(pluginName);
  5027. !(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;
  5028. if (EventPluginRegistry.plugins[pluginIndex]) {
  5029. continue;
  5030. }
  5031. !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;
  5032. EventPluginRegistry.plugins[pluginIndex] = pluginModule;
  5033. var publishedEvents = pluginModule.eventTypes;
  5034. for (var eventName in publishedEvents) {
  5035. !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;
  5036. }
  5037. }
  5038. }
  5039. /**
  5040. * Publishes an event so that it can be dispatched by the supplied plugin.
  5041. *
  5042. * @param {object} dispatchConfig Dispatch configuration for the event.
  5043. * @param {object} PluginModule Plugin publishing the event.
  5044. * @return {boolean} True if the event was successfully published.
  5045. * @private
  5046. */
  5047. function publishEventForPlugin(dispatchConfig, pluginModule, eventName) {
  5048. !!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;
  5049. EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig;
  5050. var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
  5051. if (phasedRegistrationNames) {
  5052. for (var phaseName in phasedRegistrationNames) {
  5053. if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
  5054. var phasedRegistrationName = phasedRegistrationNames[phaseName];
  5055. publishRegistrationName(phasedRegistrationName, pluginModule, eventName);
  5056. }
  5057. }
  5058. return true;
  5059. } else if (dispatchConfig.registrationName) {
  5060. publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);
  5061. return true;
  5062. }
  5063. return false;
  5064. }
  5065. /**
  5066. * Publishes a registration name that is used to identify dispatched events and
  5067. * can be used with `EventPluginHub.putListener` to register listeners.
  5068. *
  5069. * @param {string} registrationName Registration name to add.
  5070. * @param {object} PluginModule Plugin publishing the event.
  5071. * @private
  5072. */
  5073. function publishRegistrationName(registrationName, pluginModule, eventName) {
  5074. !!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;
  5075. EventPluginRegistry.registrationNameModules[registrationName] = pluginModule;
  5076. EventPluginRegistry.registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;
  5077. if (process.env.NODE_ENV !== 'production') {
  5078. var lowerCasedName = registrationName.toLowerCase();
  5079. EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName;
  5080. if (registrationName === 'onDoubleClick') {
  5081. EventPluginRegistry.possibleRegistrationNames.ondblclick = registrationName;
  5082. }
  5083. }
  5084. }
  5085. /**
  5086. * Registers plugins so that they can extract and dispatch events.
  5087. *
  5088. * @see {EventPluginHub}
  5089. */
  5090. var EventPluginRegistry = {
  5091. /**
  5092. * Ordered list of injected plugins.
  5093. */
  5094. plugins: [],
  5095. /**
  5096. * Mapping from event name to dispatch config
  5097. */
  5098. eventNameDispatchConfigs: {},
  5099. /**
  5100. * Mapping from registration name to plugin module
  5101. */
  5102. registrationNameModules: {},
  5103. /**
  5104. * Mapping from registration name to event name
  5105. */
  5106. registrationNameDependencies: {},
  5107. /**
  5108. * Mapping from lowercase registration names to the properly cased version,
  5109. * used to warn in the case of missing event handlers. Available
  5110. * only in __DEV__.
  5111. * @type {Object}
  5112. */
  5113. possibleRegistrationNames: process.env.NODE_ENV !== 'production' ? {} : null,
  5114. // Trust the developer to only use possibleRegistrationNames in __DEV__
  5115. /**
  5116. * Injects an ordering of plugins (by plugin name). This allows the ordering
  5117. * to be decoupled from injection of the actual plugins so that ordering is
  5118. * always deterministic regardless of packaging, on-the-fly injection, etc.
  5119. *
  5120. * @param {array} InjectedEventPluginOrder
  5121. * @internal
  5122. * @see {EventPluginHub.injection.injectEventPluginOrder}
  5123. */
  5124. injectEventPluginOrder: function (injectedEventPluginOrder) {
  5125. !!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;
  5126. // Clone the ordering so it cannot be dynamically mutated.
  5127. eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);
  5128. recomputePluginOrdering();
  5129. },
  5130. /**
  5131. * Injects plugins to be used by `EventPluginHub`. The plugin names must be
  5132. * in the ordering injected by `injectEventPluginOrder`.
  5133. *
  5134. * Plugins can be injected as part of page initialization or on-the-fly.
  5135. *
  5136. * @param {object} injectedNamesToPlugins Map from names to plugin modules.
  5137. * @internal
  5138. * @see {EventPluginHub.injection.injectEventPluginsByName}
  5139. */
  5140. injectEventPluginsByName: function (injectedNamesToPlugins) {
  5141. var isOrderingDirty = false;
  5142. for (var pluginName in injectedNamesToPlugins) {
  5143. if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
  5144. continue;
  5145. }
  5146. var pluginModule = injectedNamesToPlugins[pluginName];
  5147. if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {
  5148. !!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;
  5149. namesToPlugins[pluginName] = pluginModule;
  5150. isOrderingDirty = true;
  5151. }
  5152. }
  5153. if (isOrderingDirty) {
  5154. recomputePluginOrdering();
  5155. }
  5156. },
  5157. /**
  5158. * Looks up the plugin for the supplied event.
  5159. *
  5160. * @param {object} event A synthetic event.
  5161. * @return {?object} The plugin that created the supplied event.
  5162. * @internal
  5163. */
  5164. getPluginModuleForEvent: function (event) {
  5165. var dispatchConfig = event.dispatchConfig;
  5166. if (dispatchConfig.registrationName) {
  5167. return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null;
  5168. }
  5169. if (dispatchConfig.phasedRegistrationNames !== undefined) {
  5170. // pulling phasedRegistrationNames out of dispatchConfig helps Flow see
  5171. // that it is not undefined.
  5172. var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
  5173. for (var phase in phasedRegistrationNames) {
  5174. if (!phasedRegistrationNames.hasOwnProperty(phase)) {
  5175. continue;
  5176. }
  5177. var pluginModule = EventPluginRegistry.registrationNameModules[phasedRegistrationNames[phase]];
  5178. if (pluginModule) {
  5179. return pluginModule;
  5180. }
  5181. }
  5182. }
  5183. return null;
  5184. },
  5185. /**
  5186. * Exposed for unit testing.
  5187. * @private
  5188. */
  5189. _resetEventPlugins: function () {
  5190. eventPluginOrder = null;
  5191. for (var pluginName in namesToPlugins) {
  5192. if (namesToPlugins.hasOwnProperty(pluginName)) {
  5193. delete namesToPlugins[pluginName];
  5194. }
  5195. }
  5196. EventPluginRegistry.plugins.length = 0;
  5197. var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs;
  5198. for (var eventName in eventNameDispatchConfigs) {
  5199. if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {
  5200. delete eventNameDispatchConfigs[eventName];
  5201. }
  5202. }
  5203. var registrationNameModules = EventPluginRegistry.registrationNameModules;
  5204. for (var registrationName in registrationNameModules) {
  5205. if (registrationNameModules.hasOwnProperty(registrationName)) {
  5206. delete registrationNameModules[registrationName];
  5207. }
  5208. }
  5209. if (process.env.NODE_ENV !== 'production') {
  5210. var possibleRegistrationNames = EventPluginRegistry.possibleRegistrationNames;
  5211. for (var lowerCasedName in possibleRegistrationNames) {
  5212. if (possibleRegistrationNames.hasOwnProperty(lowerCasedName)) {
  5213. delete possibleRegistrationNames[lowerCasedName];
  5214. }
  5215. }
  5216. }
  5217. }
  5218. };
  5219. module.exports = EventPluginRegistry;
  5220. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  5221. /***/ },
  5222. /* 46 */
  5223. /***/ function(module, exports, __webpack_require__) {
  5224. /* WEBPACK VAR INJECTION */(function(process) {/**
  5225. * Copyright 2013-present, Facebook, Inc.
  5226. * All rights reserved.
  5227. *
  5228. * This source code is licensed under the BSD-style license found in the
  5229. * LICENSE file in the root directory of this source tree. An additional grant
  5230. * of patent rights can be found in the PATENTS file in the same directory.
  5231. *
  5232. */
  5233. 'use strict';
  5234. var _prodInvariant = __webpack_require__(37);
  5235. var ReactErrorUtils = __webpack_require__(47);
  5236. var invariant = __webpack_require__(10);
  5237. var warning = __webpack_require__(13);
  5238. /**
  5239. * Injected dependencies:
  5240. */
  5241. /**
  5242. * - `ComponentTree`: [required] Module that can convert between React instances
  5243. * and actual node references.
  5244. */
  5245. var ComponentTree;
  5246. var TreeTraversal;
  5247. var injection = {
  5248. injectComponentTree: function (Injected) {
  5249. ComponentTree = Injected;
  5250. if (process.env.NODE_ENV !== 'production') {
  5251. process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;
  5252. }
  5253. },
  5254. injectTreeTraversal: function (Injected) {
  5255. TreeTraversal = Injected;
  5256. if (process.env.NODE_ENV !== 'production') {
  5257. process.env.NODE_ENV !== 'production' ? warning(Injected && Injected.isAncestor && Injected.getLowestCommonAncestor, 'EventPluginUtils.injection.injectTreeTraversal(...): Injected ' + 'module is missing isAncestor or getLowestCommonAncestor.') : void 0;
  5258. }
  5259. }
  5260. };
  5261. function isEndish(topLevelType) {
  5262. return topLevelType === 'topMouseUp' || topLevelType === 'topTouchEnd' || topLevelType === 'topTouchCancel';
  5263. }
  5264. function isMoveish(topLevelType) {
  5265. return topLevelType === 'topMouseMove' || topLevelType === 'topTouchMove';
  5266. }
  5267. function isStartish(topLevelType) {
  5268. return topLevelType === 'topMouseDown' || topLevelType === 'topTouchStart';
  5269. }
  5270. var validateEventDispatches;
  5271. if (process.env.NODE_ENV !== 'production') {
  5272. validateEventDispatches = function (event) {
  5273. var dispatchListeners = event._dispatchListeners;
  5274. var dispatchInstances = event._dispatchInstances;
  5275. var listenersIsArr = Array.isArray(dispatchListeners);
  5276. var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
  5277. var instancesIsArr = Array.isArray(dispatchInstances);
  5278. var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
  5279. process.env.NODE_ENV !== 'production' ? warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : void 0;
  5280. };
  5281. }
  5282. /**
  5283. * Dispatch the event to the listener.
  5284. * @param {SyntheticEvent} event SyntheticEvent to handle
  5285. * @param {boolean} simulated If the event is simulated (changes exn behavior)
  5286. * @param {function} listener Application-level callback
  5287. * @param {*} inst Internal component instance
  5288. */
  5289. function executeDispatch(event, simulated, listener, inst) {
  5290. var type = event.type || 'unknown-event';
  5291. event.currentTarget = EventPluginUtils.getNodeFromInstance(inst);
  5292. if (simulated) {
  5293. ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event);
  5294. } else {
  5295. ReactErrorUtils.invokeGuardedCallback(type, listener, event);
  5296. }
  5297. event.currentTarget = null;
  5298. }
  5299. /**
  5300. * Standard/simple iteration through an event's collected dispatches.
  5301. */
  5302. function executeDispatchesInOrder(event, simulated) {
  5303. var dispatchListeners = event._dispatchListeners;
  5304. var dispatchInstances = event._dispatchInstances;
  5305. if (process.env.NODE_ENV !== 'production') {
  5306. validateEventDispatches(event);
  5307. }
  5308. if (Array.isArray(dispatchListeners)) {
  5309. for (var i = 0; i < dispatchListeners.length; i++) {
  5310. if (event.isPropagationStopped()) {
  5311. break;
  5312. }
  5313. // Listeners and Instances are two parallel arrays that are always in sync.
  5314. executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]);
  5315. }
  5316. } else if (dispatchListeners) {
  5317. executeDispatch(event, simulated, dispatchListeners, dispatchInstances);
  5318. }
  5319. event._dispatchListeners = null;
  5320. event._dispatchInstances = null;
  5321. }
  5322. /**
  5323. * Standard/simple iteration through an event's collected dispatches, but stops
  5324. * at the first dispatch execution returning true, and returns that id.
  5325. *
  5326. * @return {?string} id of the first dispatch execution who's listener returns
  5327. * true, or null if no listener returned true.
  5328. */
  5329. function executeDispatchesInOrderStopAtTrueImpl(event) {
  5330. var dispatchListeners = event._dispatchListeners;
  5331. var dispatchInstances = event._dispatchInstances;
  5332. if (process.env.NODE_ENV !== 'production') {
  5333. validateEventDispatches(event);
  5334. }
  5335. if (Array.isArray(dispatchListeners)) {
  5336. for (var i = 0; i < dispatchListeners.length; i++) {
  5337. if (event.isPropagationStopped()) {
  5338. break;
  5339. }
  5340. // Listeners and Instances are two parallel arrays that are always in sync.
  5341. if (dispatchListeners[i](event, dispatchInstances[i])) {
  5342. return dispatchInstances[i];
  5343. }
  5344. }
  5345. } else if (dispatchListeners) {
  5346. if (dispatchListeners(event, dispatchInstances)) {
  5347. return dispatchInstances;
  5348. }
  5349. }
  5350. return null;
  5351. }
  5352. /**
  5353. * @see executeDispatchesInOrderStopAtTrueImpl
  5354. */
  5355. function executeDispatchesInOrderStopAtTrue(event) {
  5356. var ret = executeDispatchesInOrderStopAtTrueImpl(event);
  5357. event._dispatchInstances = null;
  5358. event._dispatchListeners = null;
  5359. return ret;
  5360. }
  5361. /**
  5362. * Execution of a "direct" dispatch - there must be at most one dispatch
  5363. * accumulated on the event or it is considered an error. It doesn't really make
  5364. * sense for an event with multiple dispatches (bubbled) to keep track of the
  5365. * return values at each dispatch execution, but it does tend to make sense when
  5366. * dealing with "direct" dispatches.
  5367. *
  5368. * @return {*} The return value of executing the single dispatch.
  5369. */
  5370. function executeDirectDispatch(event) {
  5371. if (process.env.NODE_ENV !== 'production') {
  5372. validateEventDispatches(event);
  5373. }
  5374. var dispatchListener = event._dispatchListeners;
  5375. var dispatchInstance = event._dispatchInstances;
  5376. !!Array.isArray(dispatchListener) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : _prodInvariant('103') : void 0;
  5377. event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null;
  5378. var res = dispatchListener ? dispatchListener(event) : null;
  5379. event.currentTarget = null;
  5380. event._dispatchListeners = null;
  5381. event._dispatchInstances = null;
  5382. return res;
  5383. }
  5384. /**
  5385. * @param {SyntheticEvent} event
  5386. * @return {boolean} True iff number of dispatches accumulated is greater than 0.
  5387. */
  5388. function hasDispatches(event) {
  5389. return !!event._dispatchListeners;
  5390. }
  5391. /**
  5392. * General utilities that are useful in creating custom Event Plugins.
  5393. */
  5394. var EventPluginUtils = {
  5395. isEndish: isEndish,
  5396. isMoveish: isMoveish,
  5397. isStartish: isStartish,
  5398. executeDirectDispatch: executeDirectDispatch,
  5399. executeDispatchesInOrder: executeDispatchesInOrder,
  5400. executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue,
  5401. hasDispatches: hasDispatches,
  5402. getInstanceFromNode: function (node) {
  5403. return ComponentTree.getInstanceFromNode(node);
  5404. },
  5405. getNodeFromInstance: function (node) {
  5406. return ComponentTree.getNodeFromInstance(node);
  5407. },
  5408. isAncestor: function (a, b) {
  5409. return TreeTraversal.isAncestor(a, b);
  5410. },
  5411. getLowestCommonAncestor: function (a, b) {
  5412. return TreeTraversal.getLowestCommonAncestor(a, b);
  5413. },
  5414. getParentInstance: function (inst) {
  5415. return TreeTraversal.getParentInstance(inst);
  5416. },
  5417. traverseTwoPhase: function (target, fn, arg) {
  5418. return TreeTraversal.traverseTwoPhase(target, fn, arg);
  5419. },
  5420. traverseEnterLeave: function (from, to, fn, argFrom, argTo) {
  5421. return TreeTraversal.traverseEnterLeave(from, to, fn, argFrom, argTo);
  5422. },
  5423. injection: injection
  5424. };
  5425. module.exports = EventPluginUtils;
  5426. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  5427. /***/ },
  5428. /* 47 */
  5429. /***/ function(module, exports, __webpack_require__) {
  5430. /* WEBPACK VAR INJECTION */(function(process) {/**
  5431. * Copyright 2013-present, Facebook, Inc.
  5432. * All rights reserved.
  5433. *
  5434. * This source code is licensed under the BSD-style license found in the
  5435. * LICENSE file in the root directory of this source tree. An additional grant
  5436. * of patent rights can be found in the PATENTS file in the same directory.
  5437. *
  5438. *
  5439. */
  5440. 'use strict';
  5441. var caughtError = null;
  5442. /**
  5443. * Call a function while guarding against errors that happens within it.
  5444. *
  5445. * @param {String} name of the guard to use for logging or debugging
  5446. * @param {Function} func The function to invoke
  5447. * @param {*} a First argument
  5448. * @param {*} b Second argument
  5449. */
  5450. function invokeGuardedCallback(name, func, a) {
  5451. try {
  5452. func(a);
  5453. } catch (x) {
  5454. if (caughtError === null) {
  5455. caughtError = x;
  5456. }
  5457. }
  5458. }
  5459. var ReactErrorUtils = {
  5460. invokeGuardedCallback: invokeGuardedCallback,
  5461. /**
  5462. * Invoked by ReactTestUtils.Simulate so that any errors thrown by the event
  5463. * handler are sure to be rethrown by rethrowCaughtError.
  5464. */
  5465. invokeGuardedCallbackWithCatch: invokeGuardedCallback,
  5466. /**
  5467. * During execution of guarded functions we will capture the first error which
  5468. * we will rethrow to be handled by the top level error handler.
  5469. */
  5470. rethrowCaughtError: function () {
  5471. if (caughtError) {
  5472. var error = caughtError;
  5473. caughtError = null;
  5474. throw error;
  5475. }
  5476. }
  5477. };
  5478. if (process.env.NODE_ENV !== 'production') {
  5479. /**
  5480. * To help development we can get better devtools integration by simulating a
  5481. * real browser event.
  5482. */
  5483. if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
  5484. var fakeNode = document.createElement('react');
  5485. ReactErrorUtils.invokeGuardedCallback = function (name, func, a) {
  5486. var boundFunc = func.bind(null, a);
  5487. var evtType = 'react-' + name;
  5488. fakeNode.addEventListener(evtType, boundFunc, false);
  5489. var evt = document.createEvent('Event');
  5490. // $FlowFixMe https://github.com/facebook/flow/issues/2336
  5491. evt.initEvent(evtType, false, false);
  5492. fakeNode.dispatchEvent(evt);
  5493. fakeNode.removeEventListener(evtType, boundFunc, false);
  5494. };
  5495. }
  5496. }
  5497. module.exports = ReactErrorUtils;
  5498. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  5499. /***/ },
  5500. /* 48 */
  5501. /***/ function(module, exports, __webpack_require__) {
  5502. /* WEBPACK VAR INJECTION */(function(process) {/**
  5503. * Copyright 2014-present, Facebook, Inc.
  5504. * All rights reserved.
  5505. *
  5506. * This source code is licensed under the BSD-style license found in the
  5507. * LICENSE file in the root directory of this source tree. An additional grant
  5508. * of patent rights can be found in the PATENTS file in the same directory.
  5509. *
  5510. *
  5511. */
  5512. 'use strict';
  5513. var _prodInvariant = __webpack_require__(37);
  5514. var invariant = __webpack_require__(10);
  5515. /**
  5516. * Accumulates items that must not be null or undefined into the first one. This
  5517. * is used to conserve memory by avoiding array allocations, and thus sacrifices
  5518. * API cleanness. Since `current` can be null before being passed in and not
  5519. * null after this function, make sure to assign it back to `current`:
  5520. *
  5521. * `a = accumulateInto(a, b);`
  5522. *
  5523. * This API should be sparingly used. Try `accumulate` for something cleaner.
  5524. *
  5525. * @return {*|array<*>} An accumulation of items.
  5526. */
  5527. function accumulateInto(current, next) {
  5528. !(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : _prodInvariant('30') : void 0;
  5529. if (current == null) {
  5530. return next;
  5531. }
  5532. // Both are not empty. Warning: Never call x.concat(y) when you are not
  5533. // certain that x is an Array (x could be a string with concat method).
  5534. if (Array.isArray(current)) {
  5535. if (Array.isArray(next)) {
  5536. current.push.apply(current, next);
  5537. return current;
  5538. }
  5539. current.push(next);
  5540. return current;
  5541. }
  5542. if (Array.isArray(next)) {
  5543. // A bit too dangerous to mutate `next`.
  5544. return [current].concat(next);
  5545. }
  5546. return [current, next];
  5547. }
  5548. module.exports = accumulateInto;
  5549. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  5550. /***/ },
  5551. /* 49 */
  5552. /***/ function(module, exports) {
  5553. /**
  5554. * Copyright 2013-present, Facebook, Inc.
  5555. * All rights reserved.
  5556. *
  5557. * This source code is licensed under the BSD-style license found in the
  5558. * LICENSE file in the root directory of this source tree. An additional grant
  5559. * of patent rights can be found in the PATENTS file in the same directory.
  5560. *
  5561. *
  5562. */
  5563. 'use strict';
  5564. /**
  5565. * @param {array} arr an "accumulation" of items which is either an Array or
  5566. * a single item. Useful when paired with the `accumulate` module. This is a
  5567. * simple utility that allows us to reason about a collection of items, but
  5568. * handling the case when there is exactly one item (and we do not need to
  5569. * allocate an array).
  5570. */
  5571. function forEachAccumulated(arr, cb, scope) {
  5572. if (Array.isArray(arr)) {
  5573. arr.forEach(cb, scope);
  5574. } else if (arr) {
  5575. cb.call(scope, arr);
  5576. }
  5577. }
  5578. module.exports = forEachAccumulated;
  5579. /***/ },
  5580. /* 50 */
  5581. /***/ function(module, exports) {
  5582. /**
  5583. * Copyright (c) 2013-present, Facebook, Inc.
  5584. * All rights reserved.
  5585. *
  5586. * This source code is licensed under the BSD-style license found in the
  5587. * LICENSE file in the root directory of this source tree. An additional grant
  5588. * of patent rights can be found in the PATENTS file in the same directory.
  5589. *
  5590. */
  5591. 'use strict';
  5592. var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
  5593. /**
  5594. * Simple, lightweight module assisting with the detection and context of
  5595. * Worker. Helps avoid circular dependencies and allows code to reason about
  5596. * whether or not they are in a Worker, even if they never include the main
  5597. * `ReactWorker` dependency.
  5598. */
  5599. var ExecutionEnvironment = {
  5600. canUseDOM: canUseDOM,
  5601. canUseWorkers: typeof Worker !== 'undefined',
  5602. canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
  5603. canUseViewport: canUseDOM && !!window.screen,
  5604. isInWorker: !canUseDOM // For now, this is true - might change in the future.
  5605. };
  5606. module.exports = ExecutionEnvironment;
  5607. /***/ },
  5608. /* 51 */
  5609. /***/ function(module, exports, __webpack_require__) {
  5610. /**
  5611. * Copyright 2013-present, Facebook, Inc.
  5612. * All rights reserved.
  5613. *
  5614. * This source code is licensed under the BSD-style license found in the
  5615. * LICENSE file in the root directory of this source tree. An additional grant
  5616. * of patent rights can be found in the PATENTS file in the same directory.
  5617. *
  5618. */
  5619. 'use strict';
  5620. var _assign = __webpack_require__(6);
  5621. var PooledClass = __webpack_require__(52);
  5622. var getTextContentAccessor = __webpack_require__(53);
  5623. /**
  5624. * This helper class stores information about text content of a target node,
  5625. * allowing comparison of content before and after a given event.
  5626. *
  5627. * Identify the node where selection currently begins, then observe
  5628. * both its text content and its current position in the DOM. Since the
  5629. * browser may natively replace the target node during composition, we can
  5630. * use its position to find its replacement.
  5631. *
  5632. * @param {DOMEventTarget} root
  5633. */
  5634. function FallbackCompositionState(root) {
  5635. this._root = root;
  5636. this._startText = this.getText();
  5637. this._fallbackText = null;
  5638. }
  5639. _assign(FallbackCompositionState.prototype, {
  5640. destructor: function () {
  5641. this._root = null;
  5642. this._startText = null;
  5643. this._fallbackText = null;
  5644. },
  5645. /**
  5646. * Get current text of input.
  5647. *
  5648. * @return {string}
  5649. */
  5650. getText: function () {
  5651. if ('value' in this._root) {
  5652. return this._root.value;
  5653. }
  5654. return this._root[getTextContentAccessor()];
  5655. },
  5656. /**
  5657. * Determine the differing substring between the initially stored
  5658. * text content and the current content.
  5659. *
  5660. * @return {string}
  5661. */
  5662. getData: function () {
  5663. if (this._fallbackText) {
  5664. return this._fallbackText;
  5665. }
  5666. var start;
  5667. var startValue = this._startText;
  5668. var startLength = startValue.length;
  5669. var end;
  5670. var endValue = this.getText();
  5671. var endLength = endValue.length;
  5672. for (start = 0; start < startLength; start++) {
  5673. if (startValue[start] !== endValue[start]) {
  5674. break;
  5675. }
  5676. }
  5677. var minEnd = startLength - start;
  5678. for (end = 1; end <= minEnd; end++) {
  5679. if (startValue[startLength - end] !== endValue[endLength - end]) {
  5680. break;
  5681. }
  5682. }
  5683. var sliceTail = end > 1 ? 1 - end : undefined;
  5684. this._fallbackText = endValue.slice(start, sliceTail);
  5685. return this._fallbackText;
  5686. }
  5687. });
  5688. PooledClass.addPoolingTo(FallbackCompositionState);
  5689. module.exports = FallbackCompositionState;
  5690. /***/ },
  5691. /* 52 */
  5692. /***/ function(module, exports, __webpack_require__) {
  5693. /* WEBPACK VAR INJECTION */(function(process) {/**
  5694. * Copyright 2013-present, Facebook, Inc.
  5695. * All rights reserved.
  5696. *
  5697. * This source code is licensed under the BSD-style license found in the
  5698. * LICENSE file in the root directory of this source tree. An additional grant
  5699. * of patent rights can be found in the PATENTS file in the same directory.
  5700. *
  5701. *
  5702. */
  5703. 'use strict';
  5704. var _prodInvariant = __webpack_require__(37);
  5705. var invariant = __webpack_require__(10);
  5706. /**
  5707. * Static poolers. Several custom versions for each potential number of
  5708. * arguments. A completely generic pooler is easy to implement, but would
  5709. * require accessing the `arguments` object. In each of these, `this` refers to
  5710. * the Class itself, not an instance. If any others are needed, simply add them
  5711. * here, or in their own files.
  5712. */
  5713. var oneArgumentPooler = function (copyFieldsFrom) {
  5714. var Klass = this;
  5715. if (Klass.instancePool.length) {
  5716. var instance = Klass.instancePool.pop();
  5717. Klass.call(instance, copyFieldsFrom);
  5718. return instance;
  5719. } else {
  5720. return new Klass(copyFieldsFrom);
  5721. }
  5722. };
  5723. var twoArgumentPooler = function (a1, a2) {
  5724. var Klass = this;
  5725. if (Klass.instancePool.length) {
  5726. var instance = Klass.instancePool.pop();
  5727. Klass.call(instance, a1, a2);
  5728. return instance;
  5729. } else {
  5730. return new Klass(a1, a2);
  5731. }
  5732. };
  5733. var threeArgumentPooler = function (a1, a2, a3) {
  5734. var Klass = this;
  5735. if (Klass.instancePool.length) {
  5736. var instance = Klass.instancePool.pop();
  5737. Klass.call(instance, a1, a2, a3);
  5738. return instance;
  5739. } else {
  5740. return new Klass(a1, a2, a3);
  5741. }
  5742. };
  5743. var fourArgumentPooler = function (a1, a2, a3, a4) {
  5744. var Klass = this;
  5745. if (Klass.instancePool.length) {
  5746. var instance = Klass.instancePool.pop();
  5747. Klass.call(instance, a1, a2, a3, a4);
  5748. return instance;
  5749. } else {
  5750. return new Klass(a1, a2, a3, a4);
  5751. }
  5752. };
  5753. var standardReleaser = function (instance) {
  5754. var Klass = this;
  5755. !(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;
  5756. instance.destructor();
  5757. if (Klass.instancePool.length < Klass.poolSize) {
  5758. Klass.instancePool.push(instance);
  5759. }
  5760. };
  5761. var DEFAULT_POOL_SIZE = 10;
  5762. var DEFAULT_POOLER = oneArgumentPooler;
  5763. /**
  5764. * Augments `CopyConstructor` to be a poolable class, augmenting only the class
  5765. * itself (statically) not adding any prototypical fields. Any CopyConstructor
  5766. * you give this may have a `poolSize` property, and will look for a
  5767. * prototypical `destructor` on instances.
  5768. *
  5769. * @param {Function} CopyConstructor Constructor that can be used to reset.
  5770. * @param {Function} pooler Customizable pooler.
  5771. */
  5772. var addPoolingTo = function (CopyConstructor, pooler) {
  5773. // Casting as any so that flow ignores the actual implementation and trusts
  5774. // it to match the type we declared
  5775. var NewKlass = CopyConstructor;
  5776. NewKlass.instancePool = [];
  5777. NewKlass.getPooled = pooler || DEFAULT_POOLER;
  5778. if (!NewKlass.poolSize) {
  5779. NewKlass.poolSize = DEFAULT_POOL_SIZE;
  5780. }
  5781. NewKlass.release = standardReleaser;
  5782. return NewKlass;
  5783. };
  5784. var PooledClass = {
  5785. addPoolingTo: addPoolingTo,
  5786. oneArgumentPooler: oneArgumentPooler,
  5787. twoArgumentPooler: twoArgumentPooler,
  5788. threeArgumentPooler: threeArgumentPooler,
  5789. fourArgumentPooler: fourArgumentPooler
  5790. };
  5791. module.exports = PooledClass;
  5792. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  5793. /***/ },
  5794. /* 53 */
  5795. /***/ function(module, exports, __webpack_require__) {
  5796. /**
  5797. * Copyright 2013-present, Facebook, Inc.
  5798. * All rights reserved.
  5799. *
  5800. * This source code is licensed under the BSD-style license found in the
  5801. * LICENSE file in the root directory of this source tree. An additional grant
  5802. * of patent rights can be found in the PATENTS file in the same directory.
  5803. *
  5804. */
  5805. 'use strict';
  5806. var ExecutionEnvironment = __webpack_require__(50);
  5807. var contentKey = null;
  5808. /**
  5809. * Gets the key used to access text content on a DOM node.
  5810. *
  5811. * @return {?string} Key used to access text content.
  5812. * @internal
  5813. */
  5814. function getTextContentAccessor() {
  5815. if (!contentKey && ExecutionEnvironment.canUseDOM) {
  5816. // Prefer textContent to innerText because many browsers support both but
  5817. // SVG <text> elements don't support innerText even when <div> does.
  5818. contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
  5819. }
  5820. return contentKey;
  5821. }
  5822. module.exports = getTextContentAccessor;
  5823. /***/ },
  5824. /* 54 */
  5825. /***/ function(module, exports, __webpack_require__) {
  5826. /**
  5827. * Copyright 2013-present, Facebook, Inc.
  5828. * All rights reserved.
  5829. *
  5830. * This source code is licensed under the BSD-style license found in the
  5831. * LICENSE file in the root directory of this source tree. An additional grant
  5832. * of patent rights can be found in the PATENTS file in the same directory.
  5833. *
  5834. */
  5835. 'use strict';
  5836. var SyntheticEvent = __webpack_require__(55);
  5837. /**
  5838. * @interface Event
  5839. * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
  5840. */
  5841. var CompositionEventInterface = {
  5842. data: null
  5843. };
  5844. /**
  5845. * @param {object} dispatchConfig Configuration used to dispatch this event.
  5846. * @param {string} dispatchMarker Marker identifying the event target.
  5847. * @param {object} nativeEvent Native browser event.
  5848. * @extends {SyntheticUIEvent}
  5849. */
  5850. function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  5851. return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  5852. }
  5853. SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);
  5854. module.exports = SyntheticCompositionEvent;
  5855. /***/ },
  5856. /* 55 */
  5857. /***/ function(module, exports, __webpack_require__) {
  5858. /* WEBPACK VAR INJECTION */(function(process) {/**
  5859. * Copyright 2013-present, Facebook, Inc.
  5860. * All rights reserved.
  5861. *
  5862. * This source code is licensed under the BSD-style license found in the
  5863. * LICENSE file in the root directory of this source tree. An additional grant
  5864. * of patent rights can be found in the PATENTS file in the same directory.
  5865. *
  5866. */
  5867. 'use strict';
  5868. var _assign = __webpack_require__(6);
  5869. var PooledClass = __webpack_require__(52);
  5870. var emptyFunction = __webpack_require__(14);
  5871. var warning = __webpack_require__(13);
  5872. var didWarnForAddedNewProperty = false;
  5873. var isProxySupported = typeof Proxy === 'function';
  5874. var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];
  5875. /**
  5876. * @interface Event
  5877. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  5878. */
  5879. var EventInterface = {
  5880. type: null,
  5881. target: null,
  5882. // currentTarget is set when dispatching; no use in copying it here
  5883. currentTarget: emptyFunction.thatReturnsNull,
  5884. eventPhase: null,
  5885. bubbles: null,
  5886. cancelable: null,
  5887. timeStamp: function (event) {
  5888. return event.timeStamp || Date.now();
  5889. },
  5890. defaultPrevented: null,
  5891. isTrusted: null
  5892. };
  5893. /**
  5894. * Synthetic events are dispatched by event plugins, typically in response to a
  5895. * top-level event delegation handler.
  5896. *
  5897. * These systems should generally use pooling to reduce the frequency of garbage
  5898. * collection. The system should check `isPersistent` to determine whether the
  5899. * event should be released into the pool after being dispatched. Users that
  5900. * need a persisted event should invoke `persist`.
  5901. *
  5902. * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
  5903. * normalizing browser quirks. Subclasses do not necessarily have to implement a
  5904. * DOM interface; custom application-specific events can also subclass this.
  5905. *
  5906. * @param {object} dispatchConfig Configuration used to dispatch this event.
  5907. * @param {*} targetInst Marker identifying the event target.
  5908. * @param {object} nativeEvent Native browser event.
  5909. * @param {DOMEventTarget} nativeEventTarget Target node.
  5910. */
  5911. function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
  5912. if (process.env.NODE_ENV !== 'production') {
  5913. // these have a getter/setter for warnings
  5914. delete this.nativeEvent;
  5915. delete this.preventDefault;
  5916. delete this.stopPropagation;
  5917. }
  5918. this.dispatchConfig = dispatchConfig;
  5919. this._targetInst = targetInst;
  5920. this.nativeEvent = nativeEvent;
  5921. var Interface = this.constructor.Interface;
  5922. for (var propName in Interface) {
  5923. if (!Interface.hasOwnProperty(propName)) {
  5924. continue;
  5925. }
  5926. if (process.env.NODE_ENV !== 'production') {
  5927. delete this[propName]; // this has a getter/setter for warnings
  5928. }
  5929. var normalize = Interface[propName];
  5930. if (normalize) {
  5931. this[propName] = normalize(nativeEvent);
  5932. } else {
  5933. if (propName === 'target') {
  5934. this.target = nativeEventTarget;
  5935. } else {
  5936. this[propName] = nativeEvent[propName];
  5937. }
  5938. }
  5939. }
  5940. var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
  5941. if (defaultPrevented) {
  5942. this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
  5943. } else {
  5944. this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
  5945. }
  5946. this.isPropagationStopped = emptyFunction.thatReturnsFalse;
  5947. return this;
  5948. }
  5949. _assign(SyntheticEvent.prototype, {
  5950. preventDefault: function () {
  5951. this.defaultPrevented = true;
  5952. var event = this.nativeEvent;
  5953. if (!event) {
  5954. return;
  5955. }
  5956. if (event.preventDefault) {
  5957. event.preventDefault();
  5958. } else if (typeof event.returnValue !== 'unknown') {
  5959. // eslint-disable-line valid-typeof
  5960. event.returnValue = false;
  5961. }
  5962. this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
  5963. },
  5964. stopPropagation: function () {
  5965. var event = this.nativeEvent;
  5966. if (!event) {
  5967. return;
  5968. }
  5969. if (event.stopPropagation) {
  5970. event.stopPropagation();
  5971. } else if (typeof event.cancelBubble !== 'unknown') {
  5972. // eslint-disable-line valid-typeof
  5973. // The ChangeEventPlugin registers a "propertychange" event for
  5974. // IE. This event does not support bubbling or cancelling, and
  5975. // any references to cancelBubble throw "Member not found". A
  5976. // typeof check of "unknown" circumvents this issue (and is also
  5977. // IE specific).
  5978. event.cancelBubble = true;
  5979. }
  5980. this.isPropagationStopped = emptyFunction.thatReturnsTrue;
  5981. },
  5982. /**
  5983. * We release all dispatched `SyntheticEvent`s after each event loop, adding
  5984. * them back into the pool. This allows a way to hold onto a reference that
  5985. * won't be added back into the pool.
  5986. */
  5987. persist: function () {
  5988. this.isPersistent = emptyFunction.thatReturnsTrue;
  5989. },
  5990. /**
  5991. * Checks if this event should be released back into the pool.
  5992. *
  5993. * @return {boolean} True if this should not be released, false otherwise.
  5994. */
  5995. isPersistent: emptyFunction.thatReturnsFalse,
  5996. /**
  5997. * `PooledClass` looks for `destructor` on each instance it releases.
  5998. */
  5999. destructor: function () {
  6000. var Interface = this.constructor.Interface;
  6001. for (var propName in Interface) {
  6002. if (process.env.NODE_ENV !== 'production') {
  6003. Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
  6004. } else {
  6005. this[propName] = null;
  6006. }
  6007. }
  6008. for (var i = 0; i < shouldBeReleasedProperties.length; i++) {
  6009. this[shouldBeReleasedProperties[i]] = null;
  6010. }
  6011. if (process.env.NODE_ENV !== 'production') {
  6012. Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
  6013. Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction));
  6014. Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction));
  6015. }
  6016. }
  6017. });
  6018. SyntheticEvent.Interface = EventInterface;
  6019. if (process.env.NODE_ENV !== 'production') {
  6020. if (isProxySupported) {
  6021. /*eslint-disable no-func-assign */
  6022. SyntheticEvent = new Proxy(SyntheticEvent, {
  6023. construct: function (target, args) {
  6024. return this.apply(target, Object.create(target.prototype), args);
  6025. },
  6026. apply: function (constructor, that, args) {
  6027. return new Proxy(constructor.apply(that, args), {
  6028. set: function (target, prop, value) {
  6029. if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
  6030. 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;
  6031. didWarnForAddedNewProperty = true;
  6032. }
  6033. target[prop] = value;
  6034. return true;
  6035. }
  6036. });
  6037. }
  6038. });
  6039. /*eslint-enable no-func-assign */
  6040. }
  6041. }
  6042. /**
  6043. * Helper to reduce boilerplate when creating subclasses.
  6044. *
  6045. * @param {function} Class
  6046. * @param {?object} Interface
  6047. */
  6048. SyntheticEvent.augmentClass = function (Class, Interface) {
  6049. var Super = this;
  6050. var E = function () {};
  6051. E.prototype = Super.prototype;
  6052. var prototype = new E();
  6053. _assign(prototype, Class.prototype);
  6054. Class.prototype = prototype;
  6055. Class.prototype.constructor = Class;
  6056. Class.Interface = _assign({}, Super.Interface, Interface);
  6057. Class.augmentClass = Super.augmentClass;
  6058. PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
  6059. };
  6060. PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
  6061. module.exports = SyntheticEvent;
  6062. /**
  6063. * Helper to nullify syntheticEvent instance properties when destructing
  6064. *
  6065. * @param {object} SyntheticEvent
  6066. * @param {String} propName
  6067. * @return {object} defineProperty object
  6068. */
  6069. function getPooledWarningPropertyDefinition(propName, getVal) {
  6070. var isFunction = typeof getVal === 'function';
  6071. return {
  6072. configurable: true,
  6073. set: set,
  6074. get: get
  6075. };
  6076. function set(val) {
  6077. var action = isFunction ? 'setting the method' : 'setting the property';
  6078. warn(action, 'This is effectively a no-op');
  6079. return val;
  6080. }
  6081. function get() {
  6082. var action = isFunction ? 'accessing the method' : 'accessing the property';
  6083. var result = isFunction ? 'This is a no-op function' : 'This is set to null';
  6084. warn(action, result);
  6085. return getVal;
  6086. }
  6087. function warn(action, result) {
  6088. var warningCondition = false;
  6089. 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;
  6090. }
  6091. }
  6092. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  6093. /***/ },
  6094. /* 56 */
  6095. /***/ function(module, exports, __webpack_require__) {
  6096. /**
  6097. * Copyright 2013-present, Facebook, Inc.
  6098. * All rights reserved.
  6099. *
  6100. * This source code is licensed under the BSD-style license found in the
  6101. * LICENSE file in the root directory of this source tree. An additional grant
  6102. * of patent rights can be found in the PATENTS file in the same directory.
  6103. *
  6104. */
  6105. 'use strict';
  6106. var SyntheticEvent = __webpack_require__(55);
  6107. /**
  6108. * @interface Event
  6109. * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
  6110. * /#events-inputevents
  6111. */
  6112. var InputEventInterface = {
  6113. data: null
  6114. };
  6115. /**
  6116. * @param {object} dispatchConfig Configuration used to dispatch this event.
  6117. * @param {string} dispatchMarker Marker identifying the event target.
  6118. * @param {object} nativeEvent Native browser event.
  6119. * @extends {SyntheticUIEvent}
  6120. */
  6121. function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  6122. return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  6123. }
  6124. SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);
  6125. module.exports = SyntheticInputEvent;
  6126. /***/ },
  6127. /* 57 */
  6128. /***/ function(module, exports, __webpack_require__) {
  6129. /**
  6130. * Copyright 2013-present, Facebook, Inc.
  6131. * All rights reserved.
  6132. *
  6133. * This source code is licensed under the BSD-style license found in the
  6134. * LICENSE file in the root directory of this source tree. An additional grant
  6135. * of patent rights can be found in the PATENTS file in the same directory.
  6136. *
  6137. */
  6138. 'use strict';
  6139. var EventPluginHub = __webpack_require__(44);
  6140. var EventPropagators = __webpack_require__(43);
  6141. var ExecutionEnvironment = __webpack_require__(50);
  6142. var ReactDOMComponentTree = __webpack_require__(36);
  6143. var ReactUpdates = __webpack_require__(58);
  6144. var SyntheticEvent = __webpack_require__(55);
  6145. var getEventTarget = __webpack_require__(71);
  6146. var isEventSupported = __webpack_require__(72);
  6147. var isTextInputElement = __webpack_require__(73);
  6148. var eventTypes = {
  6149. change: {
  6150. phasedRegistrationNames: {
  6151. bubbled: 'onChange',
  6152. captured: 'onChangeCapture'
  6153. },
  6154. dependencies: ['topBlur', 'topChange', 'topClick', 'topFocus', 'topInput', 'topKeyDown', 'topKeyUp', 'topSelectionChange']
  6155. }
  6156. };
  6157. /**
  6158. * For IE shims
  6159. */
  6160. var activeElement = null;
  6161. var activeElementInst = null;
  6162. var activeElementValue = null;
  6163. var activeElementValueProp = null;
  6164. /**
  6165. * SECTION: handle `change` event
  6166. */
  6167. function shouldUseChangeEvent(elem) {
  6168. var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
  6169. return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
  6170. }
  6171. var doesChangeEventBubble = false;
  6172. if (ExecutionEnvironment.canUseDOM) {
  6173. // See `handleChange` comment below
  6174. doesChangeEventBubble = isEventSupported('change') && (!document.documentMode || document.documentMode > 8);
  6175. }
  6176. function manualDispatchChangeEvent(nativeEvent) {
  6177. var event = SyntheticEvent.getPooled(eventTypes.change, activeElementInst, nativeEvent, getEventTarget(nativeEvent));
  6178. EventPropagators.accumulateTwoPhaseDispatches(event);
  6179. // If change and propertychange bubbled, we'd just bind to it like all the
  6180. // other events and have it go through ReactBrowserEventEmitter. Since it
  6181. // doesn't, we manually listen for the events and so we have to enqueue and
  6182. // process the abstract event manually.
  6183. //
  6184. // Batching is necessary here in order to ensure that all event handlers run
  6185. // before the next rerender (including event handlers attached to ancestor
  6186. // elements instead of directly on the input). Without this, controlled
  6187. // components don't work properly in conjunction with event bubbling because
  6188. // the component is rerendered and the value reverted before all the event
  6189. // handlers can run. See https://github.com/facebook/react/issues/708.
  6190. ReactUpdates.batchedUpdates(runEventInBatch, event);
  6191. }
  6192. function runEventInBatch(event) {
  6193. EventPluginHub.enqueueEvents(event);
  6194. EventPluginHub.processEventQueue(false);
  6195. }
  6196. function startWatchingForChangeEventIE8(target, targetInst) {
  6197. activeElement = target;
  6198. activeElementInst = targetInst;
  6199. activeElement.attachEvent('onchange', manualDispatchChangeEvent);
  6200. }
  6201. function stopWatchingForChangeEventIE8() {
  6202. if (!activeElement) {
  6203. return;
  6204. }
  6205. activeElement.detachEvent('onchange', manualDispatchChangeEvent);
  6206. activeElement = null;
  6207. activeElementInst = null;
  6208. }
  6209. function getTargetInstForChangeEvent(topLevelType, targetInst) {
  6210. if (topLevelType === 'topChange') {
  6211. return targetInst;
  6212. }
  6213. }
  6214. function handleEventsForChangeEventIE8(topLevelType, target, targetInst) {
  6215. if (topLevelType === 'topFocus') {
  6216. // stopWatching() should be a noop here but we call it just in case we
  6217. // missed a blur event somehow.
  6218. stopWatchingForChangeEventIE8();
  6219. startWatchingForChangeEventIE8(target, targetInst);
  6220. } else if (topLevelType === 'topBlur') {
  6221. stopWatchingForChangeEventIE8();
  6222. }
  6223. }
  6224. /**
  6225. * SECTION: handle `input` event
  6226. */
  6227. var isInputEventSupported = false;
  6228. if (ExecutionEnvironment.canUseDOM) {
  6229. // IE9 claims to support the input event but fails to trigger it when
  6230. // deleting text, so we ignore its input events.
  6231. // IE10+ fire input events to often, such when a placeholder
  6232. // changes or when an input with a placeholder is focused.
  6233. isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 11);
  6234. }
  6235. /**
  6236. * (For IE <=11) Replacement getter/setter for the `value` property that gets
  6237. * set on the active element.
  6238. */
  6239. var newValueProp = {
  6240. get: function () {
  6241. return activeElementValueProp.get.call(this);
  6242. },
  6243. set: function (val) {
  6244. // Cast to a string so we can do equality checks.
  6245. activeElementValue = '' + val;
  6246. activeElementValueProp.set.call(this, val);
  6247. }
  6248. };
  6249. /**
  6250. * (For IE <=11) Starts tracking propertychange events on the passed-in element
  6251. * and override the value property so that we can distinguish user events from
  6252. * value changes in JS.
  6253. */
  6254. function startWatchingForValueChange(target, targetInst) {
  6255. activeElement = target;
  6256. activeElementInst = targetInst;
  6257. activeElementValue = target.value;
  6258. activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');
  6259. // Not guarded in a canDefineProperty check: IE8 supports defineProperty only
  6260. // on DOM elements
  6261. Object.defineProperty(activeElement, 'value', newValueProp);
  6262. if (activeElement.attachEvent) {
  6263. activeElement.attachEvent('onpropertychange', handlePropertyChange);
  6264. } else {
  6265. activeElement.addEventListener('propertychange', handlePropertyChange, false);
  6266. }
  6267. }
  6268. /**
  6269. * (For IE <=11) Removes the event listeners from the currently-tracked element,
  6270. * if any exists.
  6271. */
  6272. function stopWatchingForValueChange() {
  6273. if (!activeElement) {
  6274. return;
  6275. }
  6276. // delete restores the original property definition
  6277. delete activeElement.value;
  6278. if (activeElement.detachEvent) {
  6279. activeElement.detachEvent('onpropertychange', handlePropertyChange);
  6280. } else {
  6281. activeElement.removeEventListener('propertychange', handlePropertyChange, false);
  6282. }
  6283. activeElement = null;
  6284. activeElementInst = null;
  6285. activeElementValue = null;
  6286. activeElementValueProp = null;
  6287. }
  6288. /**
  6289. * (For IE <=11) Handles a propertychange event, sending a `change` event if
  6290. * the value of the active element has changed.
  6291. */
  6292. function handlePropertyChange(nativeEvent) {
  6293. if (nativeEvent.propertyName !== 'value') {
  6294. return;
  6295. }
  6296. var value = nativeEvent.srcElement.value;
  6297. if (value === activeElementValue) {
  6298. return;
  6299. }
  6300. activeElementValue = value;
  6301. manualDispatchChangeEvent(nativeEvent);
  6302. }
  6303. /**
  6304. * If a `change` event should be fired, returns the target's ID.
  6305. */
  6306. function getTargetInstForInputEvent(topLevelType, targetInst) {
  6307. if (topLevelType === 'topInput') {
  6308. // In modern browsers (i.e., not IE8 or IE9), the input event is exactly
  6309. // what we want so fall through here and trigger an abstract event
  6310. return targetInst;
  6311. }
  6312. }
  6313. function handleEventsForInputEventIE(topLevelType, target, targetInst) {
  6314. if (topLevelType === 'topFocus') {
  6315. // In IE8, we can capture almost all .value changes by adding a
  6316. // propertychange handler and looking for events with propertyName
  6317. // equal to 'value'
  6318. // In IE9-11, propertychange fires for most input events but is buggy and
  6319. // doesn't fire when text is deleted, but conveniently, selectionchange
  6320. // appears to fire in all of the remaining cases so we catch those and
  6321. // forward the event if the value has changed
  6322. // In either case, we don't want to call the event handler if the value
  6323. // is changed from JS so we redefine a setter for `.value` that updates
  6324. // our activeElementValue variable, allowing us to ignore those changes
  6325. //
  6326. // stopWatching() should be a noop here but we call it just in case we
  6327. // missed a blur event somehow.
  6328. stopWatchingForValueChange();
  6329. startWatchingForValueChange(target, targetInst);
  6330. } else if (topLevelType === 'topBlur') {
  6331. stopWatchingForValueChange();
  6332. }
  6333. }
  6334. // For IE8 and IE9.
  6335. function getTargetInstForInputEventIE(topLevelType, targetInst) {
  6336. if (topLevelType === 'topSelectionChange' || topLevelType === 'topKeyUp' || topLevelType === 'topKeyDown') {
  6337. // On the selectionchange event, the target is just document which isn't
  6338. // helpful for us so just check activeElement instead.
  6339. //
  6340. // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
  6341. // propertychange on the first input event after setting `value` from a
  6342. // script and fires only keydown, keypress, keyup. Catching keyup usually
  6343. // gets it and catching keydown lets us fire an event for the first
  6344. // keystroke if user does a key repeat (it'll be a little delayed: right
  6345. // before the second keystroke). Other input methods (e.g., paste) seem to
  6346. // fire selectionchange normally.
  6347. if (activeElement && activeElement.value !== activeElementValue) {
  6348. activeElementValue = activeElement.value;
  6349. return activeElementInst;
  6350. }
  6351. }
  6352. }
  6353. /**
  6354. * SECTION: handle `click` event
  6355. */
  6356. function shouldUseClickEvent(elem) {
  6357. // Use the `click` event to detect changes to checkbox and radio inputs.
  6358. // This approach works across all browsers, whereas `change` does not fire
  6359. // until `blur` in IE8.
  6360. return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
  6361. }
  6362. function getTargetInstForClickEvent(topLevelType, targetInst) {
  6363. if (topLevelType === 'topClick') {
  6364. return targetInst;
  6365. }
  6366. }
  6367. /**
  6368. * This plugin creates an `onChange` event that normalizes change events
  6369. * across form elements. This event fires at a time when it's possible to
  6370. * change the element's value without seeing a flicker.
  6371. *
  6372. * Supported elements are:
  6373. * - input (see `isTextInputElement`)
  6374. * - textarea
  6375. * - select
  6376. */
  6377. var ChangeEventPlugin = {
  6378. eventTypes: eventTypes,
  6379. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  6380. var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
  6381. var getTargetInstFunc, handleEventFunc;
  6382. if (shouldUseChangeEvent(targetNode)) {
  6383. if (doesChangeEventBubble) {
  6384. getTargetInstFunc = getTargetInstForChangeEvent;
  6385. } else {
  6386. handleEventFunc = handleEventsForChangeEventIE8;
  6387. }
  6388. } else if (isTextInputElement(targetNode)) {
  6389. if (isInputEventSupported) {
  6390. getTargetInstFunc = getTargetInstForInputEvent;
  6391. } else {
  6392. getTargetInstFunc = getTargetInstForInputEventIE;
  6393. handleEventFunc = handleEventsForInputEventIE;
  6394. }
  6395. } else if (shouldUseClickEvent(targetNode)) {
  6396. getTargetInstFunc = getTargetInstForClickEvent;
  6397. }
  6398. if (getTargetInstFunc) {
  6399. var inst = getTargetInstFunc(topLevelType, targetInst);
  6400. if (inst) {
  6401. var event = SyntheticEvent.getPooled(eventTypes.change, inst, nativeEvent, nativeEventTarget);
  6402. event.type = 'change';
  6403. EventPropagators.accumulateTwoPhaseDispatches(event);
  6404. return event;
  6405. }
  6406. }
  6407. if (handleEventFunc) {
  6408. handleEventFunc(topLevelType, targetNode, targetInst);
  6409. }
  6410. }
  6411. };
  6412. module.exports = ChangeEventPlugin;
  6413. /***/ },
  6414. /* 58 */
  6415. /***/ function(module, exports, __webpack_require__) {
  6416. /* WEBPACK VAR INJECTION */(function(process) {/**
  6417. * Copyright 2013-present, Facebook, Inc.
  6418. * All rights reserved.
  6419. *
  6420. * This source code is licensed under the BSD-style license found in the
  6421. * LICENSE file in the root directory of this source tree. An additional grant
  6422. * of patent rights can be found in the PATENTS file in the same directory.
  6423. *
  6424. */
  6425. 'use strict';
  6426. var _prodInvariant = __webpack_require__(37),
  6427. _assign = __webpack_require__(6);
  6428. var CallbackQueue = __webpack_require__(59);
  6429. var PooledClass = __webpack_require__(52);
  6430. var ReactFeatureFlags = __webpack_require__(60);
  6431. var ReactReconciler = __webpack_require__(61);
  6432. var Transaction = __webpack_require__(70);
  6433. var invariant = __webpack_require__(10);
  6434. var dirtyComponents = [];
  6435. var updateBatchNumber = 0;
  6436. var asapCallbackQueue = CallbackQueue.getPooled();
  6437. var asapEnqueued = false;
  6438. var batchingStrategy = null;
  6439. function ensureInjected() {
  6440. !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching strategy') : _prodInvariant('123') : void 0;
  6441. }
  6442. var NESTED_UPDATES = {
  6443. initialize: function () {
  6444. this.dirtyComponentsLength = dirtyComponents.length;
  6445. },
  6446. close: function () {
  6447. if (this.dirtyComponentsLength !== dirtyComponents.length) {
  6448. // Additional updates were enqueued by componentDidUpdate handlers or
  6449. // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run
  6450. // these new updates so that if A's componentDidUpdate calls setState on
  6451. // B, B will update before the callback A's updater provided when calling
  6452. // setState.
  6453. dirtyComponents.splice(0, this.dirtyComponentsLength);
  6454. flushBatchedUpdates();
  6455. } else {
  6456. dirtyComponents.length = 0;
  6457. }
  6458. }
  6459. };
  6460. var UPDATE_QUEUEING = {
  6461. initialize: function () {
  6462. this.callbackQueue.reset();
  6463. },
  6464. close: function () {
  6465. this.callbackQueue.notifyAll();
  6466. }
  6467. };
  6468. var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
  6469. function ReactUpdatesFlushTransaction() {
  6470. this.reinitializeTransaction();
  6471. this.dirtyComponentsLength = null;
  6472. this.callbackQueue = CallbackQueue.getPooled();
  6473. this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled(
  6474. /* useCreateElement */true);
  6475. }
  6476. _assign(ReactUpdatesFlushTransaction.prototype, Transaction, {
  6477. getTransactionWrappers: function () {
  6478. return TRANSACTION_WRAPPERS;
  6479. },
  6480. destructor: function () {
  6481. this.dirtyComponentsLength = null;
  6482. CallbackQueue.release(this.callbackQueue);
  6483. this.callbackQueue = null;
  6484. ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);
  6485. this.reconcileTransaction = null;
  6486. },
  6487. perform: function (method, scope, a) {
  6488. // Essentially calls `this.reconcileTransaction.perform(method, scope, a)`
  6489. // with this transaction's wrappers around it.
  6490. return Transaction.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a);
  6491. }
  6492. });
  6493. PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
  6494. function batchedUpdates(callback, a, b, c, d, e) {
  6495. ensureInjected();
  6496. return batchingStrategy.batchedUpdates(callback, a, b, c, d, e);
  6497. }
  6498. /**
  6499. * Array comparator for ReactComponents by mount ordering.
  6500. *
  6501. * @param {ReactComponent} c1 first component you're comparing
  6502. * @param {ReactComponent} c2 second component you're comparing
  6503. * @return {number} Return value usable by Array.prototype.sort().
  6504. */
  6505. function mountOrderComparator(c1, c2) {
  6506. return c1._mountOrder - c2._mountOrder;
  6507. }
  6508. function runBatchedUpdates(transaction) {
  6509. var len = transaction.dirtyComponentsLength;
  6510. !(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;
  6511. // Since reconciling a component higher in the owner hierarchy usually (not
  6512. // always -- see shouldComponentUpdate()) will reconcile children, reconcile
  6513. // them before their children by sorting the array.
  6514. dirtyComponents.sort(mountOrderComparator);
  6515. // Any updates enqueued while reconciling must be performed after this entire
  6516. // batch. Otherwise, if dirtyComponents is [A, B] where A has children B and
  6517. // C, B could update twice in a single batch if C's render enqueues an update
  6518. // to B (since B would have already updated, we should skip it, and the only
  6519. // way we can know to do so is by checking the batch counter).
  6520. updateBatchNumber++;
  6521. for (var i = 0; i < len; i++) {
  6522. // If a component is unmounted before pending changes apply, it will still
  6523. // be here, but we assume that it has cleared its _pendingCallbacks and
  6524. // that performUpdateIfNecessary is a noop.
  6525. var component = dirtyComponents[i];
  6526. // If performUpdateIfNecessary happens to enqueue any new updates, we
  6527. // shouldn't execute the callbacks until the next render happens, so
  6528. // stash the callbacks first
  6529. var callbacks = component._pendingCallbacks;
  6530. component._pendingCallbacks = null;
  6531. var markerName;
  6532. if (ReactFeatureFlags.logTopLevelRenders) {
  6533. var namedComponent = component;
  6534. // Duck type TopLevelWrapper. This is probably always true.
  6535. if (component._currentElement.type.isReactTopLevelWrapper) {
  6536. namedComponent = component._renderedComponent;
  6537. }
  6538. markerName = 'React update: ' + namedComponent.getName();
  6539. console.time(markerName);
  6540. }
  6541. ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber);
  6542. if (markerName) {
  6543. console.timeEnd(markerName);
  6544. }
  6545. if (callbacks) {
  6546. for (var j = 0; j < callbacks.length; j++) {
  6547. transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance());
  6548. }
  6549. }
  6550. }
  6551. }
  6552. var flushBatchedUpdates = function () {
  6553. // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents
  6554. // array and perform any updates enqueued by mount-ready handlers (i.e.,
  6555. // componentDidUpdate) but we need to check here too in order to catch
  6556. // updates enqueued by setState callbacks and asap calls.
  6557. while (dirtyComponents.length || asapEnqueued) {
  6558. if (dirtyComponents.length) {
  6559. var transaction = ReactUpdatesFlushTransaction.getPooled();
  6560. transaction.perform(runBatchedUpdates, null, transaction);
  6561. ReactUpdatesFlushTransaction.release(transaction);
  6562. }
  6563. if (asapEnqueued) {
  6564. asapEnqueued = false;
  6565. var queue = asapCallbackQueue;
  6566. asapCallbackQueue = CallbackQueue.getPooled();
  6567. queue.notifyAll();
  6568. CallbackQueue.release(queue);
  6569. }
  6570. }
  6571. };
  6572. /**
  6573. * Mark a component as needing a rerender, adding an optional callback to a
  6574. * list of functions which will be executed once the rerender occurs.
  6575. */
  6576. function enqueueUpdate(component) {
  6577. ensureInjected();
  6578. // Various parts of our code (such as ReactCompositeComponent's
  6579. // _renderValidatedComponent) assume that calls to render aren't nested;
  6580. // verify that that's the case. (This is called by each top-level update
  6581. // function, like setState, forceUpdate, etc.; creation and
  6582. // destruction of top-level components is guarded in ReactMount.)
  6583. if (!batchingStrategy.isBatchingUpdates) {
  6584. batchingStrategy.batchedUpdates(enqueueUpdate, component);
  6585. return;
  6586. }
  6587. dirtyComponents.push(component);
  6588. if (component._updateBatchNumber == null) {
  6589. component._updateBatchNumber = updateBatchNumber + 1;
  6590. }
  6591. }
  6592. /**
  6593. * Enqueue a callback to be run at the end of the current batching cycle. Throws
  6594. * if no updates are currently being performed.
  6595. */
  6596. function asap(callback, context) {
  6597. !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;
  6598. asapCallbackQueue.enqueue(callback, context);
  6599. asapEnqueued = true;
  6600. }
  6601. var ReactUpdatesInjection = {
  6602. injectReconcileTransaction: function (ReconcileTransaction) {
  6603. !ReconcileTransaction ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : _prodInvariant('126') : void 0;
  6604. ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
  6605. },
  6606. injectBatchingStrategy: function (_batchingStrategy) {
  6607. !_batchingStrategy ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : _prodInvariant('127') : void 0;
  6608. !(typeof _batchingStrategy.batchedUpdates === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : _prodInvariant('128') : void 0;
  6609. !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : _prodInvariant('129') : void 0;
  6610. batchingStrategy = _batchingStrategy;
  6611. }
  6612. };
  6613. var ReactUpdates = {
  6614. /**
  6615. * React references `ReactReconcileTransaction` using this property in order
  6616. * to allow dependency injection.
  6617. *
  6618. * @internal
  6619. */
  6620. ReactReconcileTransaction: null,
  6621. batchedUpdates: batchedUpdates,
  6622. enqueueUpdate: enqueueUpdate,
  6623. flushBatchedUpdates: flushBatchedUpdates,
  6624. injection: ReactUpdatesInjection,
  6625. asap: asap
  6626. };
  6627. module.exports = ReactUpdates;
  6628. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  6629. /***/ },
  6630. /* 59 */
  6631. /***/ function(module, exports, __webpack_require__) {
  6632. /* WEBPACK VAR INJECTION */(function(process) {/**
  6633. * Copyright 2013-present, Facebook, Inc.
  6634. * All rights reserved.
  6635. *
  6636. * This source code is licensed under the BSD-style license found in the
  6637. * LICENSE file in the root directory of this source tree. An additional grant
  6638. * of patent rights can be found in the PATENTS file in the same directory.
  6639. *
  6640. *
  6641. */
  6642. 'use strict';
  6643. var _prodInvariant = __webpack_require__(37);
  6644. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6645. var PooledClass = __webpack_require__(52);
  6646. var invariant = __webpack_require__(10);
  6647. /**
  6648. * A specialized pseudo-event module to help keep track of components waiting to
  6649. * be notified when their DOM representations are available for use.
  6650. *
  6651. * This implements `PooledClass`, so you should never need to instantiate this.
  6652. * Instead, use `CallbackQueue.getPooled()`.
  6653. *
  6654. * @class ReactMountReady
  6655. * @implements PooledClass
  6656. * @internal
  6657. */
  6658. var CallbackQueue = function () {
  6659. function CallbackQueue(arg) {
  6660. _classCallCheck(this, CallbackQueue);
  6661. this._callbacks = null;
  6662. this._contexts = null;
  6663. this._arg = arg;
  6664. }
  6665. /**
  6666. * Enqueues a callback to be invoked when `notifyAll` is invoked.
  6667. *
  6668. * @param {function} callback Invoked when `notifyAll` is invoked.
  6669. * @param {?object} context Context to call `callback` with.
  6670. * @internal
  6671. */
  6672. CallbackQueue.prototype.enqueue = function enqueue(callback, context) {
  6673. this._callbacks = this._callbacks || [];
  6674. this._callbacks.push(callback);
  6675. this._contexts = this._contexts || [];
  6676. this._contexts.push(context);
  6677. };
  6678. /**
  6679. * Invokes all enqueued callbacks and clears the queue. This is invoked after
  6680. * the DOM representation of a component has been created or updated.
  6681. *
  6682. * @internal
  6683. */
  6684. CallbackQueue.prototype.notifyAll = function notifyAll() {
  6685. var callbacks = this._callbacks;
  6686. var contexts = this._contexts;
  6687. var arg = this._arg;
  6688. if (callbacks && contexts) {
  6689. !(callbacks.length === contexts.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : _prodInvariant('24') : void 0;
  6690. this._callbacks = null;
  6691. this._contexts = null;
  6692. for (var i = 0; i < callbacks.length; i++) {
  6693. callbacks[i].call(contexts[i], arg);
  6694. }
  6695. callbacks.length = 0;
  6696. contexts.length = 0;
  6697. }
  6698. };
  6699. CallbackQueue.prototype.checkpoint = function checkpoint() {
  6700. return this._callbacks ? this._callbacks.length : 0;
  6701. };
  6702. CallbackQueue.prototype.rollback = function rollback(len) {
  6703. if (this._callbacks && this._contexts) {
  6704. this._callbacks.length = len;
  6705. this._contexts.length = len;
  6706. }
  6707. };
  6708. /**
  6709. * Resets the internal queue.
  6710. *
  6711. * @internal
  6712. */
  6713. CallbackQueue.prototype.reset = function reset() {
  6714. this._callbacks = null;
  6715. this._contexts = null;
  6716. };
  6717. /**
  6718. * `PooledClass` looks for this.
  6719. */
  6720. CallbackQueue.prototype.destructor = function destructor() {
  6721. this.reset();
  6722. };
  6723. return CallbackQueue;
  6724. }();
  6725. module.exports = PooledClass.addPoolingTo(CallbackQueue);
  6726. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  6727. /***/ },
  6728. /* 60 */
  6729. /***/ function(module, exports) {
  6730. /**
  6731. * Copyright 2013-present, Facebook, Inc.
  6732. * All rights reserved.
  6733. *
  6734. * This source code is licensed under the BSD-style license found in the
  6735. * LICENSE file in the root directory of this source tree. An additional grant
  6736. * of patent rights can be found in the PATENTS file in the same directory.
  6737. *
  6738. *
  6739. */
  6740. 'use strict';
  6741. var ReactFeatureFlags = {
  6742. // When true, call console.time() before and .timeEnd() after each top-level
  6743. // render (both initial renders and updates). Useful when looking at prod-mode
  6744. // timeline profiles in Chrome, for example.
  6745. logTopLevelRenders: false
  6746. };
  6747. module.exports = ReactFeatureFlags;
  6748. /***/ },
  6749. /* 61 */
  6750. /***/ function(module, exports, __webpack_require__) {
  6751. /* WEBPACK VAR INJECTION */(function(process) {/**
  6752. * Copyright 2013-present, Facebook, Inc.
  6753. * All rights reserved.
  6754. *
  6755. * This source code is licensed under the BSD-style license found in the
  6756. * LICENSE file in the root directory of this source tree. An additional grant
  6757. * of patent rights can be found in the PATENTS file in the same directory.
  6758. *
  6759. */
  6760. 'use strict';
  6761. var ReactRef = __webpack_require__(62);
  6762. var ReactInstrumentation = __webpack_require__(64);
  6763. var warning = __webpack_require__(13);
  6764. /**
  6765. * Helper to call ReactRef.attachRefs with this composite component, split out
  6766. * to avoid allocations in the transaction mount-ready queue.
  6767. */
  6768. function attachRefs() {
  6769. ReactRef.attachRefs(this, this._currentElement);
  6770. }
  6771. var ReactReconciler = {
  6772. /**
  6773. * Initializes the component, renders markup, and registers event listeners.
  6774. *
  6775. * @param {ReactComponent} internalInstance
  6776. * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
  6777. * @param {?object} the containing host component instance
  6778. * @param {?object} info about the host container
  6779. * @return {?string} Rendered markup to be inserted into the DOM.
  6780. * @final
  6781. * @internal
  6782. */
  6783. mountComponent: function (internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID // 0 in production and for roots
  6784. ) {
  6785. if (process.env.NODE_ENV !== 'production') {
  6786. if (internalInstance._debugID !== 0) {
  6787. ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement, parentDebugID);
  6788. }
  6789. }
  6790. var markup = internalInstance.mountComponent(transaction, hostParent, hostContainerInfo, context, parentDebugID);
  6791. if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {
  6792. transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
  6793. }
  6794. if (process.env.NODE_ENV !== 'production') {
  6795. if (internalInstance._debugID !== 0) {
  6796. ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID);
  6797. }
  6798. }
  6799. return markup;
  6800. },
  6801. /**
  6802. * Returns a value that can be passed to
  6803. * ReactComponentEnvironment.replaceNodeWithMarkup.
  6804. */
  6805. getHostNode: function (internalInstance) {
  6806. return internalInstance.getHostNode();
  6807. },
  6808. /**
  6809. * Releases any resources allocated by `mountComponent`.
  6810. *
  6811. * @final
  6812. * @internal
  6813. */
  6814. unmountComponent: function (internalInstance, safely) {
  6815. if (process.env.NODE_ENV !== 'production') {
  6816. if (internalInstance._debugID !== 0) {
  6817. ReactInstrumentation.debugTool.onBeforeUnmountComponent(internalInstance._debugID);
  6818. }
  6819. }
  6820. ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
  6821. internalInstance.unmountComponent(safely);
  6822. if (process.env.NODE_ENV !== 'production') {
  6823. if (internalInstance._debugID !== 0) {
  6824. ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID);
  6825. }
  6826. }
  6827. },
  6828. /**
  6829. * Update a component using a new element.
  6830. *
  6831. * @param {ReactComponent} internalInstance
  6832. * @param {ReactElement} nextElement
  6833. * @param {ReactReconcileTransaction} transaction
  6834. * @param {object} context
  6835. * @internal
  6836. */
  6837. receiveComponent: function (internalInstance, nextElement, transaction, context) {
  6838. var prevElement = internalInstance._currentElement;
  6839. if (nextElement === prevElement && context === internalInstance._context) {
  6840. // Since elements are immutable after the owner is rendered,
  6841. // we can do a cheap identity compare here to determine if this is a
  6842. // superfluous reconcile. It's possible for state to be mutable but such
  6843. // change should trigger an update of the owner which would recreate
  6844. // the element. We explicitly check for the existence of an owner since
  6845. // it's possible for an element created outside a composite to be
  6846. // deeply mutated and reused.
  6847. // TODO: Bailing out early is just a perf optimization right?
  6848. // TODO: Removing the return statement should affect correctness?
  6849. return;
  6850. }
  6851. if (process.env.NODE_ENV !== 'production') {
  6852. if (internalInstance._debugID !== 0) {
  6853. ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, nextElement);
  6854. }
  6855. }
  6856. var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);
  6857. if (refsChanged) {
  6858. ReactRef.detachRefs(internalInstance, prevElement);
  6859. }
  6860. internalInstance.receiveComponent(nextElement, transaction, context);
  6861. if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {
  6862. transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
  6863. }
  6864. if (process.env.NODE_ENV !== 'production') {
  6865. if (internalInstance._debugID !== 0) {
  6866. ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
  6867. }
  6868. }
  6869. },
  6870. /**
  6871. * Flush any dirty changes in a component.
  6872. *
  6873. * @param {ReactComponent} internalInstance
  6874. * @param {ReactReconcileTransaction} transaction
  6875. * @internal
  6876. */
  6877. performUpdateIfNecessary: function (internalInstance, transaction, updateBatchNumber) {
  6878. if (internalInstance._updateBatchNumber !== updateBatchNumber) {
  6879. // The component's enqueued batch number should always be the current
  6880. // batch or the following one.
  6881. 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;
  6882. return;
  6883. }
  6884. if (process.env.NODE_ENV !== 'production') {
  6885. if (internalInstance._debugID !== 0) {
  6886. ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement);
  6887. }
  6888. }
  6889. internalInstance.performUpdateIfNecessary(transaction);
  6890. if (process.env.NODE_ENV !== 'production') {
  6891. if (internalInstance._debugID !== 0) {
  6892. ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
  6893. }
  6894. }
  6895. }
  6896. };
  6897. module.exports = ReactReconciler;
  6898. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  6899. /***/ },
  6900. /* 62 */
  6901. /***/ function(module, exports, __webpack_require__) {
  6902. /**
  6903. * Copyright 2013-present, Facebook, Inc.
  6904. * All rights reserved.
  6905. *
  6906. * This source code is licensed under the BSD-style license found in the
  6907. * LICENSE file in the root directory of this source tree. An additional grant
  6908. * of patent rights can be found in the PATENTS file in the same directory.
  6909. *
  6910. *
  6911. */
  6912. 'use strict';
  6913. var ReactOwner = __webpack_require__(63);
  6914. var ReactRef = {};
  6915. function attachRef(ref, component, owner) {
  6916. if (typeof ref === 'function') {
  6917. ref(component.getPublicInstance());
  6918. } else {
  6919. // Legacy ref
  6920. ReactOwner.addComponentAsRefTo(component, ref, owner);
  6921. }
  6922. }
  6923. function detachRef(ref, component, owner) {
  6924. if (typeof ref === 'function') {
  6925. ref(null);
  6926. } else {
  6927. // Legacy ref
  6928. ReactOwner.removeComponentAsRefFrom(component, ref, owner);
  6929. }
  6930. }
  6931. ReactRef.attachRefs = function (instance, element) {
  6932. if (element === null || typeof element !== 'object') {
  6933. return;
  6934. }
  6935. var ref = element.ref;
  6936. if (ref != null) {
  6937. attachRef(ref, instance, element._owner);
  6938. }
  6939. };
  6940. ReactRef.shouldUpdateRefs = function (prevElement, nextElement) {
  6941. // If either the owner or a `ref` has changed, make sure the newest owner
  6942. // has stored a reference to `this`, and the previous owner (if different)
  6943. // has forgotten the reference to `this`. We use the element instead
  6944. // of the public this.props because the post processing cannot determine
  6945. // a ref. The ref conceptually lives on the element.
  6946. // TODO: Should this even be possible? The owner cannot change because
  6947. // it's forbidden by shouldUpdateReactComponent. The ref can change
  6948. // if you swap the keys of but not the refs. Reconsider where this check
  6949. // is made. It probably belongs where the key checking and
  6950. // instantiateReactComponent is done.
  6951. var prevRef = null;
  6952. var prevOwner = null;
  6953. if (prevElement !== null && typeof prevElement === 'object') {
  6954. prevRef = prevElement.ref;
  6955. prevOwner = prevElement._owner;
  6956. }
  6957. var nextRef = null;
  6958. var nextOwner = null;
  6959. if (nextElement !== null && typeof nextElement === 'object') {
  6960. nextRef = nextElement.ref;
  6961. nextOwner = nextElement._owner;
  6962. }
  6963. return prevRef !== nextRef ||
  6964. // If owner changes but we have an unchanged function ref, don't update refs
  6965. typeof nextRef === 'string' && nextOwner !== prevOwner;
  6966. };
  6967. ReactRef.detachRefs = function (instance, element) {
  6968. if (element === null || typeof element !== 'object') {
  6969. return;
  6970. }
  6971. var ref = element.ref;
  6972. if (ref != null) {
  6973. detachRef(ref, instance, element._owner);
  6974. }
  6975. };
  6976. module.exports = ReactRef;
  6977. /***/ },
  6978. /* 63 */
  6979. /***/ function(module, exports, __webpack_require__) {
  6980. /* WEBPACK VAR INJECTION */(function(process) {/**
  6981. * Copyright 2013-present, Facebook, Inc.
  6982. * All rights reserved.
  6983. *
  6984. * This source code is licensed under the BSD-style license found in the
  6985. * LICENSE file in the root directory of this source tree. An additional grant
  6986. * of patent rights can be found in the PATENTS file in the same directory.
  6987. *
  6988. *
  6989. */
  6990. 'use strict';
  6991. var _prodInvariant = __webpack_require__(37);
  6992. var invariant = __webpack_require__(10);
  6993. /**
  6994. * @param {?object} object
  6995. * @return {boolean} True if `object` is a valid owner.
  6996. * @final
  6997. */
  6998. function isValidOwner(object) {
  6999. return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function');
  7000. }
  7001. /**
  7002. * ReactOwners are capable of storing references to owned components.
  7003. *
  7004. * All components are capable of //being// referenced by owner components, but
  7005. * only ReactOwner components are capable of //referencing// owned components.
  7006. * The named reference is known as a "ref".
  7007. *
  7008. * Refs are available when mounted and updated during reconciliation.
  7009. *
  7010. * var MyComponent = React.createClass({
  7011. * render: function() {
  7012. * return (
  7013. * <div onClick={this.handleClick}>
  7014. * <CustomComponent ref="custom" />
  7015. * </div>
  7016. * );
  7017. * },
  7018. * handleClick: function() {
  7019. * this.refs.custom.handleClick();
  7020. * },
  7021. * componentDidMount: function() {
  7022. * this.refs.custom.initialize();
  7023. * }
  7024. * });
  7025. *
  7026. * Refs should rarely be used. When refs are used, they should only be done to
  7027. * control data that is not handled by React's data flow.
  7028. *
  7029. * @class ReactOwner
  7030. */
  7031. var ReactOwner = {
  7032. /**
  7033. * Adds a component by ref to an owner component.
  7034. *
  7035. * @param {ReactComponent} component Component to reference.
  7036. * @param {string} ref Name by which to refer to the component.
  7037. * @param {ReactOwner} owner Component on which to record the ref.
  7038. * @final
  7039. * @internal
  7040. */
  7041. addComponentAsRefTo: function (component, ref, owner) {
  7042. !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;
  7043. owner.attachRef(ref, component);
  7044. },
  7045. /**
  7046. * Removes a component by ref from an owner component.
  7047. *
  7048. * @param {ReactComponent} component Component to dereference.
  7049. * @param {string} ref Name of the ref to remove.
  7050. * @param {ReactOwner} owner Component on which the ref is recorded.
  7051. * @final
  7052. * @internal
  7053. */
  7054. removeComponentAsRefFrom: function (component, ref, owner) {
  7055. !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;
  7056. var ownerPublicInstance = owner.getPublicInstance();
  7057. // Check that `component`'s owner is still alive and that `component` is still the current ref
  7058. // because we do not want to detach the ref if another component stole it.
  7059. if (ownerPublicInstance && ownerPublicInstance.refs[ref] === component.getPublicInstance()) {
  7060. owner.detachRef(ref);
  7061. }
  7062. }
  7063. };
  7064. module.exports = ReactOwner;
  7065. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  7066. /***/ },
  7067. /* 64 */
  7068. /***/ function(module, exports, __webpack_require__) {
  7069. /* WEBPACK VAR INJECTION */(function(process) {/**
  7070. * Copyright 2016-present, Facebook, Inc.
  7071. * All rights reserved.
  7072. *
  7073. * This source code is licensed under the BSD-style license found in the
  7074. * LICENSE file in the root directory of this source tree. An additional grant
  7075. * of patent rights can be found in the PATENTS file in the same directory.
  7076. *
  7077. *
  7078. */
  7079. 'use strict';
  7080. // Trust the developer to only use ReactInstrumentation with a __DEV__ check
  7081. var debugTool = null;
  7082. if (process.env.NODE_ENV !== 'production') {
  7083. var ReactDebugTool = __webpack_require__(65);
  7084. debugTool = ReactDebugTool;
  7085. }
  7086. module.exports = { debugTool: debugTool };
  7087. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  7088. /***/ },
  7089. /* 65 */
  7090. /***/ function(module, exports, __webpack_require__) {
  7091. /* WEBPACK VAR INJECTION */(function(process) {/**
  7092. * Copyright 2016-present, Facebook, Inc.
  7093. * All rights reserved.
  7094. *
  7095. * This source code is licensed under the BSD-style license found in the
  7096. * LICENSE file in the root directory of this source tree. An additional grant
  7097. * of patent rights can be found in the PATENTS file in the same directory.
  7098. *
  7099. *
  7100. */
  7101. 'use strict';
  7102. var ReactInvalidSetStateWarningHook = __webpack_require__(66);
  7103. var ReactHostOperationHistoryHook = __webpack_require__(67);
  7104. var ReactComponentTreeHook = __webpack_require__(28);
  7105. var ExecutionEnvironment = __webpack_require__(50);
  7106. var performanceNow = __webpack_require__(68);
  7107. var warning = __webpack_require__(13);
  7108. var hooks = [];
  7109. var didHookThrowForEvent = {};
  7110. function callHook(event, fn, context, arg1, arg2, arg3, arg4, arg5) {
  7111. try {
  7112. fn.call(context, arg1, arg2, arg3, arg4, arg5);
  7113. } catch (e) {
  7114. process.env.NODE_ENV !== 'production' ? warning(didHookThrowForEvent[event], 'Exception thrown by hook while handling %s: %s', event, e + '\n' + e.stack) : void 0;
  7115. didHookThrowForEvent[event] = true;
  7116. }
  7117. }
  7118. function emitEvent(event, arg1, arg2, arg3, arg4, arg5) {
  7119. for (var i = 0; i < hooks.length; i++) {
  7120. var hook = hooks[i];
  7121. var fn = hook[event];
  7122. if (fn) {
  7123. callHook(event, fn, hook, arg1, arg2, arg3, arg4, arg5);
  7124. }
  7125. }
  7126. }
  7127. var isProfiling = false;
  7128. var flushHistory = [];
  7129. var lifeCycleTimerStack = [];
  7130. var currentFlushNesting = 0;
  7131. var currentFlushMeasurements = [];
  7132. var currentFlushStartTime = 0;
  7133. var currentTimerDebugID = null;
  7134. var currentTimerStartTime = 0;
  7135. var currentTimerNestedFlushDuration = 0;
  7136. var currentTimerType = null;
  7137. var lifeCycleTimerHasWarned = false;
  7138. function clearHistory() {
  7139. ReactComponentTreeHook.purgeUnmountedComponents();
  7140. ReactHostOperationHistoryHook.clearHistory();
  7141. }
  7142. function getTreeSnapshot(registeredIDs) {
  7143. return registeredIDs.reduce(function (tree, id) {
  7144. var ownerID = ReactComponentTreeHook.getOwnerID(id);
  7145. var parentID = ReactComponentTreeHook.getParentID(id);
  7146. tree[id] = {
  7147. displayName: ReactComponentTreeHook.getDisplayName(id),
  7148. text: ReactComponentTreeHook.getText(id),
  7149. updateCount: ReactComponentTreeHook.getUpdateCount(id),
  7150. childIDs: ReactComponentTreeHook.getChildIDs(id),
  7151. // Text nodes don't have owners but this is close enough.
  7152. ownerID: ownerID || parentID && ReactComponentTreeHook.getOwnerID(parentID) || 0,
  7153. parentID: parentID
  7154. };
  7155. return tree;
  7156. }, {});
  7157. }
  7158. function resetMeasurements() {
  7159. var previousStartTime = currentFlushStartTime;
  7160. var previousMeasurements = currentFlushMeasurements;
  7161. var previousOperations = ReactHostOperationHistoryHook.getHistory();
  7162. if (currentFlushNesting === 0) {
  7163. currentFlushStartTime = 0;
  7164. currentFlushMeasurements = [];
  7165. clearHistory();
  7166. return;
  7167. }
  7168. if (previousMeasurements.length || previousOperations.length) {
  7169. var registeredIDs = ReactComponentTreeHook.getRegisteredIDs();
  7170. flushHistory.push({
  7171. duration: performanceNow() - previousStartTime,
  7172. measurements: previousMeasurements || [],
  7173. operations: previousOperations || [],
  7174. treeSnapshot: getTreeSnapshot(registeredIDs)
  7175. });
  7176. }
  7177. clearHistory();
  7178. currentFlushStartTime = performanceNow();
  7179. currentFlushMeasurements = [];
  7180. }
  7181. function checkDebugID(debugID) {
  7182. var allowRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  7183. if (allowRoot && debugID === 0) {
  7184. return;
  7185. }
  7186. if (!debugID) {
  7187. process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDebugTool: debugID may not be empty.') : void 0;
  7188. }
  7189. }
  7190. function beginLifeCycleTimer(debugID, timerType) {
  7191. if (currentFlushNesting === 0) {
  7192. return;
  7193. }
  7194. if (currentTimerType && !lifeCycleTimerHasWarned) {
  7195. 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;
  7196. lifeCycleTimerHasWarned = true;
  7197. }
  7198. currentTimerStartTime = performanceNow();
  7199. currentTimerNestedFlushDuration = 0;
  7200. currentTimerDebugID = debugID;
  7201. currentTimerType = timerType;
  7202. }
  7203. function endLifeCycleTimer(debugID, timerType) {
  7204. if (currentFlushNesting === 0) {
  7205. return;
  7206. }
  7207. if (currentTimerType !== timerType && !lifeCycleTimerHasWarned) {
  7208. 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;
  7209. lifeCycleTimerHasWarned = true;
  7210. }
  7211. if (isProfiling) {
  7212. currentFlushMeasurements.push({
  7213. timerType: timerType,
  7214. instanceID: debugID,
  7215. duration: performanceNow() - currentTimerStartTime - currentTimerNestedFlushDuration
  7216. });
  7217. }
  7218. currentTimerStartTime = 0;
  7219. currentTimerNestedFlushDuration = 0;
  7220. currentTimerDebugID = null;
  7221. currentTimerType = null;
  7222. }
  7223. function pauseCurrentLifeCycleTimer() {
  7224. var currentTimer = {
  7225. startTime: currentTimerStartTime,
  7226. nestedFlushStartTime: performanceNow(),
  7227. debugID: currentTimerDebugID,
  7228. timerType: currentTimerType
  7229. };
  7230. lifeCycleTimerStack.push(currentTimer);
  7231. currentTimerStartTime = 0;
  7232. currentTimerNestedFlushDuration = 0;
  7233. currentTimerDebugID = null;
  7234. currentTimerType = null;
  7235. }
  7236. function resumeCurrentLifeCycleTimer() {
  7237. var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop(),
  7238. startTime = _lifeCycleTimerStack$.startTime,
  7239. nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime,
  7240. debugID = _lifeCycleTimerStack$.debugID,
  7241. timerType = _lifeCycleTimerStack$.timerType;
  7242. var nestedFlushDuration = performanceNow() - nestedFlushStartTime;
  7243. currentTimerStartTime = startTime;
  7244. currentTimerNestedFlushDuration += nestedFlushDuration;
  7245. currentTimerDebugID = debugID;
  7246. currentTimerType = timerType;
  7247. }
  7248. var lastMarkTimeStamp = 0;
  7249. var canUsePerformanceMeasure =
  7250. // $FlowFixMe https://github.com/facebook/flow/issues/2345
  7251. typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function';
  7252. function shouldMark(debugID) {
  7253. if (!isProfiling || !canUsePerformanceMeasure) {
  7254. return false;
  7255. }
  7256. var element = ReactComponentTreeHook.getElement(debugID);
  7257. if (element == null || typeof element !== 'object') {
  7258. return false;
  7259. }
  7260. var isHostElement = typeof element.type === 'string';
  7261. if (isHostElement) {
  7262. return false;
  7263. }
  7264. return true;
  7265. }
  7266. function markBegin(debugID, markType) {
  7267. if (!shouldMark(debugID)) {
  7268. return;
  7269. }
  7270. var markName = debugID + '::' + markType;
  7271. lastMarkTimeStamp = performanceNow();
  7272. performance.mark(markName);
  7273. }
  7274. function markEnd(debugID, markType) {
  7275. if (!shouldMark(debugID)) {
  7276. return;
  7277. }
  7278. var markName = debugID + '::' + markType;
  7279. var displayName = ReactComponentTreeHook.getDisplayName(debugID) || 'Unknown';
  7280. // Chrome has an issue of dropping markers recorded too fast:
  7281. // https://bugs.chromium.org/p/chromium/issues/detail?id=640652
  7282. // To work around this, we will not report very small measurements.
  7283. // I determined the magic number by tweaking it back and forth.
  7284. // 0.05ms was enough to prevent the issue, but I set it to 0.1ms to be safe.
  7285. // When the bug is fixed, we can `measure()` unconditionally if we want to.
  7286. var timeStamp = performanceNow();
  7287. if (timeStamp - lastMarkTimeStamp > 0.1) {
  7288. var measurementName = displayName + ' [' + markType + ']';
  7289. performance.measure(measurementName, markName);
  7290. }
  7291. performance.clearMarks(markName);
  7292. performance.clearMeasures(measurementName);
  7293. }
  7294. var ReactDebugTool = {
  7295. addHook: function (hook) {
  7296. hooks.push(hook);
  7297. },
  7298. removeHook: function (hook) {
  7299. for (var i = 0; i < hooks.length; i++) {
  7300. if (hooks[i] === hook) {
  7301. hooks.splice(i, 1);
  7302. i--;
  7303. }
  7304. }
  7305. },
  7306. isProfiling: function () {
  7307. return isProfiling;
  7308. },
  7309. beginProfiling: function () {
  7310. if (isProfiling) {
  7311. return;
  7312. }
  7313. isProfiling = true;
  7314. flushHistory.length = 0;
  7315. resetMeasurements();
  7316. ReactDebugTool.addHook(ReactHostOperationHistoryHook);
  7317. },
  7318. endProfiling: function () {
  7319. if (!isProfiling) {
  7320. return;
  7321. }
  7322. isProfiling = false;
  7323. resetMeasurements();
  7324. ReactDebugTool.removeHook(ReactHostOperationHistoryHook);
  7325. },
  7326. getFlushHistory: function () {
  7327. return flushHistory;
  7328. },
  7329. onBeginFlush: function () {
  7330. currentFlushNesting++;
  7331. resetMeasurements();
  7332. pauseCurrentLifeCycleTimer();
  7333. emitEvent('onBeginFlush');
  7334. },
  7335. onEndFlush: function () {
  7336. resetMeasurements();
  7337. currentFlushNesting--;
  7338. resumeCurrentLifeCycleTimer();
  7339. emitEvent('onEndFlush');
  7340. },
  7341. onBeginLifeCycleTimer: function (debugID, timerType) {
  7342. checkDebugID(debugID);
  7343. emitEvent('onBeginLifeCycleTimer', debugID, timerType);
  7344. markBegin(debugID, timerType);
  7345. beginLifeCycleTimer(debugID, timerType);
  7346. },
  7347. onEndLifeCycleTimer: function (debugID, timerType) {
  7348. checkDebugID(debugID);
  7349. endLifeCycleTimer(debugID, timerType);
  7350. markEnd(debugID, timerType);
  7351. emitEvent('onEndLifeCycleTimer', debugID, timerType);
  7352. },
  7353. onBeginProcessingChildContext: function () {
  7354. emitEvent('onBeginProcessingChildContext');
  7355. },
  7356. onEndProcessingChildContext: function () {
  7357. emitEvent('onEndProcessingChildContext');
  7358. },
  7359. onHostOperation: function (operation) {
  7360. checkDebugID(operation.instanceID);
  7361. emitEvent('onHostOperation', operation);
  7362. },
  7363. onSetState: function () {
  7364. emitEvent('onSetState');
  7365. },
  7366. onSetChildren: function (debugID, childDebugIDs) {
  7367. checkDebugID(debugID);
  7368. childDebugIDs.forEach(checkDebugID);
  7369. emitEvent('onSetChildren', debugID, childDebugIDs);
  7370. },
  7371. onBeforeMountComponent: function (debugID, element, parentDebugID) {
  7372. checkDebugID(debugID);
  7373. checkDebugID(parentDebugID, true);
  7374. emitEvent('onBeforeMountComponent', debugID, element, parentDebugID);
  7375. markBegin(debugID, 'mount');
  7376. },
  7377. onMountComponent: function (debugID) {
  7378. checkDebugID(debugID);
  7379. markEnd(debugID, 'mount');
  7380. emitEvent('onMountComponent', debugID);
  7381. },
  7382. onBeforeUpdateComponent: function (debugID, element) {
  7383. checkDebugID(debugID);
  7384. emitEvent('onBeforeUpdateComponent', debugID, element);
  7385. markBegin(debugID, 'update');
  7386. },
  7387. onUpdateComponent: function (debugID) {
  7388. checkDebugID(debugID);
  7389. markEnd(debugID, 'update');
  7390. emitEvent('onUpdateComponent', debugID);
  7391. },
  7392. onBeforeUnmountComponent: function (debugID) {
  7393. checkDebugID(debugID);
  7394. emitEvent('onBeforeUnmountComponent', debugID);
  7395. markBegin(debugID, 'unmount');
  7396. },
  7397. onUnmountComponent: function (debugID) {
  7398. checkDebugID(debugID);
  7399. markEnd(debugID, 'unmount');
  7400. emitEvent('onUnmountComponent', debugID);
  7401. },
  7402. onTestEvent: function () {
  7403. emitEvent('onTestEvent');
  7404. }
  7405. };
  7406. // TODO remove these when RN/www gets updated
  7407. ReactDebugTool.addDevtool = ReactDebugTool.addHook;
  7408. ReactDebugTool.removeDevtool = ReactDebugTool.removeHook;
  7409. ReactDebugTool.addHook(ReactInvalidSetStateWarningHook);
  7410. ReactDebugTool.addHook(ReactComponentTreeHook);
  7411. var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
  7412. if (/[?&]react_perf\b/.test(url)) {
  7413. ReactDebugTool.beginProfiling();
  7414. }
  7415. module.exports = ReactDebugTool;
  7416. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  7417. /***/ },
  7418. /* 66 */
  7419. /***/ function(module, exports, __webpack_require__) {
  7420. /* WEBPACK VAR INJECTION */(function(process) {/**
  7421. * Copyright 2016-present, Facebook, Inc.
  7422. * All rights reserved.
  7423. *
  7424. * This source code is licensed under the BSD-style license found in the
  7425. * LICENSE file in the root directory of this source tree. An additional grant
  7426. * of patent rights can be found in the PATENTS file in the same directory.
  7427. *
  7428. *
  7429. */
  7430. 'use strict';
  7431. var warning = __webpack_require__(13);
  7432. if (process.env.NODE_ENV !== 'production') {
  7433. var processingChildContext = false;
  7434. var warnInvalidSetState = function () {
  7435. process.env.NODE_ENV !== 'production' ? warning(!processingChildContext, 'setState(...): Cannot call setState() inside getChildContext()') : void 0;
  7436. };
  7437. }
  7438. var ReactInvalidSetStateWarningHook = {
  7439. onBeginProcessingChildContext: function () {
  7440. processingChildContext = true;
  7441. },
  7442. onEndProcessingChildContext: function () {
  7443. processingChildContext = false;
  7444. },
  7445. onSetState: function () {
  7446. warnInvalidSetState();
  7447. }
  7448. };
  7449. module.exports = ReactInvalidSetStateWarningHook;
  7450. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  7451. /***/ },
  7452. /* 67 */
  7453. /***/ function(module, exports) {
  7454. /**
  7455. * Copyright 2016-present, Facebook, Inc.
  7456. * All rights reserved.
  7457. *
  7458. * This source code is licensed under the BSD-style license found in the
  7459. * LICENSE file in the root directory of this source tree. An additional grant
  7460. * of patent rights can be found in the PATENTS file in the same directory.
  7461. *
  7462. *
  7463. */
  7464. 'use strict';
  7465. var history = [];
  7466. var ReactHostOperationHistoryHook = {
  7467. onHostOperation: function (operation) {
  7468. history.push(operation);
  7469. },
  7470. clearHistory: function () {
  7471. if (ReactHostOperationHistoryHook._preventClearing) {
  7472. // Should only be used for tests.
  7473. return;
  7474. }
  7475. history = [];
  7476. },
  7477. getHistory: function () {
  7478. return history;
  7479. }
  7480. };
  7481. module.exports = ReactHostOperationHistoryHook;
  7482. /***/ },
  7483. /* 68 */
  7484. /***/ function(module, exports, __webpack_require__) {
  7485. 'use strict';
  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. var performance = __webpack_require__(69);
  7497. var performanceNow;
  7498. /**
  7499. * Detect if we can use `window.performance.now()` and gracefully fallback to
  7500. * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now
  7501. * because of Facebook's testing infrastructure.
  7502. */
  7503. if (performance.now) {
  7504. performanceNow = function performanceNow() {
  7505. return performance.now();
  7506. };
  7507. } else {
  7508. performanceNow = function performanceNow() {
  7509. return Date.now();
  7510. };
  7511. }
  7512. module.exports = performanceNow;
  7513. /***/ },
  7514. /* 69 */
  7515. /***/ function(module, exports, __webpack_require__) {
  7516. /**
  7517. * Copyright (c) 2013-present, Facebook, Inc.
  7518. * All rights reserved.
  7519. *
  7520. * This source code is licensed under the BSD-style license found in the
  7521. * LICENSE file in the root directory of this source tree. An additional grant
  7522. * of patent rights can be found in the PATENTS file in the same directory.
  7523. *
  7524. * @typechecks
  7525. */
  7526. 'use strict';
  7527. var ExecutionEnvironment = __webpack_require__(50);
  7528. var performance;
  7529. if (ExecutionEnvironment.canUseDOM) {
  7530. performance = window.performance || window.msPerformance || window.webkitPerformance;
  7531. }
  7532. module.exports = performance || {};
  7533. /***/ },
  7534. /* 70 */
  7535. /***/ function(module, exports, __webpack_require__) {
  7536. /* WEBPACK VAR INJECTION */(function(process) {/**
  7537. * Copyright 2013-present, Facebook, Inc.
  7538. * All rights reserved.
  7539. *
  7540. * This source code is licensed under the BSD-style license found in the
  7541. * LICENSE file in the root directory of this source tree. An additional grant
  7542. * of patent rights can be found in the PATENTS file in the same directory.
  7543. *
  7544. *
  7545. */
  7546. 'use strict';
  7547. var _prodInvariant = __webpack_require__(37);
  7548. var invariant = __webpack_require__(10);
  7549. var OBSERVED_ERROR = {};
  7550. /**
  7551. * `Transaction` creates a black box that is able to wrap any method such that
  7552. * certain invariants are maintained before and after the method is invoked
  7553. * (Even if an exception is thrown while invoking the wrapped method). Whoever
  7554. * instantiates a transaction can provide enforcers of the invariants at
  7555. * creation time. The `Transaction` class itself will supply one additional
  7556. * automatic invariant for you - the invariant that any transaction instance
  7557. * should not be run while it is already being run. You would typically create a
  7558. * single instance of a `Transaction` for reuse multiple times, that potentially
  7559. * is used to wrap several different methods. Wrappers are extremely simple -
  7560. * they only require implementing two methods.
  7561. *
  7562. * <pre>
  7563. * wrappers (injected at creation time)
  7564. * + +
  7565. * | |
  7566. * +-----------------|--------|--------------+
  7567. * | v | |
  7568. * | +---------------+ | |
  7569. * | +--| wrapper1 |---|----+ |
  7570. * | | +---------------+ v | |
  7571. * | | +-------------+ | |
  7572. * | | +----| wrapper2 |--------+ |
  7573. * | | | +-------------+ | | |
  7574. * | | | | | |
  7575. * | v v v v | wrapper
  7576. * | +---+ +---+ +---------+ +---+ +---+ | invariants
  7577. * perform(anyMethod) | | | | | | | | | | | | maintained
  7578. * +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->
  7579. * | | | | | | | | | | | |
  7580. * | | | | | | | | | | | |
  7581. * | | | | | | | | | | | |
  7582. * | +---+ +---+ +---------+ +---+ +---+ |
  7583. * | initialize close |
  7584. * +-----------------------------------------+
  7585. * </pre>
  7586. *
  7587. * Use cases:
  7588. * - Preserving the input selection ranges before/after reconciliation.
  7589. * Restoring selection even in the event of an unexpected error.
  7590. * - Deactivating events while rearranging the DOM, preventing blurs/focuses,
  7591. * while guaranteeing that afterwards, the event system is reactivated.
  7592. * - Flushing a queue of collected DOM mutations to the main UI thread after a
  7593. * reconciliation takes place in a worker thread.
  7594. * - Invoking any collected `componentDidUpdate` callbacks after rendering new
  7595. * content.
  7596. * - (Future use case): Wrapping particular flushes of the `ReactWorker` queue
  7597. * to preserve the `scrollTop` (an automatic scroll aware DOM).
  7598. * - (Future use case): Layout calculations before and after DOM updates.
  7599. *
  7600. * Transactional plugin API:
  7601. * - A module that has an `initialize` method that returns any precomputation.
  7602. * - and a `close` method that accepts the precomputation. `close` is invoked
  7603. * when the wrapped process is completed, or has failed.
  7604. *
  7605. * @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules
  7606. * that implement `initialize` and `close`.
  7607. * @return {Transaction} Single transaction for reuse in thread.
  7608. *
  7609. * @class Transaction
  7610. */
  7611. var TransactionImpl = {
  7612. /**
  7613. * Sets up this instance so that it is prepared for collecting metrics. Does
  7614. * so such that this setup method may be used on an instance that is already
  7615. * initialized, in a way that does not consume additional memory upon reuse.
  7616. * That can be useful if you decide to make your subclass of this mixin a
  7617. * "PooledClass".
  7618. */
  7619. reinitializeTransaction: function () {
  7620. this.transactionWrappers = this.getTransactionWrappers();
  7621. if (this.wrapperInitData) {
  7622. this.wrapperInitData.length = 0;
  7623. } else {
  7624. this.wrapperInitData = [];
  7625. }
  7626. this._isInTransaction = false;
  7627. },
  7628. _isInTransaction: false,
  7629. /**
  7630. * @abstract
  7631. * @return {Array<TransactionWrapper>} Array of transaction wrappers.
  7632. */
  7633. getTransactionWrappers: null,
  7634. isInTransaction: function () {
  7635. return !!this._isInTransaction;
  7636. },
  7637. /**
  7638. * Executes the function within a safety window. Use this for the top level
  7639. * methods that result in large amounts of computation/mutations that would
  7640. * need to be safety checked. The optional arguments helps prevent the need
  7641. * to bind in many cases.
  7642. *
  7643. * @param {function} method Member of scope to call.
  7644. * @param {Object} scope Scope to invoke from.
  7645. * @param {Object?=} a Argument to pass to the method.
  7646. * @param {Object?=} b Argument to pass to the method.
  7647. * @param {Object?=} c Argument to pass to the method.
  7648. * @param {Object?=} d Argument to pass to the method.
  7649. * @param {Object?=} e Argument to pass to the method.
  7650. * @param {Object?=} f Argument to pass to the method.
  7651. *
  7652. * @return {*} Return value from `method`.
  7653. */
  7654. perform: function (method, scope, a, b, c, d, e, f) {
  7655. !!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;
  7656. var errorThrown;
  7657. var ret;
  7658. try {
  7659. this._isInTransaction = true;
  7660. // Catching errors makes debugging more difficult, so we start with
  7661. // errorThrown set to true before setting it to false after calling
  7662. // close -- if it's still set to true in the finally block, it means
  7663. // one of these calls threw.
  7664. errorThrown = true;
  7665. this.initializeAll(0);
  7666. ret = method.call(scope, a, b, c, d, e, f);
  7667. errorThrown = false;
  7668. } finally {
  7669. try {
  7670. if (errorThrown) {
  7671. // If `method` throws, prefer to show that stack trace over any thrown
  7672. // by invoking `closeAll`.
  7673. try {
  7674. this.closeAll(0);
  7675. } catch (err) {}
  7676. } else {
  7677. // Since `method` didn't throw, we don't want to silence the exception
  7678. // here.
  7679. this.closeAll(0);
  7680. }
  7681. } finally {
  7682. this._isInTransaction = false;
  7683. }
  7684. }
  7685. return ret;
  7686. },
  7687. initializeAll: function (startIndex) {
  7688. var transactionWrappers = this.transactionWrappers;
  7689. for (var i = startIndex; i < transactionWrappers.length; i++) {
  7690. var wrapper = transactionWrappers[i];
  7691. try {
  7692. // Catching errors makes debugging more difficult, so we start with the
  7693. // OBSERVED_ERROR state before overwriting it with the real return value
  7694. // of initialize -- if it's still set to OBSERVED_ERROR in the finally
  7695. // block, it means wrapper.initialize threw.
  7696. this.wrapperInitData[i] = OBSERVED_ERROR;
  7697. this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null;
  7698. } finally {
  7699. if (this.wrapperInitData[i] === OBSERVED_ERROR) {
  7700. // The initializer for wrapper i threw an error; initialize the
  7701. // remaining wrappers but silence any exceptions from them to ensure
  7702. // that the first error is the one to bubble up.
  7703. try {
  7704. this.initializeAll(i + 1);
  7705. } catch (err) {}
  7706. }
  7707. }
  7708. }
  7709. },
  7710. /**
  7711. * Invokes each of `this.transactionWrappers.close[i]` functions, passing into
  7712. * them the respective return values of `this.transactionWrappers.init[i]`
  7713. * (`close`rs that correspond to initializers that failed will not be
  7714. * invoked).
  7715. */
  7716. closeAll: function (startIndex) {
  7717. !this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : _prodInvariant('28') : void 0;
  7718. var transactionWrappers = this.transactionWrappers;
  7719. for (var i = startIndex; i < transactionWrappers.length; i++) {
  7720. var wrapper = transactionWrappers[i];
  7721. var initData = this.wrapperInitData[i];
  7722. var errorThrown;
  7723. try {
  7724. // Catching errors makes debugging more difficult, so we start with
  7725. // errorThrown set to true before setting it to false after calling
  7726. // close -- if it's still set to true in the finally block, it means
  7727. // wrapper.close threw.
  7728. errorThrown = true;
  7729. if (initData !== OBSERVED_ERROR && wrapper.close) {
  7730. wrapper.close.call(this, initData);
  7731. }
  7732. errorThrown = false;
  7733. } finally {
  7734. if (errorThrown) {
  7735. // The closer for wrapper i threw an error; close the remaining
  7736. // wrappers but silence any exceptions from them to ensure that the
  7737. // first error is the one to bubble up.
  7738. try {
  7739. this.closeAll(i + 1);
  7740. } catch (e) {}
  7741. }
  7742. }
  7743. }
  7744. this.wrapperInitData.length = 0;
  7745. }
  7746. };
  7747. module.exports = TransactionImpl;
  7748. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  7749. /***/ },
  7750. /* 71 */
  7751. /***/ function(module, exports) {
  7752. /**
  7753. * Copyright 2013-present, Facebook, Inc.
  7754. * All rights reserved.
  7755. *
  7756. * This source code is licensed under the BSD-style license found in the
  7757. * LICENSE file in the root directory of this source tree. An additional grant
  7758. * of patent rights can be found in the PATENTS file in the same directory.
  7759. *
  7760. */
  7761. 'use strict';
  7762. /**
  7763. * Gets the target node from a native browser event by accounting for
  7764. * inconsistencies in browser DOM APIs.
  7765. *
  7766. * @param {object} nativeEvent Native browser event.
  7767. * @return {DOMEventTarget} Target node.
  7768. */
  7769. function getEventTarget(nativeEvent) {
  7770. var target = nativeEvent.target || nativeEvent.srcElement || window;
  7771. // Normalize SVG <use> element events #4963
  7772. if (target.correspondingUseElement) {
  7773. target = target.correspondingUseElement;
  7774. }
  7775. // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
  7776. // @see http://www.quirksmode.org/js/events_properties.html
  7777. return target.nodeType === 3 ? target.parentNode : target;
  7778. }
  7779. module.exports = getEventTarget;
  7780. /***/ },
  7781. /* 72 */
  7782. /***/ function(module, exports, __webpack_require__) {
  7783. /**
  7784. * Copyright 2013-present, Facebook, Inc.
  7785. * All rights reserved.
  7786. *
  7787. * This source code is licensed under the BSD-style license found in the
  7788. * LICENSE file in the root directory of this source tree. An additional grant
  7789. * of patent rights can be found in the PATENTS file in the same directory.
  7790. *
  7791. */
  7792. 'use strict';
  7793. var ExecutionEnvironment = __webpack_require__(50);
  7794. var useHasFeature;
  7795. if (ExecutionEnvironment.canUseDOM) {
  7796. useHasFeature = document.implementation && document.implementation.hasFeature &&
  7797. // always returns true in newer browsers as per the standard.
  7798. // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
  7799. document.implementation.hasFeature('', '') !== true;
  7800. }
  7801. /**
  7802. * Checks if an event is supported in the current execution environment.
  7803. *
  7804. * NOTE: This will not work correctly for non-generic events such as `change`,
  7805. * `reset`, `load`, `error`, and `select`.
  7806. *
  7807. * Borrows from Modernizr.
  7808. *
  7809. * @param {string} eventNameSuffix Event name, e.g. "click".
  7810. * @param {?boolean} capture Check if the capture phase is supported.
  7811. * @return {boolean} True if the event is supported.
  7812. * @internal
  7813. * @license Modernizr 3.0.0pre (Custom Build) | MIT
  7814. */
  7815. function isEventSupported(eventNameSuffix, capture) {
  7816. if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) {
  7817. return false;
  7818. }
  7819. var eventName = 'on' + eventNameSuffix;
  7820. var isSupported = eventName in document;
  7821. if (!isSupported) {
  7822. var element = document.createElement('div');
  7823. element.setAttribute(eventName, 'return;');
  7824. isSupported = typeof element[eventName] === 'function';
  7825. }
  7826. if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
  7827. // This is the only way to test support for the `wheel` event in IE9+.
  7828. isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
  7829. }
  7830. return isSupported;
  7831. }
  7832. module.exports = isEventSupported;
  7833. /***/ },
  7834. /* 73 */
  7835. /***/ function(module, exports) {
  7836. /**
  7837. * Copyright 2013-present, Facebook, Inc.
  7838. * All rights reserved.
  7839. *
  7840. * This source code is licensed under the BSD-style license found in the
  7841. * LICENSE file in the root directory of this source tree. An additional grant
  7842. * of patent rights can be found in the PATENTS file in the same directory.
  7843. *
  7844. *
  7845. */
  7846. 'use strict';
  7847. /**
  7848. * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
  7849. */
  7850. var supportedInputTypes = {
  7851. 'color': true,
  7852. 'date': true,
  7853. 'datetime': true,
  7854. 'datetime-local': true,
  7855. 'email': true,
  7856. 'month': true,
  7857. 'number': true,
  7858. 'password': true,
  7859. 'range': true,
  7860. 'search': true,
  7861. 'tel': true,
  7862. 'text': true,
  7863. 'time': true,
  7864. 'url': true,
  7865. 'week': true
  7866. };
  7867. function isTextInputElement(elem) {
  7868. var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
  7869. if (nodeName === 'input') {
  7870. return !!supportedInputTypes[elem.type];
  7871. }
  7872. if (nodeName === 'textarea') {
  7873. return true;
  7874. }
  7875. return false;
  7876. }
  7877. module.exports = isTextInputElement;
  7878. /***/ },
  7879. /* 74 */
  7880. /***/ function(module, exports) {
  7881. /**
  7882. * Copyright 2013-present, Facebook, Inc.
  7883. * All rights reserved.
  7884. *
  7885. * This source code is licensed under the BSD-style license found in the
  7886. * LICENSE file in the root directory of this source tree. An additional grant
  7887. * of patent rights can be found in the PATENTS file in the same directory.
  7888. *
  7889. */
  7890. 'use strict';
  7891. /**
  7892. * Module that is injectable into `EventPluginHub`, that specifies a
  7893. * deterministic ordering of `EventPlugin`s. A convenient way to reason about
  7894. * plugins, without having to package every one of them. This is better than
  7895. * having plugins be ordered in the same order that they are injected because
  7896. * that ordering would be influenced by the packaging order.
  7897. * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
  7898. * preventing default on events is convenient in `SimpleEventPlugin` handlers.
  7899. */
  7900. var DefaultEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'TapEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin'];
  7901. module.exports = DefaultEventPluginOrder;
  7902. /***/ },
  7903. /* 75 */
  7904. /***/ function(module, exports, __webpack_require__) {
  7905. /**
  7906. * Copyright 2013-present, Facebook, Inc.
  7907. * All rights reserved.
  7908. *
  7909. * This source code is licensed under the BSD-style license found in the
  7910. * LICENSE file in the root directory of this source tree. An additional grant
  7911. * of patent rights can be found in the PATENTS file in the same directory.
  7912. *
  7913. */
  7914. 'use strict';
  7915. var EventPropagators = __webpack_require__(43);
  7916. var ReactDOMComponentTree = __webpack_require__(36);
  7917. var SyntheticMouseEvent = __webpack_require__(76);
  7918. var eventTypes = {
  7919. mouseEnter: {
  7920. registrationName: 'onMouseEnter',
  7921. dependencies: ['topMouseOut', 'topMouseOver']
  7922. },
  7923. mouseLeave: {
  7924. registrationName: 'onMouseLeave',
  7925. dependencies: ['topMouseOut', 'topMouseOver']
  7926. }
  7927. };
  7928. var EnterLeaveEventPlugin = {
  7929. eventTypes: eventTypes,
  7930. /**
  7931. * For almost every interaction we care about, there will be both a top-level
  7932. * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
  7933. * we do not extract duplicate events. However, moving the mouse into the
  7934. * browser from outside will not fire a `mouseout` event. In this case, we use
  7935. * the `mouseover` top-level event.
  7936. */
  7937. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  7938. if (topLevelType === 'topMouseOver' && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
  7939. return null;
  7940. }
  7941. if (topLevelType !== 'topMouseOut' && topLevelType !== 'topMouseOver') {
  7942. // Must not be a mouse in or mouse out - ignoring.
  7943. return null;
  7944. }
  7945. var win;
  7946. if (nativeEventTarget.window === nativeEventTarget) {
  7947. // `nativeEventTarget` is probably a window object.
  7948. win = nativeEventTarget;
  7949. } else {
  7950. // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
  7951. var doc = nativeEventTarget.ownerDocument;
  7952. if (doc) {
  7953. win = doc.defaultView || doc.parentWindow;
  7954. } else {
  7955. win = window;
  7956. }
  7957. }
  7958. var from;
  7959. var to;
  7960. if (topLevelType === 'topMouseOut') {
  7961. from = targetInst;
  7962. var related = nativeEvent.relatedTarget || nativeEvent.toElement;
  7963. to = related ? ReactDOMComponentTree.getClosestInstanceFromNode(related) : null;
  7964. } else {
  7965. // Moving to a node from outside the window.
  7966. from = null;
  7967. to = targetInst;
  7968. }
  7969. if (from === to) {
  7970. // Nothing pertains to our managed components.
  7971. return null;
  7972. }
  7973. var fromNode = from == null ? win : ReactDOMComponentTree.getNodeFromInstance(from);
  7974. var toNode = to == null ? win : ReactDOMComponentTree.getNodeFromInstance(to);
  7975. var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, from, nativeEvent, nativeEventTarget);
  7976. leave.type = 'mouseleave';
  7977. leave.target = fromNode;
  7978. leave.relatedTarget = toNode;
  7979. var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, to, nativeEvent, nativeEventTarget);
  7980. enter.type = 'mouseenter';
  7981. enter.target = toNode;
  7982. enter.relatedTarget = fromNode;
  7983. EventPropagators.accumulateEnterLeaveDispatches(leave, enter, from, to);
  7984. return [leave, enter];
  7985. }
  7986. };
  7987. module.exports = EnterLeaveEventPlugin;
  7988. /***/ },
  7989. /* 76 */
  7990. /***/ function(module, exports, __webpack_require__) {
  7991. /**
  7992. * Copyright 2013-present, Facebook, Inc.
  7993. * All rights reserved.
  7994. *
  7995. * This source code is licensed under the BSD-style license found in the
  7996. * LICENSE file in the root directory of this source tree. An additional grant
  7997. * of patent rights can be found in the PATENTS file in the same directory.
  7998. *
  7999. */
  8000. 'use strict';
  8001. var SyntheticUIEvent = __webpack_require__(77);
  8002. var ViewportMetrics = __webpack_require__(78);
  8003. var getEventModifierState = __webpack_require__(79);
  8004. /**
  8005. * @interface MouseEvent
  8006. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  8007. */
  8008. var MouseEventInterface = {
  8009. screenX: null,
  8010. screenY: null,
  8011. clientX: null,
  8012. clientY: null,
  8013. ctrlKey: null,
  8014. shiftKey: null,
  8015. altKey: null,
  8016. metaKey: null,
  8017. getModifierState: getEventModifierState,
  8018. button: function (event) {
  8019. // Webkit, Firefox, IE9+
  8020. // which: 1 2 3
  8021. // button: 0 1 2 (standard)
  8022. var button = event.button;
  8023. if ('which' in event) {
  8024. return button;
  8025. }
  8026. // IE<9
  8027. // which: undefined
  8028. // button: 0 0 0
  8029. // button: 1 4 2 (onmouseup)
  8030. return button === 2 ? 2 : button === 4 ? 1 : 0;
  8031. },
  8032. buttons: null,
  8033. relatedTarget: function (event) {
  8034. return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
  8035. },
  8036. // "Proprietary" Interface.
  8037. pageX: function (event) {
  8038. return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft;
  8039. },
  8040. pageY: function (event) {
  8041. return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop;
  8042. }
  8043. };
  8044. /**
  8045. * @param {object} dispatchConfig Configuration used to dispatch this event.
  8046. * @param {string} dispatchMarker Marker identifying the event target.
  8047. * @param {object} nativeEvent Native browser event.
  8048. * @extends {SyntheticUIEvent}
  8049. */
  8050. function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  8051. return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  8052. }
  8053. SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
  8054. module.exports = SyntheticMouseEvent;
  8055. /***/ },
  8056. /* 77 */
  8057. /***/ function(module, exports, __webpack_require__) {
  8058. /**
  8059. * Copyright 2013-present, Facebook, Inc.
  8060. * All rights reserved.
  8061. *
  8062. * This source code is licensed under the BSD-style license found in the
  8063. * LICENSE file in the root directory of this source tree. An additional grant
  8064. * of patent rights can be found in the PATENTS file in the same directory.
  8065. *
  8066. */
  8067. 'use strict';
  8068. var SyntheticEvent = __webpack_require__(55);
  8069. var getEventTarget = __webpack_require__(71);
  8070. /**
  8071. * @interface UIEvent
  8072. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  8073. */
  8074. var UIEventInterface = {
  8075. view: function (event) {
  8076. if (event.view) {
  8077. return event.view;
  8078. }
  8079. var target = getEventTarget(event);
  8080. if (target.window === target) {
  8081. // target is a window object
  8082. return target;
  8083. }
  8084. var doc = target.ownerDocument;
  8085. // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
  8086. if (doc) {
  8087. return doc.defaultView || doc.parentWindow;
  8088. } else {
  8089. return window;
  8090. }
  8091. },
  8092. detail: function (event) {
  8093. return event.detail || 0;
  8094. }
  8095. };
  8096. /**
  8097. * @param {object} dispatchConfig Configuration used to dispatch this event.
  8098. * @param {string} dispatchMarker Marker identifying the event target.
  8099. * @param {object} nativeEvent Native browser event.
  8100. * @extends {SyntheticEvent}
  8101. */
  8102. function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  8103. return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  8104. }
  8105. SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
  8106. module.exports = SyntheticUIEvent;
  8107. /***/ },
  8108. /* 78 */
  8109. /***/ function(module, exports) {
  8110. /**
  8111. * Copyright 2013-present, Facebook, Inc.
  8112. * All rights reserved.
  8113. *
  8114. * This source code is licensed under the BSD-style license found in the
  8115. * LICENSE file in the root directory of this source tree. An additional grant
  8116. * of patent rights can be found in the PATENTS file in the same directory.
  8117. *
  8118. */
  8119. 'use strict';
  8120. var ViewportMetrics = {
  8121. currentScrollLeft: 0,
  8122. currentScrollTop: 0,
  8123. refreshScrollValues: function (scrollPosition) {
  8124. ViewportMetrics.currentScrollLeft = scrollPosition.x;
  8125. ViewportMetrics.currentScrollTop = scrollPosition.y;
  8126. }
  8127. };
  8128. module.exports = ViewportMetrics;
  8129. /***/ },
  8130. /* 79 */
  8131. /***/ function(module, exports) {
  8132. /**
  8133. * Copyright 2013-present, Facebook, Inc.
  8134. * All rights reserved.
  8135. *
  8136. * This source code is licensed under the BSD-style license found in the
  8137. * LICENSE file in the root directory of this source tree. An additional grant
  8138. * of patent rights can be found in the PATENTS file in the same directory.
  8139. *
  8140. */
  8141. 'use strict';
  8142. /**
  8143. * Translation from modifier key to the associated property in the event.
  8144. * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
  8145. */
  8146. var modifierKeyToProp = {
  8147. 'Alt': 'altKey',
  8148. 'Control': 'ctrlKey',
  8149. 'Meta': 'metaKey',
  8150. 'Shift': 'shiftKey'
  8151. };
  8152. // IE8 does not implement getModifierState so we simply map it to the only
  8153. // modifier keys exposed by the event itself, does not support Lock-keys.
  8154. // Currently, all major browsers except Chrome seems to support Lock-keys.
  8155. function modifierStateGetter(keyArg) {
  8156. var syntheticEvent = this;
  8157. var nativeEvent = syntheticEvent.nativeEvent;
  8158. if (nativeEvent.getModifierState) {
  8159. return nativeEvent.getModifierState(keyArg);
  8160. }
  8161. var keyProp = modifierKeyToProp[keyArg];
  8162. return keyProp ? !!nativeEvent[keyProp] : false;
  8163. }
  8164. function getEventModifierState(nativeEvent) {
  8165. return modifierStateGetter;
  8166. }
  8167. module.exports = getEventModifierState;
  8168. /***/ },
  8169. /* 80 */
  8170. /***/ function(module, exports, __webpack_require__) {
  8171. /**
  8172. * Copyright 2013-present, Facebook, Inc.
  8173. * All rights reserved.
  8174. *
  8175. * This source code is licensed under the BSD-style license found in the
  8176. * LICENSE file in the root directory of this source tree. An additional grant
  8177. * of patent rights can be found in the PATENTS file in the same directory.
  8178. *
  8179. */
  8180. 'use strict';
  8181. var DOMProperty = __webpack_require__(38);
  8182. var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
  8183. var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;
  8184. var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
  8185. var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
  8186. var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;
  8187. var HTMLDOMPropertyConfig = {
  8188. isCustomAttribute: RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$')),
  8189. Properties: {
  8190. /**
  8191. * Standard Properties
  8192. */
  8193. accept: 0,
  8194. acceptCharset: 0,
  8195. accessKey: 0,
  8196. action: 0,
  8197. allowFullScreen: HAS_BOOLEAN_VALUE,
  8198. allowTransparency: 0,
  8199. alt: 0,
  8200. // specifies target context for links with `preload` type
  8201. as: 0,
  8202. async: HAS_BOOLEAN_VALUE,
  8203. autoComplete: 0,
  8204. // autoFocus is polyfilled/normalized by AutoFocusUtils
  8205. // autoFocus: HAS_BOOLEAN_VALUE,
  8206. autoPlay: HAS_BOOLEAN_VALUE,
  8207. capture: HAS_BOOLEAN_VALUE,
  8208. cellPadding: 0,
  8209. cellSpacing: 0,
  8210. charSet: 0,
  8211. challenge: 0,
  8212. checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
  8213. cite: 0,
  8214. classID: 0,
  8215. className: 0,
  8216. cols: HAS_POSITIVE_NUMERIC_VALUE,
  8217. colSpan: 0,
  8218. content: 0,
  8219. contentEditable: 0,
  8220. contextMenu: 0,
  8221. controls: HAS_BOOLEAN_VALUE,
  8222. coords: 0,
  8223. crossOrigin: 0,
  8224. data: 0, // For `<object />` acts as `src`.
  8225. dateTime: 0,
  8226. 'default': HAS_BOOLEAN_VALUE,
  8227. defer: HAS_BOOLEAN_VALUE,
  8228. dir: 0,
  8229. disabled: HAS_BOOLEAN_VALUE,
  8230. download: HAS_OVERLOADED_BOOLEAN_VALUE,
  8231. draggable: 0,
  8232. encType: 0,
  8233. form: 0,
  8234. formAction: 0,
  8235. formEncType: 0,
  8236. formMethod: 0,
  8237. formNoValidate: HAS_BOOLEAN_VALUE,
  8238. formTarget: 0,
  8239. frameBorder: 0,
  8240. headers: 0,
  8241. height: 0,
  8242. hidden: HAS_BOOLEAN_VALUE,
  8243. high: 0,
  8244. href: 0,
  8245. hrefLang: 0,
  8246. htmlFor: 0,
  8247. httpEquiv: 0,
  8248. icon: 0,
  8249. id: 0,
  8250. inputMode: 0,
  8251. integrity: 0,
  8252. is: 0,
  8253. keyParams: 0,
  8254. keyType: 0,
  8255. kind: 0,
  8256. label: 0,
  8257. lang: 0,
  8258. list: 0,
  8259. loop: HAS_BOOLEAN_VALUE,
  8260. low: 0,
  8261. manifest: 0,
  8262. marginHeight: 0,
  8263. marginWidth: 0,
  8264. max: 0,
  8265. maxLength: 0,
  8266. media: 0,
  8267. mediaGroup: 0,
  8268. method: 0,
  8269. min: 0,
  8270. minLength: 0,
  8271. // Caution; `option.selected` is not updated if `select.multiple` is
  8272. // disabled with `removeAttribute`.
  8273. multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
  8274. muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
  8275. name: 0,
  8276. nonce: 0,
  8277. noValidate: HAS_BOOLEAN_VALUE,
  8278. open: HAS_BOOLEAN_VALUE,
  8279. optimum: 0,
  8280. pattern: 0,
  8281. placeholder: 0,
  8282. playsInline: HAS_BOOLEAN_VALUE,
  8283. poster: 0,
  8284. preload: 0,
  8285. profile: 0,
  8286. radioGroup: 0,
  8287. readOnly: HAS_BOOLEAN_VALUE,
  8288. referrerPolicy: 0,
  8289. rel: 0,
  8290. required: HAS_BOOLEAN_VALUE,
  8291. reversed: HAS_BOOLEAN_VALUE,
  8292. role: 0,
  8293. rows: HAS_POSITIVE_NUMERIC_VALUE,
  8294. rowSpan: HAS_NUMERIC_VALUE,
  8295. sandbox: 0,
  8296. scope: 0,
  8297. scoped: HAS_BOOLEAN_VALUE,
  8298. scrolling: 0,
  8299. seamless: HAS_BOOLEAN_VALUE,
  8300. selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
  8301. shape: 0,
  8302. size: HAS_POSITIVE_NUMERIC_VALUE,
  8303. sizes: 0,
  8304. span: HAS_POSITIVE_NUMERIC_VALUE,
  8305. spellCheck: 0,
  8306. src: 0,
  8307. srcDoc: 0,
  8308. srcLang: 0,
  8309. srcSet: 0,
  8310. start: HAS_NUMERIC_VALUE,
  8311. step: 0,
  8312. style: 0,
  8313. summary: 0,
  8314. tabIndex: 0,
  8315. target: 0,
  8316. title: 0,
  8317. // Setting .type throws on non-<input> tags
  8318. type: 0,
  8319. useMap: 0,
  8320. value: 0,
  8321. width: 0,
  8322. wmode: 0,
  8323. wrap: 0,
  8324. /**
  8325. * RDFa Properties
  8326. */
  8327. about: 0,
  8328. datatype: 0,
  8329. inlist: 0,
  8330. prefix: 0,
  8331. // property is also supported for OpenGraph in meta tags.
  8332. property: 0,
  8333. resource: 0,
  8334. 'typeof': 0,
  8335. vocab: 0,
  8336. /**
  8337. * Non-standard Properties
  8338. */
  8339. // autoCapitalize and autoCorrect are supported in Mobile Safari for
  8340. // keyboard hints.
  8341. autoCapitalize: 0,
  8342. autoCorrect: 0,
  8343. // autoSave allows WebKit/Blink to persist values of input fields on page reloads
  8344. autoSave: 0,
  8345. // color is for Safari mask-icon link
  8346. color: 0,
  8347. // itemProp, itemScope, itemType are for
  8348. // Microdata support. See http://schema.org/docs/gs.html
  8349. itemProp: 0,
  8350. itemScope: HAS_BOOLEAN_VALUE,
  8351. itemType: 0,
  8352. // itemID and itemRef are for Microdata support as well but
  8353. // only specified in the WHATWG spec document. See
  8354. // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api
  8355. itemID: 0,
  8356. itemRef: 0,
  8357. // results show looking glass icon and recent searches on input
  8358. // search fields in WebKit/Blink
  8359. results: 0,
  8360. // IE-only attribute that specifies security restrictions on an iframe
  8361. // as an alternative to the sandbox attribute on IE<10
  8362. security: 0,
  8363. // IE-only attribute that controls focus behavior
  8364. unselectable: 0
  8365. },
  8366. DOMAttributeNames: {
  8367. acceptCharset: 'accept-charset',
  8368. className: 'class',
  8369. htmlFor: 'for',
  8370. httpEquiv: 'http-equiv'
  8371. },
  8372. DOMPropertyNames: {}
  8373. };
  8374. module.exports = HTMLDOMPropertyConfig;
  8375. /***/ },
  8376. /* 81 */
  8377. /***/ function(module, exports, __webpack_require__) {
  8378. /**
  8379. * Copyright 2013-present, Facebook, Inc.
  8380. * All rights reserved.
  8381. *
  8382. * This source code is licensed under the BSD-style license found in the
  8383. * LICENSE file in the root directory of this source tree. An additional grant
  8384. * of patent rights can be found in the PATENTS file in the same directory.
  8385. *
  8386. */
  8387. 'use strict';
  8388. var DOMChildrenOperations = __webpack_require__(82);
  8389. var ReactDOMIDOperations = __webpack_require__(93);
  8390. /**
  8391. * Abstracts away all functionality of the reconciler that requires knowledge of
  8392. * the browser context. TODO: These callers should be refactored to avoid the
  8393. * need for this injection.
  8394. */
  8395. var ReactComponentBrowserEnvironment = {
  8396. processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates,
  8397. replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup
  8398. };
  8399. module.exports = ReactComponentBrowserEnvironment;
  8400. /***/ },
  8401. /* 82 */
  8402. /***/ function(module, exports, __webpack_require__) {
  8403. /* WEBPACK VAR INJECTION */(function(process) {/**
  8404. * Copyright 2013-present, Facebook, Inc.
  8405. * All rights reserved.
  8406. *
  8407. * This source code is licensed under the BSD-style license found in the
  8408. * LICENSE file in the root directory of this source tree. An additional grant
  8409. * of patent rights can be found in the PATENTS file in the same directory.
  8410. *
  8411. */
  8412. 'use strict';
  8413. var DOMLazyTree = __webpack_require__(83);
  8414. var Danger = __webpack_require__(89);
  8415. var ReactDOMComponentTree = __webpack_require__(36);
  8416. var ReactInstrumentation = __webpack_require__(64);
  8417. var createMicrosoftUnsafeLocalFunction = __webpack_require__(86);
  8418. var setInnerHTML = __webpack_require__(85);
  8419. var setTextContent = __webpack_require__(87);
  8420. function getNodeAfter(parentNode, node) {
  8421. // Special case for text components, which return [open, close] comments
  8422. // from getHostNode.
  8423. if (Array.isArray(node)) {
  8424. node = node[1];
  8425. }
  8426. return node ? node.nextSibling : parentNode.firstChild;
  8427. }
  8428. /**
  8429. * Inserts `childNode` as a child of `parentNode` at the `index`.
  8430. *
  8431. * @param {DOMElement} parentNode Parent node in which to insert.
  8432. * @param {DOMElement} childNode Child node to insert.
  8433. * @param {number} index Index at which to insert the child.
  8434. * @internal
  8435. */
  8436. var insertChildAt = createMicrosoftUnsafeLocalFunction(function (parentNode, childNode, referenceNode) {
  8437. // We rely exclusively on `insertBefore(node, null)` instead of also using
  8438. // `appendChild(node)`. (Using `undefined` is not allowed by all browsers so
  8439. // we are careful to use `null`.)
  8440. parentNode.insertBefore(childNode, referenceNode);
  8441. });
  8442. function insertLazyTreeChildAt(parentNode, childTree, referenceNode) {
  8443. DOMLazyTree.insertTreeBefore(parentNode, childTree, referenceNode);
  8444. }
  8445. function moveChild(parentNode, childNode, referenceNode) {
  8446. if (Array.isArray(childNode)) {
  8447. moveDelimitedText(parentNode, childNode[0], childNode[1], referenceNode);
  8448. } else {
  8449. insertChildAt(parentNode, childNode, referenceNode);
  8450. }
  8451. }
  8452. function removeChild(parentNode, childNode) {
  8453. if (Array.isArray(childNode)) {
  8454. var closingComment = childNode[1];
  8455. childNode = childNode[0];
  8456. removeDelimitedText(parentNode, childNode, closingComment);
  8457. parentNode.removeChild(closingComment);
  8458. }
  8459. parentNode.removeChild(childNode);
  8460. }
  8461. function moveDelimitedText(parentNode, openingComment, closingComment, referenceNode) {
  8462. var node = openingComment;
  8463. while (true) {
  8464. var nextNode = node.nextSibling;
  8465. insertChildAt(parentNode, node, referenceNode);
  8466. if (node === closingComment) {
  8467. break;
  8468. }
  8469. node = nextNode;
  8470. }
  8471. }
  8472. function removeDelimitedText(parentNode, startNode, closingComment) {
  8473. while (true) {
  8474. var node = startNode.nextSibling;
  8475. if (node === closingComment) {
  8476. // The closing comment is removed by ReactMultiChild.
  8477. break;
  8478. } else {
  8479. parentNode.removeChild(node);
  8480. }
  8481. }
  8482. }
  8483. function replaceDelimitedText(openingComment, closingComment, stringText) {
  8484. var parentNode = openingComment.parentNode;
  8485. var nodeAfterComment = openingComment.nextSibling;
  8486. if (nodeAfterComment === closingComment) {
  8487. // There are no text nodes between the opening and closing comments; insert
  8488. // a new one if stringText isn't empty.
  8489. if (stringText) {
  8490. insertChildAt(parentNode, document.createTextNode(stringText), nodeAfterComment);
  8491. }
  8492. } else {
  8493. if (stringText) {
  8494. // Set the text content of the first node after the opening comment, and
  8495. // remove all following nodes up until the closing comment.
  8496. setTextContent(nodeAfterComment, stringText);
  8497. removeDelimitedText(parentNode, nodeAfterComment, closingComment);
  8498. } else {
  8499. removeDelimitedText(parentNode, openingComment, closingComment);
  8500. }
  8501. }
  8502. if (process.env.NODE_ENV !== 'production') {
  8503. ReactInstrumentation.debugTool.onHostOperation({
  8504. instanceID: ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID,
  8505. type: 'replace text',
  8506. payload: stringText
  8507. });
  8508. }
  8509. }
  8510. var dangerouslyReplaceNodeWithMarkup = Danger.dangerouslyReplaceNodeWithMarkup;
  8511. if (process.env.NODE_ENV !== 'production') {
  8512. dangerouslyReplaceNodeWithMarkup = function (oldChild, markup, prevInstance) {
  8513. Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup);
  8514. if (prevInstance._debugID !== 0) {
  8515. ReactInstrumentation.debugTool.onHostOperation({
  8516. instanceID: prevInstance._debugID,
  8517. type: 'replace with',
  8518. payload: markup.toString()
  8519. });
  8520. } else {
  8521. var nextInstance = ReactDOMComponentTree.getInstanceFromNode(markup.node);
  8522. if (nextInstance._debugID !== 0) {
  8523. ReactInstrumentation.debugTool.onHostOperation({
  8524. instanceID: nextInstance._debugID,
  8525. type: 'mount',
  8526. payload: markup.toString()
  8527. });
  8528. }
  8529. }
  8530. };
  8531. }
  8532. /**
  8533. * Operations for updating with DOM children.
  8534. */
  8535. var DOMChildrenOperations = {
  8536. dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup,
  8537. replaceDelimitedText: replaceDelimitedText,
  8538. /**
  8539. * Updates a component's children by processing a series of updates. The
  8540. * update configurations are each expected to have a `parentNode` property.
  8541. *
  8542. * @param {array<object>} updates List of update configurations.
  8543. * @internal
  8544. */
  8545. processUpdates: function (parentNode, updates) {
  8546. if (process.env.NODE_ENV !== 'production') {
  8547. var parentNodeDebugID = ReactDOMComponentTree.getInstanceFromNode(parentNode)._debugID;
  8548. }
  8549. for (var k = 0; k < updates.length; k++) {
  8550. var update = updates[k];
  8551. switch (update.type) {
  8552. case 'INSERT_MARKUP':
  8553. insertLazyTreeChildAt(parentNode, update.content, getNodeAfter(parentNode, update.afterNode));
  8554. if (process.env.NODE_ENV !== 'production') {
  8555. ReactInstrumentation.debugTool.onHostOperation({
  8556. instanceID: parentNodeDebugID,
  8557. type: 'insert child',
  8558. payload: { toIndex: update.toIndex, content: update.content.toString() }
  8559. });
  8560. }
  8561. break;
  8562. case 'MOVE_EXISTING':
  8563. moveChild(parentNode, update.fromNode, getNodeAfter(parentNode, update.afterNode));
  8564. if (process.env.NODE_ENV !== 'production') {
  8565. ReactInstrumentation.debugTool.onHostOperation({
  8566. instanceID: parentNodeDebugID,
  8567. type: 'move child',
  8568. payload: { fromIndex: update.fromIndex, toIndex: update.toIndex }
  8569. });
  8570. }
  8571. break;
  8572. case 'SET_MARKUP':
  8573. setInnerHTML(parentNode, update.content);
  8574. if (process.env.NODE_ENV !== 'production') {
  8575. ReactInstrumentation.debugTool.onHostOperation({
  8576. instanceID: parentNodeDebugID,
  8577. type: 'replace children',
  8578. payload: update.content.toString()
  8579. });
  8580. }
  8581. break;
  8582. case 'TEXT_CONTENT':
  8583. setTextContent(parentNode, update.content);
  8584. if (process.env.NODE_ENV !== 'production') {
  8585. ReactInstrumentation.debugTool.onHostOperation({
  8586. instanceID: parentNodeDebugID,
  8587. type: 'replace text',
  8588. payload: update.content.toString()
  8589. });
  8590. }
  8591. break;
  8592. case 'REMOVE_NODE':
  8593. removeChild(parentNode, update.fromNode);
  8594. if (process.env.NODE_ENV !== 'production') {
  8595. ReactInstrumentation.debugTool.onHostOperation({
  8596. instanceID: parentNodeDebugID,
  8597. type: 'remove child',
  8598. payload: { fromIndex: update.fromIndex }
  8599. });
  8600. }
  8601. break;
  8602. }
  8603. }
  8604. }
  8605. };
  8606. module.exports = DOMChildrenOperations;
  8607. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  8608. /***/ },
  8609. /* 83 */
  8610. /***/ function(module, exports, __webpack_require__) {
  8611. /**
  8612. * Copyright 2015-present, Facebook, Inc.
  8613. * All rights reserved.
  8614. *
  8615. * This source code is licensed under the BSD-style license found in the
  8616. * LICENSE file in the root directory of this source tree. An additional grant
  8617. * of patent rights can be found in the PATENTS file in the same directory.
  8618. *
  8619. */
  8620. 'use strict';
  8621. var DOMNamespaces = __webpack_require__(84);
  8622. var setInnerHTML = __webpack_require__(85);
  8623. var createMicrosoftUnsafeLocalFunction = __webpack_require__(86);
  8624. var setTextContent = __webpack_require__(87);
  8625. var ELEMENT_NODE_TYPE = 1;
  8626. var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
  8627. /**
  8628. * In IE (8-11) and Edge, appending nodes with no children is dramatically
  8629. * faster than appending a full subtree, so we essentially queue up the
  8630. * .appendChild calls here and apply them so each node is added to its parent
  8631. * before any children are added.
  8632. *
  8633. * In other browsers, doing so is slower or neutral compared to the other order
  8634. * (in Firefox, twice as slow) so we only do this inversion in IE.
  8635. *
  8636. * See https://github.com/spicyj/innerhtml-vs-createelement-vs-clonenode.
  8637. */
  8638. var enableLazy = typeof document !== 'undefined' && typeof document.documentMode === 'number' || typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && /\bEdge\/\d/.test(navigator.userAgent);
  8639. function insertTreeChildren(tree) {
  8640. if (!enableLazy) {
  8641. return;
  8642. }
  8643. var node = tree.node;
  8644. var children = tree.children;
  8645. if (children.length) {
  8646. for (var i = 0; i < children.length; i++) {
  8647. insertTreeBefore(node, children[i], null);
  8648. }
  8649. } else if (tree.html != null) {
  8650. setInnerHTML(node, tree.html);
  8651. } else if (tree.text != null) {
  8652. setTextContent(node, tree.text);
  8653. }
  8654. }
  8655. var insertTreeBefore = createMicrosoftUnsafeLocalFunction(function (parentNode, tree, referenceNode) {
  8656. // DocumentFragments aren't actually part of the DOM after insertion so
  8657. // appending children won't update the DOM. We need to ensure the fragment
  8658. // is properly populated first, breaking out of our lazy approach for just
  8659. // this level. Also, some <object> plugins (like Flash Player) will read
  8660. // <param> nodes immediately upon insertion into the DOM, so <object>
  8661. // must also be populated prior to insertion into the DOM.
  8662. 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)) {
  8663. insertTreeChildren(tree);
  8664. parentNode.insertBefore(tree.node, referenceNode);
  8665. } else {
  8666. parentNode.insertBefore(tree.node, referenceNode);
  8667. insertTreeChildren(tree);
  8668. }
  8669. });
  8670. function replaceChildWithTree(oldNode, newTree) {
  8671. oldNode.parentNode.replaceChild(newTree.node, oldNode);
  8672. insertTreeChildren(newTree);
  8673. }
  8674. function queueChild(parentTree, childTree) {
  8675. if (enableLazy) {
  8676. parentTree.children.push(childTree);
  8677. } else {
  8678. parentTree.node.appendChild(childTree.node);
  8679. }
  8680. }
  8681. function queueHTML(tree, html) {
  8682. if (enableLazy) {
  8683. tree.html = html;
  8684. } else {
  8685. setInnerHTML(tree.node, html);
  8686. }
  8687. }
  8688. function queueText(tree, text) {
  8689. if (enableLazy) {
  8690. tree.text = text;
  8691. } else {
  8692. setTextContent(tree.node, text);
  8693. }
  8694. }
  8695. function toString() {
  8696. return this.node.nodeName;
  8697. }
  8698. function DOMLazyTree(node) {
  8699. return {
  8700. node: node,
  8701. children: [],
  8702. html: null,
  8703. text: null,
  8704. toString: toString
  8705. };
  8706. }
  8707. DOMLazyTree.insertTreeBefore = insertTreeBefore;
  8708. DOMLazyTree.replaceChildWithTree = replaceChildWithTree;
  8709. DOMLazyTree.queueChild = queueChild;
  8710. DOMLazyTree.queueHTML = queueHTML;
  8711. DOMLazyTree.queueText = queueText;
  8712. module.exports = DOMLazyTree;
  8713. /***/ },
  8714. /* 84 */
  8715. /***/ function(module, exports) {
  8716. /**
  8717. * Copyright 2013-present, Facebook, Inc.
  8718. * All rights reserved.
  8719. *
  8720. * This source code is licensed under the BSD-style license found in the
  8721. * LICENSE file in the root directory of this source tree. An additional grant
  8722. * of patent rights can be found in the PATENTS file in the same directory.
  8723. *
  8724. */
  8725. 'use strict';
  8726. var DOMNamespaces = {
  8727. html: 'http://www.w3.org/1999/xhtml',
  8728. mathml: 'http://www.w3.org/1998/Math/MathML',
  8729. svg: 'http://www.w3.org/2000/svg'
  8730. };
  8731. module.exports = DOMNamespaces;
  8732. /***/ },
  8733. /* 85 */
  8734. /***/ function(module, exports, __webpack_require__) {
  8735. /**
  8736. * Copyright 2013-present, Facebook, Inc.
  8737. * All rights reserved.
  8738. *
  8739. * This source code is licensed under the BSD-style license found in the
  8740. * LICENSE file in the root directory of this source tree. An additional grant
  8741. * of patent rights can be found in the PATENTS file in the same directory.
  8742. *
  8743. */
  8744. 'use strict';
  8745. var ExecutionEnvironment = __webpack_require__(50);
  8746. var DOMNamespaces = __webpack_require__(84);
  8747. var WHITESPACE_TEST = /^[ \r\n\t\f]/;
  8748. var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/;
  8749. var createMicrosoftUnsafeLocalFunction = __webpack_require__(86);
  8750. // SVG temp container for IE lacking innerHTML
  8751. var reusableSVGContainer;
  8752. /**
  8753. * Set the innerHTML property of a node, ensuring that whitespace is preserved
  8754. * even in IE8.
  8755. *
  8756. * @param {DOMElement} node
  8757. * @param {string} html
  8758. * @internal
  8759. */
  8760. var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
  8761. // IE does not have innerHTML for SVG nodes, so instead we inject the
  8762. // new markup in a temp node and then move the child nodes across into
  8763. // the target node
  8764. if (node.namespaceURI === DOMNamespaces.svg && !('innerHTML' in node)) {
  8765. reusableSVGContainer = reusableSVGContainer || document.createElement('div');
  8766. reusableSVGContainer.innerHTML = '<svg>' + html + '</svg>';
  8767. var svgNode = reusableSVGContainer.firstChild;
  8768. while (svgNode.firstChild) {
  8769. node.appendChild(svgNode.firstChild);
  8770. }
  8771. } else {
  8772. node.innerHTML = html;
  8773. }
  8774. });
  8775. if (ExecutionEnvironment.canUseDOM) {
  8776. // IE8: When updating a just created node with innerHTML only leading
  8777. // whitespace is removed. When updating an existing node with innerHTML
  8778. // whitespace in root TextNodes is also collapsed.
  8779. // @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html
  8780. // Feature detection; only IE8 is known to behave improperly like this.
  8781. var testElement = document.createElement('div');
  8782. testElement.innerHTML = ' ';
  8783. if (testElement.innerHTML === '') {
  8784. setInnerHTML = function (node, html) {
  8785. // Magic theory: IE8 supposedly differentiates between added and updated
  8786. // nodes when processing innerHTML, innerHTML on updated nodes suffers
  8787. // from worse whitespace behavior. Re-adding a node like this triggers
  8788. // the initial and more favorable whitespace behavior.
  8789. // TODO: What to do on a detached node?
  8790. if (node.parentNode) {
  8791. node.parentNode.replaceChild(node, node);
  8792. }
  8793. // We also implement a workaround for non-visible tags disappearing into
  8794. // thin air on IE8, this only happens if there is no visible text
  8795. // in-front of the non-visible tags. Piggyback on the whitespace fix
  8796. // and simply check if any non-visible tags appear in the source.
  8797. if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) {
  8798. // Recover leading whitespace by temporarily prepending any character.
  8799. // \uFEFF has the potential advantage of being zero-width/invisible.
  8800. // UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode
  8801. // in hopes that this is preserved even if "\uFEFF" is transformed to
  8802. // the actual Unicode character (by Babel, for example).
  8803. // https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216
  8804. node.innerHTML = String.fromCharCode(0xFEFF) + html;
  8805. // deleteData leaves an empty `TextNode` which offsets the index of all
  8806. // children. Definitely want to avoid this.
  8807. var textNode = node.firstChild;
  8808. if (textNode.data.length === 1) {
  8809. node.removeChild(textNode);
  8810. } else {
  8811. textNode.deleteData(0, 1);
  8812. }
  8813. } else {
  8814. node.innerHTML = html;
  8815. }
  8816. };
  8817. }
  8818. testElement = null;
  8819. }
  8820. module.exports = setInnerHTML;
  8821. /***/ },
  8822. /* 86 */
  8823. /***/ function(module, exports) {
  8824. /**
  8825. * Copyright 2013-present, Facebook, Inc.
  8826. * All rights reserved.
  8827. *
  8828. * This source code is licensed under the BSD-style license found in the
  8829. * LICENSE file in the root directory of this source tree. An additional grant
  8830. * of patent rights can be found in the PATENTS file in the same directory.
  8831. *
  8832. */
  8833. /* globals MSApp */
  8834. 'use strict';
  8835. /**
  8836. * Create a function which has 'unsafe' privileges (required by windows8 apps)
  8837. */
  8838. var createMicrosoftUnsafeLocalFunction = function (func) {
  8839. if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
  8840. return function (arg0, arg1, arg2, arg3) {
  8841. MSApp.execUnsafeLocalFunction(function () {
  8842. return func(arg0, arg1, arg2, arg3);
  8843. });
  8844. };
  8845. } else {
  8846. return func;
  8847. }
  8848. };
  8849. module.exports = createMicrosoftUnsafeLocalFunction;
  8850. /***/ },
  8851. /* 87 */
  8852. /***/ function(module, exports, __webpack_require__) {
  8853. /**
  8854. * Copyright 2013-present, Facebook, Inc.
  8855. * All rights reserved.
  8856. *
  8857. * This source code is licensed under the BSD-style license found in the
  8858. * LICENSE file in the root directory of this source tree. An additional grant
  8859. * of patent rights can be found in the PATENTS file in the same directory.
  8860. *
  8861. */
  8862. 'use strict';
  8863. var ExecutionEnvironment = __webpack_require__(50);
  8864. var escapeTextContentForBrowser = __webpack_require__(88);
  8865. var setInnerHTML = __webpack_require__(85);
  8866. /**
  8867. * Set the textContent property of a node, ensuring that whitespace is preserved
  8868. * even in IE8. innerText is a poor substitute for textContent and, among many
  8869. * issues, inserts <br> instead of the literal newline chars. innerHTML behaves
  8870. * as it should.
  8871. *
  8872. * @param {DOMElement} node
  8873. * @param {string} text
  8874. * @internal
  8875. */
  8876. var setTextContent = function (node, text) {
  8877. if (text) {
  8878. var firstChild = node.firstChild;
  8879. if (firstChild && firstChild === node.lastChild && firstChild.nodeType === 3) {
  8880. firstChild.nodeValue = text;
  8881. return;
  8882. }
  8883. }
  8884. node.textContent = text;
  8885. };
  8886. if (ExecutionEnvironment.canUseDOM) {
  8887. if (!('textContent' in document.documentElement)) {
  8888. setTextContent = function (node, text) {
  8889. if (node.nodeType === 3) {
  8890. node.nodeValue = text;
  8891. return;
  8892. }
  8893. setInnerHTML(node, escapeTextContentForBrowser(text));
  8894. };
  8895. }
  8896. }
  8897. module.exports = setTextContent;
  8898. /***/ },
  8899. /* 88 */
  8900. /***/ function(module, exports) {
  8901. /**
  8902. * Copyright 2016-present, Facebook, Inc.
  8903. * All rights reserved.
  8904. *
  8905. * This source code is licensed under the BSD-style license found in the
  8906. * LICENSE file in the root directory of this source tree. An additional grant
  8907. * of patent rights can be found in the PATENTS file in the same directory.
  8908. *
  8909. * Based on the escape-html library, which is used under the MIT License below:
  8910. *
  8911. * Copyright (c) 2012-2013 TJ Holowaychuk
  8912. * Copyright (c) 2015 Andreas Lubbe
  8913. * Copyright (c) 2015 Tiancheng "Timothy" Gu
  8914. *
  8915. * Permission is hereby granted, free of charge, to any person obtaining
  8916. * a copy of this software and associated documentation files (the
  8917. * 'Software'), to deal in the Software without restriction, including
  8918. * without limitation the rights to use, copy, modify, merge, publish,
  8919. * distribute, sublicense, and/or sell copies of the Software, and to
  8920. * permit persons to whom the Software is furnished to do so, subject to
  8921. * the following conditions:
  8922. *
  8923. * The above copyright notice and this permission notice shall be
  8924. * included in all copies or substantial portions of the Software.
  8925. *
  8926. * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
  8927. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  8928. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  8929. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  8930. * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  8931. * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  8932. * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  8933. *
  8934. */
  8935. 'use strict';
  8936. // code copied and modified from escape-html
  8937. /**
  8938. * Module variables.
  8939. * @private
  8940. */
  8941. var matchHtmlRegExp = /["'&<>]/;
  8942. /**
  8943. * Escape special characters in the given string of html.
  8944. *
  8945. * @param {string} string The string to escape for inserting into HTML
  8946. * @return {string}
  8947. * @public
  8948. */
  8949. function escapeHtml(string) {
  8950. var str = '' + string;
  8951. var match = matchHtmlRegExp.exec(str);
  8952. if (!match) {
  8953. return str;
  8954. }
  8955. var escape;
  8956. var html = '';
  8957. var index = 0;
  8958. var lastIndex = 0;
  8959. for (index = match.index; index < str.length; index++) {
  8960. switch (str.charCodeAt(index)) {
  8961. case 34:
  8962. // "
  8963. escape = '&quot;';
  8964. break;
  8965. case 38:
  8966. // &
  8967. escape = '&amp;';
  8968. break;
  8969. case 39:
  8970. // '
  8971. escape = '&#x27;'; // modified from escape-html; used to be '&#39'
  8972. break;
  8973. case 60:
  8974. // <
  8975. escape = '&lt;';
  8976. break;
  8977. case 62:
  8978. // >
  8979. escape = '&gt;';
  8980. break;
  8981. default:
  8982. continue;
  8983. }
  8984. if (lastIndex !== index) {
  8985. html += str.substring(lastIndex, index);
  8986. }
  8987. lastIndex = index + 1;
  8988. html += escape;
  8989. }
  8990. return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
  8991. }
  8992. // end code copied and modified from escape-html
  8993. /**
  8994. * Escapes text to prevent scripting attacks.
  8995. *
  8996. * @param {*} text Text value to escape.
  8997. * @return {string} An escaped string.
  8998. */
  8999. function escapeTextContentForBrowser(text) {
  9000. if (typeof text === 'boolean' || typeof text === 'number') {
  9001. // this shortcircuit helps perf for types that we know will never have
  9002. // special characters, especially given that this function is used often
  9003. // for numeric dom ids.
  9004. return '' + text;
  9005. }
  9006. return escapeHtml(text);
  9007. }
  9008. module.exports = escapeTextContentForBrowser;
  9009. /***/ },
  9010. /* 89 */
  9011. /***/ function(module, exports, __webpack_require__) {
  9012. /* WEBPACK VAR INJECTION */(function(process) {/**
  9013. * Copyright 2013-present, Facebook, Inc.
  9014. * All rights reserved.
  9015. *
  9016. * This source code is licensed under the BSD-style license found in the
  9017. * LICENSE file in the root directory of this source tree. An additional grant
  9018. * of patent rights can be found in the PATENTS file in the same directory.
  9019. *
  9020. */
  9021. 'use strict';
  9022. var _prodInvariant = __webpack_require__(37);
  9023. var DOMLazyTree = __webpack_require__(83);
  9024. var ExecutionEnvironment = __webpack_require__(50);
  9025. var createNodesFromMarkup = __webpack_require__(90);
  9026. var emptyFunction = __webpack_require__(14);
  9027. var invariant = __webpack_require__(10);
  9028. var Danger = {
  9029. /**
  9030. * Replaces a node with a string of markup at its current position within its
  9031. * parent. The markup must render into a single root node.
  9032. *
  9033. * @param {DOMElement} oldChild Child node to replace.
  9034. * @param {string} markup Markup to render in place of the child node.
  9035. * @internal
  9036. */
  9037. dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) {
  9038. !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;
  9039. !markup ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : _prodInvariant('57') : void 0;
  9040. !(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;
  9041. if (typeof markup === 'string') {
  9042. var newChild = createNodesFromMarkup(markup, emptyFunction)[0];
  9043. oldChild.parentNode.replaceChild(newChild, oldChild);
  9044. } else {
  9045. DOMLazyTree.replaceChildWithTree(oldChild, markup);
  9046. }
  9047. }
  9048. };
  9049. module.exports = Danger;
  9050. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  9051. /***/ },
  9052. /* 90 */
  9053. /***/ function(module, exports, __webpack_require__) {
  9054. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  9055. /**
  9056. * Copyright (c) 2013-present, Facebook, Inc.
  9057. * All rights reserved.
  9058. *
  9059. * This source code is licensed under the BSD-style license found in the
  9060. * LICENSE file in the root directory of this source tree. An additional grant
  9061. * of patent rights can be found in the PATENTS file in the same directory.
  9062. *
  9063. * @typechecks
  9064. */
  9065. /*eslint-disable fb-www/unsafe-html*/
  9066. var ExecutionEnvironment = __webpack_require__(50);
  9067. var createArrayFromMixed = __webpack_require__(91);
  9068. var getMarkupWrap = __webpack_require__(92);
  9069. var invariant = __webpack_require__(10);
  9070. /**
  9071. * Dummy container used to render all markup.
  9072. */
  9073. var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
  9074. /**
  9075. * Pattern used by `getNodeName`.
  9076. */
  9077. var nodeNamePattern = /^\s*<(\w+)/;
  9078. /**
  9079. * Extracts the `nodeName` of the first element in a string of markup.
  9080. *
  9081. * @param {string} markup String of markup.
  9082. * @return {?string} Node name of the supplied markup.
  9083. */
  9084. function getNodeName(markup) {
  9085. var nodeNameMatch = markup.match(nodeNamePattern);
  9086. return nodeNameMatch && nodeNameMatch[1].toLowerCase();
  9087. }
  9088. /**
  9089. * Creates an array containing the nodes rendered from the supplied markup. The
  9090. * optionally supplied `handleScript` function will be invoked once for each
  9091. * <script> element that is rendered. If no `handleScript` function is supplied,
  9092. * an exception is thrown if any <script> elements are rendered.
  9093. *
  9094. * @param {string} markup A string of valid HTML markup.
  9095. * @param {?function} handleScript Invoked once for each rendered <script>.
  9096. * @return {array<DOMElement|DOMTextNode>} An array of rendered nodes.
  9097. */
  9098. function createNodesFromMarkup(markup, handleScript) {
  9099. var node = dummyNode;
  9100. !!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : void 0;
  9101. var nodeName = getNodeName(markup);
  9102. var wrap = nodeName && getMarkupWrap(nodeName);
  9103. if (wrap) {
  9104. node.innerHTML = wrap[1] + markup + wrap[2];
  9105. var wrapDepth = wrap[0];
  9106. while (wrapDepth--) {
  9107. node = node.lastChild;
  9108. }
  9109. } else {
  9110. node.innerHTML = markup;
  9111. }
  9112. var scripts = node.getElementsByTagName('script');
  9113. if (scripts.length) {
  9114. !handleScript ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : void 0;
  9115. createArrayFromMixed(scripts).forEach(handleScript);
  9116. }
  9117. var nodes = Array.from(node.childNodes);
  9118. while (node.lastChild) {
  9119. node.removeChild(node.lastChild);
  9120. }
  9121. return nodes;
  9122. }
  9123. module.exports = createNodesFromMarkup;
  9124. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  9125. /***/ },
  9126. /* 91 */
  9127. /***/ function(module, exports, __webpack_require__) {
  9128. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  9129. /**
  9130. * Copyright (c) 2013-present, Facebook, Inc.
  9131. * All rights reserved.
  9132. *
  9133. * This source code is licensed under the BSD-style license found in the
  9134. * LICENSE file in the root directory of this source tree. An additional grant
  9135. * of patent rights can be found in the PATENTS file in the same directory.
  9136. *
  9137. * @typechecks
  9138. */
  9139. var invariant = __webpack_require__(10);
  9140. /**
  9141. * Convert array-like objects to arrays.
  9142. *
  9143. * This API assumes the caller knows the contents of the data type. For less
  9144. * well defined inputs use createArrayFromMixed.
  9145. *
  9146. * @param {object|function|filelist} obj
  9147. * @return {array}
  9148. */
  9149. function toArray(obj) {
  9150. var length = obj.length;
  9151. // Some browsers builtin objects can report typeof 'function' (e.g. NodeList
  9152. // in old versions of Safari).
  9153. !(!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;
  9154. !(typeof length === 'number') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0;
  9155. !(length === 0 || length - 1 in obj) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0;
  9156. !(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;
  9157. // Old IE doesn't give collections access to hasOwnProperty. Assume inputs
  9158. // without method will throw during the slice call and skip straight to the
  9159. // fallback.
  9160. if (obj.hasOwnProperty) {
  9161. try {
  9162. return Array.prototype.slice.call(obj);
  9163. } catch (e) {
  9164. // IE < 9 does not support Array#slice on collections objects
  9165. }
  9166. }
  9167. // Fall back to copying key by key. This assumes all keys have a value,
  9168. // so will not preserve sparsely populated inputs.
  9169. var ret = Array(length);
  9170. for (var ii = 0; ii < length; ii++) {
  9171. ret[ii] = obj[ii];
  9172. }
  9173. return ret;
  9174. }
  9175. /**
  9176. * Perform a heuristic test to determine if an object is "array-like".
  9177. *
  9178. * A monk asked Joshu, a Zen master, "Has a dog Buddha nature?"
  9179. * Joshu replied: "Mu."
  9180. *
  9181. * This function determines if its argument has "array nature": it returns
  9182. * true if the argument is an actual array, an `arguments' object, or an
  9183. * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).
  9184. *
  9185. * It will return false for other array-like objects like Filelist.
  9186. *
  9187. * @param {*} obj
  9188. * @return {boolean}
  9189. */
  9190. function hasArrayNature(obj) {
  9191. return (
  9192. // not null/false
  9193. !!obj && (
  9194. // arrays are objects, NodeLists are functions in Safari
  9195. typeof obj == 'object' || typeof obj == 'function') &&
  9196. // quacks like an array
  9197. 'length' in obj &&
  9198. // not window
  9199. !('setInterval' in obj) &&
  9200. // no DOM node should be considered an array-like
  9201. // a 'select' element has 'length' and 'item' properties on IE8
  9202. typeof obj.nodeType != 'number' && (
  9203. // a real array
  9204. Array.isArray(obj) ||
  9205. // arguments
  9206. 'callee' in obj ||
  9207. // HTMLCollection/NodeList
  9208. 'item' in obj)
  9209. );
  9210. }
  9211. /**
  9212. * Ensure that the argument is an array by wrapping it in an array if it is not.
  9213. * Creates a copy of the argument if it is already an array.
  9214. *
  9215. * This is mostly useful idiomatically:
  9216. *
  9217. * var createArrayFromMixed = require('createArrayFromMixed');
  9218. *
  9219. * function takesOneOrMoreThings(things) {
  9220. * things = createArrayFromMixed(things);
  9221. * ...
  9222. * }
  9223. *
  9224. * This allows you to treat `things' as an array, but accept scalars in the API.
  9225. *
  9226. * If you need to convert an array-like object, like `arguments`, into an array
  9227. * use toArray instead.
  9228. *
  9229. * @param {*} obj
  9230. * @return {array}
  9231. */
  9232. function createArrayFromMixed(obj) {
  9233. if (!hasArrayNature(obj)) {
  9234. return [obj];
  9235. } else if (Array.isArray(obj)) {
  9236. return obj.slice();
  9237. } else {
  9238. return toArray(obj);
  9239. }
  9240. }
  9241. module.exports = createArrayFromMixed;
  9242. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  9243. /***/ },
  9244. /* 92 */
  9245. /***/ function(module, exports, __webpack_require__) {
  9246. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  9247. /**
  9248. * Copyright (c) 2013-present, Facebook, Inc.
  9249. * All rights reserved.
  9250. *
  9251. * This source code is licensed under the BSD-style license found in the
  9252. * LICENSE file in the root directory of this source tree. An additional grant
  9253. * of patent rights can be found in the PATENTS file in the same directory.
  9254. *
  9255. */
  9256. /*eslint-disable fb-www/unsafe-html */
  9257. var ExecutionEnvironment = __webpack_require__(50);
  9258. var invariant = __webpack_require__(10);
  9259. /**
  9260. * Dummy container used to detect which wraps are necessary.
  9261. */
  9262. var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
  9263. /**
  9264. * Some browsers cannot use `innerHTML` to render certain elements standalone,
  9265. * so we wrap them, render the wrapped nodes, then extract the desired node.
  9266. *
  9267. * In IE8, certain elements cannot render alone, so wrap all elements ('*').
  9268. */
  9269. var shouldWrap = {};
  9270. var selectWrap = [1, '<select multiple="true">', '</select>'];
  9271. var tableWrap = [1, '<table>', '</table>'];
  9272. var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
  9273. var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>'];
  9274. var markupWrap = {
  9275. '*': [1, '?<div>', '</div>'],
  9276. 'area': [1, '<map>', '</map>'],
  9277. 'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
  9278. 'legend': [1, '<fieldset>', '</fieldset>'],
  9279. 'param': [1, '<object>', '</object>'],
  9280. 'tr': [2, '<table><tbody>', '</tbody></table>'],
  9281. 'optgroup': selectWrap,
  9282. 'option': selectWrap,
  9283. 'caption': tableWrap,
  9284. 'colgroup': tableWrap,
  9285. 'tbody': tableWrap,
  9286. 'tfoot': tableWrap,
  9287. 'thead': tableWrap,
  9288. 'td': trWrap,
  9289. 'th': trWrap
  9290. };
  9291. // Initialize the SVG elements since we know they'll always need to be wrapped
  9292. // consistently. If they are created inside a <div> they will be initialized in
  9293. // the wrong namespace (and will not display).
  9294. var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan'];
  9295. svgElements.forEach(function (nodeName) {
  9296. markupWrap[nodeName] = svgWrap;
  9297. shouldWrap[nodeName] = true;
  9298. });
  9299. /**
  9300. * Gets the markup wrap configuration for the supplied `nodeName`.
  9301. *
  9302. * NOTE: This lazily detects which wraps are necessary for the current browser.
  9303. *
  9304. * @param {string} nodeName Lowercase `nodeName`.
  9305. * @return {?array} Markup wrap configuration, if applicable.
  9306. */
  9307. function getMarkupWrap(nodeName) {
  9308. !!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : void 0;
  9309. if (!markupWrap.hasOwnProperty(nodeName)) {
  9310. nodeName = '*';
  9311. }
  9312. if (!shouldWrap.hasOwnProperty(nodeName)) {
  9313. if (nodeName === '*') {
  9314. dummyNode.innerHTML = '<link />';
  9315. } else {
  9316. dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
  9317. }
  9318. shouldWrap[nodeName] = !dummyNode.firstChild;
  9319. }
  9320. return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
  9321. }
  9322. module.exports = getMarkupWrap;
  9323. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  9324. /***/ },
  9325. /* 93 */
  9326. /***/ function(module, exports, __webpack_require__) {
  9327. /**
  9328. * Copyright 2013-present, Facebook, Inc.
  9329. * All rights reserved.
  9330. *
  9331. * This source code is licensed under the BSD-style license found in the
  9332. * LICENSE file in the root directory of this source tree. An additional grant
  9333. * of patent rights can be found in the PATENTS file in the same directory.
  9334. *
  9335. */
  9336. 'use strict';
  9337. var DOMChildrenOperations = __webpack_require__(82);
  9338. var ReactDOMComponentTree = __webpack_require__(36);
  9339. /**
  9340. * Operations used to process updates to DOM nodes.
  9341. */
  9342. var ReactDOMIDOperations = {
  9343. /**
  9344. * Updates a component's children by processing a series of updates.
  9345. *
  9346. * @param {array<object>} updates List of update configurations.
  9347. * @internal
  9348. */
  9349. dangerouslyProcessChildrenUpdates: function (parentInst, updates) {
  9350. var node = ReactDOMComponentTree.getNodeFromInstance(parentInst);
  9351. DOMChildrenOperations.processUpdates(node, updates);
  9352. }
  9353. };
  9354. module.exports = ReactDOMIDOperations;
  9355. /***/ },
  9356. /* 94 */
  9357. /***/ function(module, exports, __webpack_require__) {
  9358. /* WEBPACK VAR INJECTION */(function(process) {/**
  9359. * Copyright 2013-present, Facebook, Inc.
  9360. * All rights reserved.
  9361. *
  9362. * This source code is licensed under the BSD-style license found in the
  9363. * LICENSE file in the root directory of this source tree. An additional grant
  9364. * of patent rights can be found in the PATENTS file in the same directory.
  9365. *
  9366. */
  9367. /* global hasOwnProperty:true */
  9368. 'use strict';
  9369. var _prodInvariant = __webpack_require__(37),
  9370. _assign = __webpack_require__(6);
  9371. var AutoFocusUtils = __webpack_require__(95);
  9372. var CSSPropertyOperations = __webpack_require__(97);
  9373. var DOMLazyTree = __webpack_require__(83);
  9374. var DOMNamespaces = __webpack_require__(84);
  9375. var DOMProperty = __webpack_require__(38);
  9376. var DOMPropertyOperations = __webpack_require__(105);
  9377. var EventPluginHub = __webpack_require__(44);
  9378. var EventPluginRegistry = __webpack_require__(45);
  9379. var ReactBrowserEventEmitter = __webpack_require__(107);
  9380. var ReactDOMComponentFlags = __webpack_require__(39);
  9381. var ReactDOMComponentTree = __webpack_require__(36);
  9382. var ReactDOMInput = __webpack_require__(110);
  9383. var ReactDOMOption = __webpack_require__(113);
  9384. var ReactDOMSelect = __webpack_require__(114);
  9385. var ReactDOMTextarea = __webpack_require__(115);
  9386. var ReactInstrumentation = __webpack_require__(64);
  9387. var ReactMultiChild = __webpack_require__(116);
  9388. var ReactServerRenderingTransaction = __webpack_require__(135);
  9389. var emptyFunction = __webpack_require__(14);
  9390. var escapeTextContentForBrowser = __webpack_require__(88);
  9391. var invariant = __webpack_require__(10);
  9392. var isEventSupported = __webpack_require__(72);
  9393. var shallowEqual = __webpack_require__(125);
  9394. var validateDOMNesting = __webpack_require__(138);
  9395. var warning = __webpack_require__(13);
  9396. var Flags = ReactDOMComponentFlags;
  9397. var deleteListener = EventPluginHub.deleteListener;
  9398. var getNode = ReactDOMComponentTree.getNodeFromInstance;
  9399. var listenTo = ReactBrowserEventEmitter.listenTo;
  9400. var registrationNameModules = EventPluginRegistry.registrationNameModules;
  9401. // For quickly matching children type, to test if can be treated as content.
  9402. var CONTENT_TYPES = { 'string': true, 'number': true };
  9403. var STYLE = 'style';
  9404. var HTML = '__html';
  9405. var RESERVED_PROPS = {
  9406. children: null,
  9407. dangerouslySetInnerHTML: null,
  9408. suppressContentEditableWarning: null
  9409. };
  9410. // Node type for document fragments (Node.DOCUMENT_FRAGMENT_NODE).
  9411. var DOC_FRAGMENT_TYPE = 11;
  9412. function getDeclarationErrorAddendum(internalInstance) {
  9413. if (internalInstance) {
  9414. var owner = internalInstance._currentElement._owner || null;
  9415. if (owner) {
  9416. var name = owner.getName();
  9417. if (name) {
  9418. return ' This DOM node was rendered by `' + name + '`.';
  9419. }
  9420. }
  9421. }
  9422. return '';
  9423. }
  9424. function friendlyStringify(obj) {
  9425. if (typeof obj === 'object') {
  9426. if (Array.isArray(obj)) {
  9427. return '[' + obj.map(friendlyStringify).join(', ') + ']';
  9428. } else {
  9429. var pairs = [];
  9430. for (var key in obj) {
  9431. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  9432. var keyEscaped = /^[a-z$_][\w$_]*$/i.test(key) ? key : JSON.stringify(key);
  9433. pairs.push(keyEscaped + ': ' + friendlyStringify(obj[key]));
  9434. }
  9435. }
  9436. return '{' + pairs.join(', ') + '}';
  9437. }
  9438. } else if (typeof obj === 'string') {
  9439. return JSON.stringify(obj);
  9440. } else if (typeof obj === 'function') {
  9441. return '[function object]';
  9442. }
  9443. // Differs from JSON.stringify in that undefined because undefined and that
  9444. // inf and nan don't become null
  9445. return String(obj);
  9446. }
  9447. var styleMutationWarning = {};
  9448. function checkAndWarnForMutatedStyle(style1, style2, component) {
  9449. if (style1 == null || style2 == null) {
  9450. return;
  9451. }
  9452. if (shallowEqual(style1, style2)) {
  9453. return;
  9454. }
  9455. var componentName = component._tag;
  9456. var owner = component._currentElement._owner;
  9457. var ownerName;
  9458. if (owner) {
  9459. ownerName = owner.getName();
  9460. }
  9461. var hash = ownerName + '|' + componentName;
  9462. if (styleMutationWarning.hasOwnProperty(hash)) {
  9463. return;
  9464. }
  9465. styleMutationWarning[hash] = true;
  9466. 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;
  9467. }
  9468. /**
  9469. * @param {object} component
  9470. * @param {?object} props
  9471. */
  9472. function assertValidProps(component, props) {
  9473. if (!props) {
  9474. return;
  9475. }
  9476. // Note the use of `==` which checks for null or undefined.
  9477. if (voidElementTags[component._tag]) {
  9478. !(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;
  9479. }
  9480. if (props.dangerouslySetInnerHTML != null) {
  9481. !(props.children == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : _prodInvariant('60') : void 0;
  9482. !(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;
  9483. }
  9484. if (process.env.NODE_ENV !== 'production') {
  9485. 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;
  9486. 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;
  9487. 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;
  9488. }
  9489. !(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;
  9490. }
  9491. function enqueuePutListener(inst, registrationName, listener, transaction) {
  9492. if (transaction instanceof ReactServerRenderingTransaction) {
  9493. return;
  9494. }
  9495. if (process.env.NODE_ENV !== 'production') {
  9496. // IE8 has no API for event capturing and the `onScroll` event doesn't
  9497. // bubble.
  9498. process.env.NODE_ENV !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), 'This browser doesn\'t support the `onScroll` event') : void 0;
  9499. }
  9500. var containerInfo = inst._hostContainerInfo;
  9501. var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE;
  9502. var doc = isDocumentFragment ? containerInfo._node : containerInfo._ownerDocument;
  9503. listenTo(registrationName, doc);
  9504. transaction.getReactMountReady().enqueue(putListener, {
  9505. inst: inst,
  9506. registrationName: registrationName,
  9507. listener: listener
  9508. });
  9509. }
  9510. function putListener() {
  9511. var listenerToPut = this;
  9512. EventPluginHub.putListener(listenerToPut.inst, listenerToPut.registrationName, listenerToPut.listener);
  9513. }
  9514. function inputPostMount() {
  9515. var inst = this;
  9516. ReactDOMInput.postMountWrapper(inst);
  9517. }
  9518. function textareaPostMount() {
  9519. var inst = this;
  9520. ReactDOMTextarea.postMountWrapper(inst);
  9521. }
  9522. function optionPostMount() {
  9523. var inst = this;
  9524. ReactDOMOption.postMountWrapper(inst);
  9525. }
  9526. var setAndValidateContentChildDev = emptyFunction;
  9527. if (process.env.NODE_ENV !== 'production') {
  9528. setAndValidateContentChildDev = function (content) {
  9529. var hasExistingContent = this._contentDebugID != null;
  9530. var debugID = this._debugID;
  9531. // This ID represents the inlined child that has no backing instance:
  9532. var contentDebugID = -debugID;
  9533. if (content == null) {
  9534. if (hasExistingContent) {
  9535. ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID);
  9536. }
  9537. this._contentDebugID = null;
  9538. return;
  9539. }
  9540. validateDOMNesting(null, String(content), this, this._ancestorInfo);
  9541. this._contentDebugID = contentDebugID;
  9542. if (hasExistingContent) {
  9543. ReactInstrumentation.debugTool.onBeforeUpdateComponent(contentDebugID, content);
  9544. ReactInstrumentation.debugTool.onUpdateComponent(contentDebugID);
  9545. } else {
  9546. ReactInstrumentation.debugTool.onBeforeMountComponent(contentDebugID, content, debugID);
  9547. ReactInstrumentation.debugTool.onMountComponent(contentDebugID);
  9548. ReactInstrumentation.debugTool.onSetChildren(debugID, [contentDebugID]);
  9549. }
  9550. };
  9551. }
  9552. // There are so many media events, it makes sense to just
  9553. // maintain a list rather than create a `trapBubbledEvent` for each
  9554. var mediaEvents = {
  9555. topAbort: 'abort',
  9556. topCanPlay: 'canplay',
  9557. topCanPlayThrough: 'canplaythrough',
  9558. topDurationChange: 'durationchange',
  9559. topEmptied: 'emptied',
  9560. topEncrypted: 'encrypted',
  9561. topEnded: 'ended',
  9562. topError: 'error',
  9563. topLoadedData: 'loadeddata',
  9564. topLoadedMetadata: 'loadedmetadata',
  9565. topLoadStart: 'loadstart',
  9566. topPause: 'pause',
  9567. topPlay: 'play',
  9568. topPlaying: 'playing',
  9569. topProgress: 'progress',
  9570. topRateChange: 'ratechange',
  9571. topSeeked: 'seeked',
  9572. topSeeking: 'seeking',
  9573. topStalled: 'stalled',
  9574. topSuspend: 'suspend',
  9575. topTimeUpdate: 'timeupdate',
  9576. topVolumeChange: 'volumechange',
  9577. topWaiting: 'waiting'
  9578. };
  9579. function trapBubbledEventsLocal() {
  9580. var inst = this;
  9581. // If a component renders to null or if another component fatals and causes
  9582. // the state of the tree to be corrupted, `node` here can be null.
  9583. !inst._rootNodeID ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Must be mounted to trap events') : _prodInvariant('63') : void 0;
  9584. var node = getNode(inst);
  9585. !node ? process.env.NODE_ENV !== 'production' ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : _prodInvariant('64') : void 0;
  9586. switch (inst._tag) {
  9587. case 'iframe':
  9588. case 'object':
  9589. inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topLoad', 'load', node)];
  9590. break;
  9591. case 'video':
  9592. case 'audio':
  9593. inst._wrapperState.listeners = [];
  9594. // Create listener for each media event
  9595. for (var event in mediaEvents) {
  9596. if (mediaEvents.hasOwnProperty(event)) {
  9597. inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(event, mediaEvents[event], node));
  9598. }
  9599. }
  9600. break;
  9601. case 'source':
  9602. inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topError', 'error', node)];
  9603. break;
  9604. case 'img':
  9605. inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topError', 'error', node), ReactBrowserEventEmitter.trapBubbledEvent('topLoad', 'load', node)];
  9606. break;
  9607. case 'form':
  9608. inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topReset', 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent('topSubmit', 'submit', node)];
  9609. break;
  9610. case 'input':
  9611. case 'select':
  9612. case 'textarea':
  9613. inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topInvalid', 'invalid', node)];
  9614. break;
  9615. }
  9616. }
  9617. function postUpdateSelectWrapper() {
  9618. ReactDOMSelect.postUpdateWrapper(this);
  9619. }
  9620. // For HTML, certain tags should omit their close tag. We keep a whitelist for
  9621. // those special-case tags.
  9622. var omittedCloseTags = {
  9623. 'area': true,
  9624. 'base': true,
  9625. 'br': true,
  9626. 'col': true,
  9627. 'embed': true,
  9628. 'hr': true,
  9629. 'img': true,
  9630. 'input': true,
  9631. 'keygen': true,
  9632. 'link': true,
  9633. 'meta': true,
  9634. 'param': true,
  9635. 'source': true,
  9636. 'track': true,
  9637. 'wbr': true
  9638. };
  9639. var newlineEatingTags = {
  9640. 'listing': true,
  9641. 'pre': true,
  9642. 'textarea': true
  9643. };
  9644. // For HTML, certain tags cannot have children. This has the same purpose as
  9645. // `omittedCloseTags` except that `menuitem` should still have its closing tag.
  9646. var voidElementTags = _assign({
  9647. 'menuitem': true
  9648. }, omittedCloseTags);
  9649. // We accept any tag to be rendered but since this gets injected into arbitrary
  9650. // HTML, we want to make sure that it's a safe tag.
  9651. // http://www.w3.org/TR/REC-xml/#NT-Name
  9652. var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
  9653. var validatedTagCache = {};
  9654. var hasOwnProperty = {}.hasOwnProperty;
  9655. function validateDangerousTag(tag) {
  9656. if (!hasOwnProperty.call(validatedTagCache, tag)) {
  9657. !VALID_TAG_REGEX.test(tag) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Invalid tag: %s', tag) : _prodInvariant('65', tag) : void 0;
  9658. validatedTagCache[tag] = true;
  9659. }
  9660. }
  9661. function isCustomComponent(tagName, props) {
  9662. return tagName.indexOf('-') >= 0 || props.is != null;
  9663. }
  9664. var globalIdCounter = 1;
  9665. /**
  9666. * Creates a new React class that is idempotent and capable of containing other
  9667. * React components. It accepts event listeners and DOM properties that are
  9668. * valid according to `DOMProperty`.
  9669. *
  9670. * - Event listeners: `onClick`, `onMouseDown`, etc.
  9671. * - DOM properties: `className`, `name`, `title`, etc.
  9672. *
  9673. * The `style` property functions differently from the DOM API. It accepts an
  9674. * object mapping of style properties to values.
  9675. *
  9676. * @constructor ReactDOMComponent
  9677. * @extends ReactMultiChild
  9678. */
  9679. function ReactDOMComponent(element) {
  9680. var tag = element.type;
  9681. validateDangerousTag(tag);
  9682. this._currentElement = element;
  9683. this._tag = tag.toLowerCase();
  9684. this._namespaceURI = null;
  9685. this._renderedChildren = null;
  9686. this._previousStyle = null;
  9687. this._previousStyleCopy = null;
  9688. this._hostNode = null;
  9689. this._hostParent = null;
  9690. this._rootNodeID = 0;
  9691. this._domID = 0;
  9692. this._hostContainerInfo = null;
  9693. this._wrapperState = null;
  9694. this._topLevelWrapper = null;
  9695. this._flags = 0;
  9696. if (process.env.NODE_ENV !== 'production') {
  9697. this._ancestorInfo = null;
  9698. setAndValidateContentChildDev.call(this, null);
  9699. }
  9700. }
  9701. ReactDOMComponent.displayName = 'ReactDOMComponent';
  9702. ReactDOMComponent.Mixin = {
  9703. /**
  9704. * Generates root tag markup then recurses. This method has side effects and
  9705. * is not idempotent.
  9706. *
  9707. * @internal
  9708. * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
  9709. * @param {?ReactDOMComponent} the parent component instance
  9710. * @param {?object} info about the host container
  9711. * @param {object} context
  9712. * @return {string} The computed markup.
  9713. */
  9714. mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
  9715. this._rootNodeID = globalIdCounter++;
  9716. this._domID = hostContainerInfo._idCounter++;
  9717. this._hostParent = hostParent;
  9718. this._hostContainerInfo = hostContainerInfo;
  9719. var props = this._currentElement.props;
  9720. switch (this._tag) {
  9721. case 'audio':
  9722. case 'form':
  9723. case 'iframe':
  9724. case 'img':
  9725. case 'link':
  9726. case 'object':
  9727. case 'source':
  9728. case 'video':
  9729. this._wrapperState = {
  9730. listeners: null
  9731. };
  9732. transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
  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, null, 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. setAndValidateContentChildDev.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. // TODO: Validate that text is allowed as a child of this node
  9981. if (contentToUse != null) {
  9982. // Avoid setting textContent when the text is empty. In IE11 setting
  9983. // textContent on a text area will cause the placeholder to not
  9984. // show within the textarea until it has been focused and blurred again.
  9985. // https://github.com/facebook/react/issues/6731#issuecomment-254874553
  9986. if (contentToUse !== '') {
  9987. if (process.env.NODE_ENV !== 'production') {
  9988. setAndValidateContentChildDev.call(this, contentToUse);
  9989. }
  9990. DOMLazyTree.queueText(lazyTree, contentToUse);
  9991. }
  9992. } else if (childrenToUse != null) {
  9993. var mountImages = this.mountChildren(childrenToUse, transaction, context);
  9994. for (var i = 0; i < mountImages.length; i++) {
  9995. DOMLazyTree.queueChild(lazyTree, mountImages[i]);
  9996. }
  9997. }
  9998. }
  9999. },
  10000. /**
  10001. * Receives a next element and updates the component.
  10002. *
  10003. * @internal
  10004. * @param {ReactElement} nextElement
  10005. * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
  10006. * @param {object} context
  10007. */
  10008. receiveComponent: function (nextElement, transaction, context) {
  10009. var prevElement = this._currentElement;
  10010. this._currentElement = nextElement;
  10011. this.updateComponent(transaction, prevElement, nextElement, context);
  10012. },
  10013. /**
  10014. * Updates a DOM component after it has already been allocated and
  10015. * attached to the DOM. Reconciles the root DOM node, then recurses.
  10016. *
  10017. * @param {ReactReconcileTransaction} transaction
  10018. * @param {ReactElement} prevElement
  10019. * @param {ReactElement} nextElement
  10020. * @internal
  10021. * @overridable
  10022. */
  10023. updateComponent: function (transaction, prevElement, nextElement, context) {
  10024. var lastProps = prevElement.props;
  10025. var nextProps = this._currentElement.props;
  10026. switch (this._tag) {
  10027. case 'input':
  10028. lastProps = ReactDOMInput.getHostProps(this, lastProps);
  10029. nextProps = ReactDOMInput.getHostProps(this, nextProps);
  10030. break;
  10031. case 'option':
  10032. lastProps = ReactDOMOption.getHostProps(this, lastProps);
  10033. nextProps = ReactDOMOption.getHostProps(this, nextProps);
  10034. break;
  10035. case 'select':
  10036. lastProps = ReactDOMSelect.getHostProps(this, lastProps);
  10037. nextProps = ReactDOMSelect.getHostProps(this, nextProps);
  10038. break;
  10039. case 'textarea':
  10040. lastProps = ReactDOMTextarea.getHostProps(this, lastProps);
  10041. nextProps = ReactDOMTextarea.getHostProps(this, nextProps);
  10042. break;
  10043. }
  10044. assertValidProps(this, nextProps);
  10045. this._updateDOMProperties(lastProps, nextProps, transaction);
  10046. this._updateDOMChildren(lastProps, nextProps, transaction, context);
  10047. switch (this._tag) {
  10048. case 'input':
  10049. // Update the wrapper around inputs *after* updating props. This has to
  10050. // happen after `_updateDOMProperties`. Otherwise HTML5 input validations
  10051. // raise warnings and prevent the new value from being assigned.
  10052. ReactDOMInput.updateWrapper(this);
  10053. break;
  10054. case 'textarea':
  10055. ReactDOMTextarea.updateWrapper(this);
  10056. break;
  10057. case 'select':
  10058. // <select> value update needs to occur after <option> children
  10059. // reconciliation
  10060. transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this);
  10061. break;
  10062. }
  10063. },
  10064. /**
  10065. * Reconciles the properties by detecting differences in property values and
  10066. * updating the DOM as necessary. This function is probably the single most
  10067. * critical path for performance optimization.
  10068. *
  10069. * TODO: Benchmark whether checking for changed values in memory actually
  10070. * improves performance (especially statically positioned elements).
  10071. * TODO: Benchmark the effects of putting this at the top since 99% of props
  10072. * do not change for a given reconciliation.
  10073. * TODO: Benchmark areas that can be improved with caching.
  10074. *
  10075. * @private
  10076. * @param {object} lastProps
  10077. * @param {object} nextProps
  10078. * @param {?DOMElement} node
  10079. */
  10080. _updateDOMProperties: function (lastProps, nextProps, transaction) {
  10081. var propKey;
  10082. var styleName;
  10083. var styleUpdates;
  10084. for (propKey in lastProps) {
  10085. if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
  10086. continue;
  10087. }
  10088. if (propKey === STYLE) {
  10089. var lastStyle = this._previousStyleCopy;
  10090. for (styleName in lastStyle) {
  10091. if (lastStyle.hasOwnProperty(styleName)) {
  10092. styleUpdates = styleUpdates || {};
  10093. styleUpdates[styleName] = '';
  10094. }
  10095. }
  10096. this._previousStyleCopy = null;
  10097. } else if (registrationNameModules.hasOwnProperty(propKey)) {
  10098. if (lastProps[propKey]) {
  10099. // Only call deleteListener if there was a listener previously or
  10100. // else willDeleteListener gets called when there wasn't actually a
  10101. // listener (e.g., onClick={null})
  10102. deleteListener(this, propKey);
  10103. }
  10104. } else if (isCustomComponent(this._tag, lastProps)) {
  10105. if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
  10106. DOMPropertyOperations.deleteValueForAttribute(getNode(this), propKey);
  10107. }
  10108. } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
  10109. DOMPropertyOperations.deleteValueForProperty(getNode(this), propKey);
  10110. }
  10111. }
  10112. for (propKey in nextProps) {
  10113. var nextProp = nextProps[propKey];
  10114. var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps != null ? lastProps[propKey] : undefined;
  10115. if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
  10116. continue;
  10117. }
  10118. if (propKey === STYLE) {
  10119. if (nextProp) {
  10120. if (process.env.NODE_ENV !== 'production') {
  10121. checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this);
  10122. this._previousStyle = nextProp;
  10123. }
  10124. nextProp = this._previousStyleCopy = _assign({}, nextProp);
  10125. } else {
  10126. this._previousStyleCopy = null;
  10127. }
  10128. if (lastProp) {
  10129. // Unset styles on `lastProp` but not on `nextProp`.
  10130. for (styleName in lastProp) {
  10131. if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
  10132. styleUpdates = styleUpdates || {};
  10133. styleUpdates[styleName] = '';
  10134. }
  10135. }
  10136. // Update styles that changed since `lastProp`.
  10137. for (styleName in nextProp) {
  10138. if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
  10139. styleUpdates = styleUpdates || {};
  10140. styleUpdates[styleName] = nextProp[styleName];
  10141. }
  10142. }
  10143. } else {
  10144. // Relies on `updateStylesByID` not mutating `styleUpdates`.
  10145. styleUpdates = nextProp;
  10146. }
  10147. } else if (registrationNameModules.hasOwnProperty(propKey)) {
  10148. if (nextProp) {
  10149. enqueuePutListener(this, propKey, nextProp, transaction);
  10150. } else if (lastProp) {
  10151. deleteListener(this, propKey);
  10152. }
  10153. } else if (isCustomComponent(this._tag, nextProps)) {
  10154. if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
  10155. DOMPropertyOperations.setValueForAttribute(getNode(this), propKey, nextProp);
  10156. }
  10157. } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
  10158. var node = getNode(this);
  10159. // If we're updating to null or undefined, we should remove the property
  10160. // from the DOM node instead of inadvertently setting to a string. This
  10161. // brings us in line with the same behavior we have on initial render.
  10162. if (nextProp != null) {
  10163. DOMPropertyOperations.setValueForProperty(node, propKey, nextProp);
  10164. } else {
  10165. DOMPropertyOperations.deleteValueForProperty(node, propKey);
  10166. }
  10167. }
  10168. }
  10169. if (styleUpdates) {
  10170. CSSPropertyOperations.setValueForStyles(getNode(this), styleUpdates, this);
  10171. }
  10172. },
  10173. /**
  10174. * Reconciles the children with the various properties that affect the
  10175. * children content.
  10176. *
  10177. * @param {object} lastProps
  10178. * @param {object} nextProps
  10179. * @param {ReactReconcileTransaction} transaction
  10180. * @param {object} context
  10181. */
  10182. _updateDOMChildren: function (lastProps, nextProps, transaction, context) {
  10183. var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null;
  10184. var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null;
  10185. var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html;
  10186. var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__html;
  10187. // Note the use of `!=` which checks for null or undefined.
  10188. var lastChildren = lastContent != null ? null : lastProps.children;
  10189. var nextChildren = nextContent != null ? null : nextProps.children;
  10190. // If we're switching from children to content/html or vice versa, remove
  10191. // the old content
  10192. var lastHasContentOrHtml = lastContent != null || lastHtml != null;
  10193. var nextHasContentOrHtml = nextContent != null || nextHtml != null;
  10194. if (lastChildren != null && nextChildren == null) {
  10195. this.updateChildren(null, transaction, context);
  10196. } else if (lastHasContentOrHtml && !nextHasContentOrHtml) {
  10197. this.updateTextContent('');
  10198. if (process.env.NODE_ENV !== 'production') {
  10199. ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
  10200. }
  10201. }
  10202. if (nextContent != null) {
  10203. if (lastContent !== nextContent) {
  10204. this.updateTextContent('' + nextContent);
  10205. if (process.env.NODE_ENV !== 'production') {
  10206. setAndValidateContentChildDev.call(this, nextContent);
  10207. }
  10208. }
  10209. } else if (nextHtml != null) {
  10210. if (lastHtml !== nextHtml) {
  10211. this.updateMarkup('' + nextHtml);
  10212. }
  10213. if (process.env.NODE_ENV !== 'production') {
  10214. ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
  10215. }
  10216. } else if (nextChildren != null) {
  10217. if (process.env.NODE_ENV !== 'production') {
  10218. setAndValidateContentChildDev.call(this, null);
  10219. }
  10220. this.updateChildren(nextChildren, transaction, context);
  10221. }
  10222. },
  10223. getHostNode: function () {
  10224. return getNode(this);
  10225. },
  10226. /**
  10227. * Destroys all event registrations for this instance. Does not remove from
  10228. * the DOM. That must be done by the parent.
  10229. *
  10230. * @internal
  10231. */
  10232. unmountComponent: function (safely) {
  10233. switch (this._tag) {
  10234. case 'audio':
  10235. case 'form':
  10236. case 'iframe':
  10237. case 'img':
  10238. case 'link':
  10239. case 'object':
  10240. case 'source':
  10241. case 'video':
  10242. var listeners = this._wrapperState.listeners;
  10243. if (listeners) {
  10244. for (var i = 0; i < listeners.length; i++) {
  10245. listeners[i].remove();
  10246. }
  10247. }
  10248. break;
  10249. case 'html':
  10250. case 'head':
  10251. case 'body':
  10252. /**
  10253. * Components like <html> <head> and <body> can't be removed or added
  10254. * easily in a cross-browser way, however it's valuable to be able to
  10255. * take advantage of React's reconciliation for styling and <title>
  10256. * management. So we just document it and throw in dangerous cases.
  10257. */
  10258. 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;
  10259. break;
  10260. }
  10261. this.unmountChildren(safely);
  10262. ReactDOMComponentTree.uncacheNode(this);
  10263. EventPluginHub.deleteAllListeners(this);
  10264. this._rootNodeID = 0;
  10265. this._domID = 0;
  10266. this._wrapperState = null;
  10267. if (process.env.NODE_ENV !== 'production') {
  10268. setAndValidateContentChildDev.call(this, null);
  10269. }
  10270. },
  10271. getPublicInstance: function () {
  10272. return getNode(this);
  10273. }
  10274. };
  10275. _assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);
  10276. module.exports = ReactDOMComponent;
  10277. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  10278. /***/ },
  10279. /* 95 */
  10280. /***/ function(module, exports, __webpack_require__) {
  10281. /**
  10282. * Copyright 2013-present, Facebook, Inc.
  10283. * All rights reserved.
  10284. *
  10285. * This source code is licensed under the BSD-style license found in the
  10286. * LICENSE file in the root directory of this source tree. An additional grant
  10287. * of patent rights can be found in the PATENTS file in the same directory.
  10288. *
  10289. */
  10290. 'use strict';
  10291. var ReactDOMComponentTree = __webpack_require__(36);
  10292. var focusNode = __webpack_require__(96);
  10293. var AutoFocusUtils = {
  10294. focusDOMComponent: function () {
  10295. focusNode(ReactDOMComponentTree.getNodeFromInstance(this));
  10296. }
  10297. };
  10298. module.exports = AutoFocusUtils;
  10299. /***/ },
  10300. /* 96 */
  10301. /***/ function(module, exports) {
  10302. /**
  10303. * Copyright (c) 2013-present, Facebook, Inc.
  10304. * All rights reserved.
  10305. *
  10306. * This source code is licensed under the BSD-style license found in the
  10307. * LICENSE file in the root directory of this source tree. An additional grant
  10308. * of patent rights can be found in the PATENTS file in the same directory.
  10309. *
  10310. */
  10311. 'use strict';
  10312. /**
  10313. * @param {DOMElement} node input/textarea to focus
  10314. */
  10315. function focusNode(node) {
  10316. // IE8 can throw "Can't move focus to the control because it is invisible,
  10317. // not enabled, or of a type that does not accept the focus." for all kinds of
  10318. // reasons that are too expensive and fragile to test.
  10319. try {
  10320. node.focus();
  10321. } catch (e) {}
  10322. }
  10323. module.exports = focusNode;
  10324. /***/ },
  10325. /* 97 */
  10326. /***/ function(module, exports, __webpack_require__) {
  10327. /* WEBPACK VAR INJECTION */(function(process) {/**
  10328. * Copyright 2013-present, Facebook, Inc.
  10329. * All rights reserved.
  10330. *
  10331. * This source code is licensed under the BSD-style license found in the
  10332. * LICENSE file in the root directory of this source tree. An additional grant
  10333. * of patent rights can be found in the PATENTS file in the same directory.
  10334. *
  10335. */
  10336. 'use strict';
  10337. var CSSProperty = __webpack_require__(98);
  10338. var ExecutionEnvironment = __webpack_require__(50);
  10339. var ReactInstrumentation = __webpack_require__(64);
  10340. var camelizeStyleName = __webpack_require__(99);
  10341. var dangerousStyleValue = __webpack_require__(101);
  10342. var hyphenateStyleName = __webpack_require__(102);
  10343. var memoizeStringOnly = __webpack_require__(104);
  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({
  10475. instanceID: component._debugID,
  10476. type: 'update styles',
  10477. payload: styles
  10478. });
  10479. }
  10480. var style = node.style;
  10481. for (var styleName in styles) {
  10482. if (!styles.hasOwnProperty(styleName)) {
  10483. continue;
  10484. }
  10485. if (process.env.NODE_ENV !== 'production') {
  10486. warnValidStyle(styleName, styles[styleName], component);
  10487. }
  10488. var styleValue = dangerousStyleValue(styleName, styles[styleName], component);
  10489. if (styleName === 'float' || styleName === 'cssFloat') {
  10490. styleName = styleFloatAccessor;
  10491. }
  10492. if (styleValue) {
  10493. style[styleName] = styleValue;
  10494. } else {
  10495. var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName];
  10496. if (expansion) {
  10497. // Shorthand property that IE8 won't like unsetting, so unset each
  10498. // component to placate it
  10499. for (var individualStyleName in expansion) {
  10500. style[individualStyleName] = '';
  10501. }
  10502. } else {
  10503. style[styleName] = '';
  10504. }
  10505. }
  10506. }
  10507. }
  10508. };
  10509. module.exports = CSSPropertyOperations;
  10510. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  10511. /***/ },
  10512. /* 98 */
  10513. /***/ function(module, exports) {
  10514. /**
  10515. * Copyright 2013-present, Facebook, Inc.
  10516. * All rights reserved.
  10517. *
  10518. * This source code is licensed under the BSD-style license found in the
  10519. * LICENSE file in the root directory of this source tree. An additional grant
  10520. * of patent rights can be found in the PATENTS file in the same directory.
  10521. *
  10522. */
  10523. 'use strict';
  10524. /**
  10525. * CSS properties which accept numbers but are not in units of "px".
  10526. */
  10527. var isUnitlessNumber = {
  10528. animationIterationCount: true,
  10529. borderImageOutset: true,
  10530. borderImageSlice: true,
  10531. borderImageWidth: true,
  10532. boxFlex: true,
  10533. boxFlexGroup: true,
  10534. boxOrdinalGroup: true,
  10535. columnCount: true,
  10536. flex: true,
  10537. flexGrow: true,
  10538. flexPositive: true,
  10539. flexShrink: true,
  10540. flexNegative: true,
  10541. flexOrder: true,
  10542. gridRow: true,
  10543. gridColumn: true,
  10544. fontWeight: true,
  10545. lineClamp: true,
  10546. lineHeight: true,
  10547. opacity: true,
  10548. order: true,
  10549. orphans: true,
  10550. tabSize: true,
  10551. widows: true,
  10552. zIndex: true,
  10553. zoom: true,
  10554. // SVG-related properties
  10555. fillOpacity: true,
  10556. floodOpacity: true,
  10557. stopOpacity: true,
  10558. strokeDasharray: true,
  10559. strokeDashoffset: true,
  10560. strokeMiterlimit: true,
  10561. strokeOpacity: true,
  10562. strokeWidth: true
  10563. };
  10564. /**
  10565. * @param {string} prefix vendor-specific prefix, eg: Webkit
  10566. * @param {string} key style name, eg: transitionDuration
  10567. * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
  10568. * WebkitTransitionDuration
  10569. */
  10570. function prefixKey(prefix, key) {
  10571. return prefix + key.charAt(0).toUpperCase() + key.substring(1);
  10572. }
  10573. /**
  10574. * Support style names that may come passed in prefixed by adding permutations
  10575. * of vendor prefixes.
  10576. */
  10577. var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
  10578. // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
  10579. // infinite loop, because it iterates over the newly added props too.
  10580. Object.keys(isUnitlessNumber).forEach(function (prop) {
  10581. prefixes.forEach(function (prefix) {
  10582. isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
  10583. });
  10584. });
  10585. /**
  10586. * Most style properties can be unset by doing .style[prop] = '' but IE8
  10587. * doesn't like doing that with shorthand properties so for the properties that
  10588. * IE8 breaks on, which are listed here, we instead unset each of the
  10589. * individual properties. See http://bugs.jquery.com/ticket/12385.
  10590. * The 4-value 'clock' properties like margin, padding, border-width seem to
  10591. * behave without any problems. Curiously, list-style works too without any
  10592. * special prodding.
  10593. */
  10594. var shorthandPropertyExpansions = {
  10595. background: {
  10596. backgroundAttachment: true,
  10597. backgroundColor: true,
  10598. backgroundImage: true,
  10599. backgroundPositionX: true,
  10600. backgroundPositionY: true,
  10601. backgroundRepeat: true
  10602. },
  10603. backgroundPosition: {
  10604. backgroundPositionX: true,
  10605. backgroundPositionY: true
  10606. },
  10607. border: {
  10608. borderWidth: true,
  10609. borderStyle: true,
  10610. borderColor: true
  10611. },
  10612. borderBottom: {
  10613. borderBottomWidth: true,
  10614. borderBottomStyle: true,
  10615. borderBottomColor: true
  10616. },
  10617. borderLeft: {
  10618. borderLeftWidth: true,
  10619. borderLeftStyle: true,
  10620. borderLeftColor: true
  10621. },
  10622. borderRight: {
  10623. borderRightWidth: true,
  10624. borderRightStyle: true,
  10625. borderRightColor: true
  10626. },
  10627. borderTop: {
  10628. borderTopWidth: true,
  10629. borderTopStyle: true,
  10630. borderTopColor: true
  10631. },
  10632. font: {
  10633. fontStyle: true,
  10634. fontVariant: true,
  10635. fontWeight: true,
  10636. fontSize: true,
  10637. lineHeight: true,
  10638. fontFamily: true
  10639. },
  10640. outline: {
  10641. outlineWidth: true,
  10642. outlineStyle: true,
  10643. outlineColor: true
  10644. }
  10645. };
  10646. var CSSProperty = {
  10647. isUnitlessNumber: isUnitlessNumber,
  10648. shorthandPropertyExpansions: shorthandPropertyExpansions
  10649. };
  10650. module.exports = CSSProperty;
  10651. /***/ },
  10652. /* 99 */
  10653. /***/ function(module, exports, __webpack_require__) {
  10654. /**
  10655. * Copyright (c) 2013-present, Facebook, Inc.
  10656. * All rights reserved.
  10657. *
  10658. * This source code is licensed under the BSD-style license found in the
  10659. * LICENSE file in the root directory of this source tree. An additional grant
  10660. * of patent rights can be found in the PATENTS file in the same directory.
  10661. *
  10662. * @typechecks
  10663. */
  10664. 'use strict';
  10665. var camelize = __webpack_require__(100);
  10666. var msPattern = /^-ms-/;
  10667. /**
  10668. * Camelcases a hyphenated CSS property name, for example:
  10669. *
  10670. * > camelizeStyleName('background-color')
  10671. * < "backgroundColor"
  10672. * > camelizeStyleName('-moz-transition')
  10673. * < "MozTransition"
  10674. * > camelizeStyleName('-ms-transition')
  10675. * < "msTransition"
  10676. *
  10677. * As Andi Smith suggests
  10678. * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
  10679. * is converted to lowercase `ms`.
  10680. *
  10681. * @param {string} string
  10682. * @return {string}
  10683. */
  10684. function camelizeStyleName(string) {
  10685. return camelize(string.replace(msPattern, 'ms-'));
  10686. }
  10687. module.exports = camelizeStyleName;
  10688. /***/ },
  10689. /* 100 */
  10690. /***/ function(module, exports) {
  10691. "use strict";
  10692. /**
  10693. * Copyright (c) 2013-present, Facebook, Inc.
  10694. * All rights reserved.
  10695. *
  10696. * This source code is licensed under the BSD-style license found in the
  10697. * LICENSE file in the root directory of this source tree. An additional grant
  10698. * of patent rights can be found in the PATENTS file in the same directory.
  10699. *
  10700. * @typechecks
  10701. */
  10702. var _hyphenPattern = /-(.)/g;
  10703. /**
  10704. * Camelcases a hyphenated string, for example:
  10705. *
  10706. * > camelize('background-color')
  10707. * < "backgroundColor"
  10708. *
  10709. * @param {string} string
  10710. * @return {string}
  10711. */
  10712. function camelize(string) {
  10713. return string.replace(_hyphenPattern, function (_, character) {
  10714. return character.toUpperCase();
  10715. });
  10716. }
  10717. module.exports = camelize;
  10718. /***/ },
  10719. /* 101 */
  10720. /***/ function(module, exports, __webpack_require__) {
  10721. /* WEBPACK VAR INJECTION */(function(process) {/**
  10722. * Copyright 2013-present, Facebook, Inc.
  10723. * All rights reserved.
  10724. *
  10725. * This source code is licensed under the BSD-style license found in the
  10726. * LICENSE file in the root directory of this source tree. An additional grant
  10727. * of patent rights can be found in the PATENTS file in the same directory.
  10728. *
  10729. */
  10730. 'use strict';
  10731. var CSSProperty = __webpack_require__(98);
  10732. var warning = __webpack_require__(13);
  10733. var isUnitlessNumber = CSSProperty.isUnitlessNumber;
  10734. var styleWarnings = {};
  10735. /**
  10736. * Convert a value into the proper css writable value. The style name `name`
  10737. * should be logical (no hyphens), as specified
  10738. * in `CSSProperty.isUnitlessNumber`.
  10739. *
  10740. * @param {string} name CSS property name such as `topMargin`.
  10741. * @param {*} value CSS property value such as `10px`.
  10742. * @param {ReactDOMComponent} component
  10743. * @return {string} Normalized style value with dimensions applied.
  10744. */
  10745. function dangerousStyleValue(name, value, component) {
  10746. // Note that we've removed escapeTextForBrowser() calls here since the
  10747. // whole string will be escaped when the attribute is injected into
  10748. // the markup. If you provide unsafe user data here they can inject
  10749. // arbitrary CSS which may be problematic (I couldn't repro this):
  10750. // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
  10751. // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
  10752. // This is not an XSS hole but instead a potential CSS injection issue
  10753. // which has lead to a greater discussion about how we're going to
  10754. // trust URLs moving forward. See #2115901
  10755. var isEmpty = value == null || typeof value === 'boolean' || value === '';
  10756. if (isEmpty) {
  10757. return '';
  10758. }
  10759. var isNonNumeric = isNaN(value);
  10760. if (isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
  10761. return '' + value; // cast to string
  10762. }
  10763. if (typeof value === 'string') {
  10764. if (process.env.NODE_ENV !== 'production') {
  10765. // Allow '0' to pass through without warning. 0 is already special and
  10766. // doesn't require units, so we don't need to warn about it.
  10767. if (component && value !== '0') {
  10768. var owner = component._currentElement._owner;
  10769. var ownerName = owner ? owner.getName() : null;
  10770. if (ownerName && !styleWarnings[ownerName]) {
  10771. styleWarnings[ownerName] = {};
  10772. }
  10773. var warned = false;
  10774. if (ownerName) {
  10775. var warnings = styleWarnings[ownerName];
  10776. warned = warnings[name];
  10777. if (!warned) {
  10778. warnings[name] = true;
  10779. }
  10780. }
  10781. if (!warned) {
  10782. 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;
  10783. }
  10784. }
  10785. }
  10786. value = value.trim();
  10787. }
  10788. return value + 'px';
  10789. }
  10790. module.exports = dangerousStyleValue;
  10791. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  10792. /***/ },
  10793. /* 102 */
  10794. /***/ function(module, exports, __webpack_require__) {
  10795. /**
  10796. * Copyright (c) 2013-present, Facebook, Inc.
  10797. * All rights reserved.
  10798. *
  10799. * This source code is licensed under the BSD-style license found in the
  10800. * LICENSE file in the root directory of this source tree. An additional grant
  10801. * of patent rights can be found in the PATENTS file in the same directory.
  10802. *
  10803. * @typechecks
  10804. */
  10805. 'use strict';
  10806. var hyphenate = __webpack_require__(103);
  10807. var msPattern = /^ms-/;
  10808. /**
  10809. * Hyphenates a camelcased CSS property name, for example:
  10810. *
  10811. * > hyphenateStyleName('backgroundColor')
  10812. * < "background-color"
  10813. * > hyphenateStyleName('MozTransition')
  10814. * < "-moz-transition"
  10815. * > hyphenateStyleName('msTransition')
  10816. * < "-ms-transition"
  10817. *
  10818. * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
  10819. * is converted to `-ms-`.
  10820. *
  10821. * @param {string} string
  10822. * @return {string}
  10823. */
  10824. function hyphenateStyleName(string) {
  10825. return hyphenate(string).replace(msPattern, '-ms-');
  10826. }
  10827. module.exports = hyphenateStyleName;
  10828. /***/ },
  10829. /* 103 */
  10830. /***/ function(module, exports) {
  10831. 'use strict';
  10832. /**
  10833. * Copyright (c) 2013-present, Facebook, Inc.
  10834. * All rights reserved.
  10835. *
  10836. * This source code is licensed under the BSD-style license found in the
  10837. * LICENSE file in the root directory of this source tree. An additional grant
  10838. * of patent rights can be found in the PATENTS file in the same directory.
  10839. *
  10840. * @typechecks
  10841. */
  10842. var _uppercasePattern = /([A-Z])/g;
  10843. /**
  10844. * Hyphenates a camelcased string, for example:
  10845. *
  10846. * > hyphenate('backgroundColor')
  10847. * < "background-color"
  10848. *
  10849. * For CSS style names, use `hyphenateStyleName` instead which works properly
  10850. * with all vendor prefixes, including `ms`.
  10851. *
  10852. * @param {string} string
  10853. * @return {string}
  10854. */
  10855. function hyphenate(string) {
  10856. return string.replace(_uppercasePattern, '-$1').toLowerCase();
  10857. }
  10858. module.exports = hyphenate;
  10859. /***/ },
  10860. /* 104 */
  10861. /***/ function(module, exports) {
  10862. /**
  10863. * Copyright (c) 2013-present, Facebook, Inc.
  10864. * All rights reserved.
  10865. *
  10866. * This source code is licensed under the BSD-style license found in the
  10867. * LICENSE file in the root directory of this source tree. An additional grant
  10868. * of patent rights can be found in the PATENTS file in the same directory.
  10869. *
  10870. *
  10871. * @typechecks static-only
  10872. */
  10873. 'use strict';
  10874. /**
  10875. * Memoizes the return value of a function that accepts one string argument.
  10876. */
  10877. function memoizeStringOnly(callback) {
  10878. var cache = {};
  10879. return function (string) {
  10880. if (!cache.hasOwnProperty(string)) {
  10881. cache[string] = callback.call(this, string);
  10882. }
  10883. return cache[string];
  10884. };
  10885. }
  10886. module.exports = memoizeStringOnly;
  10887. /***/ },
  10888. /* 105 */
  10889. /***/ function(module, exports, __webpack_require__) {
  10890. /* WEBPACK VAR INJECTION */(function(process) {/**
  10891. * Copyright 2013-present, Facebook, Inc.
  10892. * All rights reserved.
  10893. *
  10894. * This source code is licensed under the BSD-style license found in the
  10895. * LICENSE file in the root directory of this source tree. An additional grant
  10896. * of patent rights can be found in the PATENTS file in the same directory.
  10897. *
  10898. */
  10899. 'use strict';
  10900. var DOMProperty = __webpack_require__(38);
  10901. var ReactDOMComponentTree = __webpack_require__(36);
  10902. var ReactInstrumentation = __webpack_require__(64);
  10903. var quoteAttributeValueForBrowser = __webpack_require__(106);
  10904. var warning = __webpack_require__(13);
  10905. var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + DOMProperty.ATTRIBUTE_NAME_START_CHAR + '][' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$');
  10906. var illegalAttributeNameCache = {};
  10907. var validatedAttributeNameCache = {};
  10908. function isAttributeNameSafe(attributeName) {
  10909. if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
  10910. return true;
  10911. }
  10912. if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
  10913. return false;
  10914. }
  10915. if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
  10916. validatedAttributeNameCache[attributeName] = true;
  10917. return true;
  10918. }
  10919. illegalAttributeNameCache[attributeName] = true;
  10920. process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : void 0;
  10921. return false;
  10922. }
  10923. function shouldIgnoreValue(propertyInfo, value) {
  10924. return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;
  10925. }
  10926. /**
  10927. * Operations for dealing with DOM properties.
  10928. */
  10929. var DOMPropertyOperations = {
  10930. /**
  10931. * Creates markup for the ID property.
  10932. *
  10933. * @param {string} id Unescaped ID.
  10934. * @return {string} Markup string.
  10935. */
  10936. createMarkupForID: function (id) {
  10937. return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id);
  10938. },
  10939. setAttributeForID: function (node, id) {
  10940. node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id);
  10941. },
  10942. createMarkupForRoot: function () {
  10943. return DOMProperty.ROOT_ATTRIBUTE_NAME + '=""';
  10944. },
  10945. setAttributeForRoot: function (node) {
  10946. node.setAttribute(DOMProperty.ROOT_ATTRIBUTE_NAME, '');
  10947. },
  10948. /**
  10949. * Creates markup for a property.
  10950. *
  10951. * @param {string} name
  10952. * @param {*} value
  10953. * @return {?string} Markup string, or null if the property was invalid.
  10954. */
  10955. createMarkupForProperty: function (name, value) {
  10956. var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
  10957. if (propertyInfo) {
  10958. if (shouldIgnoreValue(propertyInfo, value)) {
  10959. return '';
  10960. }
  10961. var attributeName = propertyInfo.attributeName;
  10962. if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
  10963. return attributeName + '=""';
  10964. }
  10965. return attributeName + '=' + quoteAttributeValueForBrowser(value);
  10966. } else if (DOMProperty.isCustomAttribute(name)) {
  10967. if (value == null) {
  10968. return '';
  10969. }
  10970. return name + '=' + quoteAttributeValueForBrowser(value);
  10971. }
  10972. return null;
  10973. },
  10974. /**
  10975. * Creates markup for a custom property.
  10976. *
  10977. * @param {string} name
  10978. * @param {*} value
  10979. * @return {string} Markup string, or empty string if the property was invalid.
  10980. */
  10981. createMarkupForCustomAttribute: function (name, value) {
  10982. if (!isAttributeNameSafe(name) || value == null) {
  10983. return '';
  10984. }
  10985. return name + '=' + quoteAttributeValueForBrowser(value);
  10986. },
  10987. /**
  10988. * Sets the value for a property on a node.
  10989. *
  10990. * @param {DOMElement} node
  10991. * @param {string} name
  10992. * @param {*} value
  10993. */
  10994. setValueForProperty: function (node, name, value) {
  10995. var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
  10996. if (propertyInfo) {
  10997. var mutationMethod = propertyInfo.mutationMethod;
  10998. if (mutationMethod) {
  10999. mutationMethod(node, value);
  11000. } else if (shouldIgnoreValue(propertyInfo, value)) {
  11001. this.deleteValueForProperty(node, name);
  11002. return;
  11003. } else if (propertyInfo.mustUseProperty) {
  11004. // Contrary to `setAttribute`, object properties are properly
  11005. // `toString`ed by IE8/9.
  11006. node[propertyInfo.propertyName] = value;
  11007. } else {
  11008. var attributeName = propertyInfo.attributeName;
  11009. var namespace = propertyInfo.attributeNamespace;
  11010. // `setAttribute` with objects becomes only `[object]` in IE8/9,
  11011. // ('' + value) makes it output the correct toString()-value.
  11012. if (namespace) {
  11013. node.setAttributeNS(namespace, attributeName, '' + value);
  11014. } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
  11015. node.setAttribute(attributeName, '');
  11016. } else {
  11017. node.setAttribute(attributeName, '' + value);
  11018. }
  11019. }
  11020. } else if (DOMProperty.isCustomAttribute(name)) {
  11021. DOMPropertyOperations.setValueForAttribute(node, name, value);
  11022. return;
  11023. }
  11024. if (process.env.NODE_ENV !== 'production') {
  11025. var payload = {};
  11026. payload[name] = value;
  11027. ReactInstrumentation.debugTool.onHostOperation({
  11028. instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
  11029. type: 'update attribute',
  11030. payload: payload
  11031. });
  11032. }
  11033. },
  11034. setValueForAttribute: function (node, name, value) {
  11035. if (!isAttributeNameSafe(name)) {
  11036. return;
  11037. }
  11038. if (value == null) {
  11039. node.removeAttribute(name);
  11040. } else {
  11041. node.setAttribute(name, '' + value);
  11042. }
  11043. if (process.env.NODE_ENV !== 'production') {
  11044. var payload = {};
  11045. payload[name] = value;
  11046. ReactInstrumentation.debugTool.onHostOperation({
  11047. instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
  11048. type: 'update attribute',
  11049. payload: payload
  11050. });
  11051. }
  11052. },
  11053. /**
  11054. * Deletes an attributes from a node.
  11055. *
  11056. * @param {DOMElement} node
  11057. * @param {string} name
  11058. */
  11059. deleteValueForAttribute: function (node, name) {
  11060. node.removeAttribute(name);
  11061. if (process.env.NODE_ENV !== 'production') {
  11062. ReactInstrumentation.debugTool.onHostOperation({
  11063. instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
  11064. type: 'remove attribute',
  11065. payload: name
  11066. });
  11067. }
  11068. },
  11069. /**
  11070. * Deletes the value for a property on a node.
  11071. *
  11072. * @param {DOMElement} node
  11073. * @param {string} name
  11074. */
  11075. deleteValueForProperty: function (node, name) {
  11076. var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
  11077. if (propertyInfo) {
  11078. var mutationMethod = propertyInfo.mutationMethod;
  11079. if (mutationMethod) {
  11080. mutationMethod(node, undefined);
  11081. } else if (propertyInfo.mustUseProperty) {
  11082. var propName = propertyInfo.propertyName;
  11083. if (propertyInfo.hasBooleanValue) {
  11084. node[propName] = false;
  11085. } else {
  11086. node[propName] = '';
  11087. }
  11088. } else {
  11089. node.removeAttribute(propertyInfo.attributeName);
  11090. }
  11091. } else if (DOMProperty.isCustomAttribute(name)) {
  11092. node.removeAttribute(name);
  11093. }
  11094. if (process.env.NODE_ENV !== 'production') {
  11095. ReactInstrumentation.debugTool.onHostOperation({
  11096. instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
  11097. type: 'remove attribute',
  11098. payload: name
  11099. });
  11100. }
  11101. }
  11102. };
  11103. module.exports = DOMPropertyOperations;
  11104. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  11105. /***/ },
  11106. /* 106 */
  11107. /***/ function(module, exports, __webpack_require__) {
  11108. /**
  11109. * Copyright 2013-present, Facebook, Inc.
  11110. * All rights reserved.
  11111. *
  11112. * This source code is licensed under the BSD-style license found in the
  11113. * LICENSE file in the root directory of this source tree. An additional grant
  11114. * of patent rights can be found in the PATENTS file in the same directory.
  11115. *
  11116. */
  11117. 'use strict';
  11118. var escapeTextContentForBrowser = __webpack_require__(88);
  11119. /**
  11120. * Escapes attribute value to prevent scripting attacks.
  11121. *
  11122. * @param {*} value Value to escape.
  11123. * @return {string} An escaped string.
  11124. */
  11125. function quoteAttributeValueForBrowser(value) {
  11126. return '"' + escapeTextContentForBrowser(value) + '"';
  11127. }
  11128. module.exports = quoteAttributeValueForBrowser;
  11129. /***/ },
  11130. /* 107 */
  11131. /***/ function(module, exports, __webpack_require__) {
  11132. /**
  11133. * Copyright 2013-present, Facebook, Inc.
  11134. * All rights reserved.
  11135. *
  11136. * This source code is licensed under the BSD-style license found in the
  11137. * LICENSE file in the root directory of this source tree. An additional grant
  11138. * of patent rights can be found in the PATENTS file in the same directory.
  11139. *
  11140. */
  11141. 'use strict';
  11142. var _assign = __webpack_require__(6);
  11143. var EventPluginRegistry = __webpack_require__(45);
  11144. var ReactEventEmitterMixin = __webpack_require__(108);
  11145. var ViewportMetrics = __webpack_require__(78);
  11146. var getVendorPrefixedEventName = __webpack_require__(109);
  11147. var isEventSupported = __webpack_require__(72);
  11148. /**
  11149. * Summary of `ReactBrowserEventEmitter` event handling:
  11150. *
  11151. * - Top-level delegation is used to trap most native browser events. This
  11152. * may only occur in the main thread and is the responsibility of
  11153. * ReactEventListener, which is injected and can therefore support pluggable
  11154. * event sources. This is the only work that occurs in the main thread.
  11155. *
  11156. * - We normalize and de-duplicate events to account for browser quirks. This
  11157. * may be done in the worker thread.
  11158. *
  11159. * - Forward these native events (with the associated top-level type used to
  11160. * trap it) to `EventPluginHub`, which in turn will ask plugins if they want
  11161. * to extract any synthetic events.
  11162. *
  11163. * - The `EventPluginHub` will then process each event by annotating them with
  11164. * "dispatches", a sequence of listeners and IDs that care about that event.
  11165. *
  11166. * - The `EventPluginHub` then dispatches the events.
  11167. *
  11168. * Overview of React and the event system:
  11169. *
  11170. * +------------+ .
  11171. * | DOM | .
  11172. * +------------+ .
  11173. * | .
  11174. * v .
  11175. * +------------+ .
  11176. * | ReactEvent | .
  11177. * | Listener | .
  11178. * +------------+ . +-----------+
  11179. * | . +--------+|SimpleEvent|
  11180. * | . | |Plugin |
  11181. * +-----|------+ . v +-----------+
  11182. * | | | . +--------------+ +------------+
  11183. * | +-----------.--->|EventPluginHub| | Event |
  11184. * | | . | | +-----------+ | Propagators|
  11185. * | ReactEvent | . | | |TapEvent | |------------|
  11186. * | Emitter | . | |<---+|Plugin | |other plugin|
  11187. * | | . | | +-----------+ | utilities |
  11188. * | +-----------.--->| | +------------+
  11189. * | | | . +--------------+
  11190. * +-----|------+ . ^ +-----------+
  11191. * | . | |Enter/Leave|
  11192. * + . +-------+|Plugin |
  11193. * +-------------+ . +-----------+
  11194. * | application | .
  11195. * |-------------| .
  11196. * | | .
  11197. * | | .
  11198. * +-------------+ .
  11199. * .
  11200. * React Core . General Purpose Event Plugin System
  11201. */
  11202. var hasEventPageXY;
  11203. var alreadyListeningTo = {};
  11204. var isMonitoringScrollValue = false;
  11205. var reactTopListenersCounter = 0;
  11206. // For events like 'submit' which don't consistently bubble (which we trap at a
  11207. // lower node than `document`), binding at `document` would cause duplicate
  11208. // events so we don't include them here
  11209. var topEventMapping = {
  11210. topAbort: 'abort',
  11211. topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend',
  11212. topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration',
  11213. topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart',
  11214. topBlur: 'blur',
  11215. topCanPlay: 'canplay',
  11216. topCanPlayThrough: 'canplaythrough',
  11217. topChange: 'change',
  11218. topClick: 'click',
  11219. topCompositionEnd: 'compositionend',
  11220. topCompositionStart: 'compositionstart',
  11221. topCompositionUpdate: 'compositionupdate',
  11222. topContextMenu: 'contextmenu',
  11223. topCopy: 'copy',
  11224. topCut: 'cut',
  11225. topDoubleClick: 'dblclick',
  11226. topDrag: 'drag',
  11227. topDragEnd: 'dragend',
  11228. topDragEnter: 'dragenter',
  11229. topDragExit: 'dragexit',
  11230. topDragLeave: 'dragleave',
  11231. topDragOver: 'dragover',
  11232. topDragStart: 'dragstart',
  11233. topDrop: 'drop',
  11234. topDurationChange: 'durationchange',
  11235. topEmptied: 'emptied',
  11236. topEncrypted: 'encrypted',
  11237. topEnded: 'ended',
  11238. topError: 'error',
  11239. topFocus: 'focus',
  11240. topInput: 'input',
  11241. topKeyDown: 'keydown',
  11242. topKeyPress: 'keypress',
  11243. topKeyUp: 'keyup',
  11244. topLoadedData: 'loadeddata',
  11245. topLoadedMetadata: 'loadedmetadata',
  11246. topLoadStart: 'loadstart',
  11247. topMouseDown: 'mousedown',
  11248. topMouseMove: 'mousemove',
  11249. topMouseOut: 'mouseout',
  11250. topMouseOver: 'mouseover',
  11251. topMouseUp: 'mouseup',
  11252. topPaste: 'paste',
  11253. topPause: 'pause',
  11254. topPlay: 'play',
  11255. topPlaying: 'playing',
  11256. topProgress: 'progress',
  11257. topRateChange: 'ratechange',
  11258. topScroll: 'scroll',
  11259. topSeeked: 'seeked',
  11260. topSeeking: 'seeking',
  11261. topSelectionChange: 'selectionchange',
  11262. topStalled: 'stalled',
  11263. topSuspend: 'suspend',
  11264. topTextInput: 'textInput',
  11265. topTimeUpdate: 'timeupdate',
  11266. topTouchCancel: 'touchcancel',
  11267. topTouchEnd: 'touchend',
  11268. topTouchMove: 'touchmove',
  11269. topTouchStart: 'touchstart',
  11270. topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend',
  11271. topVolumeChange: 'volumechange',
  11272. topWaiting: 'waiting',
  11273. topWheel: 'wheel'
  11274. };
  11275. /**
  11276. * To ensure no conflicts with other potential React instances on the page
  11277. */
  11278. var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2);
  11279. function getListeningForDocument(mountAt) {
  11280. // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`
  11281. // directly.
  11282. if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
  11283. mountAt[topListenersIDKey] = reactTopListenersCounter++;
  11284. alreadyListeningTo[mountAt[topListenersIDKey]] = {};
  11285. }
  11286. return alreadyListeningTo[mountAt[topListenersIDKey]];
  11287. }
  11288. /**
  11289. * `ReactBrowserEventEmitter` is used to attach top-level event listeners. For
  11290. * example:
  11291. *
  11292. * EventPluginHub.putListener('myID', 'onClick', myFunction);
  11293. *
  11294. * This would allocate a "registration" of `('onClick', myFunction)` on 'myID'.
  11295. *
  11296. * @internal
  11297. */
  11298. var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, {
  11299. /**
  11300. * Injectable event backend
  11301. */
  11302. ReactEventListener: null,
  11303. injection: {
  11304. /**
  11305. * @param {object} ReactEventListener
  11306. */
  11307. injectReactEventListener: function (ReactEventListener) {
  11308. ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel);
  11309. ReactBrowserEventEmitter.ReactEventListener = ReactEventListener;
  11310. }
  11311. },
  11312. /**
  11313. * Sets whether or not any created callbacks should be enabled.
  11314. *
  11315. * @param {boolean} enabled True if callbacks should be enabled.
  11316. */
  11317. setEnabled: function (enabled) {
  11318. if (ReactBrowserEventEmitter.ReactEventListener) {
  11319. ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);
  11320. }
  11321. },
  11322. /**
  11323. * @return {boolean} True if callbacks are enabled.
  11324. */
  11325. isEnabled: function () {
  11326. return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled());
  11327. },
  11328. /**
  11329. * We listen for bubbled touch events on the document object.
  11330. *
  11331. * Firefox v8.01 (and possibly others) exhibited strange behavior when
  11332. * mounting `onmousemove` events at some node that was not the document
  11333. * element. The symptoms were that if your mouse is not moving over something
  11334. * contained within that mount point (for example on the background) the
  11335. * top-level listeners for `onmousemove` won't be called. However, if you
  11336. * register the `mousemove` on the document object, then it will of course
  11337. * catch all `mousemove`s. This along with iOS quirks, justifies restricting
  11338. * top-level listeners to the document object only, at least for these
  11339. * movement types of events and possibly all events.
  11340. *
  11341. * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
  11342. *
  11343. * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
  11344. * they bubble to document.
  11345. *
  11346. * @param {string} registrationName Name of listener (e.g. `onClick`).
  11347. * @param {object} contentDocumentHandle Document which owns the container
  11348. */
  11349. listenTo: function (registrationName, contentDocumentHandle) {
  11350. var mountAt = contentDocumentHandle;
  11351. var isListening = getListeningForDocument(mountAt);
  11352. var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName];
  11353. for (var i = 0; i < dependencies.length; i++) {
  11354. var dependency = dependencies[i];
  11355. if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
  11356. if (dependency === 'topWheel') {
  11357. if (isEventSupported('wheel')) {
  11358. ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'wheel', mountAt);
  11359. } else if (isEventSupported('mousewheel')) {
  11360. ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'mousewheel', mountAt);
  11361. } else {
  11362. // Firefox needs to capture a different mouse scroll event.
  11363. // @see http://www.quirksmode.org/dom/events/tests/scroll.html
  11364. ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'DOMMouseScroll', mountAt);
  11365. }
  11366. } else if (dependency === 'topScroll') {
  11367. if (isEventSupported('scroll', true)) {
  11368. ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topScroll', 'scroll', mountAt);
  11369. } else {
  11370. ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topScroll', 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE);
  11371. }
  11372. } else if (dependency === 'topFocus' || dependency === 'topBlur') {
  11373. if (isEventSupported('focus', true)) {
  11374. ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topFocus', 'focus', mountAt);
  11375. ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topBlur', 'blur', mountAt);
  11376. } else if (isEventSupported('focusin')) {
  11377. // IE has `focusin` and `focusout` events which bubble.
  11378. // @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html
  11379. ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topFocus', 'focusin', mountAt);
  11380. ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topBlur', 'focusout', mountAt);
  11381. }
  11382. // to make sure blur and focus event listeners are only attached once
  11383. isListening.topBlur = true;
  11384. isListening.topFocus = true;
  11385. } else if (topEventMapping.hasOwnProperty(dependency)) {
  11386. ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt);
  11387. }
  11388. isListening[dependency] = true;
  11389. }
  11390. }
  11391. },
  11392. trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
  11393. return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle);
  11394. },
  11395. trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
  11396. return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle);
  11397. },
  11398. /**
  11399. * Protect against document.createEvent() returning null
  11400. * Some popup blocker extensions appear to do this:
  11401. * https://github.com/facebook/react/issues/6887
  11402. */
  11403. supportsEventPageXY: function () {
  11404. if (!document.createEvent) {
  11405. return false;
  11406. }
  11407. var ev = document.createEvent('MouseEvent');
  11408. return ev != null && 'pageX' in ev;
  11409. },
  11410. /**
  11411. * Listens to window scroll and resize events. We cache scroll values so that
  11412. * application code can access them without triggering reflows.
  11413. *
  11414. * ViewportMetrics is only used by SyntheticMouse/TouchEvent and only when
  11415. * pageX/pageY isn't supported (legacy browsers).
  11416. *
  11417. * NOTE: Scroll events do not bubble.
  11418. *
  11419. * @see http://www.quirksmode.org/dom/events/scroll.html
  11420. */
  11421. ensureScrollValueMonitoring: function () {
  11422. if (hasEventPageXY === undefined) {
  11423. hasEventPageXY = ReactBrowserEventEmitter.supportsEventPageXY();
  11424. }
  11425. if (!hasEventPageXY && !isMonitoringScrollValue) {
  11426. var refresh = ViewportMetrics.refreshScrollValues;
  11427. ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
  11428. isMonitoringScrollValue = true;
  11429. }
  11430. }
  11431. });
  11432. module.exports = ReactBrowserEventEmitter;
  11433. /***/ },
  11434. /* 108 */
  11435. /***/ function(module, exports, __webpack_require__) {
  11436. /**
  11437. * Copyright 2013-present, Facebook, Inc.
  11438. * All rights reserved.
  11439. *
  11440. * This source code is licensed under the BSD-style license found in the
  11441. * LICENSE file in the root directory of this source tree. An additional grant
  11442. * of patent rights can be found in the PATENTS file in the same directory.
  11443. *
  11444. */
  11445. 'use strict';
  11446. var EventPluginHub = __webpack_require__(44);
  11447. function runEventQueueInBatch(events) {
  11448. EventPluginHub.enqueueEvents(events);
  11449. EventPluginHub.processEventQueue(false);
  11450. }
  11451. var ReactEventEmitterMixin = {
  11452. /**
  11453. * Streams a fired top-level event to `EventPluginHub` where plugins have the
  11454. * opportunity to create `ReactEvent`s to be dispatched.
  11455. */
  11456. handleTopLevel: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  11457. var events = EventPluginHub.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
  11458. runEventQueueInBatch(events);
  11459. }
  11460. };
  11461. module.exports = ReactEventEmitterMixin;
  11462. /***/ },
  11463. /* 109 */
  11464. /***/ function(module, exports, __webpack_require__) {
  11465. /**
  11466. * Copyright 2013-present, Facebook, Inc.
  11467. * All rights reserved.
  11468. *
  11469. * This source code is licensed under the BSD-style license found in the
  11470. * LICENSE file in the root directory of this source tree. An additional grant
  11471. * of patent rights can be found in the PATENTS file in the same directory.
  11472. *
  11473. */
  11474. 'use strict';
  11475. var ExecutionEnvironment = __webpack_require__(50);
  11476. /**
  11477. * Generate a mapping of standard vendor prefixes using the defined style property and event name.
  11478. *
  11479. * @param {string} styleProp
  11480. * @param {string} eventName
  11481. * @returns {object}
  11482. */
  11483. function makePrefixMap(styleProp, eventName) {
  11484. var prefixes = {};
  11485. prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
  11486. prefixes['Webkit' + styleProp] = 'webkit' + eventName;
  11487. prefixes['Moz' + styleProp] = 'moz' + eventName;
  11488. prefixes['ms' + styleProp] = 'MS' + eventName;
  11489. prefixes['O' + styleProp] = 'o' + eventName.toLowerCase();
  11490. return prefixes;
  11491. }
  11492. /**
  11493. * A list of event names to a configurable list of vendor prefixes.
  11494. */
  11495. var vendorPrefixes = {
  11496. animationend: makePrefixMap('Animation', 'AnimationEnd'),
  11497. animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
  11498. animationstart: makePrefixMap('Animation', 'AnimationStart'),
  11499. transitionend: makePrefixMap('Transition', 'TransitionEnd')
  11500. };
  11501. /**
  11502. * Event names that have already been detected and prefixed (if applicable).
  11503. */
  11504. var prefixedEventNames = {};
  11505. /**
  11506. * Element to check for prefixes on.
  11507. */
  11508. var style = {};
  11509. /**
  11510. * Bootstrap if a DOM exists.
  11511. */
  11512. if (ExecutionEnvironment.canUseDOM) {
  11513. style = document.createElement('div').style;
  11514. // On some platforms, in particular some releases of Android 4.x,
  11515. // the un-prefixed "animation" and "transition" properties are defined on the
  11516. // style object but the events that fire will still be prefixed, so we need
  11517. // to check if the un-prefixed events are usable, and if not remove them from the map.
  11518. if (!('AnimationEvent' in window)) {
  11519. delete vendorPrefixes.animationend.animation;
  11520. delete vendorPrefixes.animationiteration.animation;
  11521. delete vendorPrefixes.animationstart.animation;
  11522. }
  11523. // Same as above
  11524. if (!('TransitionEvent' in window)) {
  11525. delete vendorPrefixes.transitionend.transition;
  11526. }
  11527. }
  11528. /**
  11529. * Attempts to determine the correct vendor prefixed event name.
  11530. *
  11531. * @param {string} eventName
  11532. * @returns {string}
  11533. */
  11534. function getVendorPrefixedEventName(eventName) {
  11535. if (prefixedEventNames[eventName]) {
  11536. return prefixedEventNames[eventName];
  11537. } else if (!vendorPrefixes[eventName]) {
  11538. return eventName;
  11539. }
  11540. var prefixMap = vendorPrefixes[eventName];
  11541. for (var styleProp in prefixMap) {
  11542. if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
  11543. return prefixedEventNames[eventName] = prefixMap[styleProp];
  11544. }
  11545. }
  11546. return '';
  11547. }
  11548. module.exports = getVendorPrefixedEventName;
  11549. /***/ },
  11550. /* 110 */
  11551. /***/ function(module, exports, __webpack_require__) {
  11552. /* WEBPACK VAR INJECTION */(function(process) {/**
  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. */
  11561. 'use strict';
  11562. var _prodInvariant = __webpack_require__(37),
  11563. _assign = __webpack_require__(6);
  11564. var DOMPropertyOperations = __webpack_require__(105);
  11565. var LinkedValueUtils = __webpack_require__(111);
  11566. var ReactDOMComponentTree = __webpack_require__(36);
  11567. var ReactUpdates = __webpack_require__(58);
  11568. var invariant = __webpack_require__(10);
  11569. var warning = __webpack_require__(13);
  11570. var didWarnValueLink = false;
  11571. var didWarnCheckedLink = false;
  11572. var didWarnValueDefaultValue = false;
  11573. var didWarnCheckedDefaultChecked = false;
  11574. var didWarnControlledToUncontrolled = false;
  11575. var didWarnUncontrolledToControlled = false;
  11576. function forceUpdateIfMounted() {
  11577. if (this._rootNodeID) {
  11578. // DOM component is still mounted; update
  11579. ReactDOMInput.updateWrapper(this);
  11580. }
  11581. }
  11582. function isControlled(props) {
  11583. var usesChecked = props.type === 'checkbox' || props.type === 'radio';
  11584. return usesChecked ? props.checked != null : props.value != null;
  11585. }
  11586. /**
  11587. * Implements an <input> host component that allows setting these optional
  11588. * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
  11589. *
  11590. * If `checked` or `value` are not supplied (or null/undefined), user actions
  11591. * that affect the checked state or value will trigger updates to the element.
  11592. *
  11593. * If they are supplied (and not null/undefined), the rendered element will not
  11594. * trigger updates to the element. Instead, the props must change in order for
  11595. * the rendered element to be updated.
  11596. *
  11597. * The rendered element will be initialized as unchecked (or `defaultChecked`)
  11598. * with an empty value (or `defaultValue`).
  11599. *
  11600. * @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
  11601. */
  11602. var ReactDOMInput = {
  11603. getHostProps: function (inst, props) {
  11604. var value = LinkedValueUtils.getValue(props);
  11605. var checked = LinkedValueUtils.getChecked(props);
  11606. var hostProps = _assign({
  11607. // Make sure we set .type before any other properties (setting .value
  11608. // before .type means .value is lost in IE11 and below)
  11609. type: undefined,
  11610. // Make sure we set .step before .value (setting .value before .step
  11611. // means .value is rounded on mount, based upon step precision)
  11612. step: undefined,
  11613. // Make sure we set .min & .max before .value (to ensure proper order
  11614. // in corner cases such as min or max deriving from value, e.g. Issue #7170)
  11615. min: undefined,
  11616. max: undefined
  11617. }, props, {
  11618. defaultChecked: undefined,
  11619. defaultValue: undefined,
  11620. value: value != null ? value : inst._wrapperState.initialValue,
  11621. checked: checked != null ? checked : inst._wrapperState.initialChecked,
  11622. onChange: inst._wrapperState.onChange
  11623. });
  11624. return hostProps;
  11625. },
  11626. mountWrapper: function (inst, props) {
  11627. if (process.env.NODE_ENV !== 'production') {
  11628. LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner);
  11629. var owner = inst._currentElement._owner;
  11630. if (props.valueLink !== undefined && !didWarnValueLink) {
  11631. process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
  11632. didWarnValueLink = true;
  11633. }
  11634. if (props.checkedLink !== undefined && !didWarnCheckedLink) {
  11635. process.env.NODE_ENV !== 'production' ? warning(false, '`checkedLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
  11636. didWarnCheckedLink = true;
  11637. }
  11638. if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
  11639. 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;
  11640. didWarnCheckedDefaultChecked = true;
  11641. }
  11642. if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
  11643. 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;
  11644. didWarnValueDefaultValue = true;
  11645. }
  11646. }
  11647. var defaultValue = props.defaultValue;
  11648. inst._wrapperState = {
  11649. initialChecked: props.checked != null ? props.checked : props.defaultChecked,
  11650. initialValue: props.value != null ? props.value : defaultValue,
  11651. listeners: null,
  11652. onChange: _handleChange.bind(inst)
  11653. };
  11654. if (process.env.NODE_ENV !== 'production') {
  11655. inst._wrapperState.controlled = isControlled(props);
  11656. }
  11657. },
  11658. updateWrapper: function (inst) {
  11659. var props = inst._currentElement.props;
  11660. if (process.env.NODE_ENV !== 'production') {
  11661. var controlled = isControlled(props);
  11662. var owner = inst._currentElement._owner;
  11663. if (!inst._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
  11664. 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;
  11665. didWarnUncontrolledToControlled = true;
  11666. }
  11667. if (inst._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
  11668. 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;
  11669. didWarnControlledToUncontrolled = true;
  11670. }
  11671. }
  11672. // TODO: Shouldn't this be getChecked(props)?
  11673. var checked = props.checked;
  11674. if (checked != null) {
  11675. DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'checked', checked || false);
  11676. }
  11677. var node = ReactDOMComponentTree.getNodeFromInstance(inst);
  11678. var value = LinkedValueUtils.getValue(props);
  11679. if (value != null) {
  11680. // Cast `value` to a string to ensure the value is set correctly. While
  11681. // browsers typically do this as necessary, jsdom doesn't.
  11682. var newValue = '' + value;
  11683. // To avoid side effects (such as losing text selection), only set value if changed
  11684. if (newValue !== node.value) {
  11685. node.value = newValue;
  11686. }
  11687. } else {
  11688. if (props.value == null && props.defaultValue != null) {
  11689. // In Chrome, assigning defaultValue to certain input types triggers input validation.
  11690. // For number inputs, the display value loses trailing decimal points. For email inputs,
  11691. // Chrome raises "The specified value <x> is not a valid email address".
  11692. //
  11693. // Here we check to see if the defaultValue has actually changed, avoiding these problems
  11694. // when the user is inputting text
  11695. //
  11696. // https://github.com/facebook/react/issues/7253
  11697. if (node.defaultValue !== '' + props.defaultValue) {
  11698. node.defaultValue = '' + props.defaultValue;
  11699. }
  11700. }
  11701. if (props.checked == null && props.defaultChecked != null) {
  11702. node.defaultChecked = !!props.defaultChecked;
  11703. }
  11704. }
  11705. },
  11706. postMountWrapper: function (inst) {
  11707. var props = inst._currentElement.props;
  11708. // This is in postMount because we need access to the DOM node, which is not
  11709. // available until after the component has mounted.
  11710. var node = ReactDOMComponentTree.getNodeFromInstance(inst);
  11711. // Detach value from defaultValue. We won't do anything if we're working on
  11712. // submit or reset inputs as those values & defaultValues are linked. They
  11713. // are not resetable nodes so this operation doesn't matter and actually
  11714. // removes browser-default values (eg "Submit Query") when no value is
  11715. // provided.
  11716. switch (props.type) {
  11717. case 'submit':
  11718. case 'reset':
  11719. break;
  11720. case 'color':
  11721. case 'date':
  11722. case 'datetime':
  11723. case 'datetime-local':
  11724. case 'month':
  11725. case 'time':
  11726. case 'week':
  11727. // This fixes the no-show issue on iOS Safari and Android Chrome:
  11728. // https://github.com/facebook/react/issues/7233
  11729. node.value = '';
  11730. node.value = node.defaultValue;
  11731. break;
  11732. default:
  11733. node.value = node.value;
  11734. break;
  11735. }
  11736. // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
  11737. // this is needed to work around a chrome bug where setting defaultChecked
  11738. // will sometimes influence the value of checked (even after detachment).
  11739. // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416
  11740. // We need to temporarily unset name to avoid disrupting radio button groups.
  11741. var name = node.name;
  11742. if (name !== '') {
  11743. node.name = '';
  11744. }
  11745. node.defaultChecked = !node.defaultChecked;
  11746. node.defaultChecked = !node.defaultChecked;
  11747. if (name !== '') {
  11748. node.name = name;
  11749. }
  11750. }
  11751. };
  11752. function _handleChange(event) {
  11753. var props = this._currentElement.props;
  11754. var returnValue = LinkedValueUtils.executeOnChange(props, event);
  11755. // Here we use asap to wait until all updates have propagated, which
  11756. // is important when using controlled components within layers:
  11757. // https://github.com/facebook/react/issues/1698
  11758. ReactUpdates.asap(forceUpdateIfMounted, this);
  11759. var name = props.name;
  11760. if (props.type === 'radio' && name != null) {
  11761. var rootNode = ReactDOMComponentTree.getNodeFromInstance(this);
  11762. var queryRoot = rootNode;
  11763. while (queryRoot.parentNode) {
  11764. queryRoot = queryRoot.parentNode;
  11765. }
  11766. // If `rootNode.form` was non-null, then we could try `form.elements`,
  11767. // but that sometimes behaves strangely in IE8. We could also try using
  11768. // `form.getElementsByName`, but that will only return direct children
  11769. // and won't include inputs that use the HTML5 `form=` attribute. Since
  11770. // the input might not even be in a form, let's just use the global
  11771. // `querySelectorAll` to ensure we don't miss anything.
  11772. var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
  11773. for (var i = 0; i < group.length; i++) {
  11774. var otherNode = group[i];
  11775. if (otherNode === rootNode || otherNode.form !== rootNode.form) {
  11776. continue;
  11777. }
  11778. // This will throw if radio buttons rendered by different copies of React
  11779. // and the same name are rendered into the same form (same as #1939).
  11780. // That's probably okay; we don't support it just as we don't support
  11781. // mixing React radio buttons with non-React ones.
  11782. var otherInstance = ReactDOMComponentTree.getInstanceFromNode(otherNode);
  11783. !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;
  11784. // If this is a controlled radio button group, forcing the input that
  11785. // was previously checked to update will cause it to be come re-checked
  11786. // as appropriate.
  11787. ReactUpdates.asap(forceUpdateIfMounted, otherInstance);
  11788. }
  11789. }
  11790. return returnValue;
  11791. }
  11792. module.exports = ReactDOMInput;
  11793. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  11794. /***/ },
  11795. /* 111 */
  11796. /***/ function(module, exports, __webpack_require__) {
  11797. /* WEBPACK VAR INJECTION */(function(process) {/**
  11798. * Copyright 2013-present, Facebook, Inc.
  11799. * All rights reserved.
  11800. *
  11801. * This source code is licensed under the BSD-style license found in the
  11802. * LICENSE file in the root directory of this source tree. An additional grant
  11803. * of patent rights can be found in the PATENTS file in the same directory.
  11804. *
  11805. */
  11806. 'use strict';
  11807. var _prodInvariant = __webpack_require__(37);
  11808. var React = __webpack_require__(4);
  11809. var ReactPropTypesSecret = __webpack_require__(112);
  11810. var invariant = __webpack_require__(10);
  11811. var warning = __webpack_require__(13);
  11812. var hasReadOnlyValue = {
  11813. 'button': true,
  11814. 'checkbox': true,
  11815. 'image': true,
  11816. 'hidden': true,
  11817. 'radio': true,
  11818. 'reset': true,
  11819. 'submit': true
  11820. };
  11821. function _assertSingleLink(inputProps) {
  11822. !(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;
  11823. }
  11824. function _assertValueLink(inputProps) {
  11825. _assertSingleLink(inputProps);
  11826. !(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;
  11827. }
  11828. function _assertCheckedLink(inputProps) {
  11829. _assertSingleLink(inputProps);
  11830. !(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;
  11831. }
  11832. var propTypes = {
  11833. value: function (props, propName, componentName) {
  11834. if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) {
  11835. return null;
  11836. }
  11837. 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`.');
  11838. },
  11839. checked: function (props, propName, componentName) {
  11840. if (!props[propName] || props.onChange || props.readOnly || props.disabled) {
  11841. return null;
  11842. }
  11843. 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`.');
  11844. },
  11845. onChange: React.PropTypes.func
  11846. };
  11847. var loggedTypeFailures = {};
  11848. function getDeclarationErrorAddendum(owner) {
  11849. if (owner) {
  11850. var name = owner.getName();
  11851. if (name) {
  11852. return ' Check the render method of `' + name + '`.';
  11853. }
  11854. }
  11855. return '';
  11856. }
  11857. /**
  11858. * Provide a linked `value` attribute for controlled forms. You should not use
  11859. * this outside of the ReactDOM controlled form components.
  11860. */
  11861. var LinkedValueUtils = {
  11862. checkPropTypes: function (tagName, props, owner) {
  11863. for (var propName in propTypes) {
  11864. if (propTypes.hasOwnProperty(propName)) {
  11865. var error = propTypes[propName](props, propName, tagName, 'prop', null, ReactPropTypesSecret);
  11866. }
  11867. if (error instanceof Error && !(error.message in loggedTypeFailures)) {
  11868. // Only monitor this failure once because there tends to be a lot of the
  11869. // same error.
  11870. loggedTypeFailures[error.message] = true;
  11871. var addendum = getDeclarationErrorAddendum(owner);
  11872. process.env.NODE_ENV !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : void 0;
  11873. }
  11874. }
  11875. },
  11876. /**
  11877. * @param {object} inputProps Props for form component
  11878. * @return {*} current value of the input either from value prop or link.
  11879. */
  11880. getValue: function (inputProps) {
  11881. if (inputProps.valueLink) {
  11882. _assertValueLink(inputProps);
  11883. return inputProps.valueLink.value;
  11884. }
  11885. return inputProps.value;
  11886. },
  11887. /**
  11888. * @param {object} inputProps Props for form component
  11889. * @return {*} current checked status of the input either from checked prop
  11890. * or link.
  11891. */
  11892. getChecked: function (inputProps) {
  11893. if (inputProps.checkedLink) {
  11894. _assertCheckedLink(inputProps);
  11895. return inputProps.checkedLink.value;
  11896. }
  11897. return inputProps.checked;
  11898. },
  11899. /**
  11900. * @param {object} inputProps Props for form component
  11901. * @param {SyntheticEvent} event change event to handle
  11902. */
  11903. executeOnChange: function (inputProps, event) {
  11904. if (inputProps.valueLink) {
  11905. _assertValueLink(inputProps);
  11906. return inputProps.valueLink.requestChange(event.target.value);
  11907. } else if (inputProps.checkedLink) {
  11908. _assertCheckedLink(inputProps);
  11909. return inputProps.checkedLink.requestChange(event.target.checked);
  11910. } else if (inputProps.onChange) {
  11911. return inputProps.onChange.call(undefined, event);
  11912. }
  11913. }
  11914. };
  11915. module.exports = LinkedValueUtils;
  11916. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  11917. /***/ },
  11918. /* 112 */
  11919. /***/ function(module, exports) {
  11920. /**
  11921. * Copyright 2013-present, Facebook, Inc.
  11922. * All rights reserved.
  11923. *
  11924. * This source code is licensed under the BSD-style license found in the
  11925. * LICENSE file in the root directory of this source tree. An additional grant
  11926. * of patent rights can be found in the PATENTS file in the same directory.
  11927. *
  11928. *
  11929. */
  11930. 'use strict';
  11931. var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
  11932. module.exports = ReactPropTypesSecret;
  11933. /***/ },
  11934. /* 113 */
  11935. /***/ function(module, exports, __webpack_require__) {
  11936. /* WEBPACK VAR INJECTION */(function(process) {/**
  11937. * Copyright 2013-present, Facebook, Inc.
  11938. * All rights reserved.
  11939. *
  11940. * This source code is licensed under the BSD-style license found in the
  11941. * LICENSE file in the root directory of this source tree. An additional grant
  11942. * of patent rights can be found in the PATENTS file in the same directory.
  11943. *
  11944. */
  11945. 'use strict';
  11946. var _assign = __webpack_require__(6);
  11947. var React = __webpack_require__(4);
  11948. var ReactDOMComponentTree = __webpack_require__(36);
  11949. var ReactDOMSelect = __webpack_require__(114);
  11950. var warning = __webpack_require__(13);
  11951. var didWarnInvalidOptionChildren = false;
  11952. function flattenChildren(children) {
  11953. var content = '';
  11954. // Flatten children and warn if they aren't strings or numbers;
  11955. // invalid types are ignored.
  11956. React.Children.forEach(children, function (child) {
  11957. if (child == null) {
  11958. return;
  11959. }
  11960. if (typeof child === 'string' || typeof child === 'number') {
  11961. content += child;
  11962. } else if (!didWarnInvalidOptionChildren) {
  11963. didWarnInvalidOptionChildren = true;
  11964. process.env.NODE_ENV !== 'production' ? warning(false, 'Only strings and numbers are supported as <option> children.') : void 0;
  11965. }
  11966. });
  11967. return content;
  11968. }
  11969. /**
  11970. * Implements an <option> host component that warns when `selected` is set.
  11971. */
  11972. var ReactDOMOption = {
  11973. mountWrapper: function (inst, props, hostParent) {
  11974. // TODO (yungsters): Remove support for `selected` in <option>.
  11975. if (process.env.NODE_ENV !== 'production') {
  11976. 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;
  11977. }
  11978. // Look up whether this option is 'selected'
  11979. var selectValue = null;
  11980. if (hostParent != null) {
  11981. var selectParent = hostParent;
  11982. if (selectParent._tag === 'optgroup') {
  11983. selectParent = selectParent._hostParent;
  11984. }
  11985. if (selectParent != null && selectParent._tag === 'select') {
  11986. selectValue = ReactDOMSelect.getSelectValueContext(selectParent);
  11987. }
  11988. }
  11989. // If the value is null (e.g., no specified value or after initial mount)
  11990. // or missing (e.g., for <datalist>), we don't change props.selected
  11991. var selected = null;
  11992. if (selectValue != null) {
  11993. var value;
  11994. if (props.value != null) {
  11995. value = props.value + '';
  11996. } else {
  11997. value = flattenChildren(props.children);
  11998. }
  11999. selected = false;
  12000. if (Array.isArray(selectValue)) {
  12001. // multiple
  12002. for (var i = 0; i < selectValue.length; i++) {
  12003. if ('' + selectValue[i] === value) {
  12004. selected = true;
  12005. break;
  12006. }
  12007. }
  12008. } else {
  12009. selected = '' + selectValue === value;
  12010. }
  12011. }
  12012. inst._wrapperState = { selected: selected };
  12013. },
  12014. postMountWrapper: function (inst) {
  12015. // value="" should make a value attribute (#6219)
  12016. var props = inst._currentElement.props;
  12017. if (props.value != null) {
  12018. var node = ReactDOMComponentTree.getNodeFromInstance(inst);
  12019. node.setAttribute('value', props.value);
  12020. }
  12021. },
  12022. getHostProps: function (inst, props) {
  12023. var hostProps = _assign({ selected: undefined, children: undefined }, props);
  12024. // Read state only from initial mount because <select> updates value
  12025. // manually; we need the initial state only for server rendering
  12026. if (inst._wrapperState.selected != null) {
  12027. hostProps.selected = inst._wrapperState.selected;
  12028. }
  12029. var content = flattenChildren(props.children);
  12030. if (content) {
  12031. hostProps.children = content;
  12032. }
  12033. return hostProps;
  12034. }
  12035. };
  12036. module.exports = ReactDOMOption;
  12037. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  12038. /***/ },
  12039. /* 114 */
  12040. /***/ function(module, exports, __webpack_require__) {
  12041. /* WEBPACK VAR INJECTION */(function(process) {/**
  12042. * Copyright 2013-present, Facebook, Inc.
  12043. * All rights reserved.
  12044. *
  12045. * This source code is licensed under the BSD-style license found in the
  12046. * LICENSE file in the root directory of this source tree. An additional grant
  12047. * of patent rights can be found in the PATENTS file in the same directory.
  12048. *
  12049. */
  12050. 'use strict';
  12051. var _assign = __webpack_require__(6);
  12052. var LinkedValueUtils = __webpack_require__(111);
  12053. var ReactDOMComponentTree = __webpack_require__(36);
  12054. var ReactUpdates = __webpack_require__(58);
  12055. var warning = __webpack_require__(13);
  12056. var didWarnValueLink = false;
  12057. var didWarnValueDefaultValue = false;
  12058. function updateOptionsIfPendingUpdateAndMounted() {
  12059. if (this._rootNodeID && this._wrapperState.pendingUpdate) {
  12060. this._wrapperState.pendingUpdate = false;
  12061. var props = this._currentElement.props;
  12062. var value = LinkedValueUtils.getValue(props);
  12063. if (value != null) {
  12064. updateOptions(this, Boolean(props.multiple), value);
  12065. }
  12066. }
  12067. }
  12068. function getDeclarationErrorAddendum(owner) {
  12069. if (owner) {
  12070. var name = owner.getName();
  12071. if (name) {
  12072. return ' Check the render method of `' + name + '`.';
  12073. }
  12074. }
  12075. return '';
  12076. }
  12077. var valuePropNames = ['value', 'defaultValue'];
  12078. /**
  12079. * Validation function for `value` and `defaultValue`.
  12080. * @private
  12081. */
  12082. function checkSelectPropTypes(inst, props) {
  12083. var owner = inst._currentElement._owner;
  12084. LinkedValueUtils.checkPropTypes('select', props, owner);
  12085. if (props.valueLink !== undefined && !didWarnValueLink) {
  12086. process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;
  12087. didWarnValueLink = true;
  12088. }
  12089. for (var i = 0; i < valuePropNames.length; i++) {
  12090. var propName = valuePropNames[i];
  12091. if (props[propName] == null) {
  12092. continue;
  12093. }
  12094. var isArray = Array.isArray(props[propName]);
  12095. if (props.multiple && !isArray) {
  12096. 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;
  12097. } else if (!props.multiple && isArray) {
  12098. 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;
  12099. }
  12100. }
  12101. }
  12102. /**
  12103. * @param {ReactDOMComponent} inst
  12104. * @param {boolean} multiple
  12105. * @param {*} propValue A stringable (with `multiple`, a list of stringables).
  12106. * @private
  12107. */
  12108. function updateOptions(inst, multiple, propValue) {
  12109. var selectedValue, i;
  12110. var options = ReactDOMComponentTree.getNodeFromInstance(inst).options;
  12111. if (multiple) {
  12112. selectedValue = {};
  12113. for (i = 0; i < propValue.length; i++) {
  12114. selectedValue['' + propValue[i]] = true;
  12115. }
  12116. for (i = 0; i < options.length; i++) {
  12117. var selected = selectedValue.hasOwnProperty(options[i].value);
  12118. if (options[i].selected !== selected) {
  12119. options[i].selected = selected;
  12120. }
  12121. }
  12122. } else {
  12123. // Do not set `select.value` as exact behavior isn't consistent across all
  12124. // browsers for all cases.
  12125. selectedValue = '' + propValue;
  12126. for (i = 0; i < options.length; i++) {
  12127. if (options[i].value === selectedValue) {
  12128. options[i].selected = true;
  12129. return;
  12130. }
  12131. }
  12132. if (options.length) {
  12133. options[0].selected = true;
  12134. }
  12135. }
  12136. }
  12137. /**
  12138. * Implements a <select> host component that allows optionally setting the
  12139. * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
  12140. * stringable. If `multiple` is true, the prop must be an array of stringables.
  12141. *
  12142. * If `value` is not supplied (or null/undefined), user actions that change the
  12143. * selected option will trigger updates to the rendered options.
  12144. *
  12145. * If it is supplied (and not null/undefined), the rendered options will not
  12146. * update in response to user actions. Instead, the `value` prop must change in
  12147. * order for the rendered options to update.
  12148. *
  12149. * If `defaultValue` is provided, any options with the supplied values will be
  12150. * selected.
  12151. */
  12152. var ReactDOMSelect = {
  12153. getHostProps: function (inst, props) {
  12154. return _assign({}, props, {
  12155. onChange: inst._wrapperState.onChange,
  12156. value: undefined
  12157. });
  12158. },
  12159. mountWrapper: function (inst, props) {
  12160. if (process.env.NODE_ENV !== 'production') {
  12161. checkSelectPropTypes(inst, props);
  12162. }
  12163. var value = LinkedValueUtils.getValue(props);
  12164. inst._wrapperState = {
  12165. pendingUpdate: false,
  12166. initialValue: value != null ? value : props.defaultValue,
  12167. listeners: null,
  12168. onChange: _handleChange.bind(inst),
  12169. wasMultiple: Boolean(props.multiple)
  12170. };
  12171. if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
  12172. 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;
  12173. didWarnValueDefaultValue = true;
  12174. }
  12175. },
  12176. getSelectValueContext: function (inst) {
  12177. // ReactDOMOption looks at this initial value so the initial generated
  12178. // markup has correct `selected` attributes
  12179. return inst._wrapperState.initialValue;
  12180. },
  12181. postUpdateWrapper: function (inst) {
  12182. var props = inst._currentElement.props;
  12183. // After the initial mount, we control selected-ness manually so don't pass
  12184. // this value down
  12185. inst._wrapperState.initialValue = undefined;
  12186. var wasMultiple = inst._wrapperState.wasMultiple;
  12187. inst._wrapperState.wasMultiple = Boolean(props.multiple);
  12188. var value = LinkedValueUtils.getValue(props);
  12189. if (value != null) {
  12190. inst._wrapperState.pendingUpdate = false;
  12191. updateOptions(inst, Boolean(props.multiple), value);
  12192. } else if (wasMultiple !== Boolean(props.multiple)) {
  12193. // For simplicity, reapply `defaultValue` if `multiple` is toggled.
  12194. if (props.defaultValue != null) {
  12195. updateOptions(inst, Boolean(props.multiple), props.defaultValue);
  12196. } else {
  12197. // Revert the select back to its default unselected state.
  12198. updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : '');
  12199. }
  12200. }
  12201. }
  12202. };
  12203. function _handleChange(event) {
  12204. var props = this._currentElement.props;
  12205. var returnValue = LinkedValueUtils.executeOnChange(props, event);
  12206. if (this._rootNodeID) {
  12207. this._wrapperState.pendingUpdate = true;
  12208. }
  12209. ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this);
  12210. return returnValue;
  12211. }
  12212. module.exports = ReactDOMSelect;
  12213. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  12214. /***/ },
  12215. /* 115 */
  12216. /***/ function(module, exports, __webpack_require__) {
  12217. /* WEBPACK VAR INJECTION */(function(process) {/**
  12218. * Copyright 2013-present, Facebook, Inc.
  12219. * All rights reserved.
  12220. *
  12221. * This source code is licensed under the BSD-style license found in the
  12222. * LICENSE file in the root directory of this source tree. An additional grant
  12223. * of patent rights can be found in the PATENTS file in the same directory.
  12224. *
  12225. */
  12226. 'use strict';
  12227. var _prodInvariant = __webpack_require__(37),
  12228. _assign = __webpack_require__(6);
  12229. var LinkedValueUtils = __webpack_require__(111);
  12230. var ReactDOMComponentTree = __webpack_require__(36);
  12231. var ReactUpdates = __webpack_require__(58);
  12232. var invariant = __webpack_require__(10);
  12233. var warning = __webpack_require__(13);
  12234. var didWarnValueLink = false;
  12235. var didWarnValDefaultVal = false;
  12236. function forceUpdateIfMounted() {
  12237. if (this._rootNodeID) {
  12238. // DOM component is still mounted; update
  12239. ReactDOMTextarea.updateWrapper(this);
  12240. }
  12241. }
  12242. /**
  12243. * Implements a <textarea> host component that allows setting `value`, and
  12244. * `defaultValue`. This differs from the traditional DOM API because value is
  12245. * usually set as PCDATA children.
  12246. *
  12247. * If `value` is not supplied (or null/undefined), user actions that affect the
  12248. * value will trigger updates to the element.
  12249. *
  12250. * If `value` is supplied (and not null/undefined), the rendered element will
  12251. * not trigger updates to the element. Instead, the `value` prop must change in
  12252. * order for the rendered element to be updated.
  12253. *
  12254. * The rendered element will be initialized with an empty value, the prop
  12255. * `defaultValue` if specified, or the children content (deprecated).
  12256. */
  12257. var ReactDOMTextarea = {
  12258. getHostProps: function (inst, props) {
  12259. !(props.dangerouslySetInnerHTML == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : _prodInvariant('91') : void 0;
  12260. // Always set children to the same thing. In IE9, the selection range will
  12261. // get reset if `textContent` is mutated. We could add a check in setTextContent
  12262. // to only set the value if/when the value differs from the node value (which would
  12263. // completely solve this IE9 bug), but Sebastian+Ben seemed to like this solution.
  12264. // The value can be a boolean or object so that's why it's forced to be a string.
  12265. var hostProps = _assign({}, props, {
  12266. value: undefined,
  12267. defaultValue: undefined,
  12268. children: '' + inst._wrapperState.initialValue,
  12269. onChange: inst._wrapperState.onChange
  12270. });
  12271. return hostProps;
  12272. },
  12273. mountWrapper: function (inst, props) {
  12274. if (process.env.NODE_ENV !== 'production') {
  12275. LinkedValueUtils.checkPropTypes('textarea', props, inst._currentElement._owner);
  12276. if (props.valueLink !== undefined && !didWarnValueLink) {
  12277. process.env.NODE_ENV !== 'production' ? warning(false, '`valueLink` prop on `textarea` is deprecated; set `value` and `onChange` instead.') : void 0;
  12278. didWarnValueLink = true;
  12279. }
  12280. if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
  12281. 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;
  12282. didWarnValDefaultVal = true;
  12283. }
  12284. }
  12285. var value = LinkedValueUtils.getValue(props);
  12286. var initialValue = value;
  12287. // Only bother fetching default value if we're going to use it
  12288. if (value == null) {
  12289. var defaultValue = props.defaultValue;
  12290. // TODO (yungsters): Remove support for children content in <textarea>.
  12291. var children = props.children;
  12292. if (children != null) {
  12293. if (process.env.NODE_ENV !== 'production') {
  12294. process.env.NODE_ENV !== 'production' ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : void 0;
  12295. }
  12296. !(defaultValue == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : _prodInvariant('92') : void 0;
  12297. if (Array.isArray(children)) {
  12298. !(children.length <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, '<textarea> can only have at most one child.') : _prodInvariant('93') : void 0;
  12299. children = children[0];
  12300. }
  12301. defaultValue = '' + children;
  12302. }
  12303. if (defaultValue == null) {
  12304. defaultValue = '';
  12305. }
  12306. initialValue = defaultValue;
  12307. }
  12308. inst._wrapperState = {
  12309. initialValue: '' + initialValue,
  12310. listeners: null,
  12311. onChange: _handleChange.bind(inst)
  12312. };
  12313. },
  12314. updateWrapper: function (inst) {
  12315. var props = inst._currentElement.props;
  12316. var node = ReactDOMComponentTree.getNodeFromInstance(inst);
  12317. var value = LinkedValueUtils.getValue(props);
  12318. if (value != null) {
  12319. // Cast `value` to a string to ensure the value is set correctly. While
  12320. // browsers typically do this as necessary, jsdom doesn't.
  12321. var newValue = '' + value;
  12322. // To avoid side effects (such as losing text selection), only set value if changed
  12323. if (newValue !== node.value) {
  12324. node.value = newValue;
  12325. }
  12326. if (props.defaultValue == null) {
  12327. node.defaultValue = newValue;
  12328. }
  12329. }
  12330. if (props.defaultValue != null) {
  12331. node.defaultValue = props.defaultValue;
  12332. }
  12333. },
  12334. postMountWrapper: function (inst) {
  12335. // This is in postMount because we need access to the DOM node, which is not
  12336. // available until after the component has mounted.
  12337. var node = ReactDOMComponentTree.getNodeFromInstance(inst);
  12338. var textContent = node.textContent;
  12339. // Only set node.value if textContent is equal to the expected
  12340. // initial value. In IE10/IE11 there is a bug where the placeholder attribute
  12341. // will populate textContent as well.
  12342. // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/
  12343. if (textContent === inst._wrapperState.initialValue) {
  12344. node.value = textContent;
  12345. }
  12346. }
  12347. };
  12348. function _handleChange(event) {
  12349. var props = this._currentElement.props;
  12350. var returnValue = LinkedValueUtils.executeOnChange(props, event);
  12351. ReactUpdates.asap(forceUpdateIfMounted, this);
  12352. return returnValue;
  12353. }
  12354. module.exports = ReactDOMTextarea;
  12355. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  12356. /***/ },
  12357. /* 116 */
  12358. /***/ function(module, exports, __webpack_require__) {
  12359. /* WEBPACK VAR INJECTION */(function(process) {/**
  12360. * Copyright 2013-present, Facebook, Inc.
  12361. * All rights reserved.
  12362. *
  12363. * This source code is licensed under the BSD-style license found in the
  12364. * LICENSE file in the root directory of this source tree. An additional grant
  12365. * of patent rights can be found in the PATENTS file in the same directory.
  12366. *
  12367. */
  12368. 'use strict';
  12369. var _prodInvariant = __webpack_require__(37);
  12370. var ReactComponentEnvironment = __webpack_require__(117);
  12371. var ReactInstanceMap = __webpack_require__(118);
  12372. var ReactInstrumentation = __webpack_require__(64);
  12373. var ReactCurrentOwner = __webpack_require__(12);
  12374. var ReactReconciler = __webpack_require__(61);
  12375. var ReactChildReconciler = __webpack_require__(119);
  12376. var emptyFunction = __webpack_require__(14);
  12377. var flattenChildren = __webpack_require__(134);
  12378. var invariant = __webpack_require__(10);
  12379. /**
  12380. * Make an update for markup to be rendered and inserted at a supplied index.
  12381. *
  12382. * @param {string} markup Markup that renders into an element.
  12383. * @param {number} toIndex Destination index.
  12384. * @private
  12385. */
  12386. function makeInsertMarkup(markup, afterNode, toIndex) {
  12387. // NOTE: Null values reduce hidden classes.
  12388. return {
  12389. type: 'INSERT_MARKUP',
  12390. content: markup,
  12391. fromIndex: null,
  12392. fromNode: null,
  12393. toIndex: toIndex,
  12394. afterNode: afterNode
  12395. };
  12396. }
  12397. /**
  12398. * Make an update for moving an existing element to another index.
  12399. *
  12400. * @param {number} fromIndex Source index of the existing element.
  12401. * @param {number} toIndex Destination index of the element.
  12402. * @private
  12403. */
  12404. function makeMove(child, afterNode, toIndex) {
  12405. // NOTE: Null values reduce hidden classes.
  12406. return {
  12407. type: 'MOVE_EXISTING',
  12408. content: null,
  12409. fromIndex: child._mountIndex,
  12410. fromNode: ReactReconciler.getHostNode(child),
  12411. toIndex: toIndex,
  12412. afterNode: afterNode
  12413. };
  12414. }
  12415. /**
  12416. * Make an update for removing an element at an index.
  12417. *
  12418. * @param {number} fromIndex Index of the element to remove.
  12419. * @private
  12420. */
  12421. function makeRemove(child, node) {
  12422. // NOTE: Null values reduce hidden classes.
  12423. return {
  12424. type: 'REMOVE_NODE',
  12425. content: null,
  12426. fromIndex: child._mountIndex,
  12427. fromNode: node,
  12428. toIndex: null,
  12429. afterNode: null
  12430. };
  12431. }
  12432. /**
  12433. * Make an update for setting the markup of a node.
  12434. *
  12435. * @param {string} markup Markup that renders into an element.
  12436. * @private
  12437. */
  12438. function makeSetMarkup(markup) {
  12439. // NOTE: Null values reduce hidden classes.
  12440. return {
  12441. type: 'SET_MARKUP',
  12442. content: markup,
  12443. fromIndex: null,
  12444. fromNode: null,
  12445. toIndex: null,
  12446. afterNode: null
  12447. };
  12448. }
  12449. /**
  12450. * Make an update for setting the text content.
  12451. *
  12452. * @param {string} textContent Text content to set.
  12453. * @private
  12454. */
  12455. function makeTextContent(textContent) {
  12456. // NOTE: Null values reduce hidden classes.
  12457. return {
  12458. type: 'TEXT_CONTENT',
  12459. content: textContent,
  12460. fromIndex: null,
  12461. fromNode: null,
  12462. toIndex: null,
  12463. afterNode: null
  12464. };
  12465. }
  12466. /**
  12467. * Push an update, if any, onto the queue. Creates a new queue if none is
  12468. * passed and always returns the queue. Mutative.
  12469. */
  12470. function enqueue(queue, update) {
  12471. if (update) {
  12472. queue = queue || [];
  12473. queue.push(update);
  12474. }
  12475. return queue;
  12476. }
  12477. /**
  12478. * Processes any enqueued updates.
  12479. *
  12480. * @private
  12481. */
  12482. function processQueue(inst, updateQueue) {
  12483. ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);
  12484. }
  12485. var setChildrenForInstrumentation = emptyFunction;
  12486. if (process.env.NODE_ENV !== 'production') {
  12487. var getDebugID = function (inst) {
  12488. if (!inst._debugID) {
  12489. // Check for ART-like instances. TODO: This is silly/gross.
  12490. var internal;
  12491. if (internal = ReactInstanceMap.get(inst)) {
  12492. inst = internal;
  12493. }
  12494. }
  12495. return inst._debugID;
  12496. };
  12497. setChildrenForInstrumentation = function (children) {
  12498. var debugID = getDebugID(this);
  12499. // TODO: React Native empty components are also multichild.
  12500. // This means they still get into this method but don't have _debugID.
  12501. if (debugID !== 0) {
  12502. ReactInstrumentation.debugTool.onSetChildren(debugID, children ? Object.keys(children).map(function (key) {
  12503. return children[key]._debugID;
  12504. }) : []);
  12505. }
  12506. };
  12507. }
  12508. /**
  12509. * ReactMultiChild are capable of reconciling multiple children.
  12510. *
  12511. * @class ReactMultiChild
  12512. * @internal
  12513. */
  12514. var ReactMultiChild = {
  12515. /**
  12516. * Provides common functionality for components that must reconcile multiple
  12517. * children. This is used by `ReactDOMComponent` to mount, update, and
  12518. * unmount child components.
  12519. *
  12520. * @lends {ReactMultiChild.prototype}
  12521. */
  12522. Mixin: {
  12523. _reconcilerInstantiateChildren: function (nestedChildren, transaction, context) {
  12524. if (process.env.NODE_ENV !== 'production') {
  12525. var selfDebugID = getDebugID(this);
  12526. if (this._currentElement) {
  12527. try {
  12528. ReactCurrentOwner.current = this._currentElement._owner;
  12529. return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context, selfDebugID);
  12530. } finally {
  12531. ReactCurrentOwner.current = null;
  12532. }
  12533. }
  12534. }
  12535. return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
  12536. },
  12537. _reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context) {
  12538. var nextChildren;
  12539. var selfDebugID = 0;
  12540. if (process.env.NODE_ENV !== 'production') {
  12541. selfDebugID = getDebugID(this);
  12542. if (this._currentElement) {
  12543. try {
  12544. ReactCurrentOwner.current = this._currentElement._owner;
  12545. nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);
  12546. } finally {
  12547. ReactCurrentOwner.current = null;
  12548. }
  12549. ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);
  12550. return nextChildren;
  12551. }
  12552. }
  12553. nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);
  12554. ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);
  12555. return nextChildren;
  12556. },
  12557. /**
  12558. * Generates a "mount image" for each of the supplied children. In the case
  12559. * of `ReactDOMComponent`, a mount image is a string of markup.
  12560. *
  12561. * @param {?object} nestedChildren Nested child maps.
  12562. * @return {array} An array of mounted representations.
  12563. * @internal
  12564. */
  12565. mountChildren: function (nestedChildren, transaction, context) {
  12566. var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context);
  12567. this._renderedChildren = children;
  12568. var mountImages = [];
  12569. var index = 0;
  12570. for (var name in children) {
  12571. if (children.hasOwnProperty(name)) {
  12572. var child = children[name];
  12573. var selfDebugID = 0;
  12574. if (process.env.NODE_ENV !== 'production') {
  12575. selfDebugID = getDebugID(this);
  12576. }
  12577. var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._hostContainerInfo, context, selfDebugID);
  12578. child._mountIndex = index++;
  12579. mountImages.push(mountImage);
  12580. }
  12581. }
  12582. if (process.env.NODE_ENV !== 'production') {
  12583. setChildrenForInstrumentation.call(this, children);
  12584. }
  12585. return mountImages;
  12586. },
  12587. /**
  12588. * Replaces any rendered children with a text content string.
  12589. *
  12590. * @param {string} nextContent String of content.
  12591. * @internal
  12592. */
  12593. updateTextContent: function (nextContent) {
  12594. var prevChildren = this._renderedChildren;
  12595. // Remove any rendered children.
  12596. ReactChildReconciler.unmountChildren(prevChildren, false);
  12597. for (var name in prevChildren) {
  12598. if (prevChildren.hasOwnProperty(name)) {
  12599. true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0;
  12600. }
  12601. }
  12602. // Set new text content.
  12603. var updates = [makeTextContent(nextContent)];
  12604. processQueue(this, updates);
  12605. },
  12606. /**
  12607. * Replaces any rendered children with a markup string.
  12608. *
  12609. * @param {string} nextMarkup String of markup.
  12610. * @internal
  12611. */
  12612. updateMarkup: function (nextMarkup) {
  12613. var prevChildren = this._renderedChildren;
  12614. // Remove any rendered children.
  12615. ReactChildReconciler.unmountChildren(prevChildren, false);
  12616. for (var name in prevChildren) {
  12617. if (prevChildren.hasOwnProperty(name)) {
  12618. true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0;
  12619. }
  12620. }
  12621. var updates = [makeSetMarkup(nextMarkup)];
  12622. processQueue(this, updates);
  12623. },
  12624. /**
  12625. * Updates the rendered children with new children.
  12626. *
  12627. * @param {?object} nextNestedChildrenElements Nested child element maps.
  12628. * @param {ReactReconcileTransaction} transaction
  12629. * @internal
  12630. */
  12631. updateChildren: function (nextNestedChildrenElements, transaction, context) {
  12632. // Hook used by React ART
  12633. this._updateChildren(nextNestedChildrenElements, transaction, context);
  12634. },
  12635. /**
  12636. * @param {?object} nextNestedChildrenElements Nested child element maps.
  12637. * @param {ReactReconcileTransaction} transaction
  12638. * @final
  12639. * @protected
  12640. */
  12641. _updateChildren: function (nextNestedChildrenElements, transaction, context) {
  12642. var prevChildren = this._renderedChildren;
  12643. var removedNodes = {};
  12644. var mountImages = [];
  12645. var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context);
  12646. if (!nextChildren && !prevChildren) {
  12647. return;
  12648. }
  12649. var updates = null;
  12650. var name;
  12651. // `nextIndex` will increment for each child in `nextChildren`, but
  12652. // `lastIndex` will be the last index visited in `prevChildren`.
  12653. var nextIndex = 0;
  12654. var lastIndex = 0;
  12655. // `nextMountIndex` will increment for each newly mounted child.
  12656. var nextMountIndex = 0;
  12657. var lastPlacedNode = null;
  12658. for (name in nextChildren) {
  12659. if (!nextChildren.hasOwnProperty(name)) {
  12660. continue;
  12661. }
  12662. var prevChild = prevChildren && prevChildren[name];
  12663. var nextChild = nextChildren[name];
  12664. if (prevChild === nextChild) {
  12665. updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex));
  12666. lastIndex = Math.max(prevChild._mountIndex, lastIndex);
  12667. prevChild._mountIndex = nextIndex;
  12668. } else {
  12669. if (prevChild) {
  12670. // Update `lastIndex` before `_mountIndex` gets unset by unmounting.
  12671. lastIndex = Math.max(prevChild._mountIndex, lastIndex);
  12672. // The `removedNodes` loop below will actually remove the child.
  12673. }
  12674. // The child must be instantiated before it's mounted.
  12675. updates = enqueue(updates, this._mountChildAtIndex(nextChild, mountImages[nextMountIndex], lastPlacedNode, nextIndex, transaction, context));
  12676. nextMountIndex++;
  12677. }
  12678. nextIndex++;
  12679. lastPlacedNode = ReactReconciler.getHostNode(nextChild);
  12680. }
  12681. // Remove children that are no longer present.
  12682. for (name in removedNodes) {
  12683. if (removedNodes.hasOwnProperty(name)) {
  12684. updates = enqueue(updates, this._unmountChild(prevChildren[name], removedNodes[name]));
  12685. }
  12686. }
  12687. if (updates) {
  12688. processQueue(this, updates);
  12689. }
  12690. this._renderedChildren = nextChildren;
  12691. if (process.env.NODE_ENV !== 'production') {
  12692. setChildrenForInstrumentation.call(this, nextChildren);
  12693. }
  12694. },
  12695. /**
  12696. * Unmounts all rendered children. This should be used to clean up children
  12697. * when this component is unmounted. It does not actually perform any
  12698. * backend operations.
  12699. *
  12700. * @internal
  12701. */
  12702. unmountChildren: function (safely) {
  12703. var renderedChildren = this._renderedChildren;
  12704. ReactChildReconciler.unmountChildren(renderedChildren, safely);
  12705. this._renderedChildren = null;
  12706. },
  12707. /**
  12708. * Moves a child component to the supplied index.
  12709. *
  12710. * @param {ReactComponent} child Component to move.
  12711. * @param {number} toIndex Destination index of the element.
  12712. * @param {number} lastIndex Last index visited of the siblings of `child`.
  12713. * @protected
  12714. */
  12715. moveChild: function (child, afterNode, toIndex, lastIndex) {
  12716. // If the index of `child` is less than `lastIndex`, then it needs to
  12717. // be moved. Otherwise, we do not need to move it because a child will be
  12718. // inserted or moved before `child`.
  12719. if (child._mountIndex < lastIndex) {
  12720. return makeMove(child, afterNode, toIndex);
  12721. }
  12722. },
  12723. /**
  12724. * Creates a child component.
  12725. *
  12726. * @param {ReactComponent} child Component to create.
  12727. * @param {string} mountImage Markup to insert.
  12728. * @protected
  12729. */
  12730. createChild: function (child, afterNode, mountImage) {
  12731. return makeInsertMarkup(mountImage, afterNode, child._mountIndex);
  12732. },
  12733. /**
  12734. * Removes a child component.
  12735. *
  12736. * @param {ReactComponent} child Child to remove.
  12737. * @protected
  12738. */
  12739. removeChild: function (child, node) {
  12740. return makeRemove(child, node);
  12741. },
  12742. /**
  12743. * Mounts a child with the supplied name.
  12744. *
  12745. * NOTE: This is part of `updateChildren` and is here for readability.
  12746. *
  12747. * @param {ReactComponent} child Component to mount.
  12748. * @param {string} name Name of the child.
  12749. * @param {number} index Index at which to insert the child.
  12750. * @param {ReactReconcileTransaction} transaction
  12751. * @private
  12752. */
  12753. _mountChildAtIndex: function (child, mountImage, afterNode, index, transaction, context) {
  12754. child._mountIndex = index;
  12755. return this.createChild(child, afterNode, mountImage);
  12756. },
  12757. /**
  12758. * Unmounts a rendered child.
  12759. *
  12760. * NOTE: This is part of `updateChildren` and is here for readability.
  12761. *
  12762. * @param {ReactComponent} child Component to unmount.
  12763. * @private
  12764. */
  12765. _unmountChild: function (child, node) {
  12766. var update = this.removeChild(child, node);
  12767. child._mountIndex = null;
  12768. return update;
  12769. }
  12770. }
  12771. };
  12772. module.exports = ReactMultiChild;
  12773. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  12774. /***/ },
  12775. /* 117 */
  12776. /***/ function(module, exports, __webpack_require__) {
  12777. /* WEBPACK VAR INJECTION */(function(process) {/**
  12778. * Copyright 2014-present, Facebook, Inc.
  12779. * All rights reserved.
  12780. *
  12781. * This source code is licensed under the BSD-style license found in the
  12782. * LICENSE file in the root directory of this source tree. An additional grant
  12783. * of patent rights can be found in the PATENTS file in the same directory.
  12784. *
  12785. *
  12786. */
  12787. 'use strict';
  12788. var _prodInvariant = __webpack_require__(37);
  12789. var invariant = __webpack_require__(10);
  12790. var injected = false;
  12791. var ReactComponentEnvironment = {
  12792. /**
  12793. * Optionally injectable hook for swapping out mount images in the middle of
  12794. * the tree.
  12795. */
  12796. replaceNodeWithMarkup: null,
  12797. /**
  12798. * Optionally injectable hook for processing a queue of child updates. Will
  12799. * later move into MultiChildComponents.
  12800. */
  12801. processChildrenUpdates: null,
  12802. injection: {
  12803. injectEnvironment: function (environment) {
  12804. !!injected ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : _prodInvariant('104') : void 0;
  12805. ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup;
  12806. ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates;
  12807. injected = true;
  12808. }
  12809. }
  12810. };
  12811. module.exports = ReactComponentEnvironment;
  12812. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  12813. /***/ },
  12814. /* 118 */
  12815. /***/ function(module, exports) {
  12816. /**
  12817. * Copyright 2013-present, Facebook, Inc.
  12818. * All rights reserved.
  12819. *
  12820. * This source code is licensed under the BSD-style license found in the
  12821. * LICENSE file in the root directory of this source tree. An additional grant
  12822. * of patent rights can be found in the PATENTS file in the same directory.
  12823. *
  12824. */
  12825. 'use strict';
  12826. /**
  12827. * `ReactInstanceMap` maintains a mapping from a public facing stateful
  12828. * instance (key) and the internal representation (value). This allows public
  12829. * methods to accept the user facing instance as an argument and map them back
  12830. * to internal methods.
  12831. */
  12832. // TODO: Replace this with ES6: var ReactInstanceMap = new Map();
  12833. var ReactInstanceMap = {
  12834. /**
  12835. * This API should be called `delete` but we'd have to make sure to always
  12836. * transform these to strings for IE support. When this transform is fully
  12837. * supported we can rename it.
  12838. */
  12839. remove: function (key) {
  12840. key._reactInternalInstance = undefined;
  12841. },
  12842. get: function (key) {
  12843. return key._reactInternalInstance;
  12844. },
  12845. has: function (key) {
  12846. return key._reactInternalInstance !== undefined;
  12847. },
  12848. set: function (key, value) {
  12849. key._reactInternalInstance = value;
  12850. }
  12851. };
  12852. module.exports = ReactInstanceMap;
  12853. /***/ },
  12854. /* 119 */
  12855. /***/ function(module, exports, __webpack_require__) {
  12856. /* WEBPACK VAR INJECTION */(function(process) {/**
  12857. * Copyright 2014-present, Facebook, Inc.
  12858. * All rights reserved.
  12859. *
  12860. * This source code is licensed under the BSD-style license found in the
  12861. * LICENSE file in the root directory of this source tree. An additional grant
  12862. * of patent rights can be found in the PATENTS file in the same directory.
  12863. *
  12864. */
  12865. 'use strict';
  12866. var ReactReconciler = __webpack_require__(61);
  12867. var instantiateReactComponent = __webpack_require__(120);
  12868. var KeyEscapeUtils = __webpack_require__(130);
  12869. var shouldUpdateReactComponent = __webpack_require__(126);
  12870. var traverseAllChildren = __webpack_require__(131);
  12871. var warning = __webpack_require__(13);
  12872. var ReactComponentTreeHook;
  12873. if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
  12874. // Temporary hack.
  12875. // Inline requires don't work well with Jest:
  12876. // https://github.com/facebook/react/issues/7240
  12877. // Remove the inline requires when we don't need them anymore:
  12878. // https://github.com/facebook/react/pull/7178
  12879. ReactComponentTreeHook = __webpack_require__(28);
  12880. }
  12881. function instantiateChild(childInstances, child, name, selfDebugID) {
  12882. // We found a component instance.
  12883. var keyUnique = childInstances[name] === undefined;
  12884. if (process.env.NODE_ENV !== 'production') {
  12885. if (!ReactComponentTreeHook) {
  12886. ReactComponentTreeHook = __webpack_require__(28);
  12887. }
  12888. if (!keyUnique) {
  12889. 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;
  12890. }
  12891. }
  12892. if (child != null && keyUnique) {
  12893. childInstances[name] = instantiateReactComponent(child, true);
  12894. }
  12895. }
  12896. /**
  12897. * ReactChildReconciler provides helpers for initializing or updating a set of
  12898. * children. Its output is suitable for passing it onto ReactMultiChild which
  12899. * does diffed reordering and insertion.
  12900. */
  12901. var ReactChildReconciler = {
  12902. /**
  12903. * Generates a "mount image" for each of the supplied children. In the case
  12904. * of `ReactDOMComponent`, a mount image is a string of markup.
  12905. *
  12906. * @param {?object} nestedChildNodes Nested child maps.
  12907. * @return {?object} A set of child instances.
  12908. * @internal
  12909. */
  12910. instantiateChildren: function (nestedChildNodes, transaction, context, selfDebugID // 0 in production and for roots
  12911. ) {
  12912. if (nestedChildNodes == null) {
  12913. return null;
  12914. }
  12915. var childInstances = {};
  12916. if (process.env.NODE_ENV !== 'production') {
  12917. traverseAllChildren(nestedChildNodes, function (childInsts, child, name) {
  12918. return instantiateChild(childInsts, child, name, selfDebugID);
  12919. }, childInstances);
  12920. } else {
  12921. traverseAllChildren(nestedChildNodes, instantiateChild, childInstances);
  12922. }
  12923. return childInstances;
  12924. },
  12925. /**
  12926. * Updates the rendered children and returns a new set of children.
  12927. *
  12928. * @param {?object} prevChildren Previously initialized set of children.
  12929. * @param {?object} nextChildren Flat child element maps.
  12930. * @param {ReactReconcileTransaction} transaction
  12931. * @param {object} context
  12932. * @return {?object} A new set of child instances.
  12933. * @internal
  12934. */
  12935. updateChildren: function (prevChildren, nextChildren, mountImages, removedNodes, transaction, hostParent, hostContainerInfo, context, selfDebugID // 0 in production and for roots
  12936. ) {
  12937. // We currently don't have a way to track moves here but if we use iterators
  12938. // instead of for..in we can zip the iterators and check if an item has
  12939. // moved.
  12940. // TODO: If nothing has changed, return the prevChildren object so that we
  12941. // can quickly bailout if nothing has changed.
  12942. if (!nextChildren && !prevChildren) {
  12943. return;
  12944. }
  12945. var name;
  12946. var prevChild;
  12947. for (name in nextChildren) {
  12948. if (!nextChildren.hasOwnProperty(name)) {
  12949. continue;
  12950. }
  12951. prevChild = prevChildren && prevChildren[name];
  12952. var prevElement = prevChild && prevChild._currentElement;
  12953. var nextElement = nextChildren[name];
  12954. if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) {
  12955. ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context);
  12956. nextChildren[name] = prevChild;
  12957. } else {
  12958. if (prevChild) {
  12959. removedNodes[name] = ReactReconciler.getHostNode(prevChild);
  12960. ReactReconciler.unmountComponent(prevChild, false);
  12961. }
  12962. // The child must be instantiated before it's mounted.
  12963. var nextChildInstance = instantiateReactComponent(nextElement, true);
  12964. nextChildren[name] = nextChildInstance;
  12965. // Creating mount image now ensures refs are resolved in right order
  12966. // (see https://github.com/facebook/react/pull/7101 for explanation).
  12967. var nextChildMountImage = ReactReconciler.mountComponent(nextChildInstance, transaction, hostParent, hostContainerInfo, context, selfDebugID);
  12968. mountImages.push(nextChildMountImage);
  12969. }
  12970. }
  12971. // Unmount children that are no longer present.
  12972. for (name in prevChildren) {
  12973. if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
  12974. prevChild = prevChildren[name];
  12975. removedNodes[name] = ReactReconciler.getHostNode(prevChild);
  12976. ReactReconciler.unmountComponent(prevChild, false);
  12977. }
  12978. }
  12979. },
  12980. /**
  12981. * Unmounts all rendered children. This should be used to clean up children
  12982. * when this component is unmounted.
  12983. *
  12984. * @param {?object} renderedChildren Previously initialized set of children.
  12985. * @internal
  12986. */
  12987. unmountChildren: function (renderedChildren, safely) {
  12988. for (var name in renderedChildren) {
  12989. if (renderedChildren.hasOwnProperty(name)) {
  12990. var renderedChild = renderedChildren[name];
  12991. ReactReconciler.unmountComponent(renderedChild, safely);
  12992. }
  12993. }
  12994. }
  12995. };
  12996. module.exports = ReactChildReconciler;
  12997. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  12998. /***/ },
  12999. /* 120 */
  13000. /***/ function(module, exports, __webpack_require__) {
  13001. /* WEBPACK VAR INJECTION */(function(process) {/**
  13002. * Copyright 2013-present, Facebook, Inc.
  13003. * All rights reserved.
  13004. *
  13005. * This source code is licensed under the BSD-style license found in the
  13006. * LICENSE file in the root directory of this source tree. An additional grant
  13007. * of patent rights can be found in the PATENTS file in the same directory.
  13008. *
  13009. */
  13010. 'use strict';
  13011. var _prodInvariant = __webpack_require__(37),
  13012. _assign = __webpack_require__(6);
  13013. var ReactCompositeComponent = __webpack_require__(121);
  13014. var ReactEmptyComponent = __webpack_require__(127);
  13015. var ReactHostComponent = __webpack_require__(128);
  13016. var getNextDebugID = __webpack_require__(129);
  13017. var invariant = __webpack_require__(10);
  13018. var warning = __webpack_require__(13);
  13019. // To avoid a cyclic dependency, we create the final class in this module
  13020. var ReactCompositeComponentWrapper = function (element) {
  13021. this.construct(element);
  13022. };
  13023. _assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent, {
  13024. _instantiateReactComponent: instantiateReactComponent
  13025. });
  13026. function getDeclarationErrorAddendum(owner) {
  13027. if (owner) {
  13028. var name = owner.getName();
  13029. if (name) {
  13030. return ' Check the render method of `' + name + '`.';
  13031. }
  13032. }
  13033. return '';
  13034. }
  13035. /**
  13036. * Check if the type reference is a known internal type. I.e. not a user
  13037. * provided composite type.
  13038. *
  13039. * @param {function} type
  13040. * @return {boolean} Returns true if this is a valid internal type.
  13041. */
  13042. function isInternalComponentType(type) {
  13043. return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function';
  13044. }
  13045. /**
  13046. * Given a ReactNode, create an instance that will actually be mounted.
  13047. *
  13048. * @param {ReactNode} node
  13049. * @param {boolean} shouldHaveDebugID
  13050. * @return {object} A new instance of the element's constructor.
  13051. * @protected
  13052. */
  13053. function instantiateReactComponent(node, shouldHaveDebugID) {
  13054. var instance;
  13055. if (node === null || node === false) {
  13056. instance = ReactEmptyComponent.create(instantiateReactComponent);
  13057. } else if (typeof node === 'object') {
  13058. var element = node;
  13059. var type = element.type;
  13060. if (typeof type !== 'function' && typeof type !== 'string') {
  13061. var info = '';
  13062. if (process.env.NODE_ENV !== 'production') {
  13063. if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
  13064. info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.';
  13065. }
  13066. }
  13067. info += getDeclarationErrorAddendum(element._owner);
  13068. true ? 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', type == null ? type : typeof type, info) : _prodInvariant('130', type == null ? type : typeof type, info) : void 0;
  13069. }
  13070. // Special case string values
  13071. if (typeof element.type === 'string') {
  13072. instance = ReactHostComponent.createInternalComponent(element);
  13073. } else if (isInternalComponentType(element.type)) {
  13074. // This is temporarily available for custom components that are not string
  13075. // representations. I.e. ART. Once those are updated to use the string
  13076. // representation, we can drop this code path.
  13077. instance = new element.type(element);
  13078. // We renamed this. Allow the old name for compat. :(
  13079. if (!instance.getHostNode) {
  13080. instance.getHostNode = instance.getNativeNode;
  13081. }
  13082. } else {
  13083. instance = new ReactCompositeComponentWrapper(element);
  13084. }
  13085. } else if (typeof node === 'string' || typeof node === 'number') {
  13086. instance = ReactHostComponent.createInstanceForText(node);
  13087. } else {
  13088. true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : _prodInvariant('131', typeof node) : void 0;
  13089. }
  13090. if (process.env.NODE_ENV !== 'production') {
  13091. 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;
  13092. }
  13093. // These two fields are used by the DOM and ART diffing algorithms
  13094. // respectively. Instead of using expandos on components, we should be
  13095. // storing the state needed by the diffing algorithms elsewhere.
  13096. instance._mountIndex = 0;
  13097. instance._mountImage = null;
  13098. if (process.env.NODE_ENV !== 'production') {
  13099. instance._debugID = shouldHaveDebugID ? getNextDebugID() : 0;
  13100. }
  13101. // Internal instances should fully constructed at this point, so they should
  13102. // not get any new fields added to them at this point.
  13103. if (process.env.NODE_ENV !== 'production') {
  13104. if (Object.preventExtensions) {
  13105. Object.preventExtensions(instance);
  13106. }
  13107. }
  13108. return instance;
  13109. }
  13110. module.exports = instantiateReactComponent;
  13111. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  13112. /***/ },
  13113. /* 121 */
  13114. /***/ function(module, exports, __webpack_require__) {
  13115. /* WEBPACK VAR INJECTION */(function(process) {/**
  13116. * Copyright 2013-present, Facebook, Inc.
  13117. * All rights reserved.
  13118. *
  13119. * This source code is licensed under the BSD-style license found in the
  13120. * LICENSE file in the root directory of this source tree. An additional grant
  13121. * of patent rights can be found in the PATENTS file in the same directory.
  13122. *
  13123. */
  13124. 'use strict';
  13125. var _prodInvariant = __webpack_require__(37),
  13126. _assign = __webpack_require__(6);
  13127. var React = __webpack_require__(4);
  13128. var ReactComponentEnvironment = __webpack_require__(117);
  13129. var ReactCurrentOwner = __webpack_require__(12);
  13130. var ReactErrorUtils = __webpack_require__(47);
  13131. var ReactInstanceMap = __webpack_require__(118);
  13132. var ReactInstrumentation = __webpack_require__(64);
  13133. var ReactNodeTypes = __webpack_require__(122);
  13134. var ReactReconciler = __webpack_require__(61);
  13135. if (process.env.NODE_ENV !== 'production') {
  13136. var checkReactTypeSpec = __webpack_require__(123);
  13137. }
  13138. var emptyObject = __webpack_require__(22);
  13139. var invariant = __webpack_require__(10);
  13140. var shallowEqual = __webpack_require__(125);
  13141. var shouldUpdateReactComponent = __webpack_require__(126);
  13142. var warning = __webpack_require__(13);
  13143. var CompositeTypes = {
  13144. ImpureClass: 0,
  13145. PureClass: 1,
  13146. StatelessFunctional: 2
  13147. };
  13148. function StatelessComponent(Component) {}
  13149. StatelessComponent.prototype.render = function () {
  13150. var Component = ReactInstanceMap.get(this)._currentElement.type;
  13151. var element = Component(this.props, this.context, this.updater);
  13152. warnIfInvalidElement(Component, element);
  13153. return element;
  13154. };
  13155. function warnIfInvalidElement(Component, element) {
  13156. if (process.env.NODE_ENV !== 'production') {
  13157. process.env.NODE_ENV !== 'production' ? warning(element === null || element === false || React.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;
  13158. process.env.NODE_ENV !== 'production' ? warning(!Component.childContextTypes, '%s(...): childContextTypes cannot be defined on a functional component.', Component.displayName || Component.name || 'Component') : void 0;
  13159. }
  13160. }
  13161. function shouldConstruct(Component) {
  13162. return !!(Component.prototype && Component.prototype.isReactComponent);
  13163. }
  13164. function isPureComponent(Component) {
  13165. return !!(Component.prototype && Component.prototype.isPureReactComponent);
  13166. }
  13167. // Separated into a function to contain deoptimizations caused by try/finally.
  13168. function measureLifeCyclePerf(fn, debugID, timerType) {
  13169. if (debugID === 0) {
  13170. // Top-level wrappers (see ReactMount) and empty components (see
  13171. // ReactDOMEmptyComponent) are invisible to hooks and devtools.
  13172. // Both are implementation details that should go away in the future.
  13173. return fn();
  13174. }
  13175. ReactInstrumentation.debugTool.onBeginLifeCycleTimer(debugID, timerType);
  13176. try {
  13177. return fn();
  13178. } finally {
  13179. ReactInstrumentation.debugTool.onEndLifeCycleTimer(debugID, timerType);
  13180. }
  13181. }
  13182. /**
  13183. * ------------------ The Life-Cycle of a Composite Component ------------------
  13184. *
  13185. * - constructor: Initialization of state. The instance is now retained.
  13186. * - componentWillMount
  13187. * - render
  13188. * - [children's constructors]
  13189. * - [children's componentWillMount and render]
  13190. * - [children's componentDidMount]
  13191. * - componentDidMount
  13192. *
  13193. * Update Phases:
  13194. * - componentWillReceiveProps (only called if parent updated)
  13195. * - shouldComponentUpdate
  13196. * - componentWillUpdate
  13197. * - render
  13198. * - [children's constructors or receive props phases]
  13199. * - componentDidUpdate
  13200. *
  13201. * - componentWillUnmount
  13202. * - [children's componentWillUnmount]
  13203. * - [children destroyed]
  13204. * - (destroyed): The instance is now blank, released by React and ready for GC.
  13205. *
  13206. * -----------------------------------------------------------------------------
  13207. */
  13208. /**
  13209. * An incrementing ID assigned to each component when it is mounted. This is
  13210. * used to enforce the order in which `ReactUpdates` updates dirty components.
  13211. *
  13212. * @private
  13213. */
  13214. var nextMountID = 1;
  13215. /**
  13216. * @lends {ReactCompositeComponent.prototype}
  13217. */
  13218. var ReactCompositeComponent = {
  13219. /**
  13220. * Base constructor for all composite component.
  13221. *
  13222. * @param {ReactElement} element
  13223. * @final
  13224. * @internal
  13225. */
  13226. construct: function (element) {
  13227. this._currentElement = element;
  13228. this._rootNodeID = 0;
  13229. this._compositeType = null;
  13230. this._instance = null;
  13231. this._hostParent = null;
  13232. this._hostContainerInfo = null;
  13233. // See ReactUpdateQueue
  13234. this._updateBatchNumber = null;
  13235. this._pendingElement = null;
  13236. this._pendingStateQueue = null;
  13237. this._pendingReplaceState = false;
  13238. this._pendingForceUpdate = false;
  13239. this._renderedNodeType = null;
  13240. this._renderedComponent = null;
  13241. this._context = null;
  13242. this._mountOrder = 0;
  13243. this._topLevelWrapper = null;
  13244. // See ReactUpdates and ReactUpdateQueue.
  13245. this._pendingCallbacks = null;
  13246. // ComponentWillUnmount shall only be called once
  13247. this._calledComponentWillUnmount = false;
  13248. if (process.env.NODE_ENV !== 'production') {
  13249. this._warnedAboutRefsInRender = false;
  13250. }
  13251. },
  13252. /**
  13253. * Initializes the component, renders markup, and registers event listeners.
  13254. *
  13255. * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
  13256. * @param {?object} hostParent
  13257. * @param {?object} hostContainerInfo
  13258. * @param {?object} context
  13259. * @return {?string} Rendered markup to be inserted into the DOM.
  13260. * @final
  13261. * @internal
  13262. */
  13263. mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
  13264. var _this = this;
  13265. this._context = context;
  13266. this._mountOrder = nextMountID++;
  13267. this._hostParent = hostParent;
  13268. this._hostContainerInfo = hostContainerInfo;
  13269. var publicProps = this._currentElement.props;
  13270. var publicContext = this._processContext(context);
  13271. var Component = this._currentElement.type;
  13272. var updateQueue = transaction.getUpdateQueue();
  13273. // Initialize the public class
  13274. var doConstruct = shouldConstruct(Component);
  13275. var inst = this._constructComponent(doConstruct, publicProps, publicContext, updateQueue);
  13276. var renderedElement;
  13277. // Support functional components
  13278. if (!doConstruct && (inst == null || inst.render == null)) {
  13279. renderedElement = inst;
  13280. warnIfInvalidElement(Component, renderedElement);
  13281. !(inst === null || inst === false || React.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;
  13282. inst = new StatelessComponent(Component);
  13283. this._compositeType = CompositeTypes.StatelessFunctional;
  13284. } else {
  13285. if (isPureComponent(Component)) {
  13286. this._compositeType = CompositeTypes.PureClass;
  13287. } else {
  13288. this._compositeType = CompositeTypes.ImpureClass;
  13289. }
  13290. }
  13291. if (process.env.NODE_ENV !== 'production') {
  13292. // This will throw later in _renderValidatedComponent, but add an early
  13293. // warning now to help debugging
  13294. if (inst.render == null) {
  13295. 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;
  13296. }
  13297. var propsMutated = inst.props !== publicProps;
  13298. var componentName = Component.displayName || Component.name || 'Component';
  13299. 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;
  13300. }
  13301. // These should be set up in the constructor, but as a convenience for
  13302. // simpler class abstractions, we set them up after the fact.
  13303. inst.props = publicProps;
  13304. inst.context = publicContext;
  13305. inst.refs = emptyObject;
  13306. inst.updater = updateQueue;
  13307. this._instance = inst;
  13308. // Store a reference from the instance back to the internal representation
  13309. ReactInstanceMap.set(inst, this);
  13310. if (process.env.NODE_ENV !== 'production') {
  13311. // Since plain JS classes are defined without any special initialization
  13312. // logic, we can not catch common errors early. Therefore, we have to
  13313. // catch them here, at initialization time, instead.
  13314. process.env.NODE_ENV !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved || inst.state, '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;
  13315. 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;
  13316. 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;
  13317. 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;
  13318. 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;
  13319. 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;
  13320. 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;
  13321. }
  13322. var initialState = inst.state;
  13323. if (initialState === undefined) {
  13324. inst.state = initialState = null;
  13325. }
  13326. !(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;
  13327. this._pendingStateQueue = null;
  13328. this._pendingReplaceState = false;
  13329. this._pendingForceUpdate = false;
  13330. var markup;
  13331. if (inst.unstable_handleError) {
  13332. markup = this.performInitialMountWithErrorHandling(renderedElement, hostParent, hostContainerInfo, transaction, context);
  13333. } else {
  13334. markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
  13335. }
  13336. if (inst.componentDidMount) {
  13337. if (process.env.NODE_ENV !== 'production') {
  13338. transaction.getReactMountReady().enqueue(function () {
  13339. measureLifeCyclePerf(function () {
  13340. return inst.componentDidMount();
  13341. }, _this._debugID, 'componentDidMount');
  13342. });
  13343. } else {
  13344. transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);
  13345. }
  13346. }
  13347. return markup;
  13348. },
  13349. _constructComponent: function (doConstruct, publicProps, publicContext, updateQueue) {
  13350. if (process.env.NODE_ENV !== 'production') {
  13351. ReactCurrentOwner.current = this;
  13352. try {
  13353. return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue);
  13354. } finally {
  13355. ReactCurrentOwner.current = null;
  13356. }
  13357. } else {
  13358. return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue);
  13359. }
  13360. },
  13361. _constructComponentWithoutOwner: function (doConstruct, publicProps, publicContext, updateQueue) {
  13362. var Component = this._currentElement.type;
  13363. if (doConstruct) {
  13364. if (process.env.NODE_ENV !== 'production') {
  13365. return measureLifeCyclePerf(function () {
  13366. return new Component(publicProps, publicContext, updateQueue);
  13367. }, this._debugID, 'ctor');
  13368. } else {
  13369. return new Component(publicProps, publicContext, updateQueue);
  13370. }
  13371. }
  13372. // This can still be an instance in case of factory components
  13373. // but we'll count this as time spent rendering as the more common case.
  13374. if (process.env.NODE_ENV !== 'production') {
  13375. return measureLifeCyclePerf(function () {
  13376. return Component(publicProps, publicContext, updateQueue);
  13377. }, this._debugID, 'render');
  13378. } else {
  13379. return Component(publicProps, publicContext, updateQueue);
  13380. }
  13381. },
  13382. performInitialMountWithErrorHandling: function (renderedElement, hostParent, hostContainerInfo, transaction, context) {
  13383. var markup;
  13384. var checkpoint = transaction.checkpoint();
  13385. try {
  13386. markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
  13387. } catch (e) {
  13388. // Roll back to checkpoint, handle error (which may add items to the transaction), and take a new checkpoint
  13389. transaction.rollback(checkpoint);
  13390. this._instance.unstable_handleError(e);
  13391. if (this._pendingStateQueue) {
  13392. this._instance.state = this._processPendingState(this._instance.props, this._instance.context);
  13393. }
  13394. checkpoint = transaction.checkpoint();
  13395. this._renderedComponent.unmountComponent(true);
  13396. transaction.rollback(checkpoint);
  13397. // Try again - we've informed the component about the error, so they can render an error message this time.
  13398. // If this throws again, the error will bubble up (and can be caught by a higher error boundary).
  13399. markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
  13400. }
  13401. return markup;
  13402. },
  13403. performInitialMount: function (renderedElement, hostParent, hostContainerInfo, transaction, context) {
  13404. var inst = this._instance;
  13405. var debugID = 0;
  13406. if (process.env.NODE_ENV !== 'production') {
  13407. debugID = this._debugID;
  13408. }
  13409. if (inst.componentWillMount) {
  13410. if (process.env.NODE_ENV !== 'production') {
  13411. measureLifeCyclePerf(function () {
  13412. return inst.componentWillMount();
  13413. }, debugID, 'componentWillMount');
  13414. } else {
  13415. inst.componentWillMount();
  13416. }
  13417. // When mounting, calls to `setState` by `componentWillMount` will set
  13418. // `this._pendingStateQueue` without triggering a re-render.
  13419. if (this._pendingStateQueue) {
  13420. inst.state = this._processPendingState(inst.props, inst.context);
  13421. }
  13422. }
  13423. // If not a stateless component, we now render
  13424. if (renderedElement === undefined) {
  13425. renderedElement = this._renderValidatedComponent();
  13426. }
  13427. var nodeType = ReactNodeTypes.getType(renderedElement);
  13428. this._renderedNodeType = nodeType;
  13429. var child = this._instantiateReactComponent(renderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */
  13430. );
  13431. this._renderedComponent = child;
  13432. var markup = ReactReconciler.mountComponent(child, transaction, hostParent, hostContainerInfo, this._processChildContext(context), debugID);
  13433. if (process.env.NODE_ENV !== 'production') {
  13434. if (debugID !== 0) {
  13435. var childDebugIDs = child._debugID !== 0 ? [child._debugID] : [];
  13436. ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs);
  13437. }
  13438. }
  13439. return markup;
  13440. },
  13441. getHostNode: function () {
  13442. return ReactReconciler.getHostNode(this._renderedComponent);
  13443. },
  13444. /**
  13445. * Releases any resources allocated by `mountComponent`.
  13446. *
  13447. * @final
  13448. * @internal
  13449. */
  13450. unmountComponent: function (safely) {
  13451. if (!this._renderedComponent) {
  13452. return;
  13453. }
  13454. var inst = this._instance;
  13455. if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) {
  13456. inst._calledComponentWillUnmount = true;
  13457. if (safely) {
  13458. var name = this.getName() + '.componentWillUnmount()';
  13459. ReactErrorUtils.invokeGuardedCallback(name, inst.componentWillUnmount.bind(inst));
  13460. } else {
  13461. if (process.env.NODE_ENV !== 'production') {
  13462. measureLifeCyclePerf(function () {
  13463. return inst.componentWillUnmount();
  13464. }, this._debugID, 'componentWillUnmount');
  13465. } else {
  13466. inst.componentWillUnmount();
  13467. }
  13468. }
  13469. }
  13470. if (this._renderedComponent) {
  13471. ReactReconciler.unmountComponent(this._renderedComponent, safely);
  13472. this._renderedNodeType = null;
  13473. this._renderedComponent = null;
  13474. this._instance = null;
  13475. }
  13476. // Reset pending fields
  13477. // Even if this component is scheduled for another update in ReactUpdates,
  13478. // it would still be ignored because these fields are reset.
  13479. this._pendingStateQueue = null;
  13480. this._pendingReplaceState = false;
  13481. this._pendingForceUpdate = false;
  13482. this._pendingCallbacks = null;
  13483. this._pendingElement = null;
  13484. // These fields do not really need to be reset since this object is no
  13485. // longer accessible.
  13486. this._context = null;
  13487. this._rootNodeID = 0;
  13488. this._topLevelWrapper = null;
  13489. // Delete the reference from the instance to this internal representation
  13490. // which allow the internals to be properly cleaned up even if the user
  13491. // leaks a reference to the public instance.
  13492. ReactInstanceMap.remove(inst);
  13493. // Some existing components rely on inst.props even after they've been
  13494. // destroyed (in event handlers).
  13495. // TODO: inst.props = null;
  13496. // TODO: inst.state = null;
  13497. // TODO: inst.context = null;
  13498. },
  13499. /**
  13500. * Filters the context object to only contain keys specified in
  13501. * `contextTypes`
  13502. *
  13503. * @param {object} context
  13504. * @return {?object}
  13505. * @private
  13506. */
  13507. _maskContext: function (context) {
  13508. var Component = this._currentElement.type;
  13509. var contextTypes = Component.contextTypes;
  13510. if (!contextTypes) {
  13511. return emptyObject;
  13512. }
  13513. var maskedContext = {};
  13514. for (var contextName in contextTypes) {
  13515. maskedContext[contextName] = context[contextName];
  13516. }
  13517. return maskedContext;
  13518. },
  13519. /**
  13520. * Filters the context object to only contain keys specified in
  13521. * `contextTypes`, and asserts that they are valid.
  13522. *
  13523. * @param {object} context
  13524. * @return {?object}
  13525. * @private
  13526. */
  13527. _processContext: function (context) {
  13528. var maskedContext = this._maskContext(context);
  13529. if (process.env.NODE_ENV !== 'production') {
  13530. var Component = this._currentElement.type;
  13531. if (Component.contextTypes) {
  13532. this._checkContextTypes(Component.contextTypes, maskedContext, 'context');
  13533. }
  13534. }
  13535. return maskedContext;
  13536. },
  13537. /**
  13538. * @param {object} currentContext
  13539. * @return {object}
  13540. * @private
  13541. */
  13542. _processChildContext: function (currentContext) {
  13543. var Component = this._currentElement.type;
  13544. var inst = this._instance;
  13545. var childContext;
  13546. if (inst.getChildContext) {
  13547. if (process.env.NODE_ENV !== 'production') {
  13548. ReactInstrumentation.debugTool.onBeginProcessingChildContext();
  13549. try {
  13550. childContext = inst.getChildContext();
  13551. } finally {
  13552. ReactInstrumentation.debugTool.onEndProcessingChildContext();
  13553. }
  13554. } else {
  13555. childContext = inst.getChildContext();
  13556. }
  13557. }
  13558. if (childContext) {
  13559. !(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;
  13560. if (process.env.NODE_ENV !== 'production') {
  13561. this._checkContextTypes(Component.childContextTypes, childContext, 'childContext');
  13562. }
  13563. for (var name in childContext) {
  13564. !(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;
  13565. }
  13566. return _assign({}, currentContext, childContext);
  13567. }
  13568. return currentContext;
  13569. },
  13570. /**
  13571. * Assert that the context types are valid
  13572. *
  13573. * @param {object} typeSpecs Map of context field to a ReactPropType
  13574. * @param {object} values Runtime values that need to be type-checked
  13575. * @param {string} location e.g. "prop", "context", "child context"
  13576. * @private
  13577. */
  13578. _checkContextTypes: function (typeSpecs, values, location) {
  13579. if (process.env.NODE_ENV !== 'production') {
  13580. checkReactTypeSpec(typeSpecs, values, location, this.getName(), null, this._debugID);
  13581. }
  13582. },
  13583. receiveComponent: function (nextElement, transaction, nextContext) {
  13584. var prevElement = this._currentElement;
  13585. var prevContext = this._context;
  13586. this._pendingElement = null;
  13587. this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext);
  13588. },
  13589. /**
  13590. * If any of `_pendingElement`, `_pendingStateQueue`, or `_pendingForceUpdate`
  13591. * is set, update the component.
  13592. *
  13593. * @param {ReactReconcileTransaction} transaction
  13594. * @internal
  13595. */
  13596. performUpdateIfNecessary: function (transaction) {
  13597. if (this._pendingElement != null) {
  13598. ReactReconciler.receiveComponent(this, this._pendingElement, transaction, this._context);
  13599. } else if (this._pendingStateQueue !== null || this._pendingForceUpdate) {
  13600. this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context);
  13601. } else {
  13602. this._updateBatchNumber = null;
  13603. }
  13604. },
  13605. /**
  13606. * Perform an update to a mounted component. The componentWillReceiveProps and
  13607. * shouldComponentUpdate methods are called, then (assuming the update isn't
  13608. * skipped) the remaining update lifecycle methods are called and the DOM
  13609. * representation is updated.
  13610. *
  13611. * By default, this implements React's rendering and reconciliation algorithm.
  13612. * Sophisticated clients may wish to override this.
  13613. *
  13614. * @param {ReactReconcileTransaction} transaction
  13615. * @param {ReactElement} prevParentElement
  13616. * @param {ReactElement} nextParentElement
  13617. * @internal
  13618. * @overridable
  13619. */
  13620. updateComponent: function (transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) {
  13621. var inst = this._instance;
  13622. !(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;
  13623. var willReceive = false;
  13624. var nextContext;
  13625. // Determine if the context has changed or not
  13626. if (this._context === nextUnmaskedContext) {
  13627. nextContext = inst.context;
  13628. } else {
  13629. nextContext = this._processContext(nextUnmaskedContext);
  13630. willReceive = true;
  13631. }
  13632. var prevProps = prevParentElement.props;
  13633. var nextProps = nextParentElement.props;
  13634. // Not a simple state update but a props update
  13635. if (prevParentElement !== nextParentElement) {
  13636. willReceive = true;
  13637. }
  13638. // An update here will schedule an update but immediately set
  13639. // _pendingStateQueue which will ensure that any state updates gets
  13640. // immediately reconciled instead of waiting for the next batch.
  13641. if (willReceive && inst.componentWillReceiveProps) {
  13642. if (process.env.NODE_ENV !== 'production') {
  13643. measureLifeCyclePerf(function () {
  13644. return inst.componentWillReceiveProps(nextProps, nextContext);
  13645. }, this._debugID, 'componentWillReceiveProps');
  13646. } else {
  13647. inst.componentWillReceiveProps(nextProps, nextContext);
  13648. }
  13649. }
  13650. var nextState = this._processPendingState(nextProps, nextContext);
  13651. var shouldUpdate = true;
  13652. if (!this._pendingForceUpdate) {
  13653. if (inst.shouldComponentUpdate) {
  13654. if (process.env.NODE_ENV !== 'production') {
  13655. shouldUpdate = measureLifeCyclePerf(function () {
  13656. return inst.shouldComponentUpdate(nextProps, nextState, nextContext);
  13657. }, this._debugID, 'shouldComponentUpdate');
  13658. } else {
  13659. shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext);
  13660. }
  13661. } else {
  13662. if (this._compositeType === CompositeTypes.PureClass) {
  13663. shouldUpdate = !shallowEqual(prevProps, nextProps) || !shallowEqual(inst.state, nextState);
  13664. }
  13665. }
  13666. }
  13667. if (process.env.NODE_ENV !== 'production') {
  13668. 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;
  13669. }
  13670. this._updateBatchNumber = null;
  13671. if (shouldUpdate) {
  13672. this._pendingForceUpdate = false;
  13673. // Will set `this.props`, `this.state` and `this.context`.
  13674. this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext);
  13675. } else {
  13676. // If it's determined that a component should not update, we still want
  13677. // to set props and state but we shortcut the rest of the update.
  13678. this._currentElement = nextParentElement;
  13679. this._context = nextUnmaskedContext;
  13680. inst.props = nextProps;
  13681. inst.state = nextState;
  13682. inst.context = nextContext;
  13683. }
  13684. },
  13685. _processPendingState: function (props, context) {
  13686. var inst = this._instance;
  13687. var queue = this._pendingStateQueue;
  13688. var replace = this._pendingReplaceState;
  13689. this._pendingReplaceState = false;
  13690. this._pendingStateQueue = null;
  13691. if (!queue) {
  13692. return inst.state;
  13693. }
  13694. if (replace && queue.length === 1) {
  13695. return queue[0];
  13696. }
  13697. var nextState = _assign({}, replace ? queue[0] : inst.state);
  13698. for (var i = replace ? 1 : 0; i < queue.length; i++) {
  13699. var partial = queue[i];
  13700. _assign(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial);
  13701. }
  13702. return nextState;
  13703. },
  13704. /**
  13705. * Merges new props and state, notifies delegate methods of update and
  13706. * performs update.
  13707. *
  13708. * @param {ReactElement} nextElement Next element
  13709. * @param {object} nextProps Next public object to set as properties.
  13710. * @param {?object} nextState Next object to set as state.
  13711. * @param {?object} nextContext Next public object to set as context.
  13712. * @param {ReactReconcileTransaction} transaction
  13713. * @param {?object} unmaskedContext
  13714. * @private
  13715. */
  13716. _performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) {
  13717. var _this2 = this;
  13718. var inst = this._instance;
  13719. var hasComponentDidUpdate = Boolean(inst.componentDidUpdate);
  13720. var prevProps;
  13721. var prevState;
  13722. var prevContext;
  13723. if (hasComponentDidUpdate) {
  13724. prevProps = inst.props;
  13725. prevState = inst.state;
  13726. prevContext = inst.context;
  13727. }
  13728. if (inst.componentWillUpdate) {
  13729. if (process.env.NODE_ENV !== 'production') {
  13730. measureLifeCyclePerf(function () {
  13731. return inst.componentWillUpdate(nextProps, nextState, nextContext);
  13732. }, this._debugID, 'componentWillUpdate');
  13733. } else {
  13734. inst.componentWillUpdate(nextProps, nextState, nextContext);
  13735. }
  13736. }
  13737. this._currentElement = nextElement;
  13738. this._context = unmaskedContext;
  13739. inst.props = nextProps;
  13740. inst.state = nextState;
  13741. inst.context = nextContext;
  13742. this._updateRenderedComponent(transaction, unmaskedContext);
  13743. if (hasComponentDidUpdate) {
  13744. if (process.env.NODE_ENV !== 'production') {
  13745. transaction.getReactMountReady().enqueue(function () {
  13746. measureLifeCyclePerf(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), _this2._debugID, 'componentDidUpdate');
  13747. });
  13748. } else {
  13749. transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst);
  13750. }
  13751. }
  13752. },
  13753. /**
  13754. * Call the component's `render` method and update the DOM accordingly.
  13755. *
  13756. * @param {ReactReconcileTransaction} transaction
  13757. * @internal
  13758. */
  13759. _updateRenderedComponent: function (transaction, context) {
  13760. var prevComponentInstance = this._renderedComponent;
  13761. var prevRenderedElement = prevComponentInstance._currentElement;
  13762. var nextRenderedElement = this._renderValidatedComponent();
  13763. var debugID = 0;
  13764. if (process.env.NODE_ENV !== 'production') {
  13765. debugID = this._debugID;
  13766. }
  13767. if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) {
  13768. ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context));
  13769. } else {
  13770. var oldHostNode = ReactReconciler.getHostNode(prevComponentInstance);
  13771. ReactReconciler.unmountComponent(prevComponentInstance, false);
  13772. var nodeType = ReactNodeTypes.getType(nextRenderedElement);
  13773. this._renderedNodeType = nodeType;
  13774. var child = this._instantiateReactComponent(nextRenderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */
  13775. );
  13776. this._renderedComponent = child;
  13777. var nextMarkup = ReactReconciler.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), debugID);
  13778. if (process.env.NODE_ENV !== 'production') {
  13779. if (debugID !== 0) {
  13780. var childDebugIDs = child._debugID !== 0 ? [child._debugID] : [];
  13781. ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs);
  13782. }
  13783. }
  13784. this._replaceNodeWithMarkup(oldHostNode, nextMarkup, prevComponentInstance);
  13785. }
  13786. },
  13787. /**
  13788. * Overridden in shallow rendering.
  13789. *
  13790. * @protected
  13791. */
  13792. _replaceNodeWithMarkup: function (oldHostNode, nextMarkup, prevInstance) {
  13793. ReactComponentEnvironment.replaceNodeWithMarkup(oldHostNode, nextMarkup, prevInstance);
  13794. },
  13795. /**
  13796. * @protected
  13797. */
  13798. _renderValidatedComponentWithoutOwnerOrContext: function () {
  13799. var inst = this._instance;
  13800. var renderedElement;
  13801. if (process.env.NODE_ENV !== 'production') {
  13802. renderedElement = measureLifeCyclePerf(function () {
  13803. return inst.render();
  13804. }, this._debugID, 'render');
  13805. } else {
  13806. renderedElement = inst.render();
  13807. }
  13808. if (process.env.NODE_ENV !== 'production') {
  13809. // We allow auto-mocks to proceed as if they're returning null.
  13810. if (renderedElement === undefined && inst.render._isMockFunction) {
  13811. // This is probably bad practice. Consider warning here and
  13812. // deprecating this convenience.
  13813. renderedElement = null;
  13814. }
  13815. }
  13816. return renderedElement;
  13817. },
  13818. /**
  13819. * @private
  13820. */
  13821. _renderValidatedComponent: function () {
  13822. var renderedElement;
  13823. if (process.env.NODE_ENV !== 'production' || this._compositeType !== CompositeTypes.StatelessFunctional) {
  13824. ReactCurrentOwner.current = this;
  13825. try {
  13826. renderedElement = this._renderValidatedComponentWithoutOwnerOrContext();
  13827. } finally {
  13828. ReactCurrentOwner.current = null;
  13829. }
  13830. } else {
  13831. renderedElement = this._renderValidatedComponentWithoutOwnerOrContext();
  13832. }
  13833. !(
  13834. // TODO: An `isValidNode` function would probably be more appropriate
  13835. renderedElement === null || renderedElement === false || React.isValidElement(renderedElement)) ? 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;
  13836. return renderedElement;
  13837. },
  13838. /**
  13839. * Lazily allocates the refs object and stores `component` as `ref`.
  13840. *
  13841. * @param {string} ref Reference name.
  13842. * @param {component} component Component to store as `ref`.
  13843. * @final
  13844. * @private
  13845. */
  13846. attachRef: function (ref, component) {
  13847. var inst = this.getPublicInstance();
  13848. !(inst != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Stateless function components cannot have refs.') : _prodInvariant('110') : void 0;
  13849. var publicComponentInstance = component.getPublicInstance();
  13850. if (process.env.NODE_ENV !== 'production') {
  13851. var componentName = component && component.getName ? component.getName() : 'a component';
  13852. process.env.NODE_ENV !== 'production' ? warning(publicComponentInstance != null || component._compositeType !== CompositeTypes.StatelessFunctional, '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;
  13853. }
  13854. var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs;
  13855. refs[ref] = publicComponentInstance;
  13856. },
  13857. /**
  13858. * Detaches a reference name.
  13859. *
  13860. * @param {string} ref Name to dereference.
  13861. * @final
  13862. * @private
  13863. */
  13864. detachRef: function (ref) {
  13865. var refs = this.getPublicInstance().refs;
  13866. delete refs[ref];
  13867. },
  13868. /**
  13869. * Get a text description of the component that can be used to identify it
  13870. * in error messages.
  13871. * @return {string} The name or null.
  13872. * @internal
  13873. */
  13874. getName: function () {
  13875. var type = this._currentElement.type;
  13876. var constructor = this._instance && this._instance.constructor;
  13877. return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null;
  13878. },
  13879. /**
  13880. * Get the publicly accessible representation of this component - i.e. what
  13881. * is exposed by refs and returned by render. Can be null for stateless
  13882. * components.
  13883. *
  13884. * @return {ReactComponent} the public component instance.
  13885. * @internal
  13886. */
  13887. getPublicInstance: function () {
  13888. var inst = this._instance;
  13889. if (this._compositeType === CompositeTypes.StatelessFunctional) {
  13890. return null;
  13891. }
  13892. return inst;
  13893. },
  13894. // Stub
  13895. _instantiateReactComponent: null
  13896. };
  13897. module.exports = ReactCompositeComponent;
  13898. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  13899. /***/ },
  13900. /* 122 */
  13901. /***/ function(module, exports, __webpack_require__) {
  13902. /* WEBPACK VAR INJECTION */(function(process) {/**
  13903. * Copyright 2013-present, Facebook, Inc.
  13904. * All rights reserved.
  13905. *
  13906. * This source code is licensed under the BSD-style license found in the
  13907. * LICENSE file in the root directory of this source tree. An additional grant
  13908. * of patent rights can be found in the PATENTS file in the same directory.
  13909. *
  13910. *
  13911. */
  13912. 'use strict';
  13913. var _prodInvariant = __webpack_require__(37);
  13914. var React = __webpack_require__(4);
  13915. var invariant = __webpack_require__(10);
  13916. var ReactNodeTypes = {
  13917. HOST: 0,
  13918. COMPOSITE: 1,
  13919. EMPTY: 2,
  13920. getType: function (node) {
  13921. if (node === null || node === false) {
  13922. return ReactNodeTypes.EMPTY;
  13923. } else if (React.isValidElement(node)) {
  13924. if (typeof node.type === 'function') {
  13925. return ReactNodeTypes.COMPOSITE;
  13926. } else {
  13927. return ReactNodeTypes.HOST;
  13928. }
  13929. }
  13930. true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unexpected node: %s', node) : _prodInvariant('26', node) : void 0;
  13931. }
  13932. };
  13933. module.exports = ReactNodeTypes;
  13934. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  13935. /***/ },
  13936. /* 123 */
  13937. /***/ function(module, exports, __webpack_require__) {
  13938. /* WEBPACK VAR INJECTION */(function(process) {/**
  13939. * Copyright 2013-present, Facebook, Inc.
  13940. * All rights reserved.
  13941. *
  13942. * This source code is licensed under the BSD-style license found in the
  13943. * LICENSE file in the root directory of this source tree. An additional grant
  13944. * of patent rights can be found in the PATENTS file in the same directory.
  13945. *
  13946. */
  13947. 'use strict';
  13948. var _prodInvariant = __webpack_require__(37);
  13949. var ReactPropTypeLocationNames = __webpack_require__(124);
  13950. var ReactPropTypesSecret = __webpack_require__(112);
  13951. var invariant = __webpack_require__(10);
  13952. var warning = __webpack_require__(13);
  13953. var ReactComponentTreeHook;
  13954. if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
  13955. // Temporary hack.
  13956. // Inline requires don't work well with Jest:
  13957. // https://github.com/facebook/react/issues/7240
  13958. // Remove the inline requires when we don't need them anymore:
  13959. // https://github.com/facebook/react/pull/7178
  13960. ReactComponentTreeHook = __webpack_require__(28);
  13961. }
  13962. var loggedTypeFailures = {};
  13963. /**
  13964. * Assert that the values match with the type specs.
  13965. * Error messages are memorized and will only be shown once.
  13966. *
  13967. * @param {object} typeSpecs Map of name to a ReactPropType
  13968. * @param {object} values Runtime values that need to be type-checked
  13969. * @param {string} location e.g. "prop", "context", "child context"
  13970. * @param {string} componentName Name of the component for error messages.
  13971. * @param {?object} element The React element that is being type-checked
  13972. * @param {?number} debugID The React component instance that is being type-checked
  13973. * @private
  13974. */
  13975. function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) {
  13976. for (var typeSpecName in typeSpecs) {
  13977. if (typeSpecs.hasOwnProperty(typeSpecName)) {
  13978. var error;
  13979. // Prop type validation may throw. In case they do, we don't want to
  13980. // fail the render phase where it didn't fail before. So we log it.
  13981. // After these have been cleaned up, we'll let them throw.
  13982. try {
  13983. // This is intentionally an invariant that gets caught. It's the same
  13984. // behavior as without this statement except with a better message.
  13985. !(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;
  13986. error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
  13987. } catch (ex) {
  13988. error = ex;
  13989. }
  13990. 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;
  13991. if (error instanceof Error && !(error.message in loggedTypeFailures)) {
  13992. // Only monitor this failure once because there tends to be a lot of the
  13993. // same error.
  13994. loggedTypeFailures[error.message] = true;
  13995. var componentStackInfo = '';
  13996. if (process.env.NODE_ENV !== 'production') {
  13997. if (!ReactComponentTreeHook) {
  13998. ReactComponentTreeHook = __webpack_require__(28);
  13999. }
  14000. if (debugID !== null) {
  14001. componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID);
  14002. } else if (element !== null) {
  14003. componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element);
  14004. }
  14005. }
  14006. process.env.NODE_ENV !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0;
  14007. }
  14008. }
  14009. }
  14010. }
  14011. module.exports = checkReactTypeSpec;
  14012. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  14013. /***/ },
  14014. /* 124 */
  14015. /***/ function(module, exports, __webpack_require__) {
  14016. /* WEBPACK VAR INJECTION */(function(process) {/**
  14017. * Copyright 2013-present, Facebook, Inc.
  14018. * All rights reserved.
  14019. *
  14020. * This source code is licensed under the BSD-style license found in the
  14021. * LICENSE file in the root directory of this source tree. An additional grant
  14022. * of patent rights can be found in the PATENTS file in the same directory.
  14023. *
  14024. *
  14025. */
  14026. 'use strict';
  14027. var ReactPropTypeLocationNames = {};
  14028. if (process.env.NODE_ENV !== 'production') {
  14029. ReactPropTypeLocationNames = {
  14030. prop: 'prop',
  14031. context: 'context',
  14032. childContext: 'child context'
  14033. };
  14034. }
  14035. module.exports = ReactPropTypeLocationNames;
  14036. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  14037. /***/ },
  14038. /* 125 */
  14039. /***/ function(module, exports) {
  14040. /**
  14041. * Copyright (c) 2013-present, Facebook, Inc.
  14042. * All rights reserved.
  14043. *
  14044. * This source code is licensed under the BSD-style license found in the
  14045. * LICENSE file in the root directory of this source tree. An additional grant
  14046. * of patent rights can be found in the PATENTS file in the same directory.
  14047. *
  14048. * @typechecks
  14049. *
  14050. */
  14051. /*eslint-disable no-self-compare */
  14052. 'use strict';
  14053. var hasOwnProperty = Object.prototype.hasOwnProperty;
  14054. /**
  14055. * inlined Object.is polyfill to avoid requiring consumers ship their own
  14056. * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
  14057. */
  14058. function is(x, y) {
  14059. // SameValue algorithm
  14060. if (x === y) {
  14061. // Steps 1-5, 7-10
  14062. // Steps 6.b-6.e: +0 != -0
  14063. // Added the nonzero y check to make Flow happy, but it is redundant
  14064. return x !== 0 || y !== 0 || 1 / x === 1 / y;
  14065. } else {
  14066. // Step 6.a: NaN == NaN
  14067. return x !== x && y !== y;
  14068. }
  14069. }
  14070. /**
  14071. * Performs equality by iterating through keys on an object and returning false
  14072. * when any key has values which are not strictly equal between the arguments.
  14073. * Returns true when the values of all keys are strictly equal.
  14074. */
  14075. function shallowEqual(objA, objB) {
  14076. if (is(objA, objB)) {
  14077. return true;
  14078. }
  14079. if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
  14080. return false;
  14081. }
  14082. var keysA = Object.keys(objA);
  14083. var keysB = Object.keys(objB);
  14084. if (keysA.length !== keysB.length) {
  14085. return false;
  14086. }
  14087. // Test for A's keys different from B.
  14088. for (var i = 0; i < keysA.length; i++) {
  14089. if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
  14090. return false;
  14091. }
  14092. }
  14093. return true;
  14094. }
  14095. module.exports = shallowEqual;
  14096. /***/ },
  14097. /* 126 */
  14098. /***/ function(module, exports) {
  14099. /**
  14100. * Copyright 2013-present, Facebook, Inc.
  14101. * All rights reserved.
  14102. *
  14103. * This source code is licensed under the BSD-style license found in the
  14104. * LICENSE file in the root directory of this source tree. An additional grant
  14105. * of patent rights can be found in the PATENTS file in the same directory.
  14106. *
  14107. */
  14108. 'use strict';
  14109. /**
  14110. * Given a `prevElement` and `nextElement`, determines if the existing
  14111. * instance should be updated as opposed to being destroyed or replaced by a new
  14112. * instance. Both arguments are elements. This ensures that this logic can
  14113. * operate on stateless trees without any backing instance.
  14114. *
  14115. * @param {?object} prevElement
  14116. * @param {?object} nextElement
  14117. * @return {boolean} True if the existing instance should be updated.
  14118. * @protected
  14119. */
  14120. function shouldUpdateReactComponent(prevElement, nextElement) {
  14121. var prevEmpty = prevElement === null || prevElement === false;
  14122. var nextEmpty = nextElement === null || nextElement === false;
  14123. if (prevEmpty || nextEmpty) {
  14124. return prevEmpty === nextEmpty;
  14125. }
  14126. var prevType = typeof prevElement;
  14127. var nextType = typeof nextElement;
  14128. if (prevType === 'string' || prevType === 'number') {
  14129. return nextType === 'string' || nextType === 'number';
  14130. } else {
  14131. return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key;
  14132. }
  14133. }
  14134. module.exports = shouldUpdateReactComponent;
  14135. /***/ },
  14136. /* 127 */
  14137. /***/ function(module, exports) {
  14138. /**
  14139. * Copyright 2014-present, Facebook, Inc.
  14140. * All rights reserved.
  14141. *
  14142. * This source code is licensed under the BSD-style license found in the
  14143. * LICENSE file in the root directory of this source tree. An additional grant
  14144. * of patent rights can be found in the PATENTS file in the same directory.
  14145. *
  14146. */
  14147. 'use strict';
  14148. var emptyComponentFactory;
  14149. var ReactEmptyComponentInjection = {
  14150. injectEmptyComponentFactory: function (factory) {
  14151. emptyComponentFactory = factory;
  14152. }
  14153. };
  14154. var ReactEmptyComponent = {
  14155. create: function (instantiate) {
  14156. return emptyComponentFactory(instantiate);
  14157. }
  14158. };
  14159. ReactEmptyComponent.injection = ReactEmptyComponentInjection;
  14160. module.exports = ReactEmptyComponent;
  14161. /***/ },
  14162. /* 128 */
  14163. /***/ function(module, exports, __webpack_require__) {
  14164. /* WEBPACK VAR INJECTION */(function(process) {/**
  14165. * Copyright 2014-present, Facebook, Inc.
  14166. * All rights reserved.
  14167. *
  14168. * This source code is licensed under the BSD-style license found in the
  14169. * LICENSE file in the root directory of this source tree. An additional grant
  14170. * of patent rights can be found in the PATENTS file in the same directory.
  14171. *
  14172. */
  14173. 'use strict';
  14174. var _prodInvariant = __webpack_require__(37);
  14175. var invariant = __webpack_require__(10);
  14176. var genericComponentClass = null;
  14177. var textComponentClass = null;
  14178. var ReactHostComponentInjection = {
  14179. // This accepts a class that receives the tag string. This is a catch all
  14180. // that can render any kind of tag.
  14181. injectGenericComponentClass: function (componentClass) {
  14182. genericComponentClass = componentClass;
  14183. },
  14184. // This accepts a text component class that takes the text string to be
  14185. // rendered as props.
  14186. injectTextComponentClass: function (componentClass) {
  14187. textComponentClass = componentClass;
  14188. }
  14189. };
  14190. /**
  14191. * Get a host internal component class for a specific tag.
  14192. *
  14193. * @param {ReactElement} element The element to create.
  14194. * @return {function} The internal class constructor function.
  14195. */
  14196. function createInternalComponent(element) {
  14197. !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;
  14198. return new genericComponentClass(element);
  14199. }
  14200. /**
  14201. * @param {ReactText} text
  14202. * @return {ReactComponent}
  14203. */
  14204. function createInstanceForText(text) {
  14205. return new textComponentClass(text);
  14206. }
  14207. /**
  14208. * @param {ReactComponent} component
  14209. * @return {boolean}
  14210. */
  14211. function isTextComponent(component) {
  14212. return component instanceof textComponentClass;
  14213. }
  14214. var ReactHostComponent = {
  14215. createInternalComponent: createInternalComponent,
  14216. createInstanceForText: createInstanceForText,
  14217. isTextComponent: isTextComponent,
  14218. injection: ReactHostComponentInjection
  14219. };
  14220. module.exports = ReactHostComponent;
  14221. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  14222. /***/ },
  14223. /* 129 */
  14224. /***/ function(module, exports) {
  14225. /**
  14226. * Copyright 2013-present, Facebook, Inc.
  14227. * All rights reserved.
  14228. *
  14229. * This source code is licensed under the BSD-style license found in the
  14230. * LICENSE file in the root directory of this source tree. An additional grant
  14231. * of patent rights can be found in the PATENTS file in the same directory.
  14232. *
  14233. *
  14234. */
  14235. 'use strict';
  14236. var nextDebugID = 1;
  14237. function getNextDebugID() {
  14238. return nextDebugID++;
  14239. }
  14240. module.exports = getNextDebugID;
  14241. /***/ },
  14242. /* 130 */
  14243. /***/ function(module, exports) {
  14244. /**
  14245. * Copyright 2013-present, Facebook, Inc.
  14246. * All rights reserved.
  14247. *
  14248. * This source code is licensed under the BSD-style license found in the
  14249. * LICENSE file in the root directory of this source tree. An additional grant
  14250. * of patent rights can be found in the PATENTS file in the same directory.
  14251. *
  14252. *
  14253. */
  14254. 'use strict';
  14255. /**
  14256. * Escape and wrap key so it is safe to use as a reactid
  14257. *
  14258. * @param {string} key to be escaped.
  14259. * @return {string} the escaped key.
  14260. */
  14261. function escape(key) {
  14262. var escapeRegex = /[=:]/g;
  14263. var escaperLookup = {
  14264. '=': '=0',
  14265. ':': '=2'
  14266. };
  14267. var escapedString = ('' + key).replace(escapeRegex, function (match) {
  14268. return escaperLookup[match];
  14269. });
  14270. return '$' + escapedString;
  14271. }
  14272. /**
  14273. * Unescape and unwrap key for human-readable display
  14274. *
  14275. * @param {string} key to unescape.
  14276. * @return {string} the unescaped key.
  14277. */
  14278. function unescape(key) {
  14279. var unescapeRegex = /(=0|=2)/g;
  14280. var unescaperLookup = {
  14281. '=0': '=',
  14282. '=2': ':'
  14283. };
  14284. var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);
  14285. return ('' + keySubstring).replace(unescapeRegex, function (match) {
  14286. return unescaperLookup[match];
  14287. });
  14288. }
  14289. var KeyEscapeUtils = {
  14290. escape: escape,
  14291. unescape: unescape
  14292. };
  14293. module.exports = KeyEscapeUtils;
  14294. /***/ },
  14295. /* 131 */
  14296. /***/ function(module, exports, __webpack_require__) {
  14297. /* WEBPACK VAR INJECTION */(function(process) {/**
  14298. * Copyright 2013-present, Facebook, Inc.
  14299. * All rights reserved.
  14300. *
  14301. * This source code is licensed under the BSD-style license found in the
  14302. * LICENSE file in the root directory of this source tree. An additional grant
  14303. * of patent rights can be found in the PATENTS file in the same directory.
  14304. *
  14305. */
  14306. 'use strict';
  14307. var _prodInvariant = __webpack_require__(37);
  14308. var ReactCurrentOwner = __webpack_require__(12);
  14309. var REACT_ELEMENT_TYPE = __webpack_require__(132);
  14310. var getIteratorFn = __webpack_require__(133);
  14311. var invariant = __webpack_require__(10);
  14312. var KeyEscapeUtils = __webpack_require__(130);
  14313. var warning = __webpack_require__(13);
  14314. var SEPARATOR = '.';
  14315. var SUBSEPARATOR = ':';
  14316. /**
  14317. * This is inlined from ReactElement since this file is shared between
  14318. * isomorphic and renderers. We could extract this to a
  14319. *
  14320. */
  14321. /**
  14322. * TODO: Test that a single child and an array with one item have the same key
  14323. * pattern.
  14324. */
  14325. var didWarnAboutMaps = false;
  14326. /**
  14327. * Generate a key string that identifies a component within a set.
  14328. *
  14329. * @param {*} component A component that could contain a manual key.
  14330. * @param {number} index Index that is used if a manual key is not provided.
  14331. * @return {string}
  14332. */
  14333. function getComponentKey(component, index) {
  14334. // Do some typechecking here since we call this blindly. We want to ensure
  14335. // that we don't block potential future ES APIs.
  14336. if (component && typeof component === 'object' && component.key != null) {
  14337. // Explicit key
  14338. return KeyEscapeUtils.escape(component.key);
  14339. }
  14340. // Implicit key determined by the index in the set
  14341. return index.toString(36);
  14342. }
  14343. /**
  14344. * @param {?*} children Children tree container.
  14345. * @param {!string} nameSoFar Name of the key path so far.
  14346. * @param {!function} callback Callback to invoke with each child found.
  14347. * @param {?*} traverseContext Used to pass information throughout the traversal
  14348. * process.
  14349. * @return {!number} The number of children in this subtree.
  14350. */
  14351. function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
  14352. var type = typeof children;
  14353. if (type === 'undefined' || type === 'boolean') {
  14354. // All of the above are perceived as null.
  14355. children = null;
  14356. }
  14357. if (children === null || type === 'string' || type === 'number' ||
  14358. // The following is inlined from ReactElement. This means we can optimize
  14359. // some checks. React Fiber also inlines this logic for similar purposes.
  14360. type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) {
  14361. callback(traverseContext, children,
  14362. // If it's the only child, treat the name as if it was wrapped in an array
  14363. // so that it's consistent if the number of children grows.
  14364. nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
  14365. return 1;
  14366. }
  14367. var child;
  14368. var nextName;
  14369. var subtreeCount = 0; // Count of children found in the current subtree.
  14370. var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
  14371. if (Array.isArray(children)) {
  14372. for (var i = 0; i < children.length; i++) {
  14373. child = children[i];
  14374. nextName = nextNamePrefix + getComponentKey(child, i);
  14375. subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
  14376. }
  14377. } else {
  14378. var iteratorFn = getIteratorFn(children);
  14379. if (iteratorFn) {
  14380. var iterator = iteratorFn.call(children);
  14381. var step;
  14382. if (iteratorFn !== children.entries) {
  14383. var ii = 0;
  14384. while (!(step = iterator.next()).done) {
  14385. child = step.value;
  14386. nextName = nextNamePrefix + getComponentKey(child, ii++);
  14387. subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
  14388. }
  14389. } else {
  14390. if (process.env.NODE_ENV !== 'production') {
  14391. var mapsAsChildrenAddendum = '';
  14392. if (ReactCurrentOwner.current) {
  14393. var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName();
  14394. if (mapsAsChildrenOwnerName) {
  14395. mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.';
  14396. }
  14397. }
  14398. 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;
  14399. didWarnAboutMaps = true;
  14400. }
  14401. // Iterator will provide entry [k,v] tuples rather than values.
  14402. while (!(step = iterator.next()).done) {
  14403. var entry = step.value;
  14404. if (entry) {
  14405. child = entry[1];
  14406. nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
  14407. subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
  14408. }
  14409. }
  14410. }
  14411. } else if (type === 'object') {
  14412. var addendum = '';
  14413. if (process.env.NODE_ENV !== 'production') {
  14414. 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.';
  14415. if (children._isReactElement) {
  14416. 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.';
  14417. }
  14418. if (ReactCurrentOwner.current) {
  14419. var name = ReactCurrentOwner.current.getName();
  14420. if (name) {
  14421. addendum += ' Check the render method of `' + name + '`.';
  14422. }
  14423. }
  14424. }
  14425. var childrenString = String(children);
  14426. 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;
  14427. }
  14428. }
  14429. return subtreeCount;
  14430. }
  14431. /**
  14432. * Traverses children that are typically specified as `props.children`, but
  14433. * might also be specified through attributes:
  14434. *
  14435. * - `traverseAllChildren(this.props.children, ...)`
  14436. * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
  14437. *
  14438. * The `traverseContext` is an optional argument that is passed through the
  14439. * entire traversal. It can be used to store accumulations or anything else that
  14440. * the callback might find relevant.
  14441. *
  14442. * @param {?*} children Children tree object.
  14443. * @param {!function} callback To invoke upon traversing each child.
  14444. * @param {?*} traverseContext Context for traversal.
  14445. * @return {!number} The number of children in this subtree.
  14446. */
  14447. function traverseAllChildren(children, callback, traverseContext) {
  14448. if (children == null) {
  14449. return 0;
  14450. }
  14451. return traverseAllChildrenImpl(children, '', callback, traverseContext);
  14452. }
  14453. module.exports = traverseAllChildren;
  14454. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  14455. /***/ },
  14456. /* 132 */
  14457. /***/ function(module, exports) {
  14458. /**
  14459. * Copyright 2014-present, Facebook, Inc.
  14460. * All rights reserved.
  14461. *
  14462. * This source code is licensed under the BSD-style license found in the
  14463. * LICENSE file in the root directory of this source tree. An additional grant
  14464. * of patent rights can be found in the PATENTS file in the same directory.
  14465. *
  14466. *
  14467. */
  14468. 'use strict';
  14469. // The Symbol used to tag the ReactElement type. If there is no native Symbol
  14470. // nor polyfill, then a plain number is used for performance.
  14471. var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
  14472. module.exports = REACT_ELEMENT_TYPE;
  14473. /***/ },
  14474. /* 133 */
  14475. /***/ function(module, exports) {
  14476. /**
  14477. * Copyright 2013-present, Facebook, Inc.
  14478. * All rights reserved.
  14479. *
  14480. * This source code is licensed under the BSD-style license found in the
  14481. * LICENSE file in the root directory of this source tree. An additional grant
  14482. * of patent rights can be found in the PATENTS file in the same directory.
  14483. *
  14484. *
  14485. */
  14486. 'use strict';
  14487. /* global Symbol */
  14488. var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
  14489. var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
  14490. /**
  14491. * Returns the iterator method function contained on the iterable object.
  14492. *
  14493. * Be sure to invoke the function with the iterable as context:
  14494. *
  14495. * var iteratorFn = getIteratorFn(myIterable);
  14496. * if (iteratorFn) {
  14497. * var iterator = iteratorFn.call(myIterable);
  14498. * ...
  14499. * }
  14500. *
  14501. * @param {?object} maybeIterable
  14502. * @return {?function}
  14503. */
  14504. function getIteratorFn(maybeIterable) {
  14505. var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
  14506. if (typeof iteratorFn === 'function') {
  14507. return iteratorFn;
  14508. }
  14509. }
  14510. module.exports = getIteratorFn;
  14511. /***/ },
  14512. /* 134 */
  14513. /***/ function(module, exports, __webpack_require__) {
  14514. /* WEBPACK VAR INJECTION */(function(process) {/**
  14515. * Copyright 2013-present, Facebook, Inc.
  14516. * All rights reserved.
  14517. *
  14518. * This source code is licensed under the BSD-style license found in the
  14519. * LICENSE file in the root directory of this source tree. An additional grant
  14520. * of patent rights can be found in the PATENTS file in the same directory.
  14521. *
  14522. *
  14523. */
  14524. 'use strict';
  14525. var KeyEscapeUtils = __webpack_require__(130);
  14526. var traverseAllChildren = __webpack_require__(131);
  14527. var warning = __webpack_require__(13);
  14528. var ReactComponentTreeHook;
  14529. if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') {
  14530. // Temporary hack.
  14531. // Inline requires don't work well with Jest:
  14532. // https://github.com/facebook/react/issues/7240
  14533. // Remove the inline requires when we don't need them anymore:
  14534. // https://github.com/facebook/react/pull/7178
  14535. ReactComponentTreeHook = __webpack_require__(28);
  14536. }
  14537. /**
  14538. * @param {function} traverseContext Context passed through traversal.
  14539. * @param {?ReactComponent} child React child component.
  14540. * @param {!string} name String name of key path to child.
  14541. * @param {number=} selfDebugID Optional debugID of the current internal instance.
  14542. */
  14543. function flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID) {
  14544. // We found a component instance.
  14545. if (traverseContext && typeof traverseContext === 'object') {
  14546. var result = traverseContext;
  14547. var keyUnique = result[name] === undefined;
  14548. if (process.env.NODE_ENV !== 'production') {
  14549. if (!ReactComponentTreeHook) {
  14550. ReactComponentTreeHook = __webpack_require__(28);
  14551. }
  14552. if (!keyUnique) {
  14553. 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;
  14554. }
  14555. }
  14556. if (keyUnique && child != null) {
  14557. result[name] = child;
  14558. }
  14559. }
  14560. }
  14561. /**
  14562. * Flattens children that are typically specified as `props.children`. Any null
  14563. * children will not be included in the resulting object.
  14564. * @return {!object} flattened children keyed by name.
  14565. */
  14566. function flattenChildren(children, selfDebugID) {
  14567. if (children == null) {
  14568. return children;
  14569. }
  14570. var result = {};
  14571. if (process.env.NODE_ENV !== 'production') {
  14572. traverseAllChildren(children, function (traverseContext, child, name) {
  14573. return flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID);
  14574. }, result);
  14575. } else {
  14576. traverseAllChildren(children, flattenSingleChildIntoContext, result);
  14577. }
  14578. return result;
  14579. }
  14580. module.exports = flattenChildren;
  14581. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  14582. /***/ },
  14583. /* 135 */
  14584. /***/ function(module, exports, __webpack_require__) {
  14585. /* WEBPACK VAR INJECTION */(function(process) {/**
  14586. * Copyright 2014-present, Facebook, Inc.
  14587. * All rights reserved.
  14588. *
  14589. * This source code is licensed under the BSD-style license found in the
  14590. * LICENSE file in the root directory of this source tree. An additional grant
  14591. * of patent rights can be found in the PATENTS file in the same directory.
  14592. *
  14593. */
  14594. 'use strict';
  14595. var _assign = __webpack_require__(6);
  14596. var PooledClass = __webpack_require__(52);
  14597. var Transaction = __webpack_require__(70);
  14598. var ReactInstrumentation = __webpack_require__(64);
  14599. var ReactServerUpdateQueue = __webpack_require__(136);
  14600. /**
  14601. * Executed within the scope of the `Transaction` instance. Consider these as
  14602. * being member methods, but with an implied ordering while being isolated from
  14603. * each other.
  14604. */
  14605. var TRANSACTION_WRAPPERS = [];
  14606. if (process.env.NODE_ENV !== 'production') {
  14607. TRANSACTION_WRAPPERS.push({
  14608. initialize: ReactInstrumentation.debugTool.onBeginFlush,
  14609. close: ReactInstrumentation.debugTool.onEndFlush
  14610. });
  14611. }
  14612. var noopCallbackQueue = {
  14613. enqueue: function () {}
  14614. };
  14615. /**
  14616. * @class ReactServerRenderingTransaction
  14617. * @param {boolean} renderToStaticMarkup
  14618. */
  14619. function ReactServerRenderingTransaction(renderToStaticMarkup) {
  14620. this.reinitializeTransaction();
  14621. this.renderToStaticMarkup = renderToStaticMarkup;
  14622. this.useCreateElement = false;
  14623. this.updateQueue = new ReactServerUpdateQueue(this);
  14624. }
  14625. var Mixin = {
  14626. /**
  14627. * @see Transaction
  14628. * @abstract
  14629. * @final
  14630. * @return {array} Empty list of operation wrap procedures.
  14631. */
  14632. getTransactionWrappers: function () {
  14633. return TRANSACTION_WRAPPERS;
  14634. },
  14635. /**
  14636. * @return {object} The queue to collect `onDOMReady` callbacks with.
  14637. */
  14638. getReactMountReady: function () {
  14639. return noopCallbackQueue;
  14640. },
  14641. /**
  14642. * @return {object} The queue to collect React async events.
  14643. */
  14644. getUpdateQueue: function () {
  14645. return this.updateQueue;
  14646. },
  14647. /**
  14648. * `PooledClass` looks for this, and will invoke this before allowing this
  14649. * instance to be reused.
  14650. */
  14651. destructor: function () {},
  14652. checkpoint: function () {},
  14653. rollback: function () {}
  14654. };
  14655. _assign(ReactServerRenderingTransaction.prototype, Transaction, Mixin);
  14656. PooledClass.addPoolingTo(ReactServerRenderingTransaction);
  14657. module.exports = ReactServerRenderingTransaction;
  14658. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  14659. /***/ },
  14660. /* 136 */
  14661. /***/ function(module, exports, __webpack_require__) {
  14662. /* WEBPACK VAR INJECTION */(function(process) {/**
  14663. * Copyright 2015-present, Facebook, Inc.
  14664. * All rights reserved.
  14665. *
  14666. * This source code is licensed under the BSD-style license found in the
  14667. * LICENSE file in the root directory of this source tree. An additional grant
  14668. * of patent rights can be found in the PATENTS file in the same directory.
  14669. *
  14670. *
  14671. */
  14672. 'use strict';
  14673. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14674. var ReactUpdateQueue = __webpack_require__(137);
  14675. var warning = __webpack_require__(13);
  14676. function warnNoop(publicInstance, callerName) {
  14677. if (process.env.NODE_ENV !== 'production') {
  14678. var constructor = publicInstance.constructor;
  14679. 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;
  14680. }
  14681. }
  14682. /**
  14683. * This is the update queue used for server rendering.
  14684. * It delegates to ReactUpdateQueue while server rendering is in progress and
  14685. * switches to ReactNoopUpdateQueue after the transaction has completed.
  14686. * @class ReactServerUpdateQueue
  14687. * @param {Transaction} transaction
  14688. */
  14689. var ReactServerUpdateQueue = function () {
  14690. function ReactServerUpdateQueue(transaction) {
  14691. _classCallCheck(this, ReactServerUpdateQueue);
  14692. this.transaction = transaction;
  14693. }
  14694. /**
  14695. * Checks whether or not this composite component is mounted.
  14696. * @param {ReactClass} publicInstance The instance we want to test.
  14697. * @return {boolean} True if mounted, false otherwise.
  14698. * @protected
  14699. * @final
  14700. */
  14701. ReactServerUpdateQueue.prototype.isMounted = function isMounted(publicInstance) {
  14702. return false;
  14703. };
  14704. /**
  14705. * Enqueue a callback that will be executed after all the pending updates
  14706. * have processed.
  14707. *
  14708. * @param {ReactClass} publicInstance The instance to use as `this` context.
  14709. * @param {?function} callback Called after state is updated.
  14710. * @internal
  14711. */
  14712. ReactServerUpdateQueue.prototype.enqueueCallback = function enqueueCallback(publicInstance, callback, callerName) {
  14713. if (this.transaction.isInTransaction()) {
  14714. ReactUpdateQueue.enqueueCallback(publicInstance, callback, callerName);
  14715. }
  14716. };
  14717. /**
  14718. * Forces an update. This should only be invoked when it is known with
  14719. * certainty that we are **not** in a DOM transaction.
  14720. *
  14721. * You may want to call this when you know that some deeper aspect of the
  14722. * component's state has changed but `setState` was not called.
  14723. *
  14724. * This will not invoke `shouldComponentUpdate`, but it will invoke
  14725. * `componentWillUpdate` and `componentDidUpdate`.
  14726. *
  14727. * @param {ReactClass} publicInstance The instance that should rerender.
  14728. * @internal
  14729. */
  14730. ReactServerUpdateQueue.prototype.enqueueForceUpdate = function enqueueForceUpdate(publicInstance) {
  14731. if (this.transaction.isInTransaction()) {
  14732. ReactUpdateQueue.enqueueForceUpdate(publicInstance);
  14733. } else {
  14734. warnNoop(publicInstance, 'forceUpdate');
  14735. }
  14736. };
  14737. /**
  14738. * Replaces all of the state. Always use this or `setState` to mutate state.
  14739. * You should treat `this.state` as immutable.
  14740. *
  14741. * There is no guarantee that `this.state` will be immediately updated, so
  14742. * accessing `this.state` after calling this method may return the old value.
  14743. *
  14744. * @param {ReactClass} publicInstance The instance that should rerender.
  14745. * @param {object|function} completeState Next state.
  14746. * @internal
  14747. */
  14748. ReactServerUpdateQueue.prototype.enqueueReplaceState = function enqueueReplaceState(publicInstance, completeState) {
  14749. if (this.transaction.isInTransaction()) {
  14750. ReactUpdateQueue.enqueueReplaceState(publicInstance, completeState);
  14751. } else {
  14752. warnNoop(publicInstance, 'replaceState');
  14753. }
  14754. };
  14755. /**
  14756. * Sets a subset of the state. This only exists because _pendingState is
  14757. * internal. This provides a merging strategy that is not available to deep
  14758. * properties which is confusing. TODO: Expose pendingState or don't use it
  14759. * during the merge.
  14760. *
  14761. * @param {ReactClass} publicInstance The instance that should rerender.
  14762. * @param {object|function} partialState Next partial state to be merged with state.
  14763. * @internal
  14764. */
  14765. ReactServerUpdateQueue.prototype.enqueueSetState = function enqueueSetState(publicInstance, partialState) {
  14766. if (this.transaction.isInTransaction()) {
  14767. ReactUpdateQueue.enqueueSetState(publicInstance, partialState);
  14768. } else {
  14769. warnNoop(publicInstance, 'setState');
  14770. }
  14771. };
  14772. return ReactServerUpdateQueue;
  14773. }();
  14774. module.exports = ReactServerUpdateQueue;
  14775. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  14776. /***/ },
  14777. /* 137 */
  14778. /***/ function(module, exports, __webpack_require__) {
  14779. /* WEBPACK VAR INJECTION */(function(process) {/**
  14780. * Copyright 2015-present, Facebook, Inc.
  14781. * All rights reserved.
  14782. *
  14783. * This source code is licensed under the BSD-style license found in the
  14784. * LICENSE file in the root directory of this source tree. An additional grant
  14785. * of patent rights can be found in the PATENTS file in the same directory.
  14786. *
  14787. */
  14788. 'use strict';
  14789. var _prodInvariant = __webpack_require__(37);
  14790. var ReactCurrentOwner = __webpack_require__(12);
  14791. var ReactInstanceMap = __webpack_require__(118);
  14792. var ReactInstrumentation = __webpack_require__(64);
  14793. var ReactUpdates = __webpack_require__(58);
  14794. var invariant = __webpack_require__(10);
  14795. var warning = __webpack_require__(13);
  14796. function enqueueUpdate(internalInstance) {
  14797. ReactUpdates.enqueueUpdate(internalInstance);
  14798. }
  14799. function formatUnexpectedArgument(arg) {
  14800. var type = typeof arg;
  14801. if (type !== 'object') {
  14802. return type;
  14803. }
  14804. var displayName = arg.constructor && arg.constructor.name || type;
  14805. var keys = Object.keys(arg);
  14806. if (keys.length > 0 && keys.length < 20) {
  14807. return displayName + ' (keys: ' + keys.join(', ') + ')';
  14808. }
  14809. return displayName;
  14810. }
  14811. function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
  14812. var internalInstance = ReactInstanceMap.get(publicInstance);
  14813. if (!internalInstance) {
  14814. if (process.env.NODE_ENV !== 'production') {
  14815. var ctor = publicInstance.constructor;
  14816. // Only warn when we have a callerName. Otherwise we should be silent.
  14817. // We're probably calling from enqueueCallback. We don't want to warn
  14818. // there because we already warned for the corresponding lifecycle method.
  14819. 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;
  14820. }
  14821. return null;
  14822. }
  14823. if (process.env.NODE_ENV !== 'production') {
  14824. 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;
  14825. }
  14826. return internalInstance;
  14827. }
  14828. /**
  14829. * ReactUpdateQueue allows for state updates to be scheduled into a later
  14830. * reconciliation step.
  14831. */
  14832. var ReactUpdateQueue = {
  14833. /**
  14834. * Checks whether or not this composite component is mounted.
  14835. * @param {ReactClass} publicInstance The instance we want to test.
  14836. * @return {boolean} True if mounted, false otherwise.
  14837. * @protected
  14838. * @final
  14839. */
  14840. isMounted: function (publicInstance) {
  14841. if (process.env.NODE_ENV !== 'production') {
  14842. var owner = ReactCurrentOwner.current;
  14843. if (owner !== null) {
  14844. 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;
  14845. owner._warnedAboutRefsInRender = true;
  14846. }
  14847. }
  14848. var internalInstance = ReactInstanceMap.get(publicInstance);
  14849. if (internalInstance) {
  14850. // During componentWillMount and render this will still be null but after
  14851. // that will always render to something. At least for now. So we can use
  14852. // this hack.
  14853. return !!internalInstance._renderedComponent;
  14854. } else {
  14855. return false;
  14856. }
  14857. },
  14858. /**
  14859. * Enqueue a callback that will be executed after all the pending updates
  14860. * have processed.
  14861. *
  14862. * @param {ReactClass} publicInstance The instance to use as `this` context.
  14863. * @param {?function} callback Called after state is updated.
  14864. * @param {string} callerName Name of the calling function in the public API.
  14865. * @internal
  14866. */
  14867. enqueueCallback: function (publicInstance, callback, callerName) {
  14868. ReactUpdateQueue.validateCallback(callback, callerName);
  14869. var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);
  14870. // Previously we would throw an error if we didn't have an internal
  14871. // instance. Since we want to make it a no-op instead, we mirror the same
  14872. // behavior we have in other enqueue* methods.
  14873. // We also need to ignore callbacks in componentWillMount. See
  14874. // enqueueUpdates.
  14875. if (!internalInstance) {
  14876. return null;
  14877. }
  14878. if (internalInstance._pendingCallbacks) {
  14879. internalInstance._pendingCallbacks.push(callback);
  14880. } else {
  14881. internalInstance._pendingCallbacks = [callback];
  14882. }
  14883. // TODO: The callback here is ignored when setState is called from
  14884. // componentWillMount. Either fix it or disallow doing so completely in
  14885. // favor of getInitialState. Alternatively, we can disallow
  14886. // componentWillMount during server-side rendering.
  14887. enqueueUpdate(internalInstance);
  14888. },
  14889. enqueueCallbackInternal: function (internalInstance, callback) {
  14890. if (internalInstance._pendingCallbacks) {
  14891. internalInstance._pendingCallbacks.push(callback);
  14892. } else {
  14893. internalInstance._pendingCallbacks = [callback];
  14894. }
  14895. enqueueUpdate(internalInstance);
  14896. },
  14897. /**
  14898. * Forces an update. This should only be invoked when it is known with
  14899. * certainty that we are **not** in a DOM transaction.
  14900. *
  14901. * You may want to call this when you know that some deeper aspect of the
  14902. * component's state has changed but `setState` was not called.
  14903. *
  14904. * This will not invoke `shouldComponentUpdate`, but it will invoke
  14905. * `componentWillUpdate` and `componentDidUpdate`.
  14906. *
  14907. * @param {ReactClass} publicInstance The instance that should rerender.
  14908. * @internal
  14909. */
  14910. enqueueForceUpdate: function (publicInstance) {
  14911. var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate');
  14912. if (!internalInstance) {
  14913. return;
  14914. }
  14915. internalInstance._pendingForceUpdate = true;
  14916. enqueueUpdate(internalInstance);
  14917. },
  14918. /**
  14919. * Replaces all of the state. Always use this or `setState` to mutate state.
  14920. * You should treat `this.state` as immutable.
  14921. *
  14922. * There is no guarantee that `this.state` will be immediately updated, so
  14923. * accessing `this.state` after calling this method may return the old value.
  14924. *
  14925. * @param {ReactClass} publicInstance The instance that should rerender.
  14926. * @param {object} completeState Next state.
  14927. * @internal
  14928. */
  14929. enqueueReplaceState: function (publicInstance, completeState) {
  14930. var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState');
  14931. if (!internalInstance) {
  14932. return;
  14933. }
  14934. internalInstance._pendingStateQueue = [completeState];
  14935. internalInstance._pendingReplaceState = true;
  14936. enqueueUpdate(internalInstance);
  14937. },
  14938. /**
  14939. * Sets a subset of the state. This only exists because _pendingState is
  14940. * internal. This provides a merging strategy that is not available to deep
  14941. * properties which is confusing. TODO: Expose pendingState or don't use it
  14942. * during the merge.
  14943. *
  14944. * @param {ReactClass} publicInstance The instance that should rerender.
  14945. * @param {object} partialState Next partial state to be merged with state.
  14946. * @internal
  14947. */
  14948. enqueueSetState: function (publicInstance, partialState) {
  14949. if (process.env.NODE_ENV !== 'production') {
  14950. ReactInstrumentation.debugTool.onSetState();
  14951. process.env.NODE_ENV !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : void 0;
  14952. }
  14953. var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState');
  14954. if (!internalInstance) {
  14955. return;
  14956. }
  14957. var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []);
  14958. queue.push(partialState);
  14959. enqueueUpdate(internalInstance);
  14960. },
  14961. enqueueElementInternal: function (internalInstance, nextElement, nextContext) {
  14962. internalInstance._pendingElement = nextElement;
  14963. // TODO: introduce _pendingContext instead of setting it directly.
  14964. internalInstance._context = nextContext;
  14965. enqueueUpdate(internalInstance);
  14966. },
  14967. validateCallback: function (callback, callerName) {
  14968. !(!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;
  14969. }
  14970. };
  14971. module.exports = ReactUpdateQueue;
  14972. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  14973. /***/ },
  14974. /* 138 */
  14975. /***/ function(module, exports, __webpack_require__) {
  14976. /* WEBPACK VAR INJECTION */(function(process) {/**
  14977. * Copyright 2015-present, Facebook, Inc.
  14978. * All rights reserved.
  14979. *
  14980. * This source code is licensed under the BSD-style license found in the
  14981. * LICENSE file in the root directory of this source tree. An additional grant
  14982. * of patent rights can be found in the PATENTS file in the same directory.
  14983. *
  14984. */
  14985. 'use strict';
  14986. var _assign = __webpack_require__(6);
  14987. var emptyFunction = __webpack_require__(14);
  14988. var warning = __webpack_require__(13);
  14989. var validateDOMNesting = emptyFunction;
  14990. if (process.env.NODE_ENV !== 'production') {
  14991. // This validation code was written based on the HTML5 parsing spec:
  14992. // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
  14993. //
  14994. // Note: this does not catch all invalid nesting, nor does it try to (as it's
  14995. // not clear what practical benefit doing so provides); instead, we warn only
  14996. // for cases where the parser will give a parse tree differing from what React
  14997. // intended. For example, <b><div></div></b> is invalid but we don't warn
  14998. // because it still parses correctly; we do warn for other cases like nested
  14999. // <p> tags where the beginning of the second element implicitly closes the
  15000. // first, causing a confusing mess.
  15001. // https://html.spec.whatwg.org/multipage/syntax.html#special
  15002. 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'];
  15003. // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
  15004. var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',
  15005. // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
  15006. // TODO: Distinguish by namespace here -- for <title>, including it here
  15007. // errs on the side of fewer warnings
  15008. 'foreignObject', 'desc', 'title'];
  15009. // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope
  15010. var buttonScopeTags = inScopeTags.concat(['button']);
  15011. // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
  15012. var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
  15013. var emptyAncestorInfo = {
  15014. current: null,
  15015. formTag: null,
  15016. aTagInScope: null,
  15017. buttonTagInScope: null,
  15018. nobrTagInScope: null,
  15019. pTagInButtonScope: null,
  15020. listItemTagAutoclosing: null,
  15021. dlItemTagAutoclosing: null
  15022. };
  15023. var updatedAncestorInfo = function (oldInfo, tag, instance) {
  15024. var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
  15025. var info = { tag: tag, instance: instance };
  15026. if (inScopeTags.indexOf(tag) !== -1) {
  15027. ancestorInfo.aTagInScope = null;
  15028. ancestorInfo.buttonTagInScope = null;
  15029. ancestorInfo.nobrTagInScope = null;
  15030. }
  15031. if (buttonScopeTags.indexOf(tag) !== -1) {
  15032. ancestorInfo.pTagInButtonScope = null;
  15033. }
  15034. // See rules for 'li', 'dd', 'dt' start tags in
  15035. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
  15036. if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
  15037. ancestorInfo.listItemTagAutoclosing = null;
  15038. ancestorInfo.dlItemTagAutoclosing = null;
  15039. }
  15040. ancestorInfo.current = info;
  15041. if (tag === 'form') {
  15042. ancestorInfo.formTag = info;
  15043. }
  15044. if (tag === 'a') {
  15045. ancestorInfo.aTagInScope = info;
  15046. }
  15047. if (tag === 'button') {
  15048. ancestorInfo.buttonTagInScope = info;
  15049. }
  15050. if (tag === 'nobr') {
  15051. ancestorInfo.nobrTagInScope = info;
  15052. }
  15053. if (tag === 'p') {
  15054. ancestorInfo.pTagInButtonScope = info;
  15055. }
  15056. if (tag === 'li') {
  15057. ancestorInfo.listItemTagAutoclosing = info;
  15058. }
  15059. if (tag === 'dd' || tag === 'dt') {
  15060. ancestorInfo.dlItemTagAutoclosing = info;
  15061. }
  15062. return ancestorInfo;
  15063. };
  15064. /**
  15065. * Returns whether
  15066. */
  15067. var isTagValidWithParent = function (tag, parentTag) {
  15068. // First, let's check if we're in an unusual parsing mode...
  15069. switch (parentTag) {
  15070. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
  15071. case 'select':
  15072. return tag === 'option' || tag === 'optgroup' || tag === '#text';
  15073. case 'optgroup':
  15074. return tag === 'option' || tag === '#text';
  15075. // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
  15076. // but
  15077. case 'option':
  15078. return tag === '#text';
  15079. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
  15080. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
  15081. // No special behavior since these rules fall back to "in body" mode for
  15082. // all except special table nodes which cause bad parsing behavior anyway.
  15083. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
  15084. case 'tr':
  15085. return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
  15086. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
  15087. case 'tbody':
  15088. case 'thead':
  15089. case 'tfoot':
  15090. return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
  15091. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
  15092. case 'colgroup':
  15093. return tag === 'col' || tag === 'template';
  15094. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
  15095. case 'table':
  15096. return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
  15097. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
  15098. case 'head':
  15099. return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
  15100. // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
  15101. case 'html':
  15102. return tag === 'head' || tag === 'body';
  15103. case '#document':
  15104. return tag === 'html';
  15105. }
  15106. // Probably in the "in body" parsing mode, so we outlaw only tag combos
  15107. // where the parsing rules cause implicit opens or closes to be added.
  15108. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
  15109. switch (tag) {
  15110. case 'h1':
  15111. case 'h2':
  15112. case 'h3':
  15113. case 'h4':
  15114. case 'h5':
  15115. case 'h6':
  15116. return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
  15117. case 'rp':
  15118. case 'rt':
  15119. return impliedEndTags.indexOf(parentTag) === -1;
  15120. case 'body':
  15121. case 'caption':
  15122. case 'col':
  15123. case 'colgroup':
  15124. case 'frame':
  15125. case 'head':
  15126. case 'html':
  15127. case 'tbody':
  15128. case 'td':
  15129. case 'tfoot':
  15130. case 'th':
  15131. case 'thead':
  15132. case 'tr':
  15133. // These tags are only valid with a few parents that have special child
  15134. // parsing rules -- if we're down here, then none of those matched and
  15135. // so we allow it only if we don't know what the parent is, as all other
  15136. // cases are invalid.
  15137. return parentTag == null;
  15138. }
  15139. return true;
  15140. };
  15141. /**
  15142. * Returns whether
  15143. */
  15144. var findInvalidAncestorForTag = function (tag, ancestorInfo) {
  15145. switch (tag) {
  15146. case 'address':
  15147. case 'article':
  15148. case 'aside':
  15149. case 'blockquote':
  15150. case 'center':
  15151. case 'details':
  15152. case 'dialog':
  15153. case 'dir':
  15154. case 'div':
  15155. case 'dl':
  15156. case 'fieldset':
  15157. case 'figcaption':
  15158. case 'figure':
  15159. case 'footer':
  15160. case 'header':
  15161. case 'hgroup':
  15162. case 'main':
  15163. case 'menu':
  15164. case 'nav':
  15165. case 'ol':
  15166. case 'p':
  15167. case 'section':
  15168. case 'summary':
  15169. case 'ul':
  15170. case 'pre':
  15171. case 'listing':
  15172. case 'table':
  15173. case 'hr':
  15174. case 'xmp':
  15175. case 'h1':
  15176. case 'h2':
  15177. case 'h3':
  15178. case 'h4':
  15179. case 'h5':
  15180. case 'h6':
  15181. return ancestorInfo.pTagInButtonScope;
  15182. case 'form':
  15183. return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
  15184. case 'li':
  15185. return ancestorInfo.listItemTagAutoclosing;
  15186. case 'dd':
  15187. case 'dt':
  15188. return ancestorInfo.dlItemTagAutoclosing;
  15189. case 'button':
  15190. return ancestorInfo.buttonTagInScope;
  15191. case 'a':
  15192. // Spec says something about storing a list of markers, but it sounds
  15193. // equivalent to this check.
  15194. return ancestorInfo.aTagInScope;
  15195. case 'nobr':
  15196. return ancestorInfo.nobrTagInScope;
  15197. }
  15198. return null;
  15199. };
  15200. /**
  15201. * Given a ReactCompositeComponent instance, return a list of its recursive
  15202. * owners, starting at the root and ending with the instance itself.
  15203. */
  15204. var findOwnerStack = function (instance) {
  15205. if (!instance) {
  15206. return [];
  15207. }
  15208. var stack = [];
  15209. do {
  15210. stack.push(instance);
  15211. } while (instance = instance._currentElement._owner);
  15212. stack.reverse();
  15213. return stack;
  15214. };
  15215. var didWarn = {};
  15216. validateDOMNesting = function (childTag, childText, childInstance, ancestorInfo) {
  15217. ancestorInfo = ancestorInfo || emptyAncestorInfo;
  15218. var parentInfo = ancestorInfo.current;
  15219. var parentTag = parentInfo && parentInfo.tag;
  15220. if (childText != null) {
  15221. process.env.NODE_ENV !== 'production' ? warning(childTag == null, 'validateDOMNesting: when childText is passed, childTag should be null') : void 0;
  15222. childTag = '#text';
  15223. }
  15224. var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
  15225. var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
  15226. var problematic = invalidParent || invalidAncestor;
  15227. if (problematic) {
  15228. var ancestorTag = problematic.tag;
  15229. var ancestorInstance = problematic.instance;
  15230. var childOwner = childInstance && childInstance._currentElement._owner;
  15231. var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner;
  15232. var childOwners = findOwnerStack(childOwner);
  15233. var ancestorOwners = findOwnerStack(ancestorOwner);
  15234. var minStackLen = Math.min(childOwners.length, ancestorOwners.length);
  15235. var i;
  15236. var deepestCommon = -1;
  15237. for (i = 0; i < minStackLen; i++) {
  15238. if (childOwners[i] === ancestorOwners[i]) {
  15239. deepestCommon = i;
  15240. } else {
  15241. break;
  15242. }
  15243. }
  15244. var UNKNOWN = '(unknown)';
  15245. var childOwnerNames = childOwners.slice(deepestCommon + 1).map(function (inst) {
  15246. return inst.getName() || UNKNOWN;
  15247. });
  15248. var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) {
  15249. return inst.getName() || UNKNOWN;
  15250. });
  15251. var ownerInfo = [].concat(
  15252. // If the parent and child instances have a common owner ancestor, start
  15253. // with that -- otherwise we just start with the parent's owners.
  15254. deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNKNOWN : [], ancestorOwnerNames, ancestorTag,
  15255. // If we're warning about an invalid (non-parent) ancestry, add '...'
  15256. invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > ');
  15257. var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo;
  15258. if (didWarn[warnKey]) {
  15259. return;
  15260. }
  15261. didWarn[warnKey] = true;
  15262. var tagDisplayName = childTag;
  15263. var whitespaceInfo = '';
  15264. if (childTag === '#text') {
  15265. if (/\S/.test(childText)) {
  15266. tagDisplayName = 'Text nodes';
  15267. } else {
  15268. tagDisplayName = 'Whitespace text nodes';
  15269. whitespaceInfo = ' Make sure you don\'t have any extra whitespace between tags on ' + 'each line of your source code.';
  15270. }
  15271. } else {
  15272. tagDisplayName = '<' + childTag + '>';
  15273. }
  15274. if (invalidParent) {
  15275. var info = '';
  15276. if (ancestorTag === 'table' && childTag === 'tr') {
  15277. info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
  15278. }
  15279. process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>.%s ' + 'See %s.%s', tagDisplayName, ancestorTag, whitespaceInfo, ownerInfo, info) : void 0;
  15280. } else {
  15281. process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>. See %s.', tagDisplayName, ancestorTag, ownerInfo) : void 0;
  15282. }
  15283. }
  15284. };
  15285. validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo;
  15286. // For testing
  15287. validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {
  15288. ancestorInfo = ancestorInfo || emptyAncestorInfo;
  15289. var parentInfo = ancestorInfo.current;
  15290. var parentTag = parentInfo && parentInfo.tag;
  15291. return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);
  15292. };
  15293. }
  15294. module.exports = validateDOMNesting;
  15295. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  15296. /***/ },
  15297. /* 139 */
  15298. /***/ function(module, exports, __webpack_require__) {
  15299. /**
  15300. * Copyright 2014-present, Facebook, Inc.
  15301. * All rights reserved.
  15302. *
  15303. * This source code is licensed under the BSD-style license found in the
  15304. * LICENSE file in the root directory of this source tree. An additional grant
  15305. * of patent rights can be found in the PATENTS file in the same directory.
  15306. *
  15307. */
  15308. 'use strict';
  15309. var _assign = __webpack_require__(6);
  15310. var DOMLazyTree = __webpack_require__(83);
  15311. var ReactDOMComponentTree = __webpack_require__(36);
  15312. var ReactDOMEmptyComponent = function (instantiate) {
  15313. // ReactCompositeComponent uses this:
  15314. this._currentElement = null;
  15315. // ReactDOMComponentTree uses these:
  15316. this._hostNode = null;
  15317. this._hostParent = null;
  15318. this._hostContainerInfo = null;
  15319. this._domID = 0;
  15320. };
  15321. _assign(ReactDOMEmptyComponent.prototype, {
  15322. mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
  15323. var domID = hostContainerInfo._idCounter++;
  15324. this._domID = domID;
  15325. this._hostParent = hostParent;
  15326. this._hostContainerInfo = hostContainerInfo;
  15327. var nodeValue = ' react-empty: ' + this._domID + ' ';
  15328. if (transaction.useCreateElement) {
  15329. var ownerDocument = hostContainerInfo._ownerDocument;
  15330. var node = ownerDocument.createComment(nodeValue);
  15331. ReactDOMComponentTree.precacheNode(this, node);
  15332. return DOMLazyTree(node);
  15333. } else {
  15334. if (transaction.renderToStaticMarkup) {
  15335. // Normally we'd insert a comment node, but since this is a situation
  15336. // where React won't take over (static pages), we can simply return
  15337. // nothing.
  15338. return '';
  15339. }
  15340. return '<!--' + nodeValue + '-->';
  15341. }
  15342. },
  15343. receiveComponent: function () {},
  15344. getHostNode: function () {
  15345. return ReactDOMComponentTree.getNodeFromInstance(this);
  15346. },
  15347. unmountComponent: function () {
  15348. ReactDOMComponentTree.uncacheNode(this);
  15349. }
  15350. });
  15351. module.exports = ReactDOMEmptyComponent;
  15352. /***/ },
  15353. /* 140 */
  15354. /***/ function(module, exports, __webpack_require__) {
  15355. /* WEBPACK VAR INJECTION */(function(process) {/**
  15356. * Copyright 2015-present, Facebook, Inc.
  15357. * All rights reserved.
  15358. *
  15359. * This source code is licensed under the BSD-style license found in the
  15360. * LICENSE file in the root directory of this source tree. An additional grant
  15361. * of patent rights can be found in the PATENTS file in the same directory.
  15362. *
  15363. */
  15364. 'use strict';
  15365. var _prodInvariant = __webpack_require__(37);
  15366. var invariant = __webpack_require__(10);
  15367. /**
  15368. * Return the lowest common ancestor of A and B, or null if they are in
  15369. * different trees.
  15370. */
  15371. function getLowestCommonAncestor(instA, instB) {
  15372. !('_hostNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
  15373. !('_hostNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
  15374. var depthA = 0;
  15375. for (var tempA = instA; tempA; tempA = tempA._hostParent) {
  15376. depthA++;
  15377. }
  15378. var depthB = 0;
  15379. for (var tempB = instB; tempB; tempB = tempB._hostParent) {
  15380. depthB++;
  15381. }
  15382. // If A is deeper, crawl up.
  15383. while (depthA - depthB > 0) {
  15384. instA = instA._hostParent;
  15385. depthA--;
  15386. }
  15387. // If B is deeper, crawl up.
  15388. while (depthB - depthA > 0) {
  15389. instB = instB._hostParent;
  15390. depthB--;
  15391. }
  15392. // Walk in lockstep until we find a match.
  15393. var depth = depthA;
  15394. while (depth--) {
  15395. if (instA === instB) {
  15396. return instA;
  15397. }
  15398. instA = instA._hostParent;
  15399. instB = instB._hostParent;
  15400. }
  15401. return null;
  15402. }
  15403. /**
  15404. * Return if A is an ancestor of B.
  15405. */
  15406. function isAncestor(instA, instB) {
  15407. !('_hostNode' in instA) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0;
  15408. !('_hostNode' in instB) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0;
  15409. while (instB) {
  15410. if (instB === instA) {
  15411. return true;
  15412. }
  15413. instB = instB._hostParent;
  15414. }
  15415. return false;
  15416. }
  15417. /**
  15418. * Return the parent instance of the passed-in instance.
  15419. */
  15420. function getParentInstance(inst) {
  15421. !('_hostNode' in inst) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getParentInstance: Invalid argument.') : _prodInvariant('36') : void 0;
  15422. return inst._hostParent;
  15423. }
  15424. /**
  15425. * Simulates the traversal of a two-phase, capture/bubble event dispatch.
  15426. */
  15427. function traverseTwoPhase(inst, fn, arg) {
  15428. var path = [];
  15429. while (inst) {
  15430. path.push(inst);
  15431. inst = inst._hostParent;
  15432. }
  15433. var i;
  15434. for (i = path.length; i-- > 0;) {
  15435. fn(path[i], 'captured', arg);
  15436. }
  15437. for (i = 0; i < path.length; i++) {
  15438. fn(path[i], 'bubbled', arg);
  15439. }
  15440. }
  15441. /**
  15442. * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
  15443. * should would receive a `mouseEnter` or `mouseLeave` event.
  15444. *
  15445. * Does not invoke the callback on the nearest common ancestor because nothing
  15446. * "entered" or "left" that element.
  15447. */
  15448. function traverseEnterLeave(from, to, fn, argFrom, argTo) {
  15449. var common = from && to ? getLowestCommonAncestor(from, to) : null;
  15450. var pathFrom = [];
  15451. while (from && from !== common) {
  15452. pathFrom.push(from);
  15453. from = from._hostParent;
  15454. }
  15455. var pathTo = [];
  15456. while (to && to !== common) {
  15457. pathTo.push(to);
  15458. to = to._hostParent;
  15459. }
  15460. var i;
  15461. for (i = 0; i < pathFrom.length; i++) {
  15462. fn(pathFrom[i], 'bubbled', argFrom);
  15463. }
  15464. for (i = pathTo.length; i-- > 0;) {
  15465. fn(pathTo[i], 'captured', argTo);
  15466. }
  15467. }
  15468. module.exports = {
  15469. isAncestor: isAncestor,
  15470. getLowestCommonAncestor: getLowestCommonAncestor,
  15471. getParentInstance: getParentInstance,
  15472. traverseTwoPhase: traverseTwoPhase,
  15473. traverseEnterLeave: traverseEnterLeave
  15474. };
  15475. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  15476. /***/ },
  15477. /* 141 */
  15478. /***/ function(module, exports, __webpack_require__) {
  15479. /* WEBPACK VAR INJECTION */(function(process) {/**
  15480. * Copyright 2013-present, Facebook, Inc.
  15481. * All rights reserved.
  15482. *
  15483. * This source code is licensed under the BSD-style license found in the
  15484. * LICENSE file in the root directory of this source tree. An additional grant
  15485. * of patent rights can be found in the PATENTS file in the same directory.
  15486. *
  15487. */
  15488. 'use strict';
  15489. var _prodInvariant = __webpack_require__(37),
  15490. _assign = __webpack_require__(6);
  15491. var DOMChildrenOperations = __webpack_require__(82);
  15492. var DOMLazyTree = __webpack_require__(83);
  15493. var ReactDOMComponentTree = __webpack_require__(36);
  15494. var escapeTextContentForBrowser = __webpack_require__(88);
  15495. var invariant = __webpack_require__(10);
  15496. var validateDOMNesting = __webpack_require__(138);
  15497. /**
  15498. * Text nodes violate a couple assumptions that React makes about components:
  15499. *
  15500. * - When mounting text into the DOM, adjacent text nodes are merged.
  15501. * - Text nodes cannot be assigned a React root ID.
  15502. *
  15503. * This component is used to wrap strings between comment nodes so that they
  15504. * can undergo the same reconciliation that is applied to elements.
  15505. *
  15506. * TODO: Investigate representing React components in the DOM with text nodes.
  15507. *
  15508. * @class ReactDOMTextComponent
  15509. * @extends ReactComponent
  15510. * @internal
  15511. */
  15512. var ReactDOMTextComponent = function (text) {
  15513. // TODO: This is really a ReactText (ReactNode), not a ReactElement
  15514. this._currentElement = text;
  15515. this._stringText = '' + text;
  15516. // ReactDOMComponentTree uses these:
  15517. this._hostNode = null;
  15518. this._hostParent = null;
  15519. // Properties
  15520. this._domID = 0;
  15521. this._mountIndex = 0;
  15522. this._closingComment = null;
  15523. this._commentNodes = null;
  15524. };
  15525. _assign(ReactDOMTextComponent.prototype, {
  15526. /**
  15527. * Creates the markup for this text node. This node is not intended to have
  15528. * any features besides containing text content.
  15529. *
  15530. * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
  15531. * @return {string} Markup for this text node.
  15532. * @internal
  15533. */
  15534. mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
  15535. if (process.env.NODE_ENV !== 'production') {
  15536. var parentInfo;
  15537. if (hostParent != null) {
  15538. parentInfo = hostParent._ancestorInfo;
  15539. } else if (hostContainerInfo != null) {
  15540. parentInfo = hostContainerInfo._ancestorInfo;
  15541. }
  15542. if (parentInfo) {
  15543. // parentInfo should always be present except for the top-level
  15544. // component when server rendering
  15545. validateDOMNesting(null, this._stringText, this, parentInfo);
  15546. }
  15547. }
  15548. var domID = hostContainerInfo._idCounter++;
  15549. var openingValue = ' react-text: ' + domID + ' ';
  15550. var closingValue = ' /react-text ';
  15551. this._domID = domID;
  15552. this._hostParent = hostParent;
  15553. if (transaction.useCreateElement) {
  15554. var ownerDocument = hostContainerInfo._ownerDocument;
  15555. var openingComment = ownerDocument.createComment(openingValue);
  15556. var closingComment = ownerDocument.createComment(closingValue);
  15557. var lazyTree = DOMLazyTree(ownerDocument.createDocumentFragment());
  15558. DOMLazyTree.queueChild(lazyTree, DOMLazyTree(openingComment));
  15559. if (this._stringText) {
  15560. DOMLazyTree.queueChild(lazyTree, DOMLazyTree(ownerDocument.createTextNode(this._stringText)));
  15561. }
  15562. DOMLazyTree.queueChild(lazyTree, DOMLazyTree(closingComment));
  15563. ReactDOMComponentTree.precacheNode(this, openingComment);
  15564. this._closingComment = closingComment;
  15565. return lazyTree;
  15566. } else {
  15567. var escapedText = escapeTextContentForBrowser(this._stringText);
  15568. if (transaction.renderToStaticMarkup) {
  15569. // Normally we'd wrap this between comment nodes for the reasons stated
  15570. // above, but since this is a situation where React won't take over
  15571. // (static pages), we can simply return the text as it is.
  15572. return escapedText;
  15573. }
  15574. return '<!--' + openingValue + '-->' + escapedText + '<!--' + closingValue + '-->';
  15575. }
  15576. },
  15577. /**
  15578. * Updates this component by updating the text content.
  15579. *
  15580. * @param {ReactText} nextText The next text content
  15581. * @param {ReactReconcileTransaction} transaction
  15582. * @internal
  15583. */
  15584. receiveComponent: function (nextText, transaction) {
  15585. if (nextText !== this._currentElement) {
  15586. this._currentElement = nextText;
  15587. var nextStringText = '' + nextText;
  15588. if (nextStringText !== this._stringText) {
  15589. // TODO: Save this as pending props and use performUpdateIfNecessary
  15590. // and/or updateComponent to do the actual update for consistency with
  15591. // other component types?
  15592. this._stringText = nextStringText;
  15593. var commentNodes = this.getHostNode();
  15594. DOMChildrenOperations.replaceDelimitedText(commentNodes[0], commentNodes[1], nextStringText);
  15595. }
  15596. }
  15597. },
  15598. getHostNode: function () {
  15599. var hostNode = this._commentNodes;
  15600. if (hostNode) {
  15601. return hostNode;
  15602. }
  15603. if (!this._closingComment) {
  15604. var openingComment = ReactDOMComponentTree.getNodeFromInstance(this);
  15605. var node = openingComment.nextSibling;
  15606. while (true) {
  15607. !(node != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing closing comment for text component %s', this._domID) : _prodInvariant('67', this._domID) : void 0;
  15608. if (node.nodeType === 8 && node.nodeValue === ' /react-text ') {
  15609. this._closingComment = node;
  15610. break;
  15611. }
  15612. node = node.nextSibling;
  15613. }
  15614. }
  15615. hostNode = [this._hostNode, this._closingComment];
  15616. this._commentNodes = hostNode;
  15617. return hostNode;
  15618. },
  15619. unmountComponent: function () {
  15620. this._closingComment = null;
  15621. this._commentNodes = null;
  15622. ReactDOMComponentTree.uncacheNode(this);
  15623. }
  15624. });
  15625. module.exports = ReactDOMTextComponent;
  15626. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  15627. /***/ },
  15628. /* 142 */
  15629. /***/ function(module, exports, __webpack_require__) {
  15630. /**
  15631. * Copyright 2013-present, Facebook, Inc.
  15632. * All rights reserved.
  15633. *
  15634. * This source code is licensed under the BSD-style license found in the
  15635. * LICENSE file in the root directory of this source tree. An additional grant
  15636. * of patent rights can be found in the PATENTS file in the same directory.
  15637. *
  15638. */
  15639. 'use strict';
  15640. var _assign = __webpack_require__(6);
  15641. var ReactUpdates = __webpack_require__(58);
  15642. var Transaction = __webpack_require__(70);
  15643. var emptyFunction = __webpack_require__(14);
  15644. var RESET_BATCHED_UPDATES = {
  15645. initialize: emptyFunction,
  15646. close: function () {
  15647. ReactDefaultBatchingStrategy.isBatchingUpdates = false;
  15648. }
  15649. };
  15650. var FLUSH_BATCHED_UPDATES = {
  15651. initialize: emptyFunction,
  15652. close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates)
  15653. };
  15654. var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES];
  15655. function ReactDefaultBatchingStrategyTransaction() {
  15656. this.reinitializeTransaction();
  15657. }
  15658. _assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction, {
  15659. getTransactionWrappers: function () {
  15660. return TRANSACTION_WRAPPERS;
  15661. }
  15662. });
  15663. var transaction = new ReactDefaultBatchingStrategyTransaction();
  15664. var ReactDefaultBatchingStrategy = {
  15665. isBatchingUpdates: false,
  15666. /**
  15667. * Call the provided function in a context within which calls to `setState`
  15668. * and friends are batched such that components aren't updated unnecessarily.
  15669. */
  15670. batchedUpdates: function (callback, a, b, c, d, e) {
  15671. var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;
  15672. ReactDefaultBatchingStrategy.isBatchingUpdates = true;
  15673. // The code is written this way to avoid extra allocations
  15674. if (alreadyBatchingUpdates) {
  15675. return callback(a, b, c, d, e);
  15676. } else {
  15677. return transaction.perform(callback, null, a, b, c, d, e);
  15678. }
  15679. }
  15680. };
  15681. module.exports = ReactDefaultBatchingStrategy;
  15682. /***/ },
  15683. /* 143 */
  15684. /***/ function(module, exports, __webpack_require__) {
  15685. /**
  15686. * Copyright 2013-present, Facebook, Inc.
  15687. * All rights reserved.
  15688. *
  15689. * This source code is licensed under the BSD-style license found in the
  15690. * LICENSE file in the root directory of this source tree. An additional grant
  15691. * of patent rights can be found in the PATENTS file in the same directory.
  15692. *
  15693. */
  15694. 'use strict';
  15695. var _assign = __webpack_require__(6);
  15696. var EventListener = __webpack_require__(144);
  15697. var ExecutionEnvironment = __webpack_require__(50);
  15698. var PooledClass = __webpack_require__(52);
  15699. var ReactDOMComponentTree = __webpack_require__(36);
  15700. var ReactUpdates = __webpack_require__(58);
  15701. var getEventTarget = __webpack_require__(71);
  15702. var getUnboundedScrollPosition = __webpack_require__(145);
  15703. /**
  15704. * Find the deepest React component completely containing the root of the
  15705. * passed-in instance (for use when entire React trees are nested within each
  15706. * other). If React trees are not nested, returns null.
  15707. */
  15708. function findParent(inst) {
  15709. // TODO: It may be a good idea to cache this to prevent unnecessary DOM
  15710. // traversal, but caching is difficult to do correctly without using a
  15711. // mutation observer to listen for all DOM changes.
  15712. while (inst._hostParent) {
  15713. inst = inst._hostParent;
  15714. }
  15715. var rootNode = ReactDOMComponentTree.getNodeFromInstance(inst);
  15716. var container = rootNode.parentNode;
  15717. return ReactDOMComponentTree.getClosestInstanceFromNode(container);
  15718. }
  15719. // Used to store ancestor hierarchy in top level callback
  15720. function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
  15721. this.topLevelType = topLevelType;
  15722. this.nativeEvent = nativeEvent;
  15723. this.ancestors = [];
  15724. }
  15725. _assign(TopLevelCallbackBookKeeping.prototype, {
  15726. destructor: function () {
  15727. this.topLevelType = null;
  15728. this.nativeEvent = null;
  15729. this.ancestors.length = 0;
  15730. }
  15731. });
  15732. PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler);
  15733. function handleTopLevelImpl(bookKeeping) {
  15734. var nativeEventTarget = getEventTarget(bookKeeping.nativeEvent);
  15735. var targetInst = ReactDOMComponentTree.getClosestInstanceFromNode(nativeEventTarget);
  15736. // Loop through the hierarchy, in case there's any nested components.
  15737. // It's important that we build the array of ancestors before calling any
  15738. // event handlers, because event handlers can modify the DOM, leading to
  15739. // inconsistencies with ReactMount's node cache. See #1105.
  15740. var ancestor = targetInst;
  15741. do {
  15742. bookKeeping.ancestors.push(ancestor);
  15743. ancestor = ancestor && findParent(ancestor);
  15744. } while (ancestor);
  15745. for (var i = 0; i < bookKeeping.ancestors.length; i++) {
  15746. targetInst = bookKeeping.ancestors[i];
  15747. ReactEventListener._handleTopLevel(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
  15748. }
  15749. }
  15750. function scrollValueMonitor(cb) {
  15751. var scrollPosition = getUnboundedScrollPosition(window);
  15752. cb(scrollPosition);
  15753. }
  15754. var ReactEventListener = {
  15755. _enabled: true,
  15756. _handleTopLevel: null,
  15757. WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null,
  15758. setHandleTopLevel: function (handleTopLevel) {
  15759. ReactEventListener._handleTopLevel = handleTopLevel;
  15760. },
  15761. setEnabled: function (enabled) {
  15762. ReactEventListener._enabled = !!enabled;
  15763. },
  15764. isEnabled: function () {
  15765. return ReactEventListener._enabled;
  15766. },
  15767. /**
  15768. * Traps top-level events by using event bubbling.
  15769. *
  15770. * @param {string} topLevelType Record from `EventConstants`.
  15771. * @param {string} handlerBaseName Event name (e.g. "click").
  15772. * @param {object} element Element on which to attach listener.
  15773. * @return {?object} An object with a remove function which will forcefully
  15774. * remove the listener.
  15775. * @internal
  15776. */
  15777. trapBubbledEvent: function (topLevelType, handlerBaseName, element) {
  15778. if (!element) {
  15779. return null;
  15780. }
  15781. return EventListener.listen(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
  15782. },
  15783. /**
  15784. * Traps a top-level event by using event capturing.
  15785. *
  15786. * @param {string} topLevelType Record from `EventConstants`.
  15787. * @param {string} handlerBaseName Event name (e.g. "click").
  15788. * @param {object} element Element on which to attach listener.
  15789. * @return {?object} An object with a remove function which will forcefully
  15790. * remove the listener.
  15791. * @internal
  15792. */
  15793. trapCapturedEvent: function (topLevelType, handlerBaseName, element) {
  15794. if (!element) {
  15795. return null;
  15796. }
  15797. return EventListener.capture(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
  15798. },
  15799. monitorScrollValue: function (refresh) {
  15800. var callback = scrollValueMonitor.bind(null, refresh);
  15801. EventListener.listen(window, 'scroll', callback);
  15802. },
  15803. dispatchEvent: function (topLevelType, nativeEvent) {
  15804. if (!ReactEventListener._enabled) {
  15805. return;
  15806. }
  15807. var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent);
  15808. try {
  15809. // Event queue being processed in the same cycle allows
  15810. // `preventDefault`.
  15811. ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping);
  15812. } finally {
  15813. TopLevelCallbackBookKeeping.release(bookKeeping);
  15814. }
  15815. }
  15816. };
  15817. module.exports = ReactEventListener;
  15818. /***/ },
  15819. /* 144 */
  15820. /***/ function(module, exports, __webpack_require__) {
  15821. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  15822. /**
  15823. * Copyright (c) 2013-present, Facebook, Inc.
  15824. *
  15825. * Licensed under the Apache License, Version 2.0 (the "License");
  15826. * you may not use this file except in compliance with the License.
  15827. * You may obtain a copy of the License at
  15828. *
  15829. * http://www.apache.org/licenses/LICENSE-2.0
  15830. *
  15831. * Unless required by applicable law or agreed to in writing, software
  15832. * distributed under the License is distributed on an "AS IS" BASIS,
  15833. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15834. * See the License for the specific language governing permissions and
  15835. * limitations under the License.
  15836. *
  15837. * @typechecks
  15838. */
  15839. var emptyFunction = __webpack_require__(14);
  15840. /**
  15841. * Upstream version of event listener. Does not take into account specific
  15842. * nature of platform.
  15843. */
  15844. var EventListener = {
  15845. /**
  15846. * Listen to DOM events during the bubble phase.
  15847. *
  15848. * @param {DOMEventTarget} target DOM element to register listener on.
  15849. * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
  15850. * @param {function} callback Callback function.
  15851. * @return {object} Object with a `remove` method.
  15852. */
  15853. listen: function listen(target, eventType, callback) {
  15854. if (target.addEventListener) {
  15855. target.addEventListener(eventType, callback, false);
  15856. return {
  15857. remove: function remove() {
  15858. target.removeEventListener(eventType, callback, false);
  15859. }
  15860. };
  15861. } else if (target.attachEvent) {
  15862. target.attachEvent('on' + eventType, callback);
  15863. return {
  15864. remove: function remove() {
  15865. target.detachEvent('on' + eventType, callback);
  15866. }
  15867. };
  15868. }
  15869. },
  15870. /**
  15871. * Listen to DOM events during the capture phase.
  15872. *
  15873. * @param {DOMEventTarget} target DOM element to register listener on.
  15874. * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
  15875. * @param {function} callback Callback function.
  15876. * @return {object} Object with a `remove` method.
  15877. */
  15878. capture: function capture(target, eventType, callback) {
  15879. if (target.addEventListener) {
  15880. target.addEventListener(eventType, callback, true);
  15881. return {
  15882. remove: function remove() {
  15883. target.removeEventListener(eventType, callback, true);
  15884. }
  15885. };
  15886. } else {
  15887. if (process.env.NODE_ENV !== 'production') {
  15888. 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.');
  15889. }
  15890. return {
  15891. remove: emptyFunction
  15892. };
  15893. }
  15894. },
  15895. registerDefault: function registerDefault() {}
  15896. };
  15897. module.exports = EventListener;
  15898. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  15899. /***/ },
  15900. /* 145 */
  15901. /***/ function(module, exports) {
  15902. /**
  15903. * Copyright (c) 2013-present, Facebook, Inc.
  15904. * All rights reserved.
  15905. *
  15906. * This source code is licensed under the BSD-style license found in the
  15907. * LICENSE file in the root directory of this source tree. An additional grant
  15908. * of patent rights can be found in the PATENTS file in the same directory.
  15909. *
  15910. * @typechecks
  15911. */
  15912. 'use strict';
  15913. /**
  15914. * Gets the scroll position of the supplied element or window.
  15915. *
  15916. * The return values are unbounded, unlike `getScrollPosition`. This means they
  15917. * may be negative or exceed the element boundaries (which is possible using
  15918. * inertial scrolling).
  15919. *
  15920. * @param {DOMWindow|DOMElement} scrollable
  15921. * @return {object} Map with `x` and `y` keys.
  15922. */
  15923. function getUnboundedScrollPosition(scrollable) {
  15924. if (scrollable === window) {
  15925. return {
  15926. x: window.pageXOffset || document.documentElement.scrollLeft,
  15927. y: window.pageYOffset || document.documentElement.scrollTop
  15928. };
  15929. }
  15930. return {
  15931. x: scrollable.scrollLeft,
  15932. y: scrollable.scrollTop
  15933. };
  15934. }
  15935. module.exports = getUnboundedScrollPosition;
  15936. /***/ },
  15937. /* 146 */
  15938. /***/ function(module, exports, __webpack_require__) {
  15939. /**
  15940. * Copyright 2013-present, Facebook, Inc.
  15941. * All rights reserved.
  15942. *
  15943. * This source code is licensed under the BSD-style license found in the
  15944. * LICENSE file in the root directory of this source tree. An additional grant
  15945. * of patent rights can be found in the PATENTS file in the same directory.
  15946. *
  15947. */
  15948. 'use strict';
  15949. var DOMProperty = __webpack_require__(38);
  15950. var EventPluginHub = __webpack_require__(44);
  15951. var EventPluginUtils = __webpack_require__(46);
  15952. var ReactComponentEnvironment = __webpack_require__(117);
  15953. var ReactEmptyComponent = __webpack_require__(127);
  15954. var ReactBrowserEventEmitter = __webpack_require__(107);
  15955. var ReactHostComponent = __webpack_require__(128);
  15956. var ReactUpdates = __webpack_require__(58);
  15957. var ReactInjection = {
  15958. Component: ReactComponentEnvironment.injection,
  15959. DOMProperty: DOMProperty.injection,
  15960. EmptyComponent: ReactEmptyComponent.injection,
  15961. EventPluginHub: EventPluginHub.injection,
  15962. EventPluginUtils: EventPluginUtils.injection,
  15963. EventEmitter: ReactBrowserEventEmitter.injection,
  15964. HostComponent: ReactHostComponent.injection,
  15965. Updates: ReactUpdates.injection
  15966. };
  15967. module.exports = ReactInjection;
  15968. /***/ },
  15969. /* 147 */
  15970. /***/ function(module, exports, __webpack_require__) {
  15971. /* WEBPACK VAR INJECTION */(function(process) {/**
  15972. * Copyright 2013-present, Facebook, Inc.
  15973. * All rights reserved.
  15974. *
  15975. * This source code is licensed under the BSD-style license found in the
  15976. * LICENSE file in the root directory of this source tree. An additional grant
  15977. * of patent rights can be found in the PATENTS file in the same directory.
  15978. *
  15979. */
  15980. 'use strict';
  15981. var _assign = __webpack_require__(6);
  15982. var CallbackQueue = __webpack_require__(59);
  15983. var PooledClass = __webpack_require__(52);
  15984. var ReactBrowserEventEmitter = __webpack_require__(107);
  15985. var ReactInputSelection = __webpack_require__(148);
  15986. var ReactInstrumentation = __webpack_require__(64);
  15987. var Transaction = __webpack_require__(70);
  15988. var ReactUpdateQueue = __webpack_require__(137);
  15989. /**
  15990. * Ensures that, when possible, the selection range (currently selected text
  15991. * input) is not disturbed by performing the transaction.
  15992. */
  15993. var SELECTION_RESTORATION = {
  15994. /**
  15995. * @return {Selection} Selection information.
  15996. */
  15997. initialize: ReactInputSelection.getSelectionInformation,
  15998. /**
  15999. * @param {Selection} sel Selection information returned from `initialize`.
  16000. */
  16001. close: ReactInputSelection.restoreSelection
  16002. };
  16003. /**
  16004. * Suppresses events (blur/focus) that could be inadvertently dispatched due to
  16005. * high level DOM manipulations (like temporarily removing a text input from the
  16006. * DOM).
  16007. */
  16008. var EVENT_SUPPRESSION = {
  16009. /**
  16010. * @return {boolean} The enabled status of `ReactBrowserEventEmitter` before
  16011. * the reconciliation.
  16012. */
  16013. initialize: function () {
  16014. var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();
  16015. ReactBrowserEventEmitter.setEnabled(false);
  16016. return currentlyEnabled;
  16017. },
  16018. /**
  16019. * @param {boolean} previouslyEnabled Enabled status of
  16020. * `ReactBrowserEventEmitter` before the reconciliation occurred. `close`
  16021. * restores the previous value.
  16022. */
  16023. close: function (previouslyEnabled) {
  16024. ReactBrowserEventEmitter.setEnabled(previouslyEnabled);
  16025. }
  16026. };
  16027. /**
  16028. * Provides a queue for collecting `componentDidMount` and
  16029. * `componentDidUpdate` callbacks during the transaction.
  16030. */
  16031. var ON_DOM_READY_QUEUEING = {
  16032. /**
  16033. * Initializes the internal `onDOMReady` queue.
  16034. */
  16035. initialize: function () {
  16036. this.reactMountReady.reset();
  16037. },
  16038. /**
  16039. * After DOM is flushed, invoke all registered `onDOMReady` callbacks.
  16040. */
  16041. close: function () {
  16042. this.reactMountReady.notifyAll();
  16043. }
  16044. };
  16045. /**
  16046. * Executed within the scope of the `Transaction` instance. Consider these as
  16047. * being member methods, but with an implied ordering while being isolated from
  16048. * each other.
  16049. */
  16050. var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING];
  16051. if (process.env.NODE_ENV !== 'production') {
  16052. TRANSACTION_WRAPPERS.push({
  16053. initialize: ReactInstrumentation.debugTool.onBeginFlush,
  16054. close: ReactInstrumentation.debugTool.onEndFlush
  16055. });
  16056. }
  16057. /**
  16058. * Currently:
  16059. * - The order that these are listed in the transaction is critical:
  16060. * - Suppresses events.
  16061. * - Restores selection range.
  16062. *
  16063. * Future:
  16064. * - Restore document/overflow scroll positions that were unintentionally
  16065. * modified via DOM insertions above the top viewport boundary.
  16066. * - Implement/integrate with customized constraint based layout system and keep
  16067. * track of which dimensions must be remeasured.
  16068. *
  16069. * @class ReactReconcileTransaction
  16070. */
  16071. function ReactReconcileTransaction(useCreateElement) {
  16072. this.reinitializeTransaction();
  16073. // Only server-side rendering really needs this option (see
  16074. // `ReactServerRendering`), but server-side uses
  16075. // `ReactServerRenderingTransaction` instead. This option is here so that it's
  16076. // accessible and defaults to false when `ReactDOMComponent` and
  16077. // `ReactDOMTextComponent` checks it in `mountComponent`.`
  16078. this.renderToStaticMarkup = false;
  16079. this.reactMountReady = CallbackQueue.getPooled(null);
  16080. this.useCreateElement = useCreateElement;
  16081. }
  16082. var Mixin = {
  16083. /**
  16084. * @see Transaction
  16085. * @abstract
  16086. * @final
  16087. * @return {array<object>} List of operation wrap procedures.
  16088. * TODO: convert to array<TransactionWrapper>
  16089. */
  16090. getTransactionWrappers: function () {
  16091. return TRANSACTION_WRAPPERS;
  16092. },
  16093. /**
  16094. * @return {object} The queue to collect `onDOMReady` callbacks with.
  16095. */
  16096. getReactMountReady: function () {
  16097. return this.reactMountReady;
  16098. },
  16099. /**
  16100. * @return {object} The queue to collect React async events.
  16101. */
  16102. getUpdateQueue: function () {
  16103. return ReactUpdateQueue;
  16104. },
  16105. /**
  16106. * Save current transaction state -- if the return value from this method is
  16107. * passed to `rollback`, the transaction will be reset to that state.
  16108. */
  16109. checkpoint: function () {
  16110. // reactMountReady is the our only stateful wrapper
  16111. return this.reactMountReady.checkpoint();
  16112. },
  16113. rollback: function (checkpoint) {
  16114. this.reactMountReady.rollback(checkpoint);
  16115. },
  16116. /**
  16117. * `PooledClass` looks for this, and will invoke this before allowing this
  16118. * instance to be reused.
  16119. */
  16120. destructor: function () {
  16121. CallbackQueue.release(this.reactMountReady);
  16122. this.reactMountReady = null;
  16123. }
  16124. };
  16125. _assign(ReactReconcileTransaction.prototype, Transaction, Mixin);
  16126. PooledClass.addPoolingTo(ReactReconcileTransaction);
  16127. module.exports = ReactReconcileTransaction;
  16128. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  16129. /***/ },
  16130. /* 148 */
  16131. /***/ function(module, exports, __webpack_require__) {
  16132. /**
  16133. * Copyright 2013-present, Facebook, Inc.
  16134. * All rights reserved.
  16135. *
  16136. * This source code is licensed under the BSD-style license found in the
  16137. * LICENSE file in the root directory of this source tree. An additional grant
  16138. * of patent rights can be found in the PATENTS file in the same directory.
  16139. *
  16140. */
  16141. 'use strict';
  16142. var ReactDOMSelection = __webpack_require__(149);
  16143. var containsNode = __webpack_require__(151);
  16144. var focusNode = __webpack_require__(96);
  16145. var getActiveElement = __webpack_require__(154);
  16146. function isInDocument(node) {
  16147. return containsNode(document.documentElement, node);
  16148. }
  16149. /**
  16150. * @ReactInputSelection: React input selection module. Based on Selection.js,
  16151. * but modified to be suitable for react and has a couple of bug fixes (doesn't
  16152. * assume buttons have range selections allowed).
  16153. * Input selection module for React.
  16154. */
  16155. var ReactInputSelection = {
  16156. hasSelectionCapabilities: function (elem) {
  16157. var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
  16158. return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true');
  16159. },
  16160. getSelectionInformation: function () {
  16161. var focusedElem = getActiveElement();
  16162. return {
  16163. focusedElem: focusedElem,
  16164. selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null
  16165. };
  16166. },
  16167. /**
  16168. * @restoreSelection: If any selection information was potentially lost,
  16169. * restore it. This is useful when performing operations that could remove dom
  16170. * nodes and place them back in, resulting in focus being lost.
  16171. */
  16172. restoreSelection: function (priorSelectionInformation) {
  16173. var curFocusedElem = getActiveElement();
  16174. var priorFocusedElem = priorSelectionInformation.focusedElem;
  16175. var priorSelectionRange = priorSelectionInformation.selectionRange;
  16176. if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
  16177. if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) {
  16178. ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange);
  16179. }
  16180. focusNode(priorFocusedElem);
  16181. }
  16182. },
  16183. /**
  16184. * @getSelection: Gets the selection bounds of a focused textarea, input or
  16185. * contentEditable node.
  16186. * -@input: Look up selection bounds of this input
  16187. * -@return {start: selectionStart, end: selectionEnd}
  16188. */
  16189. getSelection: function (input) {
  16190. var selection;
  16191. if ('selectionStart' in input) {
  16192. // Modern browser with input or textarea.
  16193. selection = {
  16194. start: input.selectionStart,
  16195. end: input.selectionEnd
  16196. };
  16197. } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
  16198. // IE8 input.
  16199. var range = document.selection.createRange();
  16200. // There can only be one selection per document in IE, so it must
  16201. // be in our element.
  16202. if (range.parentElement() === input) {
  16203. selection = {
  16204. start: -range.moveStart('character', -input.value.length),
  16205. end: -range.moveEnd('character', -input.value.length)
  16206. };
  16207. }
  16208. } else {
  16209. // Content editable or old IE textarea.
  16210. selection = ReactDOMSelection.getOffsets(input);
  16211. }
  16212. return selection || { start: 0, end: 0 };
  16213. },
  16214. /**
  16215. * @setSelection: Sets the selection bounds of a textarea or input and focuses
  16216. * the input.
  16217. * -@input Set selection bounds of this input or textarea
  16218. * -@offsets Object of same form that is returned from get*
  16219. */
  16220. setSelection: function (input, offsets) {
  16221. var start = offsets.start;
  16222. var end = offsets.end;
  16223. if (end === undefined) {
  16224. end = start;
  16225. }
  16226. if ('selectionStart' in input) {
  16227. input.selectionStart = start;
  16228. input.selectionEnd = Math.min(end, input.value.length);
  16229. } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
  16230. var range = input.createTextRange();
  16231. range.collapse(true);
  16232. range.moveStart('character', start);
  16233. range.moveEnd('character', end - start);
  16234. range.select();
  16235. } else {
  16236. ReactDOMSelection.setOffsets(input, offsets);
  16237. }
  16238. }
  16239. };
  16240. module.exports = ReactInputSelection;
  16241. /***/ },
  16242. /* 149 */
  16243. /***/ function(module, exports, __webpack_require__) {
  16244. /**
  16245. * Copyright 2013-present, Facebook, Inc.
  16246. * All rights reserved.
  16247. *
  16248. * This source code is licensed under the BSD-style license found in the
  16249. * LICENSE file in the root directory of this source tree. An additional grant
  16250. * of patent rights can be found in the PATENTS file in the same directory.
  16251. *
  16252. */
  16253. 'use strict';
  16254. var ExecutionEnvironment = __webpack_require__(50);
  16255. var getNodeForCharacterOffset = __webpack_require__(150);
  16256. var getTextContentAccessor = __webpack_require__(53);
  16257. /**
  16258. * While `isCollapsed` is available on the Selection object and `collapsed`
  16259. * is available on the Range object, IE11 sometimes gets them wrong.
  16260. * If the anchor/focus nodes and offsets are the same, the range is collapsed.
  16261. */
  16262. function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
  16263. return anchorNode === focusNode && anchorOffset === focusOffset;
  16264. }
  16265. /**
  16266. * Get the appropriate anchor and focus node/offset pairs for IE.
  16267. *
  16268. * The catch here is that IE's selection API doesn't provide information
  16269. * about whether the selection is forward or backward, so we have to
  16270. * behave as though it's always forward.
  16271. *
  16272. * IE text differs from modern selection in that it behaves as though
  16273. * block elements end with a new line. This means character offsets will
  16274. * differ between the two APIs.
  16275. *
  16276. * @param {DOMElement} node
  16277. * @return {object}
  16278. */
  16279. function getIEOffsets(node) {
  16280. var selection = document.selection;
  16281. var selectedRange = selection.createRange();
  16282. var selectedLength = selectedRange.text.length;
  16283. // Duplicate selection so we can move range without breaking user selection.
  16284. var fromStart = selectedRange.duplicate();
  16285. fromStart.moveToElementText(node);
  16286. fromStart.setEndPoint('EndToStart', selectedRange);
  16287. var startOffset = fromStart.text.length;
  16288. var endOffset = startOffset + selectedLength;
  16289. return {
  16290. start: startOffset,
  16291. end: endOffset
  16292. };
  16293. }
  16294. /**
  16295. * @param {DOMElement} node
  16296. * @return {?object}
  16297. */
  16298. function getModernOffsets(node) {
  16299. var selection = window.getSelection && window.getSelection();
  16300. if (!selection || selection.rangeCount === 0) {
  16301. return null;
  16302. }
  16303. var anchorNode = selection.anchorNode;
  16304. var anchorOffset = selection.anchorOffset;
  16305. var focusNode = selection.focusNode;
  16306. var focusOffset = selection.focusOffset;
  16307. var currentRange = selection.getRangeAt(0);
  16308. // In Firefox, range.startContainer and range.endContainer can be "anonymous
  16309. // divs", e.g. the up/down buttons on an <input type="number">. Anonymous
  16310. // divs do not seem to expose properties, triggering a "Permission denied
  16311. // error" if any of its properties are accessed. The only seemingly possible
  16312. // way to avoid erroring is to access a property that typically works for
  16313. // non-anonymous divs and catch any error that may otherwise arise. See
  16314. // https://bugzilla.mozilla.org/show_bug.cgi?id=208427
  16315. try {
  16316. /* eslint-disable no-unused-expressions */
  16317. currentRange.startContainer.nodeType;
  16318. currentRange.endContainer.nodeType;
  16319. /* eslint-enable no-unused-expressions */
  16320. } catch (e) {
  16321. return null;
  16322. }
  16323. // If the node and offset values are the same, the selection is collapsed.
  16324. // `Selection.isCollapsed` is available natively, but IE sometimes gets
  16325. // this value wrong.
  16326. var isSelectionCollapsed = isCollapsed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
  16327. var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length;
  16328. var tempRange = currentRange.cloneRange();
  16329. tempRange.selectNodeContents(node);
  16330. tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);
  16331. var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempRange.startOffset, tempRange.endContainer, tempRange.endOffset);
  16332. var start = isTempRangeCollapsed ? 0 : tempRange.toString().length;
  16333. var end = start + rangeLength;
  16334. // Detect whether the selection is backward.
  16335. var detectionRange = document.createRange();
  16336. detectionRange.setStart(anchorNode, anchorOffset);
  16337. detectionRange.setEnd(focusNode, focusOffset);
  16338. var isBackward = detectionRange.collapsed;
  16339. return {
  16340. start: isBackward ? end : start,
  16341. end: isBackward ? start : end
  16342. };
  16343. }
  16344. /**
  16345. * @param {DOMElement|DOMTextNode} node
  16346. * @param {object} offsets
  16347. */
  16348. function setIEOffsets(node, offsets) {
  16349. var range = document.selection.createRange().duplicate();
  16350. var start, end;
  16351. if (offsets.end === undefined) {
  16352. start = offsets.start;
  16353. end = start;
  16354. } else if (offsets.start > offsets.end) {
  16355. start = offsets.end;
  16356. end = offsets.start;
  16357. } else {
  16358. start = offsets.start;
  16359. end = offsets.end;
  16360. }
  16361. range.moveToElementText(node);
  16362. range.moveStart('character', start);
  16363. range.setEndPoint('EndToStart', range);
  16364. range.moveEnd('character', end - start);
  16365. range.select();
  16366. }
  16367. /**
  16368. * In modern non-IE browsers, we can support both forward and backward
  16369. * selections.
  16370. *
  16371. * Note: IE10+ supports the Selection object, but it does not support
  16372. * the `extend` method, which means that even in modern IE, it's not possible
  16373. * to programmatically create a backward selection. Thus, for all IE
  16374. * versions, we use the old IE API to create our selections.
  16375. *
  16376. * @param {DOMElement|DOMTextNode} node
  16377. * @param {object} offsets
  16378. */
  16379. function setModernOffsets(node, offsets) {
  16380. if (!window.getSelection) {
  16381. return;
  16382. }
  16383. var selection = window.getSelection();
  16384. var length = node[getTextContentAccessor()].length;
  16385. var start = Math.min(offsets.start, length);
  16386. var end = offsets.end === undefined ? start : Math.min(offsets.end, length);
  16387. // IE 11 uses modern selection, but doesn't support the extend method.
  16388. // Flip backward selections, so we can set with a single range.
  16389. if (!selection.extend && start > end) {
  16390. var temp = end;
  16391. end = start;
  16392. start = temp;
  16393. }
  16394. var startMarker = getNodeForCharacterOffset(node, start);
  16395. var endMarker = getNodeForCharacterOffset(node, end);
  16396. if (startMarker && endMarker) {
  16397. var range = document.createRange();
  16398. range.setStart(startMarker.node, startMarker.offset);
  16399. selection.removeAllRanges();
  16400. if (start > end) {
  16401. selection.addRange(range);
  16402. selection.extend(endMarker.node, endMarker.offset);
  16403. } else {
  16404. range.setEnd(endMarker.node, endMarker.offset);
  16405. selection.addRange(range);
  16406. }
  16407. }
  16408. }
  16409. var useIEOffsets = ExecutionEnvironment.canUseDOM && 'selection' in document && !('getSelection' in window);
  16410. var ReactDOMSelection = {
  16411. /**
  16412. * @param {DOMElement} node
  16413. */
  16414. getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets,
  16415. /**
  16416. * @param {DOMElement|DOMTextNode} node
  16417. * @param {object} offsets
  16418. */
  16419. setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets
  16420. };
  16421. module.exports = ReactDOMSelection;
  16422. /***/ },
  16423. /* 150 */
  16424. /***/ function(module, exports) {
  16425. /**
  16426. * Copyright 2013-present, Facebook, Inc.
  16427. * All rights reserved.
  16428. *
  16429. * This source code is licensed under the BSD-style license found in the
  16430. * LICENSE file in the root directory of this source tree. An additional grant
  16431. * of patent rights can be found in the PATENTS file in the same directory.
  16432. *
  16433. */
  16434. 'use strict';
  16435. /**
  16436. * Given any node return the first leaf node without children.
  16437. *
  16438. * @param {DOMElement|DOMTextNode} node
  16439. * @return {DOMElement|DOMTextNode}
  16440. */
  16441. function getLeafNode(node) {
  16442. while (node && node.firstChild) {
  16443. node = node.firstChild;
  16444. }
  16445. return node;
  16446. }
  16447. /**
  16448. * Get the next sibling within a container. This will walk up the
  16449. * DOM if a node's siblings have been exhausted.
  16450. *
  16451. * @param {DOMElement|DOMTextNode} node
  16452. * @return {?DOMElement|DOMTextNode}
  16453. */
  16454. function getSiblingNode(node) {
  16455. while (node) {
  16456. if (node.nextSibling) {
  16457. return node.nextSibling;
  16458. }
  16459. node = node.parentNode;
  16460. }
  16461. }
  16462. /**
  16463. * Get object describing the nodes which contain characters at offset.
  16464. *
  16465. * @param {DOMElement|DOMTextNode} root
  16466. * @param {number} offset
  16467. * @return {?object}
  16468. */
  16469. function getNodeForCharacterOffset(root, offset) {
  16470. var node = getLeafNode(root);
  16471. var nodeStart = 0;
  16472. var nodeEnd = 0;
  16473. while (node) {
  16474. if (node.nodeType === 3) {
  16475. nodeEnd = nodeStart + node.textContent.length;
  16476. if (nodeStart <= offset && nodeEnd >= offset) {
  16477. return {
  16478. node: node,
  16479. offset: offset - nodeStart
  16480. };
  16481. }
  16482. nodeStart = nodeEnd;
  16483. }
  16484. node = getLeafNode(getSiblingNode(node));
  16485. }
  16486. }
  16487. module.exports = getNodeForCharacterOffset;
  16488. /***/ },
  16489. /* 151 */
  16490. /***/ function(module, exports, __webpack_require__) {
  16491. 'use strict';
  16492. /**
  16493. * Copyright (c) 2013-present, Facebook, Inc.
  16494. * All rights reserved.
  16495. *
  16496. * This source code is licensed under the BSD-style license found in the
  16497. * LICENSE file in the root directory of this source tree. An additional grant
  16498. * of patent rights can be found in the PATENTS file in the same directory.
  16499. *
  16500. *
  16501. */
  16502. var isTextNode = __webpack_require__(152);
  16503. /*eslint-disable no-bitwise */
  16504. /**
  16505. * Checks if a given DOM node contains or is another DOM node.
  16506. */
  16507. function containsNode(outerNode, innerNode) {
  16508. if (!outerNode || !innerNode) {
  16509. return false;
  16510. } else if (outerNode === innerNode) {
  16511. return true;
  16512. } else if (isTextNode(outerNode)) {
  16513. return false;
  16514. } else if (isTextNode(innerNode)) {
  16515. return containsNode(outerNode, innerNode.parentNode);
  16516. } else if ('contains' in outerNode) {
  16517. return outerNode.contains(innerNode);
  16518. } else if (outerNode.compareDocumentPosition) {
  16519. return !!(outerNode.compareDocumentPosition(innerNode) & 16);
  16520. } else {
  16521. return false;
  16522. }
  16523. }
  16524. module.exports = containsNode;
  16525. /***/ },
  16526. /* 152 */
  16527. /***/ function(module, exports, __webpack_require__) {
  16528. 'use strict';
  16529. /**
  16530. * Copyright (c) 2013-present, Facebook, Inc.
  16531. * All rights reserved.
  16532. *
  16533. * This source code is licensed under the BSD-style license found in the
  16534. * LICENSE file in the root directory of this source tree. An additional grant
  16535. * of patent rights can be found in the PATENTS file in the same directory.
  16536. *
  16537. * @typechecks
  16538. */
  16539. var isNode = __webpack_require__(153);
  16540. /**
  16541. * @param {*} object The object to check.
  16542. * @return {boolean} Whether or not the object is a DOM text node.
  16543. */
  16544. function isTextNode(object) {
  16545. return isNode(object) && object.nodeType == 3;
  16546. }
  16547. module.exports = isTextNode;
  16548. /***/ },
  16549. /* 153 */
  16550. /***/ function(module, exports) {
  16551. 'use strict';
  16552. /**
  16553. * Copyright (c) 2013-present, Facebook, Inc.
  16554. * All rights reserved.
  16555. *
  16556. * This source code is licensed under the BSD-style license found in the
  16557. * LICENSE file in the root directory of this source tree. An additional grant
  16558. * of patent rights can be found in the PATENTS file in the same directory.
  16559. *
  16560. * @typechecks
  16561. */
  16562. /**
  16563. * @param {*} object The object to check.
  16564. * @return {boolean} Whether or not the object is a DOM node.
  16565. */
  16566. function isNode(object) {
  16567. return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
  16568. }
  16569. module.exports = isNode;
  16570. /***/ },
  16571. /* 154 */
  16572. /***/ function(module, exports) {
  16573. 'use strict';
  16574. /**
  16575. * Copyright (c) 2013-present, Facebook, Inc.
  16576. * All rights reserved.
  16577. *
  16578. * This source code is licensed under the BSD-style license found in the
  16579. * LICENSE file in the root directory of this source tree. An additional grant
  16580. * of patent rights can be found in the PATENTS file in the same directory.
  16581. *
  16582. * @typechecks
  16583. */
  16584. /* eslint-disable fb-www/typeof-undefined */
  16585. /**
  16586. * Same as document.activeElement but wraps in a try-catch block. In IE it is
  16587. * not safe to call document.activeElement if there is nothing focused.
  16588. *
  16589. * The activeElement will be null only if the document or document body is not
  16590. * yet defined.
  16591. */
  16592. function getActiveElement() /*?DOMElement*/{
  16593. if (typeof document === 'undefined') {
  16594. return null;
  16595. }
  16596. try {
  16597. return document.activeElement || document.body;
  16598. } catch (e) {
  16599. return document.body;
  16600. }
  16601. }
  16602. module.exports = getActiveElement;
  16603. /***/ },
  16604. /* 155 */
  16605. /***/ function(module, exports) {
  16606. /**
  16607. * Copyright 2013-present, Facebook, Inc.
  16608. * All rights reserved.
  16609. *
  16610. * This source code is licensed under the BSD-style license found in the
  16611. * LICENSE file in the root directory of this source tree. An additional grant
  16612. * of patent rights can be found in the PATENTS file in the same directory.
  16613. *
  16614. */
  16615. 'use strict';
  16616. var NS = {
  16617. xlink: 'http://www.w3.org/1999/xlink',
  16618. xml: 'http://www.w3.org/XML/1998/namespace'
  16619. };
  16620. // We use attributes for everything SVG so let's avoid some duplication and run
  16621. // code instead.
  16622. // The following are all specified in the HTML config already so we exclude here.
  16623. // - class (as className)
  16624. // - color
  16625. // - height
  16626. // - id
  16627. // - lang
  16628. // - max
  16629. // - media
  16630. // - method
  16631. // - min
  16632. // - name
  16633. // - style
  16634. // - target
  16635. // - type
  16636. // - width
  16637. var ATTRS = {
  16638. accentHeight: 'accent-height',
  16639. accumulate: 0,
  16640. additive: 0,
  16641. alignmentBaseline: 'alignment-baseline',
  16642. allowReorder: 'allowReorder',
  16643. alphabetic: 0,
  16644. amplitude: 0,
  16645. arabicForm: 'arabic-form',
  16646. ascent: 0,
  16647. attributeName: 'attributeName',
  16648. attributeType: 'attributeType',
  16649. autoReverse: 'autoReverse',
  16650. azimuth: 0,
  16651. baseFrequency: 'baseFrequency',
  16652. baseProfile: 'baseProfile',
  16653. baselineShift: 'baseline-shift',
  16654. bbox: 0,
  16655. begin: 0,
  16656. bias: 0,
  16657. by: 0,
  16658. calcMode: 'calcMode',
  16659. capHeight: 'cap-height',
  16660. clip: 0,
  16661. clipPath: 'clip-path',
  16662. clipRule: 'clip-rule',
  16663. clipPathUnits: 'clipPathUnits',
  16664. colorInterpolation: 'color-interpolation',
  16665. colorInterpolationFilters: 'color-interpolation-filters',
  16666. colorProfile: 'color-profile',
  16667. colorRendering: 'color-rendering',
  16668. contentScriptType: 'contentScriptType',
  16669. contentStyleType: 'contentStyleType',
  16670. cursor: 0,
  16671. cx: 0,
  16672. cy: 0,
  16673. d: 0,
  16674. decelerate: 0,
  16675. descent: 0,
  16676. diffuseConstant: 'diffuseConstant',
  16677. direction: 0,
  16678. display: 0,
  16679. divisor: 0,
  16680. dominantBaseline: 'dominant-baseline',
  16681. dur: 0,
  16682. dx: 0,
  16683. dy: 0,
  16684. edgeMode: 'edgeMode',
  16685. elevation: 0,
  16686. enableBackground: 'enable-background',
  16687. end: 0,
  16688. exponent: 0,
  16689. externalResourcesRequired: 'externalResourcesRequired',
  16690. fill: 0,
  16691. fillOpacity: 'fill-opacity',
  16692. fillRule: 'fill-rule',
  16693. filter: 0,
  16694. filterRes: 'filterRes',
  16695. filterUnits: 'filterUnits',
  16696. floodColor: 'flood-color',
  16697. floodOpacity: 'flood-opacity',
  16698. focusable: 0,
  16699. fontFamily: 'font-family',
  16700. fontSize: 'font-size',
  16701. fontSizeAdjust: 'font-size-adjust',
  16702. fontStretch: 'font-stretch',
  16703. fontStyle: 'font-style',
  16704. fontVariant: 'font-variant',
  16705. fontWeight: 'font-weight',
  16706. format: 0,
  16707. from: 0,
  16708. fx: 0,
  16709. fy: 0,
  16710. g1: 0,
  16711. g2: 0,
  16712. glyphName: 'glyph-name',
  16713. glyphOrientationHorizontal: 'glyph-orientation-horizontal',
  16714. glyphOrientationVertical: 'glyph-orientation-vertical',
  16715. glyphRef: 'glyphRef',
  16716. gradientTransform: 'gradientTransform',
  16717. gradientUnits: 'gradientUnits',
  16718. hanging: 0,
  16719. horizAdvX: 'horiz-adv-x',
  16720. horizOriginX: 'horiz-origin-x',
  16721. ideographic: 0,
  16722. imageRendering: 'image-rendering',
  16723. 'in': 0,
  16724. in2: 0,
  16725. intercept: 0,
  16726. k: 0,
  16727. k1: 0,
  16728. k2: 0,
  16729. k3: 0,
  16730. k4: 0,
  16731. kernelMatrix: 'kernelMatrix',
  16732. kernelUnitLength: 'kernelUnitLength',
  16733. kerning: 0,
  16734. keyPoints: 'keyPoints',
  16735. keySplines: 'keySplines',
  16736. keyTimes: 'keyTimes',
  16737. lengthAdjust: 'lengthAdjust',
  16738. letterSpacing: 'letter-spacing',
  16739. lightingColor: 'lighting-color',
  16740. limitingConeAngle: 'limitingConeAngle',
  16741. local: 0,
  16742. markerEnd: 'marker-end',
  16743. markerMid: 'marker-mid',
  16744. markerStart: 'marker-start',
  16745. markerHeight: 'markerHeight',
  16746. markerUnits: 'markerUnits',
  16747. markerWidth: 'markerWidth',
  16748. mask: 0,
  16749. maskContentUnits: 'maskContentUnits',
  16750. maskUnits: 'maskUnits',
  16751. mathematical: 0,
  16752. mode: 0,
  16753. numOctaves: 'numOctaves',
  16754. offset: 0,
  16755. opacity: 0,
  16756. operator: 0,
  16757. order: 0,
  16758. orient: 0,
  16759. orientation: 0,
  16760. origin: 0,
  16761. overflow: 0,
  16762. overlinePosition: 'overline-position',
  16763. overlineThickness: 'overline-thickness',
  16764. paintOrder: 'paint-order',
  16765. panose1: 'panose-1',
  16766. pathLength: 'pathLength',
  16767. patternContentUnits: 'patternContentUnits',
  16768. patternTransform: 'patternTransform',
  16769. patternUnits: 'patternUnits',
  16770. pointerEvents: 'pointer-events',
  16771. points: 0,
  16772. pointsAtX: 'pointsAtX',
  16773. pointsAtY: 'pointsAtY',
  16774. pointsAtZ: 'pointsAtZ',
  16775. preserveAlpha: 'preserveAlpha',
  16776. preserveAspectRatio: 'preserveAspectRatio',
  16777. primitiveUnits: 'primitiveUnits',
  16778. r: 0,
  16779. radius: 0,
  16780. refX: 'refX',
  16781. refY: 'refY',
  16782. renderingIntent: 'rendering-intent',
  16783. repeatCount: 'repeatCount',
  16784. repeatDur: 'repeatDur',
  16785. requiredExtensions: 'requiredExtensions',
  16786. requiredFeatures: 'requiredFeatures',
  16787. restart: 0,
  16788. result: 0,
  16789. rotate: 0,
  16790. rx: 0,
  16791. ry: 0,
  16792. scale: 0,
  16793. seed: 0,
  16794. shapeRendering: 'shape-rendering',
  16795. slope: 0,
  16796. spacing: 0,
  16797. specularConstant: 'specularConstant',
  16798. specularExponent: 'specularExponent',
  16799. speed: 0,
  16800. spreadMethod: 'spreadMethod',
  16801. startOffset: 'startOffset',
  16802. stdDeviation: 'stdDeviation',
  16803. stemh: 0,
  16804. stemv: 0,
  16805. stitchTiles: 'stitchTiles',
  16806. stopColor: 'stop-color',
  16807. stopOpacity: 'stop-opacity',
  16808. strikethroughPosition: 'strikethrough-position',
  16809. strikethroughThickness: 'strikethrough-thickness',
  16810. string: 0,
  16811. stroke: 0,
  16812. strokeDasharray: 'stroke-dasharray',
  16813. strokeDashoffset: 'stroke-dashoffset',
  16814. strokeLinecap: 'stroke-linecap',
  16815. strokeLinejoin: 'stroke-linejoin',
  16816. strokeMiterlimit: 'stroke-miterlimit',
  16817. strokeOpacity: 'stroke-opacity',
  16818. strokeWidth: 'stroke-width',
  16819. surfaceScale: 'surfaceScale',
  16820. systemLanguage: 'systemLanguage',
  16821. tableValues: 'tableValues',
  16822. targetX: 'targetX',
  16823. targetY: 'targetY',
  16824. textAnchor: 'text-anchor',
  16825. textDecoration: 'text-decoration',
  16826. textRendering: 'text-rendering',
  16827. textLength: 'textLength',
  16828. to: 0,
  16829. transform: 0,
  16830. u1: 0,
  16831. u2: 0,
  16832. underlinePosition: 'underline-position',
  16833. underlineThickness: 'underline-thickness',
  16834. unicode: 0,
  16835. unicodeBidi: 'unicode-bidi',
  16836. unicodeRange: 'unicode-range',
  16837. unitsPerEm: 'units-per-em',
  16838. vAlphabetic: 'v-alphabetic',
  16839. vHanging: 'v-hanging',
  16840. vIdeographic: 'v-ideographic',
  16841. vMathematical: 'v-mathematical',
  16842. values: 0,
  16843. vectorEffect: 'vector-effect',
  16844. version: 0,
  16845. vertAdvY: 'vert-adv-y',
  16846. vertOriginX: 'vert-origin-x',
  16847. vertOriginY: 'vert-origin-y',
  16848. viewBox: 'viewBox',
  16849. viewTarget: 'viewTarget',
  16850. visibility: 0,
  16851. widths: 0,
  16852. wordSpacing: 'word-spacing',
  16853. writingMode: 'writing-mode',
  16854. x: 0,
  16855. xHeight: 'x-height',
  16856. x1: 0,
  16857. x2: 0,
  16858. xChannelSelector: 'xChannelSelector',
  16859. xlinkActuate: 'xlink:actuate',
  16860. xlinkArcrole: 'xlink:arcrole',
  16861. xlinkHref: 'xlink:href',
  16862. xlinkRole: 'xlink:role',
  16863. xlinkShow: 'xlink:show',
  16864. xlinkTitle: 'xlink:title',
  16865. xlinkType: 'xlink:type',
  16866. xmlBase: 'xml:base',
  16867. xmlns: 0,
  16868. xmlnsXlink: 'xmlns:xlink',
  16869. xmlLang: 'xml:lang',
  16870. xmlSpace: 'xml:space',
  16871. y: 0,
  16872. y1: 0,
  16873. y2: 0,
  16874. yChannelSelector: 'yChannelSelector',
  16875. z: 0,
  16876. zoomAndPan: 'zoomAndPan'
  16877. };
  16878. var SVGDOMPropertyConfig = {
  16879. Properties: {},
  16880. DOMAttributeNamespaces: {
  16881. xlinkActuate: NS.xlink,
  16882. xlinkArcrole: NS.xlink,
  16883. xlinkHref: NS.xlink,
  16884. xlinkRole: NS.xlink,
  16885. xlinkShow: NS.xlink,
  16886. xlinkTitle: NS.xlink,
  16887. xlinkType: NS.xlink,
  16888. xmlBase: NS.xml,
  16889. xmlLang: NS.xml,
  16890. xmlSpace: NS.xml
  16891. },
  16892. DOMAttributeNames: {}
  16893. };
  16894. Object.keys(ATTRS).forEach(function (key) {
  16895. SVGDOMPropertyConfig.Properties[key] = 0;
  16896. if (ATTRS[key]) {
  16897. SVGDOMPropertyConfig.DOMAttributeNames[key] = ATTRS[key];
  16898. }
  16899. });
  16900. module.exports = SVGDOMPropertyConfig;
  16901. /***/ },
  16902. /* 156 */
  16903. /***/ function(module, exports, __webpack_require__) {
  16904. /**
  16905. * Copyright 2013-present, Facebook, Inc.
  16906. * All rights reserved.
  16907. *
  16908. * This source code is licensed under the BSD-style license found in the
  16909. * LICENSE file in the root directory of this source tree. An additional grant
  16910. * of patent rights can be found in the PATENTS file in the same directory.
  16911. *
  16912. */
  16913. 'use strict';
  16914. var EventPropagators = __webpack_require__(43);
  16915. var ExecutionEnvironment = __webpack_require__(50);
  16916. var ReactDOMComponentTree = __webpack_require__(36);
  16917. var ReactInputSelection = __webpack_require__(148);
  16918. var SyntheticEvent = __webpack_require__(55);
  16919. var getActiveElement = __webpack_require__(154);
  16920. var isTextInputElement = __webpack_require__(73);
  16921. var shallowEqual = __webpack_require__(125);
  16922. var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11;
  16923. var eventTypes = {
  16924. select: {
  16925. phasedRegistrationNames: {
  16926. bubbled: 'onSelect',
  16927. captured: 'onSelectCapture'
  16928. },
  16929. dependencies: ['topBlur', 'topContextMenu', 'topFocus', 'topKeyDown', 'topKeyUp', 'topMouseDown', 'topMouseUp', 'topSelectionChange']
  16930. }
  16931. };
  16932. var activeElement = null;
  16933. var activeElementInst = null;
  16934. var lastSelection = null;
  16935. var mouseDown = false;
  16936. // Track whether a listener exists for this plugin. If none exist, we do
  16937. // not extract events. See #3639.
  16938. var hasListener = false;
  16939. /**
  16940. * Get an object which is a unique representation of the current selection.
  16941. *
  16942. * The return value will not be consistent across nodes or browsers, but
  16943. * two identical selections on the same node will return identical objects.
  16944. *
  16945. * @param {DOMElement} node
  16946. * @return {object}
  16947. */
  16948. function getSelection(node) {
  16949. if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) {
  16950. return {
  16951. start: node.selectionStart,
  16952. end: node.selectionEnd
  16953. };
  16954. } else if (window.getSelection) {
  16955. var selection = window.getSelection();
  16956. return {
  16957. anchorNode: selection.anchorNode,
  16958. anchorOffset: selection.anchorOffset,
  16959. focusNode: selection.focusNode,
  16960. focusOffset: selection.focusOffset
  16961. };
  16962. } else if (document.selection) {
  16963. var range = document.selection.createRange();
  16964. return {
  16965. parentElement: range.parentElement(),
  16966. text: range.text,
  16967. top: range.boundingTop,
  16968. left: range.boundingLeft
  16969. };
  16970. }
  16971. }
  16972. /**
  16973. * Poll selection to see whether it's changed.
  16974. *
  16975. * @param {object} nativeEvent
  16976. * @return {?SyntheticEvent}
  16977. */
  16978. function constructSelectEvent(nativeEvent, nativeEventTarget) {
  16979. // Ensure we have the right element, and that the user is not dragging a
  16980. // selection (this matches native `select` event behavior). In HTML5, select
  16981. // fires only on input and textarea thus if there's no focused element we
  16982. // won't dispatch.
  16983. if (mouseDown || activeElement == null || activeElement !== getActiveElement()) {
  16984. return null;
  16985. }
  16986. // Only fire when selection has actually changed.
  16987. var currentSelection = getSelection(activeElement);
  16988. if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
  16989. lastSelection = currentSelection;
  16990. var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementInst, nativeEvent, nativeEventTarget);
  16991. syntheticEvent.type = 'select';
  16992. syntheticEvent.target = activeElement;
  16993. EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);
  16994. return syntheticEvent;
  16995. }
  16996. return null;
  16997. }
  16998. /**
  16999. * This plugin creates an `onSelect` event that normalizes select events
  17000. * across form elements.
  17001. *
  17002. * Supported elements are:
  17003. * - input (see `isTextInputElement`)
  17004. * - textarea
  17005. * - contentEditable
  17006. *
  17007. * This differs from native browser implementations in the following ways:
  17008. * - Fires on contentEditable fields as well as inputs.
  17009. * - Fires for collapsed selection.
  17010. * - Fires after user input.
  17011. */
  17012. var SelectEventPlugin = {
  17013. eventTypes: eventTypes,
  17014. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  17015. if (!hasListener) {
  17016. return null;
  17017. }
  17018. var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
  17019. switch (topLevelType) {
  17020. // Track the input node that has focus.
  17021. case 'topFocus':
  17022. if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
  17023. activeElement = targetNode;
  17024. activeElementInst = targetInst;
  17025. lastSelection = null;
  17026. }
  17027. break;
  17028. case 'topBlur':
  17029. activeElement = null;
  17030. activeElementInst = null;
  17031. lastSelection = null;
  17032. break;
  17033. // Don't fire the event while the user is dragging. This matches the
  17034. // semantics of the native select event.
  17035. case 'topMouseDown':
  17036. mouseDown = true;
  17037. break;
  17038. case 'topContextMenu':
  17039. case 'topMouseUp':
  17040. mouseDown = false;
  17041. return constructSelectEvent(nativeEvent, nativeEventTarget);
  17042. // Chrome and IE fire non-standard event when selection is changed (and
  17043. // sometimes when it hasn't). IE's event fires out of order with respect
  17044. // to key and input events on deletion, so we discard it.
  17045. //
  17046. // Firefox doesn't support selectionchange, so check selection status
  17047. // after each key entry. The selection changes after keydown and before
  17048. // keyup, but we check on keydown as well in the case of holding down a
  17049. // key, when multiple keydown events are fired but only one keyup is.
  17050. // This is also our approach for IE handling, for the reason above.
  17051. case 'topSelectionChange':
  17052. if (skipSelectionChangeEvent) {
  17053. break;
  17054. }
  17055. // falls through
  17056. case 'topKeyDown':
  17057. case 'topKeyUp':
  17058. return constructSelectEvent(nativeEvent, nativeEventTarget);
  17059. }
  17060. return null;
  17061. },
  17062. didPutListener: function (inst, registrationName, listener) {
  17063. if (registrationName === 'onSelect') {
  17064. hasListener = true;
  17065. }
  17066. }
  17067. };
  17068. module.exports = SelectEventPlugin;
  17069. /***/ },
  17070. /* 157 */
  17071. /***/ function(module, exports, __webpack_require__) {
  17072. /* WEBPACK VAR INJECTION */(function(process) {/**
  17073. * Copyright 2013-present, Facebook, Inc.
  17074. * All rights reserved.
  17075. *
  17076. * This source code is licensed under the BSD-style license found in the
  17077. * LICENSE file in the root directory of this source tree. An additional grant
  17078. * of patent rights can be found in the PATENTS file in the same directory.
  17079. *
  17080. *
  17081. */
  17082. 'use strict';
  17083. var _prodInvariant = __webpack_require__(37);
  17084. var EventListener = __webpack_require__(144);
  17085. var EventPropagators = __webpack_require__(43);
  17086. var ReactDOMComponentTree = __webpack_require__(36);
  17087. var SyntheticAnimationEvent = __webpack_require__(158);
  17088. var SyntheticClipboardEvent = __webpack_require__(159);
  17089. var SyntheticEvent = __webpack_require__(55);
  17090. var SyntheticFocusEvent = __webpack_require__(160);
  17091. var SyntheticKeyboardEvent = __webpack_require__(161);
  17092. var SyntheticMouseEvent = __webpack_require__(76);
  17093. var SyntheticDragEvent = __webpack_require__(164);
  17094. var SyntheticTouchEvent = __webpack_require__(165);
  17095. var SyntheticTransitionEvent = __webpack_require__(166);
  17096. var SyntheticUIEvent = __webpack_require__(77);
  17097. var SyntheticWheelEvent = __webpack_require__(167);
  17098. var emptyFunction = __webpack_require__(14);
  17099. var getEventCharCode = __webpack_require__(162);
  17100. var invariant = __webpack_require__(10);
  17101. /**
  17102. * Turns
  17103. * ['abort', ...]
  17104. * into
  17105. * eventTypes = {
  17106. * 'abort': {
  17107. * phasedRegistrationNames: {
  17108. * bubbled: 'onAbort',
  17109. * captured: 'onAbortCapture',
  17110. * },
  17111. * dependencies: ['topAbort'],
  17112. * },
  17113. * ...
  17114. * };
  17115. * topLevelEventsToDispatchConfig = {
  17116. * 'topAbort': { sameConfig }
  17117. * };
  17118. */
  17119. var eventTypes = {};
  17120. var topLevelEventsToDispatchConfig = {};
  17121. ['abort', 'animationEnd', 'animationIteration', 'animationStart', 'blur', 'canPlay', 'canPlayThrough', 'click', 'contextMenu', 'copy', 'cut', 'doubleClick', 'drag', 'dragEnd', 'dragEnter', 'dragExit', 'dragLeave', 'dragOver', 'dragStart', 'drop', 'durationChange', 'emptied', 'encrypted', 'ended', 'error', 'focus', 'input', 'invalid', 'keyDown', 'keyPress', 'keyUp', 'load', 'loadedData', 'loadedMetadata', 'loadStart', 'mouseDown', 'mouseMove', 'mouseOut', 'mouseOver', 'mouseUp', 'paste', 'pause', 'play', 'playing', 'progress', 'rateChange', 'reset', 'scroll', 'seeked', 'seeking', 'stalled', 'submit', 'suspend', 'timeUpdate', 'touchCancel', 'touchEnd', 'touchMove', 'touchStart', 'transitionEnd', 'volumeChange', 'waiting', 'wheel'].forEach(function (event) {
  17122. var capitalizedEvent = event[0].toUpperCase() + event.slice(1);
  17123. var onEvent = 'on' + capitalizedEvent;
  17124. var topEvent = 'top' + capitalizedEvent;
  17125. var type = {
  17126. phasedRegistrationNames: {
  17127. bubbled: onEvent,
  17128. captured: onEvent + 'Capture'
  17129. },
  17130. dependencies: [topEvent]
  17131. };
  17132. eventTypes[event] = type;
  17133. topLevelEventsToDispatchConfig[topEvent] = type;
  17134. });
  17135. var onClickListeners = {};
  17136. function getDictionaryKey(inst) {
  17137. // Prevents V8 performance issue:
  17138. // https://github.com/facebook/react/pull/7232
  17139. return '.' + inst._rootNodeID;
  17140. }
  17141. function isInteractive(tag) {
  17142. return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
  17143. }
  17144. var SimpleEventPlugin = {
  17145. eventTypes: eventTypes,
  17146. extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  17147. var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
  17148. if (!dispatchConfig) {
  17149. return null;
  17150. }
  17151. var EventConstructor;
  17152. switch (topLevelType) {
  17153. case 'topAbort':
  17154. case 'topCanPlay':
  17155. case 'topCanPlayThrough':
  17156. case 'topDurationChange':
  17157. case 'topEmptied':
  17158. case 'topEncrypted':
  17159. case 'topEnded':
  17160. case 'topError':
  17161. case 'topInput':
  17162. case 'topInvalid':
  17163. case 'topLoad':
  17164. case 'topLoadedData':
  17165. case 'topLoadedMetadata':
  17166. case 'topLoadStart':
  17167. case 'topPause':
  17168. case 'topPlay':
  17169. case 'topPlaying':
  17170. case 'topProgress':
  17171. case 'topRateChange':
  17172. case 'topReset':
  17173. case 'topSeeked':
  17174. case 'topSeeking':
  17175. case 'topStalled':
  17176. case 'topSubmit':
  17177. case 'topSuspend':
  17178. case 'topTimeUpdate':
  17179. case 'topVolumeChange':
  17180. case 'topWaiting':
  17181. // HTML Events
  17182. // @see http://www.w3.org/TR/html5/index.html#events-0
  17183. EventConstructor = SyntheticEvent;
  17184. break;
  17185. case 'topKeyPress':
  17186. // Firefox creates a keypress event for function keys too. This removes
  17187. // the unwanted keypress events. Enter is however both printable and
  17188. // non-printable. One would expect Tab to be as well (but it isn't).
  17189. if (getEventCharCode(nativeEvent) === 0) {
  17190. return null;
  17191. }
  17192. /* falls through */
  17193. case 'topKeyDown':
  17194. case 'topKeyUp':
  17195. EventConstructor = SyntheticKeyboardEvent;
  17196. break;
  17197. case 'topBlur':
  17198. case 'topFocus':
  17199. EventConstructor = SyntheticFocusEvent;
  17200. break;
  17201. case 'topClick':
  17202. // Firefox creates a click event on right mouse clicks. This removes the
  17203. // unwanted click events.
  17204. if (nativeEvent.button === 2) {
  17205. return null;
  17206. }
  17207. /* falls through */
  17208. case 'topDoubleClick':
  17209. case 'topMouseDown':
  17210. case 'topMouseMove':
  17211. case 'topMouseUp':
  17212. // TODO: Disabled elements should not respond to mouse events
  17213. /* falls through */
  17214. case 'topMouseOut':
  17215. case 'topMouseOver':
  17216. case 'topContextMenu':
  17217. EventConstructor = SyntheticMouseEvent;
  17218. break;
  17219. case 'topDrag':
  17220. case 'topDragEnd':
  17221. case 'topDragEnter':
  17222. case 'topDragExit':
  17223. case 'topDragLeave':
  17224. case 'topDragOver':
  17225. case 'topDragStart':
  17226. case 'topDrop':
  17227. EventConstructor = SyntheticDragEvent;
  17228. break;
  17229. case 'topTouchCancel':
  17230. case 'topTouchEnd':
  17231. case 'topTouchMove':
  17232. case 'topTouchStart':
  17233. EventConstructor = SyntheticTouchEvent;
  17234. break;
  17235. case 'topAnimationEnd':
  17236. case 'topAnimationIteration':
  17237. case 'topAnimationStart':
  17238. EventConstructor = SyntheticAnimationEvent;
  17239. break;
  17240. case 'topTransitionEnd':
  17241. EventConstructor = SyntheticTransitionEvent;
  17242. break;
  17243. case 'topScroll':
  17244. EventConstructor = SyntheticUIEvent;
  17245. break;
  17246. case 'topWheel':
  17247. EventConstructor = SyntheticWheelEvent;
  17248. break;
  17249. case 'topCopy':
  17250. case 'topCut':
  17251. case 'topPaste':
  17252. EventConstructor = SyntheticClipboardEvent;
  17253. break;
  17254. }
  17255. !EventConstructor ? process.env.NODE_ENV !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : _prodInvariant('86', topLevelType) : void 0;
  17256. var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
  17257. EventPropagators.accumulateTwoPhaseDispatches(event);
  17258. return event;
  17259. },
  17260. didPutListener: function (inst, registrationName, listener) {
  17261. // Mobile Safari does not fire properly bubble click events on
  17262. // non-interactive elements, which means delegated click listeners do not
  17263. // fire. The workaround for this bug involves attaching an empty click
  17264. // listener on the target node.
  17265. // http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
  17266. if (registrationName === 'onClick' && !isInteractive(inst._tag)) {
  17267. var key = getDictionaryKey(inst);
  17268. var node = ReactDOMComponentTree.getNodeFromInstance(inst);
  17269. if (!onClickListeners[key]) {
  17270. onClickListeners[key] = EventListener.listen(node, 'click', emptyFunction);
  17271. }
  17272. }
  17273. },
  17274. willDeleteListener: function (inst, registrationName) {
  17275. if (registrationName === 'onClick' && !isInteractive(inst._tag)) {
  17276. var key = getDictionaryKey(inst);
  17277. onClickListeners[key].remove();
  17278. delete onClickListeners[key];
  17279. }
  17280. }
  17281. };
  17282. module.exports = SimpleEventPlugin;
  17283. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  17284. /***/ },
  17285. /* 158 */
  17286. /***/ function(module, exports, __webpack_require__) {
  17287. /**
  17288. * Copyright 2013-present, Facebook, Inc.
  17289. * All rights reserved.
  17290. *
  17291. * This source code is licensed under the BSD-style license found in the
  17292. * LICENSE file in the root directory of this source tree. An additional grant
  17293. * of patent rights can be found in the PATENTS file in the same directory.
  17294. *
  17295. */
  17296. 'use strict';
  17297. var SyntheticEvent = __webpack_require__(55);
  17298. /**
  17299. * @interface Event
  17300. * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
  17301. * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
  17302. */
  17303. var AnimationEventInterface = {
  17304. animationName: null,
  17305. elapsedTime: null,
  17306. pseudoElement: null
  17307. };
  17308. /**
  17309. * @param {object} dispatchConfig Configuration used to dispatch this event.
  17310. * @param {string} dispatchMarker Marker identifying the event target.
  17311. * @param {object} nativeEvent Native browser event.
  17312. * @extends {SyntheticEvent}
  17313. */
  17314. function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  17315. return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  17316. }
  17317. SyntheticEvent.augmentClass(SyntheticAnimationEvent, AnimationEventInterface);
  17318. module.exports = SyntheticAnimationEvent;
  17319. /***/ },
  17320. /* 159 */
  17321. /***/ function(module, exports, __webpack_require__) {
  17322. /**
  17323. * Copyright 2013-present, Facebook, Inc.
  17324. * All rights reserved.
  17325. *
  17326. * This source code is licensed under the BSD-style license found in the
  17327. * LICENSE file in the root directory of this source tree. An additional grant
  17328. * of patent rights can be found in the PATENTS file in the same directory.
  17329. *
  17330. */
  17331. 'use strict';
  17332. var SyntheticEvent = __webpack_require__(55);
  17333. /**
  17334. * @interface Event
  17335. * @see http://www.w3.org/TR/clipboard-apis/
  17336. */
  17337. var ClipboardEventInterface = {
  17338. clipboardData: function (event) {
  17339. return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
  17340. }
  17341. };
  17342. /**
  17343. * @param {object} dispatchConfig Configuration used to dispatch this event.
  17344. * @param {string} dispatchMarker Marker identifying the event target.
  17345. * @param {object} nativeEvent Native browser event.
  17346. * @extends {SyntheticUIEvent}
  17347. */
  17348. function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  17349. return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  17350. }
  17351. SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
  17352. module.exports = SyntheticClipboardEvent;
  17353. /***/ },
  17354. /* 160 */
  17355. /***/ function(module, exports, __webpack_require__) {
  17356. /**
  17357. * Copyright 2013-present, Facebook, Inc.
  17358. * All rights reserved.
  17359. *
  17360. * This source code is licensed under the BSD-style license found in the
  17361. * LICENSE file in the root directory of this source tree. An additional grant
  17362. * of patent rights can be found in the PATENTS file in the same directory.
  17363. *
  17364. */
  17365. 'use strict';
  17366. var SyntheticUIEvent = __webpack_require__(77);
  17367. /**
  17368. * @interface FocusEvent
  17369. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  17370. */
  17371. var FocusEventInterface = {
  17372. relatedTarget: null
  17373. };
  17374. /**
  17375. * @param {object} dispatchConfig Configuration used to dispatch this event.
  17376. * @param {string} dispatchMarker Marker identifying the event target.
  17377. * @param {object} nativeEvent Native browser event.
  17378. * @extends {SyntheticUIEvent}
  17379. */
  17380. function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  17381. return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  17382. }
  17383. SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
  17384. module.exports = SyntheticFocusEvent;
  17385. /***/ },
  17386. /* 161 */
  17387. /***/ function(module, exports, __webpack_require__) {
  17388. /**
  17389. * Copyright 2013-present, Facebook, Inc.
  17390. * All rights reserved.
  17391. *
  17392. * This source code is licensed under the BSD-style license found in the
  17393. * LICENSE file in the root directory of this source tree. An additional grant
  17394. * of patent rights can be found in the PATENTS file in the same directory.
  17395. *
  17396. */
  17397. 'use strict';
  17398. var SyntheticUIEvent = __webpack_require__(77);
  17399. var getEventCharCode = __webpack_require__(162);
  17400. var getEventKey = __webpack_require__(163);
  17401. var getEventModifierState = __webpack_require__(79);
  17402. /**
  17403. * @interface KeyboardEvent
  17404. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  17405. */
  17406. var KeyboardEventInterface = {
  17407. key: getEventKey,
  17408. location: null,
  17409. ctrlKey: null,
  17410. shiftKey: null,
  17411. altKey: null,
  17412. metaKey: null,
  17413. repeat: null,
  17414. locale: null,
  17415. getModifierState: getEventModifierState,
  17416. // Legacy Interface
  17417. charCode: function (event) {
  17418. // `charCode` is the result of a KeyPress event and represents the value of
  17419. // the actual printable character.
  17420. // KeyPress is deprecated, but its replacement is not yet final and not
  17421. // implemented in any major browser. Only KeyPress has charCode.
  17422. if (event.type === 'keypress') {
  17423. return getEventCharCode(event);
  17424. }
  17425. return 0;
  17426. },
  17427. keyCode: function (event) {
  17428. // `keyCode` is the result of a KeyDown/Up event and represents the value of
  17429. // physical keyboard key.
  17430. // The actual meaning of the value depends on the users' keyboard layout
  17431. // which cannot be detected. Assuming that it is a US keyboard layout
  17432. // provides a surprisingly accurate mapping for US and European users.
  17433. // Due to this, it is left to the user to implement at this time.
  17434. if (event.type === 'keydown' || event.type === 'keyup') {
  17435. return event.keyCode;
  17436. }
  17437. return 0;
  17438. },
  17439. which: function (event) {
  17440. // `which` is an alias for either `keyCode` or `charCode` depending on the
  17441. // type of the event.
  17442. if (event.type === 'keypress') {
  17443. return getEventCharCode(event);
  17444. }
  17445. if (event.type === 'keydown' || event.type === 'keyup') {
  17446. return event.keyCode;
  17447. }
  17448. return 0;
  17449. }
  17450. };
  17451. /**
  17452. * @param {object} dispatchConfig Configuration used to dispatch this event.
  17453. * @param {string} dispatchMarker Marker identifying the event target.
  17454. * @param {object} nativeEvent Native browser event.
  17455. * @extends {SyntheticUIEvent}
  17456. */
  17457. function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  17458. return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  17459. }
  17460. SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
  17461. module.exports = SyntheticKeyboardEvent;
  17462. /***/ },
  17463. /* 162 */
  17464. /***/ function(module, exports) {
  17465. /**
  17466. * Copyright 2013-present, Facebook, Inc.
  17467. * All rights reserved.
  17468. *
  17469. * This source code is licensed under the BSD-style license found in the
  17470. * LICENSE file in the root directory of this source tree. An additional grant
  17471. * of patent rights can be found in the PATENTS file in the same directory.
  17472. *
  17473. */
  17474. 'use strict';
  17475. /**
  17476. * `charCode` represents the actual "character code" and is safe to use with
  17477. * `String.fromCharCode`. As such, only keys that correspond to printable
  17478. * characters produce a valid `charCode`, the only exception to this is Enter.
  17479. * The Tab-key is considered non-printable and does not have a `charCode`,
  17480. * presumably because it does not produce a tab-character in browsers.
  17481. *
  17482. * @param {object} nativeEvent Native browser event.
  17483. * @return {number} Normalized `charCode` property.
  17484. */
  17485. function getEventCharCode(nativeEvent) {
  17486. var charCode;
  17487. var keyCode = nativeEvent.keyCode;
  17488. if ('charCode' in nativeEvent) {
  17489. charCode = nativeEvent.charCode;
  17490. // FF does not set `charCode` for the Enter-key, check against `keyCode`.
  17491. if (charCode === 0 && keyCode === 13) {
  17492. charCode = 13;
  17493. }
  17494. } else {
  17495. // IE8 does not implement `charCode`, but `keyCode` has the correct value.
  17496. charCode = keyCode;
  17497. }
  17498. // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
  17499. // Must not discard the (non-)printable Enter-key.
  17500. if (charCode >= 32 || charCode === 13) {
  17501. return charCode;
  17502. }
  17503. return 0;
  17504. }
  17505. module.exports = getEventCharCode;
  17506. /***/ },
  17507. /* 163 */
  17508. /***/ function(module, exports, __webpack_require__) {
  17509. /**
  17510. * Copyright 2013-present, Facebook, Inc.
  17511. * All rights reserved.
  17512. *
  17513. * This source code is licensed under the BSD-style license found in the
  17514. * LICENSE file in the root directory of this source tree. An additional grant
  17515. * of patent rights can be found in the PATENTS file in the same directory.
  17516. *
  17517. */
  17518. 'use strict';
  17519. var getEventCharCode = __webpack_require__(162);
  17520. /**
  17521. * Normalization of deprecated HTML5 `key` values
  17522. * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
  17523. */
  17524. var normalizeKey = {
  17525. 'Esc': 'Escape',
  17526. 'Spacebar': ' ',
  17527. 'Left': 'ArrowLeft',
  17528. 'Up': 'ArrowUp',
  17529. 'Right': 'ArrowRight',
  17530. 'Down': 'ArrowDown',
  17531. 'Del': 'Delete',
  17532. 'Win': 'OS',
  17533. 'Menu': 'ContextMenu',
  17534. 'Apps': 'ContextMenu',
  17535. 'Scroll': 'ScrollLock',
  17536. 'MozPrintableKey': 'Unidentified'
  17537. };
  17538. /**
  17539. * Translation from legacy `keyCode` to HTML5 `key`
  17540. * Only special keys supported, all others depend on keyboard layout or browser
  17541. * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
  17542. */
  17543. var translateToKey = {
  17544. 8: 'Backspace',
  17545. 9: 'Tab',
  17546. 12: 'Clear',
  17547. 13: 'Enter',
  17548. 16: 'Shift',
  17549. 17: 'Control',
  17550. 18: 'Alt',
  17551. 19: 'Pause',
  17552. 20: 'CapsLock',
  17553. 27: 'Escape',
  17554. 32: ' ',
  17555. 33: 'PageUp',
  17556. 34: 'PageDown',
  17557. 35: 'End',
  17558. 36: 'Home',
  17559. 37: 'ArrowLeft',
  17560. 38: 'ArrowUp',
  17561. 39: 'ArrowRight',
  17562. 40: 'ArrowDown',
  17563. 45: 'Insert',
  17564. 46: 'Delete',
  17565. 112: 'F1', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6',
  17566. 118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12',
  17567. 144: 'NumLock',
  17568. 145: 'ScrollLock',
  17569. 224: 'Meta'
  17570. };
  17571. /**
  17572. * @param {object} nativeEvent Native browser event.
  17573. * @return {string} Normalized `key` property.
  17574. */
  17575. function getEventKey(nativeEvent) {
  17576. if (nativeEvent.key) {
  17577. // Normalize inconsistent values reported by browsers due to
  17578. // implementations of a working draft specification.
  17579. // FireFox implements `key` but returns `MozPrintableKey` for all
  17580. // printable characters (normalized to `Unidentified`), ignore it.
  17581. var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
  17582. if (key !== 'Unidentified') {
  17583. return key;
  17584. }
  17585. }
  17586. // Browser does not implement `key`, polyfill as much of it as we can.
  17587. if (nativeEvent.type === 'keypress') {
  17588. var charCode = getEventCharCode(nativeEvent);
  17589. // The enter-key is technically both printable and non-printable and can
  17590. // thus be captured by `keypress`, no other non-printable key should.
  17591. return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
  17592. }
  17593. if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
  17594. // While user keyboard layout determines the actual meaning of each
  17595. // `keyCode` value, almost all function keys have a universal value.
  17596. return translateToKey[nativeEvent.keyCode] || 'Unidentified';
  17597. }
  17598. return '';
  17599. }
  17600. module.exports = getEventKey;
  17601. /***/ },
  17602. /* 164 */
  17603. /***/ function(module, exports, __webpack_require__) {
  17604. /**
  17605. * Copyright 2013-present, Facebook, Inc.
  17606. * All rights reserved.
  17607. *
  17608. * This source code is licensed under the BSD-style license found in the
  17609. * LICENSE file in the root directory of this source tree. An additional grant
  17610. * of patent rights can be found in the PATENTS file in the same directory.
  17611. *
  17612. */
  17613. 'use strict';
  17614. var SyntheticMouseEvent = __webpack_require__(76);
  17615. /**
  17616. * @interface DragEvent
  17617. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  17618. */
  17619. var DragEventInterface = {
  17620. dataTransfer: null
  17621. };
  17622. /**
  17623. * @param {object} dispatchConfig Configuration used to dispatch this event.
  17624. * @param {string} dispatchMarker Marker identifying the event target.
  17625. * @param {object} nativeEvent Native browser event.
  17626. * @extends {SyntheticUIEvent}
  17627. */
  17628. function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  17629. return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  17630. }
  17631. SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);
  17632. module.exports = SyntheticDragEvent;
  17633. /***/ },
  17634. /* 165 */
  17635. /***/ function(module, exports, __webpack_require__) {
  17636. /**
  17637. * Copyright 2013-present, Facebook, Inc.
  17638. * All rights reserved.
  17639. *
  17640. * This source code is licensed under the BSD-style license found in the
  17641. * LICENSE file in the root directory of this source tree. An additional grant
  17642. * of patent rights can be found in the PATENTS file in the same directory.
  17643. *
  17644. */
  17645. 'use strict';
  17646. var SyntheticUIEvent = __webpack_require__(77);
  17647. var getEventModifierState = __webpack_require__(79);
  17648. /**
  17649. * @interface TouchEvent
  17650. * @see http://www.w3.org/TR/touch-events/
  17651. */
  17652. var TouchEventInterface = {
  17653. touches: null,
  17654. targetTouches: null,
  17655. changedTouches: null,
  17656. altKey: null,
  17657. metaKey: null,
  17658. ctrlKey: null,
  17659. shiftKey: null,
  17660. getModifierState: getEventModifierState
  17661. };
  17662. /**
  17663. * @param {object} dispatchConfig Configuration used to dispatch this event.
  17664. * @param {string} dispatchMarker Marker identifying the event target.
  17665. * @param {object} nativeEvent Native browser event.
  17666. * @extends {SyntheticUIEvent}
  17667. */
  17668. function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  17669. return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  17670. }
  17671. SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
  17672. module.exports = SyntheticTouchEvent;
  17673. /***/ },
  17674. /* 166 */
  17675. /***/ function(module, exports, __webpack_require__) {
  17676. /**
  17677. * Copyright 2013-present, Facebook, Inc.
  17678. * All rights reserved.
  17679. *
  17680. * This source code is licensed under the BSD-style license found in the
  17681. * LICENSE file in the root directory of this source tree. An additional grant
  17682. * of patent rights can be found in the PATENTS file in the same directory.
  17683. *
  17684. */
  17685. 'use strict';
  17686. var SyntheticEvent = __webpack_require__(55);
  17687. /**
  17688. * @interface Event
  17689. * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
  17690. * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
  17691. */
  17692. var TransitionEventInterface = {
  17693. propertyName: null,
  17694. elapsedTime: null,
  17695. pseudoElement: null
  17696. };
  17697. /**
  17698. * @param {object} dispatchConfig Configuration used to dispatch this event.
  17699. * @param {string} dispatchMarker Marker identifying the event target.
  17700. * @param {object} nativeEvent Native browser event.
  17701. * @extends {SyntheticEvent}
  17702. */
  17703. function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  17704. return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  17705. }
  17706. SyntheticEvent.augmentClass(SyntheticTransitionEvent, TransitionEventInterface);
  17707. module.exports = SyntheticTransitionEvent;
  17708. /***/ },
  17709. /* 167 */
  17710. /***/ function(module, exports, __webpack_require__) {
  17711. /**
  17712. * Copyright 2013-present, Facebook, Inc.
  17713. * All rights reserved.
  17714. *
  17715. * This source code is licensed under the BSD-style license found in the
  17716. * LICENSE file in the root directory of this source tree. An additional grant
  17717. * of patent rights can be found in the PATENTS file in the same directory.
  17718. *
  17719. */
  17720. 'use strict';
  17721. var SyntheticMouseEvent = __webpack_require__(76);
  17722. /**
  17723. * @interface WheelEvent
  17724. * @see http://www.w3.org/TR/DOM-Level-3-Events/
  17725. */
  17726. var WheelEventInterface = {
  17727. deltaX: function (event) {
  17728. return 'deltaX' in event ? event.deltaX :
  17729. // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
  17730. 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
  17731. },
  17732. deltaY: function (event) {
  17733. return 'deltaY' in event ? event.deltaY :
  17734. // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
  17735. 'wheelDeltaY' in event ? -event.wheelDeltaY :
  17736. // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
  17737. 'wheelDelta' in event ? -event.wheelDelta : 0;
  17738. },
  17739. deltaZ: null,
  17740. // Browsers without "deltaMode" is reporting in raw wheel delta where one
  17741. // notch on the scroll is always +/- 120, roughly equivalent to pixels.
  17742. // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
  17743. // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
  17744. deltaMode: null
  17745. };
  17746. /**
  17747. * @param {object} dispatchConfig Configuration used to dispatch this event.
  17748. * @param {string} dispatchMarker Marker identifying the event target.
  17749. * @param {object} nativeEvent Native browser event.
  17750. * @extends {SyntheticMouseEvent}
  17751. */
  17752. function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
  17753. return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
  17754. }
  17755. SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
  17756. module.exports = SyntheticWheelEvent;
  17757. /***/ },
  17758. /* 168 */
  17759. /***/ function(module, exports, __webpack_require__) {
  17760. /* WEBPACK VAR INJECTION */(function(process) {/**
  17761. * Copyright 2013-present, Facebook, Inc.
  17762. * All rights reserved.
  17763. *
  17764. * This source code is licensed under the BSD-style license found in the
  17765. * LICENSE file in the root directory of this source tree. An additional grant
  17766. * of patent rights can be found in the PATENTS file in the same directory.
  17767. *
  17768. */
  17769. 'use strict';
  17770. var _prodInvariant = __webpack_require__(37);
  17771. var DOMLazyTree = __webpack_require__(83);
  17772. var DOMProperty = __webpack_require__(38);
  17773. var React = __webpack_require__(4);
  17774. var ReactBrowserEventEmitter = __webpack_require__(107);
  17775. var ReactCurrentOwner = __webpack_require__(12);
  17776. var ReactDOMComponentTree = __webpack_require__(36);
  17777. var ReactDOMContainerInfo = __webpack_require__(169);
  17778. var ReactDOMFeatureFlags = __webpack_require__(170);
  17779. var ReactFeatureFlags = __webpack_require__(60);
  17780. var ReactInstanceMap = __webpack_require__(118);
  17781. var ReactInstrumentation = __webpack_require__(64);
  17782. var ReactMarkupChecksum = __webpack_require__(171);
  17783. var ReactReconciler = __webpack_require__(61);
  17784. var ReactUpdateQueue = __webpack_require__(137);
  17785. var ReactUpdates = __webpack_require__(58);
  17786. var emptyObject = __webpack_require__(22);
  17787. var instantiateReactComponent = __webpack_require__(120);
  17788. var invariant = __webpack_require__(10);
  17789. var setInnerHTML = __webpack_require__(85);
  17790. var shouldUpdateReactComponent = __webpack_require__(126);
  17791. var warning = __webpack_require__(13);
  17792. var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
  17793. var ROOT_ATTR_NAME = DOMProperty.ROOT_ATTRIBUTE_NAME;
  17794. var ELEMENT_NODE_TYPE = 1;
  17795. var DOC_NODE_TYPE = 9;
  17796. var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
  17797. var instancesByReactRootID = {};
  17798. /**
  17799. * Finds the index of the first character
  17800. * that's not common between the two given strings.
  17801. *
  17802. * @return {number} the index of the character where the strings diverge
  17803. */
  17804. function firstDifferenceIndex(string1, string2) {
  17805. var minLen = Math.min(string1.length, string2.length);
  17806. for (var i = 0; i < minLen; i++) {
  17807. if (string1.charAt(i) !== string2.charAt(i)) {
  17808. return i;
  17809. }
  17810. }
  17811. return string1.length === string2.length ? -1 : minLen;
  17812. }
  17813. /**
  17814. * @param {DOMElement|DOMDocument} container DOM element that may contain
  17815. * a React component
  17816. * @return {?*} DOM element that may have the reactRoot ID, or null.
  17817. */
  17818. function getReactRootElementInContainer(container) {
  17819. if (!container) {
  17820. return null;
  17821. }
  17822. if (container.nodeType === DOC_NODE_TYPE) {
  17823. return container.documentElement;
  17824. } else {
  17825. return container.firstChild;
  17826. }
  17827. }
  17828. function internalGetID(node) {
  17829. // If node is something like a window, document, or text node, none of
  17830. // which support attributes or a .getAttribute method, gracefully return
  17831. // the empty string, as if the attribute were missing.
  17832. return node.getAttribute && node.getAttribute(ATTR_NAME) || '';
  17833. }
  17834. /**
  17835. * Mounts this component and inserts it into the DOM.
  17836. *
  17837. * @param {ReactComponent} componentInstance The instance to mount.
  17838. * @param {DOMElement} container DOM element to mount into.
  17839. * @param {ReactReconcileTransaction} transaction
  17840. * @param {boolean} shouldReuseMarkup If true, do not insert markup
  17841. */
  17842. function mountComponentIntoNode(wrapperInstance, container, transaction, shouldReuseMarkup, context) {
  17843. var markerName;
  17844. if (ReactFeatureFlags.logTopLevelRenders) {
  17845. var wrappedElement = wrapperInstance._currentElement.props.child;
  17846. var type = wrappedElement.type;
  17847. markerName = 'React mount: ' + (typeof type === 'string' ? type : type.displayName || type.name);
  17848. console.time(markerName);
  17849. }
  17850. var markup = ReactReconciler.mountComponent(wrapperInstance, transaction, null, ReactDOMContainerInfo(wrapperInstance, container), context, 0 /* parentDebugID */
  17851. );
  17852. if (markerName) {
  17853. console.timeEnd(markerName);
  17854. }
  17855. wrapperInstance._renderedComponent._topLevelWrapper = wrapperInstance;
  17856. ReactMount._mountImageIntoNode(markup, container, wrapperInstance, shouldReuseMarkup, transaction);
  17857. }
  17858. /**
  17859. * Batched mount.
  17860. *
  17861. * @param {ReactComponent} componentInstance The instance to mount.
  17862. * @param {DOMElement} container DOM element to mount into.
  17863. * @param {boolean} shouldReuseMarkup If true, do not insert markup
  17864. */
  17865. function batchedMountComponentIntoNode(componentInstance, container, shouldReuseMarkup, context) {
  17866. var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(
  17867. /* useCreateElement */
  17868. !shouldReuseMarkup && ReactDOMFeatureFlags.useCreateElement);
  17869. transaction.perform(mountComponentIntoNode, null, componentInstance, container, transaction, shouldReuseMarkup, context);
  17870. ReactUpdates.ReactReconcileTransaction.release(transaction);
  17871. }
  17872. /**
  17873. * Unmounts a component and removes it from the DOM.
  17874. *
  17875. * @param {ReactComponent} instance React component instance.
  17876. * @param {DOMElement} container DOM element to unmount from.
  17877. * @final
  17878. * @internal
  17879. * @see {ReactMount.unmountComponentAtNode}
  17880. */
  17881. function unmountComponentFromNode(instance, container, safely) {
  17882. if (process.env.NODE_ENV !== 'production') {
  17883. ReactInstrumentation.debugTool.onBeginFlush();
  17884. }
  17885. ReactReconciler.unmountComponent(instance, safely);
  17886. if (process.env.NODE_ENV !== 'production') {
  17887. ReactInstrumentation.debugTool.onEndFlush();
  17888. }
  17889. if (container.nodeType === DOC_NODE_TYPE) {
  17890. container = container.documentElement;
  17891. }
  17892. // http://jsperf.com/emptying-a-node
  17893. while (container.lastChild) {
  17894. container.removeChild(container.lastChild);
  17895. }
  17896. }
  17897. /**
  17898. * True if the supplied DOM node has a direct React-rendered child that is
  17899. * not a React root element. Useful for warning in `render`,
  17900. * `unmountComponentAtNode`, etc.
  17901. *
  17902. * @param {?DOMElement} node The candidate DOM node.
  17903. * @return {boolean} True if the DOM element contains a direct child that was
  17904. * rendered by React but is not a root element.
  17905. * @internal
  17906. */
  17907. function hasNonRootReactChild(container) {
  17908. var rootEl = getReactRootElementInContainer(container);
  17909. if (rootEl) {
  17910. var inst = ReactDOMComponentTree.getInstanceFromNode(rootEl);
  17911. return !!(inst && inst._hostParent);
  17912. }
  17913. }
  17914. /**
  17915. * True if the supplied DOM node is a React DOM element and
  17916. * it has been rendered by another copy of React.
  17917. *
  17918. * @param {?DOMElement} node The candidate DOM node.
  17919. * @return {boolean} True if the DOM has been rendered by another copy of React
  17920. * @internal
  17921. */
  17922. function nodeIsRenderedByOtherInstance(container) {
  17923. var rootEl = getReactRootElementInContainer(container);
  17924. return !!(rootEl && isReactNode(rootEl) && !ReactDOMComponentTree.getInstanceFromNode(rootEl));
  17925. }
  17926. /**
  17927. * True if the supplied DOM node is a valid node element.
  17928. *
  17929. * @param {?DOMElement} node The candidate DOM node.
  17930. * @return {boolean} True if the DOM is a valid DOM node.
  17931. * @internal
  17932. */
  17933. function isValidContainer(node) {
  17934. return !!(node && (node.nodeType === ELEMENT_NODE_TYPE || node.nodeType === DOC_NODE_TYPE || node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE));
  17935. }
  17936. /**
  17937. * True if the supplied DOM node is a valid React node element.
  17938. *
  17939. * @param {?DOMElement} node The candidate DOM node.
  17940. * @return {boolean} True if the DOM is a valid React DOM node.
  17941. * @internal
  17942. */
  17943. function isReactNode(node) {
  17944. return isValidContainer(node) && (node.hasAttribute(ROOT_ATTR_NAME) || node.hasAttribute(ATTR_NAME));
  17945. }
  17946. function getHostRootInstanceInContainer(container) {
  17947. var rootEl = getReactRootElementInContainer(container);
  17948. var prevHostInstance = rootEl && ReactDOMComponentTree.getInstanceFromNode(rootEl);
  17949. return prevHostInstance && !prevHostInstance._hostParent ? prevHostInstance : null;
  17950. }
  17951. function getTopLevelWrapperInContainer(container) {
  17952. var root = getHostRootInstanceInContainer(container);
  17953. return root ? root._hostContainerInfo._topLevelWrapper : null;
  17954. }
  17955. /**
  17956. * Temporary (?) hack so that we can store all top-level pending updates on
  17957. * composites instead of having to worry about different types of components
  17958. * here.
  17959. */
  17960. var topLevelRootCounter = 1;
  17961. var TopLevelWrapper = function () {
  17962. this.rootID = topLevelRootCounter++;
  17963. };
  17964. TopLevelWrapper.prototype.isReactComponent = {};
  17965. if (process.env.NODE_ENV !== 'production') {
  17966. TopLevelWrapper.displayName = 'TopLevelWrapper';
  17967. }
  17968. TopLevelWrapper.prototype.render = function () {
  17969. return this.props.child;
  17970. };
  17971. TopLevelWrapper.isReactTopLevelWrapper = true;
  17972. /**
  17973. * Mounting is the process of initializing a React component by creating its
  17974. * representative DOM elements and inserting them into a supplied `container`.
  17975. * Any prior content inside `container` is destroyed in the process.
  17976. *
  17977. * ReactMount.render(
  17978. * component,
  17979. * document.getElementById('container')
  17980. * );
  17981. *
  17982. * <div id="container"> <-- Supplied `container`.
  17983. * <div data-reactid=".3"> <-- Rendered reactRoot of React
  17984. * // ... component.
  17985. * </div>
  17986. * </div>
  17987. *
  17988. * Inside of `container`, the first element rendered is the "reactRoot".
  17989. */
  17990. var ReactMount = {
  17991. TopLevelWrapper: TopLevelWrapper,
  17992. /**
  17993. * Used by devtools. The keys are not important.
  17994. */
  17995. _instancesByReactRootID: instancesByReactRootID,
  17996. /**
  17997. * This is a hook provided to support rendering React components while
  17998. * ensuring that the apparent scroll position of its `container` does not
  17999. * change.
  18000. *
  18001. * @param {DOMElement} container The `container` being rendered into.
  18002. * @param {function} renderCallback This must be called once to do the render.
  18003. */
  18004. scrollMonitor: function (container, renderCallback) {
  18005. renderCallback();
  18006. },
  18007. /**
  18008. * Take a component that's already mounted into the DOM and replace its props
  18009. * @param {ReactComponent} prevComponent component instance already in the DOM
  18010. * @param {ReactElement} nextElement component instance to render
  18011. * @param {DOMElement} container container to render into
  18012. * @param {?function} callback function triggered on completion
  18013. */
  18014. _updateRootComponent: function (prevComponent, nextElement, nextContext, container, callback) {
  18015. ReactMount.scrollMonitor(container, function () {
  18016. ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement, nextContext);
  18017. if (callback) {
  18018. ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback);
  18019. }
  18020. });
  18021. return prevComponent;
  18022. },
  18023. /**
  18024. * Render a new component into the DOM. Hooked by hooks!
  18025. *
  18026. * @param {ReactElement} nextElement element to render
  18027. * @param {DOMElement} container container to render into
  18028. * @param {boolean} shouldReuseMarkup if we should skip the markup insertion
  18029. * @return {ReactComponent} nextComponent
  18030. */
  18031. _renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) {
  18032. // Various parts of our code (such as ReactCompositeComponent's
  18033. // _renderValidatedComponent) assume that calls to render aren't nested;
  18034. // verify that that's the case.
  18035. 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;
  18036. !isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : _prodInvariant('37') : void 0;
  18037. ReactBrowserEventEmitter.ensureScrollValueMonitoring();
  18038. var componentInstance = instantiateReactComponent(nextElement, false);
  18039. // The initial render is synchronous but any updates that happen during
  18040. // rendering, in componentWillMount or componentDidMount, will be batched
  18041. // according to the current batching strategy.
  18042. ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, container, shouldReuseMarkup, context);
  18043. var wrapperID = componentInstance._instance.rootID;
  18044. instancesByReactRootID[wrapperID] = componentInstance;
  18045. return componentInstance;
  18046. },
  18047. /**
  18048. * Renders a React component into the DOM in the supplied `container`.
  18049. *
  18050. * If the React component was previously rendered into `container`, this will
  18051. * perform an update on it and only mutate the DOM as necessary to reflect the
  18052. * latest React component.
  18053. *
  18054. * @param {ReactComponent} parentComponent The conceptual parent of this render tree.
  18055. * @param {ReactElement} nextElement Component element to render.
  18056. * @param {DOMElement} container DOM element to render into.
  18057. * @param {?function} callback function triggered on completion
  18058. * @return {ReactComponent} Component instance rendered in `container`.
  18059. */
  18060. renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
  18061. !(parentComponent != null && ReactInstanceMap.has(parentComponent)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : _prodInvariant('38') : void 0;
  18062. return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback);
  18063. },
  18064. _renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
  18065. ReactUpdateQueue.validateCallback(callback, 'ReactDOM.render');
  18066. !React.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 />.' :
  18067. // Check if it quacks like an element
  18068. 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;
  18069. 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;
  18070. var nextWrappedElement = React.createElement(TopLevelWrapper, { child: nextElement });
  18071. var nextContext;
  18072. if (parentComponent) {
  18073. var parentInst = ReactInstanceMap.get(parentComponent);
  18074. nextContext = parentInst._processChildContext(parentInst._context);
  18075. } else {
  18076. nextContext = emptyObject;
  18077. }
  18078. var prevComponent = getTopLevelWrapperInContainer(container);
  18079. if (prevComponent) {
  18080. var prevWrappedElement = prevComponent._currentElement;
  18081. var prevElement = prevWrappedElement.props.child;
  18082. if (shouldUpdateReactComponent(prevElement, nextElement)) {
  18083. var publicInst = prevComponent._renderedComponent.getPublicInstance();
  18084. var updatedCallback = callback && function () {
  18085. callback.call(publicInst);
  18086. };
  18087. ReactMount._updateRootComponent(prevComponent, nextWrappedElement, nextContext, container, updatedCallback);
  18088. return publicInst;
  18089. } else {
  18090. ReactMount.unmountComponentAtNode(container);
  18091. }
  18092. }
  18093. var reactRootElement = getReactRootElementInContainer(container);
  18094. var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement);
  18095. var containerHasNonRootReactChild = hasNonRootReactChild(container);
  18096. if (process.env.NODE_ENV !== 'production') {
  18097. 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;
  18098. if (!containerHasReactMarkup || reactRootElement.nextSibling) {
  18099. var rootElementSibling = reactRootElement;
  18100. while (rootElementSibling) {
  18101. if (internalGetID(rootElementSibling)) {
  18102. 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;
  18103. break;
  18104. }
  18105. rootElementSibling = rootElementSibling.nextSibling;
  18106. }
  18107. }
  18108. }
  18109. var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild;
  18110. var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, nextContext)._renderedComponent.getPublicInstance();
  18111. if (callback) {
  18112. callback.call(component);
  18113. }
  18114. return component;
  18115. },
  18116. /**
  18117. * Renders a React component into the DOM in the supplied `container`.
  18118. * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.render
  18119. *
  18120. * If the React component was previously rendered into `container`, this will
  18121. * perform an update on it and only mutate the DOM as necessary to reflect the
  18122. * latest React component.
  18123. *
  18124. * @param {ReactElement} nextElement Component element to render.
  18125. * @param {DOMElement} container DOM element to render into.
  18126. * @param {?function} callback function triggered on completion
  18127. * @return {ReactComponent} Component instance rendered in `container`.
  18128. */
  18129. render: function (nextElement, container, callback) {
  18130. return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback);
  18131. },
  18132. /**
  18133. * Unmounts and destroys the React component rendered in the `container`.
  18134. * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.unmountcomponentatnode
  18135. *
  18136. * @param {DOMElement} container DOM element containing a React component.
  18137. * @return {boolean} True if a component was found in and unmounted from
  18138. * `container`
  18139. */
  18140. unmountComponentAtNode: function (container) {
  18141. // Various parts of our code (such as ReactCompositeComponent's
  18142. // _renderValidatedComponent) assume that calls to render aren't nested;
  18143. // verify that that's the case. (Strictly speaking, unmounting won't cause a
  18144. // render but we still don't expect to be in a render call here.)
  18145. 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;
  18146. !isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : _prodInvariant('40') : void 0;
  18147. if (process.env.NODE_ENV !== 'production') {
  18148. 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;
  18149. }
  18150. var prevComponent = getTopLevelWrapperInContainer(container);
  18151. if (!prevComponent) {
  18152. // Check if the node being unmounted was rendered by React, but isn't a
  18153. // root node.
  18154. var containerHasNonRootReactChild = hasNonRootReactChild(container);
  18155. // Check if the container itself is a React root node.
  18156. var isContainerReactRoot = container.nodeType === 1 && container.hasAttribute(ROOT_ATTR_NAME);
  18157. if (process.env.NODE_ENV !== 'production') {
  18158. 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;
  18159. }
  18160. return false;
  18161. }
  18162. delete instancesByReactRootID[prevComponent._instance.rootID];
  18163. ReactUpdates.batchedUpdates(unmountComponentFromNode, prevComponent, container, false);
  18164. return true;
  18165. },
  18166. _mountImageIntoNode: function (markup, container, instance, shouldReuseMarkup, transaction) {
  18167. !isValidContainer(container) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : _prodInvariant('41') : void 0;
  18168. if (shouldReuseMarkup) {
  18169. var rootElement = getReactRootElementInContainer(container);
  18170. if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) {
  18171. ReactDOMComponentTree.precacheNode(instance, rootElement);
  18172. return;
  18173. } else {
  18174. var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
  18175. rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
  18176. var rootMarkup = rootElement.outerHTML;
  18177. rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum);
  18178. var normalizedMarkup = markup;
  18179. if (process.env.NODE_ENV !== 'production') {
  18180. // because rootMarkup is retrieved from the DOM, various normalizations
  18181. // will have occurred which will not be present in `markup`. Here,
  18182. // insert markup into a <div> or <iframe> depending on the container
  18183. // type to perform the same normalizations before comparing.
  18184. var normalizer;
  18185. if (container.nodeType === ELEMENT_NODE_TYPE) {
  18186. normalizer = document.createElement('div');
  18187. normalizer.innerHTML = markup;
  18188. normalizedMarkup = normalizer.innerHTML;
  18189. } else {
  18190. normalizer = document.createElement('iframe');
  18191. document.body.appendChild(normalizer);
  18192. normalizer.contentDocument.write(markup);
  18193. normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML;
  18194. document.body.removeChild(normalizer);
  18195. }
  18196. }
  18197. var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup);
  18198. var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20);
  18199. !(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;
  18200. if (process.env.NODE_ENV !== 'production') {
  18201. 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;
  18202. }
  18203. }
  18204. }
  18205. !(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;
  18206. if (transaction.useCreateElement) {
  18207. while (container.lastChild) {
  18208. container.removeChild(container.lastChild);
  18209. }
  18210. DOMLazyTree.insertTreeBefore(container, markup, null);
  18211. } else {
  18212. setInnerHTML(container, markup);
  18213. ReactDOMComponentTree.precacheNode(instance, container.firstChild);
  18214. }
  18215. if (process.env.NODE_ENV !== 'production') {
  18216. var hostNode = ReactDOMComponentTree.getInstanceFromNode(container.firstChild);
  18217. if (hostNode._debugID !== 0) {
  18218. ReactInstrumentation.debugTool.onHostOperation({
  18219. instanceID: hostNode._debugID,
  18220. type: 'mount',
  18221. payload: markup.toString()
  18222. });
  18223. }
  18224. }
  18225. }
  18226. };
  18227. module.exports = ReactMount;
  18228. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  18229. /***/ },
  18230. /* 169 */
  18231. /***/ function(module, exports, __webpack_require__) {
  18232. /* WEBPACK VAR INJECTION */(function(process) {/**
  18233. * Copyright 2013-present, Facebook, Inc.
  18234. * All rights reserved.
  18235. *
  18236. * This source code is licensed under the BSD-style license found in the
  18237. * LICENSE file in the root directory of this source tree. An additional grant
  18238. * of patent rights can be found in the PATENTS file in the same directory.
  18239. *
  18240. */
  18241. 'use strict';
  18242. var validateDOMNesting = __webpack_require__(138);
  18243. var DOC_NODE_TYPE = 9;
  18244. function ReactDOMContainerInfo(topLevelWrapper, node) {
  18245. var info = {
  18246. _topLevelWrapper: topLevelWrapper,
  18247. _idCounter: 1,
  18248. _ownerDocument: node ? node.nodeType === DOC_NODE_TYPE ? node : node.ownerDocument : null,
  18249. _node: node,
  18250. _tag: node ? node.nodeName.toLowerCase() : null,
  18251. _namespaceURI: node ? node.namespaceURI : null
  18252. };
  18253. if (process.env.NODE_ENV !== 'production') {
  18254. info._ancestorInfo = node ? validateDOMNesting.updatedAncestorInfo(null, info._tag, null) : null;
  18255. }
  18256. return info;
  18257. }
  18258. module.exports = ReactDOMContainerInfo;
  18259. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  18260. /***/ },
  18261. /* 170 */
  18262. /***/ function(module, exports) {
  18263. /**
  18264. * Copyright 2013-present, Facebook, Inc.
  18265. * All rights reserved.
  18266. *
  18267. * This source code is licensed under the BSD-style license found in the
  18268. * LICENSE file in the root directory of this source tree. An additional grant
  18269. * of patent rights can be found in the PATENTS file in the same directory.
  18270. *
  18271. */
  18272. 'use strict';
  18273. var ReactDOMFeatureFlags = {
  18274. useCreateElement: true,
  18275. useFiber: false
  18276. };
  18277. module.exports = ReactDOMFeatureFlags;
  18278. /***/ },
  18279. /* 171 */
  18280. /***/ function(module, exports, __webpack_require__) {
  18281. /**
  18282. * Copyright 2013-present, Facebook, Inc.
  18283. * All rights reserved.
  18284. *
  18285. * This source code is licensed under the BSD-style license found in the
  18286. * LICENSE file in the root directory of this source tree. An additional grant
  18287. * of patent rights can be found in the PATENTS file in the same directory.
  18288. *
  18289. */
  18290. 'use strict';
  18291. var adler32 = __webpack_require__(172);
  18292. var TAG_END = /\/?>/;
  18293. var COMMENT_START = /^<\!\-\-/;
  18294. var ReactMarkupChecksum = {
  18295. CHECKSUM_ATTR_NAME: 'data-react-checksum',
  18296. /**
  18297. * @param {string} markup Markup string
  18298. * @return {string} Markup string with checksum attribute attached
  18299. */
  18300. addChecksumToMarkup: function (markup) {
  18301. var checksum = adler32(markup);
  18302. // Add checksum (handle both parent tags, comments and self-closing tags)
  18303. if (COMMENT_START.test(markup)) {
  18304. return markup;
  18305. } else {
  18306. return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '"$&');
  18307. }
  18308. },
  18309. /**
  18310. * @param {string} markup to use
  18311. * @param {DOMElement} element root React element
  18312. * @returns {boolean} whether or not the markup is the same
  18313. */
  18314. canReuseMarkup: function (markup, element) {
  18315. var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
  18316. existingChecksum = existingChecksum && parseInt(existingChecksum, 10);
  18317. var markupChecksum = adler32(markup);
  18318. return markupChecksum === existingChecksum;
  18319. }
  18320. };
  18321. module.exports = ReactMarkupChecksum;
  18322. /***/ },
  18323. /* 172 */
  18324. /***/ function(module, exports) {
  18325. /**
  18326. * Copyright 2013-present, Facebook, Inc.
  18327. * All rights reserved.
  18328. *
  18329. * This source code is licensed under the BSD-style license found in the
  18330. * LICENSE file in the root directory of this source tree. An additional grant
  18331. * of patent rights can be found in the PATENTS file in the same directory.
  18332. *
  18333. *
  18334. */
  18335. 'use strict';
  18336. var MOD = 65521;
  18337. // adler32 is not cryptographically strong, and is only used to sanity check that
  18338. // markup generated on the server matches the markup generated on the client.
  18339. // This implementation (a modified version of the SheetJS version) has been optimized
  18340. // for our use case, at the expense of conforming to the adler32 specification
  18341. // for non-ascii inputs.
  18342. function adler32(data) {
  18343. var a = 1;
  18344. var b = 0;
  18345. var i = 0;
  18346. var l = data.length;
  18347. var m = l & ~0x3;
  18348. while (i < m) {
  18349. var n = Math.min(i + 4096, m);
  18350. for (; i < n; i += 4) {
  18351. b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));
  18352. }
  18353. a %= MOD;
  18354. b %= MOD;
  18355. }
  18356. for (; i < l; i++) {
  18357. b += a += data.charCodeAt(i);
  18358. }
  18359. a %= MOD;
  18360. b %= MOD;
  18361. return a | b << 16;
  18362. }
  18363. module.exports = adler32;
  18364. /***/ },
  18365. /* 173 */
  18366. /***/ function(module, exports) {
  18367. /**
  18368. * Copyright 2013-present, Facebook, Inc.
  18369. * All rights reserved.
  18370. *
  18371. * This source code is licensed under the BSD-style license found in the
  18372. * LICENSE file in the root directory of this source tree. An additional grant
  18373. * of patent rights can be found in the PATENTS file in the same directory.
  18374. *
  18375. */
  18376. 'use strict';
  18377. module.exports = '15.4.2';
  18378. /***/ },
  18379. /* 174 */
  18380. /***/ function(module, exports, __webpack_require__) {
  18381. /* WEBPACK VAR INJECTION */(function(process) {/**
  18382. * Copyright 2013-present, Facebook, Inc.
  18383. * All rights reserved.
  18384. *
  18385. * This source code is licensed under the BSD-style license found in the
  18386. * LICENSE file in the root directory of this source tree. An additional grant
  18387. * of patent rights can be found in the PATENTS file in the same directory.
  18388. *
  18389. */
  18390. 'use strict';
  18391. var _prodInvariant = __webpack_require__(37);
  18392. var ReactCurrentOwner = __webpack_require__(12);
  18393. var ReactDOMComponentTree = __webpack_require__(36);
  18394. var ReactInstanceMap = __webpack_require__(118);
  18395. var getHostComponentFromComposite = __webpack_require__(175);
  18396. var invariant = __webpack_require__(10);
  18397. var warning = __webpack_require__(13);
  18398. /**
  18399. * Returns the DOM node rendered by this element.
  18400. *
  18401. * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.finddomnode
  18402. *
  18403. * @param {ReactComponent|DOMElement} componentOrElement
  18404. * @return {?DOMElement} The root node of this element.
  18405. */
  18406. function findDOMNode(componentOrElement) {
  18407. if (process.env.NODE_ENV !== 'production') {
  18408. var owner = ReactCurrentOwner.current;
  18409. if (owner !== null) {
  18410. 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;
  18411. owner._warnedAboutRefsInRender = true;
  18412. }
  18413. }
  18414. if (componentOrElement == null) {
  18415. return null;
  18416. }
  18417. if (componentOrElement.nodeType === 1) {
  18418. return componentOrElement;
  18419. }
  18420. var inst = ReactInstanceMap.get(componentOrElement);
  18421. if (inst) {
  18422. inst = getHostComponentFromComposite(inst);
  18423. return inst ? ReactDOMComponentTree.getNodeFromInstance(inst) : null;
  18424. }
  18425. if (typeof componentOrElement.render === 'function') {
  18426. true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : _prodInvariant('44') : void 0;
  18427. } else {
  18428. 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;
  18429. }
  18430. }
  18431. module.exports = findDOMNode;
  18432. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  18433. /***/ },
  18434. /* 175 */
  18435. /***/ function(module, exports, __webpack_require__) {
  18436. /**
  18437. * Copyright 2013-present, Facebook, Inc.
  18438. * All rights reserved.
  18439. *
  18440. * This source code is licensed under the BSD-style license found in the
  18441. * LICENSE file in the root directory of this source tree. An additional grant
  18442. * of patent rights can be found in the PATENTS file in the same directory.
  18443. *
  18444. */
  18445. 'use strict';
  18446. var ReactNodeTypes = __webpack_require__(122);
  18447. function getHostComponentFromComposite(inst) {
  18448. var type;
  18449. while ((type = inst._renderedNodeType) === ReactNodeTypes.COMPOSITE) {
  18450. inst = inst._renderedComponent;
  18451. }
  18452. if (type === ReactNodeTypes.HOST) {
  18453. return inst._renderedComponent;
  18454. } else if (type === ReactNodeTypes.EMPTY) {
  18455. return null;
  18456. }
  18457. }
  18458. module.exports = getHostComponentFromComposite;
  18459. /***/ },
  18460. /* 176 */
  18461. /***/ function(module, exports, __webpack_require__) {
  18462. /**
  18463. * Copyright 2013-present, Facebook, Inc.
  18464. * All rights reserved.
  18465. *
  18466. * This source code is licensed under the BSD-style license found in the
  18467. * LICENSE file in the root directory of this source tree. An additional grant
  18468. * of patent rights can be found in the PATENTS file in the same directory.
  18469. *
  18470. */
  18471. 'use strict';
  18472. var ReactMount = __webpack_require__(168);
  18473. module.exports = ReactMount.renderSubtreeIntoContainer;
  18474. /***/ },
  18475. /* 177 */
  18476. /***/ function(module, exports, __webpack_require__) {
  18477. /* WEBPACK VAR INJECTION */(function(process) {/**
  18478. * Copyright 2013-present, Facebook, Inc.
  18479. * All rights reserved.
  18480. *
  18481. * This source code is licensed under the BSD-style license found in the
  18482. * LICENSE file in the root directory of this source tree. An additional grant
  18483. * of patent rights can be found in the PATENTS file in the same directory.
  18484. *
  18485. */
  18486. 'use strict';
  18487. var DOMProperty = __webpack_require__(38);
  18488. var EventPluginRegistry = __webpack_require__(45);
  18489. var ReactComponentTreeHook = __webpack_require__(28);
  18490. var warning = __webpack_require__(13);
  18491. if (process.env.NODE_ENV !== 'production') {
  18492. var reactProps = {
  18493. children: true,
  18494. dangerouslySetInnerHTML: true,
  18495. key: true,
  18496. ref: true,
  18497. autoFocus: true,
  18498. defaultValue: true,
  18499. valueLink: true,
  18500. defaultChecked: true,
  18501. checkedLink: true,
  18502. innerHTML: true,
  18503. suppressContentEditableWarning: true,
  18504. onFocusIn: true,
  18505. onFocusOut: true
  18506. };
  18507. var warnedProperties = {};
  18508. var validateProperty = function (tagName, name, debugID) {
  18509. if (DOMProperty.properties.hasOwnProperty(name) || DOMProperty.isCustomAttribute(name)) {
  18510. return true;
  18511. }
  18512. if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
  18513. return true;
  18514. }
  18515. if (EventPluginRegistry.registrationNameModules.hasOwnProperty(name)) {
  18516. return true;
  18517. }
  18518. warnedProperties[name] = true;
  18519. var lowerCasedName = name.toLowerCase();
  18520. // data-* attributes should be lowercase; suggest the lowercase version
  18521. var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
  18522. var registrationName = EventPluginRegistry.possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? EventPluginRegistry.possibleRegistrationNames[lowerCasedName] : null;
  18523. if (standardName != null) {
  18524. process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown DOM property %s. Did you mean %s?%s', name, standardName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
  18525. return true;
  18526. } else if (registrationName != null) {
  18527. process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown event handler property %s. Did you mean `%s`?%s', name, registrationName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
  18528. return true;
  18529. } else {
  18530. // We were unable to guess which prop the user intended.
  18531. // It is likely that the user was just blindly spreading/forwarding props
  18532. // Components should be careful to only render valid props/attributes.
  18533. // Warning will be invoked in warnUnknownProperties to allow grouping.
  18534. return false;
  18535. }
  18536. };
  18537. }
  18538. var warnUnknownProperties = function (debugID, element) {
  18539. var unknownProps = [];
  18540. for (var key in element.props) {
  18541. var isValid = validateProperty(element.type, key, debugID);
  18542. if (!isValid) {
  18543. unknownProps.push(key);
  18544. }
  18545. }
  18546. var unknownPropString = unknownProps.map(function (prop) {
  18547. return '`' + prop + '`';
  18548. }).join(', ');
  18549. if (unknownProps.length === 1) {
  18550. 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;
  18551. } else if (unknownProps.length > 1) {
  18552. 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;
  18553. }
  18554. };
  18555. function handleElement(debugID, element) {
  18556. if (element == null || typeof element.type !== 'string') {
  18557. return;
  18558. }
  18559. if (element.type.indexOf('-') >= 0 || element.props.is) {
  18560. return;
  18561. }
  18562. warnUnknownProperties(debugID, element);
  18563. }
  18564. var ReactDOMUnknownPropertyHook = {
  18565. onBeforeMountComponent: function (debugID, element) {
  18566. handleElement(debugID, element);
  18567. },
  18568. onBeforeUpdateComponent: function (debugID, element) {
  18569. handleElement(debugID, element);
  18570. }
  18571. };
  18572. module.exports = ReactDOMUnknownPropertyHook;
  18573. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  18574. /***/ },
  18575. /* 178 */
  18576. /***/ function(module, exports, __webpack_require__) {
  18577. /* WEBPACK VAR INJECTION */(function(process) {/**
  18578. * Copyright 2013-present, Facebook, Inc.
  18579. * All rights reserved.
  18580. *
  18581. * This source code is licensed under the BSD-style license found in the
  18582. * LICENSE file in the root directory of this source tree. An additional grant
  18583. * of patent rights can be found in the PATENTS file in the same directory.
  18584. *
  18585. */
  18586. 'use strict';
  18587. var ReactComponentTreeHook = __webpack_require__(28);
  18588. var warning = __webpack_require__(13);
  18589. var didWarnValueNull = false;
  18590. function handleElement(debugID, element) {
  18591. if (element == null) {
  18592. return;
  18593. }
  18594. if (element.type !== 'input' && element.type !== 'textarea' && element.type !== 'select') {
  18595. return;
  18596. }
  18597. if (element.props != null && element.props.value === null && !didWarnValueNull) {
  18598. 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;
  18599. didWarnValueNull = true;
  18600. }
  18601. }
  18602. var ReactDOMNullInputValuePropHook = {
  18603. onBeforeMountComponent: function (debugID, element) {
  18604. handleElement(debugID, element);
  18605. },
  18606. onBeforeUpdateComponent: function (debugID, element) {
  18607. handleElement(debugID, element);
  18608. }
  18609. };
  18610. module.exports = ReactDOMNullInputValuePropHook;
  18611. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  18612. /***/ },
  18613. /* 179 */
  18614. /***/ function(module, exports, __webpack_require__) {
  18615. /* WEBPACK VAR INJECTION */(function(process) {/**
  18616. * Copyright 2013-present, Facebook, Inc.
  18617. * All rights reserved.
  18618. *
  18619. * This source code is licensed under the BSD-style license found in the
  18620. * LICENSE file in the root directory of this source tree. An additional grant
  18621. * of patent rights can be found in the PATENTS file in the same directory.
  18622. *
  18623. */
  18624. 'use strict';
  18625. var DOMProperty = __webpack_require__(38);
  18626. var ReactComponentTreeHook = __webpack_require__(28);
  18627. var warning = __webpack_require__(13);
  18628. var warnedProperties = {};
  18629. var rARIA = new RegExp('^(aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$');
  18630. function validateProperty(tagName, name, debugID) {
  18631. if (warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
  18632. return true;
  18633. }
  18634. if (rARIA.test(name)) {
  18635. var lowerCasedName = name.toLowerCase();
  18636. var standardName = DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
  18637. // If this is an aria-* attribute, but is not listed in the known DOM
  18638. // DOM properties, then it is an invalid aria-* attribute.
  18639. if (standardName == null) {
  18640. warnedProperties[name] = true;
  18641. return false;
  18642. }
  18643. // aria-* attributes should be lowercase; suggest the lowercase version.
  18644. if (name !== standardName) {
  18645. process.env.NODE_ENV !== 'production' ? warning(false, 'Unknown ARIA attribute %s. Did you mean %s?%s', name, standardName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
  18646. warnedProperties[name] = true;
  18647. return true;
  18648. }
  18649. }
  18650. return true;
  18651. }
  18652. function warnInvalidARIAProps(debugID, element) {
  18653. var invalidProps = [];
  18654. for (var key in element.props) {
  18655. var isValid = validateProperty(element.type, key, debugID);
  18656. if (!isValid) {
  18657. invalidProps.push(key);
  18658. }
  18659. }
  18660. var unknownPropString = invalidProps.map(function (prop) {
  18661. return '`' + prop + '`';
  18662. }).join(', ');
  18663. if (invalidProps.length === 1) {
  18664. process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
  18665. } else if (invalidProps.length > 1) {
  18666. process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
  18667. }
  18668. }
  18669. function handleElement(debugID, element) {
  18670. if (element == null || typeof element.type !== 'string') {
  18671. return;
  18672. }
  18673. if (element.type.indexOf('-') >= 0 || element.props.is) {
  18674. return;
  18675. }
  18676. warnInvalidARIAProps(debugID, element);
  18677. }
  18678. var ReactDOMInvalidARIAHook = {
  18679. onBeforeMountComponent: function (debugID, element) {
  18680. if (process.env.NODE_ENV !== 'production') {
  18681. handleElement(debugID, element);
  18682. }
  18683. },
  18684. onBeforeUpdateComponent: function (debugID, element) {
  18685. if (process.env.NODE_ENV !== 'production') {
  18686. handleElement(debugID, element);
  18687. }
  18688. }
  18689. };
  18690. module.exports = ReactDOMInvalidARIAHook;
  18691. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  18692. /***/ },
  18693. /* 180 */
  18694. /***/ function(module, exports, __webpack_require__) {
  18695. /**
  18696. * @author oldj
  18697. * @blog http://oldj.net
  18698. */
  18699. 'use strict';
  18700. Object.defineProperty(exports, "__esModule", {
  18701. value: true
  18702. });
  18703. 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; }; }();
  18704. var _react = __webpack_require__(3);
  18705. var _react2 = _interopRequireDefault(_react);
  18706. var _panel = __webpack_require__(181);
  18707. var _panel2 = _interopRequireDefault(_panel);
  18708. var _content = __webpack_require__(209);
  18709. var _content2 = _interopRequireDefault(_content);
  18710. var _sudo = __webpack_require__(220);
  18711. var _sudo2 = _interopRequireDefault(_sudo);
  18712. var _edit = __webpack_require__(226);
  18713. var _edit2 = _interopRequireDefault(_edit);
  18714. var _preferences = __webpack_require__(229);
  18715. var _preferences2 = _interopRequireDefault(_preferences);
  18716. __webpack_require__(235);
  18717. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  18718. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18719. 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; }
  18720. 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; }
  18721. var App = function (_React$Component) {
  18722. _inherits(App, _React$Component);
  18723. function App(props) {
  18724. _classCallCheck(this, App);
  18725. var _this = _possibleConstructorReturn(this, (App.__proto__ || Object.getPrototypeOf(App)).call(this, props));
  18726. var _data = SH_Agent.getHosts();
  18727. _this.state = {
  18728. hosts: _data,
  18729. current: _data.sys
  18730. };
  18731. SH_event.on('after_apply', function () {
  18732. if (_this.state.current.is_sys) {
  18733. // 重新读取
  18734. _this.setState({
  18735. current: SH_Agent.getSysHosts()
  18736. });
  18737. }
  18738. });
  18739. ipcRenderer.on('to_import', function (e, fn) {
  18740. if (!confirm(SH_Agent.lang.confirm_import)) return;
  18741. SH_Agent.readFile(fn, function (err, cnt) {
  18742. if (err) {
  18743. alert(err.message || 'Import Error!');
  18744. return;
  18745. }
  18746. var data = void 0;
  18747. try {
  18748. data = JSON.parse(cnt);
  18749. } catch (e) {
  18750. console.log(e);
  18751. alert(e.message || 'Bad format, the import file should be a JSON file.');
  18752. return;
  18753. }
  18754. if (!data.list || !Array.isArray(data.list)) {
  18755. alert('Bad format, the data JSON should have a [list] field.');
  18756. return;
  18757. }
  18758. _this.setState({
  18759. hosts: Object.assign({}, _this.state.hosts, { list: data.list })
  18760. }, function () {
  18761. SH_event.emit('imported');
  18762. });
  18763. console.log('imported.');
  18764. });
  18765. });
  18766. return _this;
  18767. }
  18768. _createClass(App, [{
  18769. key: 'setCurrent',
  18770. value: function setCurrent(host) {
  18771. this.setState({
  18772. current: host.is_sys ? SH_Agent.getSysHosts() : host
  18773. });
  18774. }
  18775. }, {
  18776. key: 'toSave',
  18777. value: function toSave() {
  18778. clearTimeout(this._t);
  18779. this._t = setTimeout(function () {
  18780. SH_event.emit('change');
  18781. }, 1000);
  18782. }
  18783. }, {
  18784. key: 'setHostContent',
  18785. value: function setHostContent(v) {
  18786. if (this.state.current.content == v) return; // not changed
  18787. this.state.current.content = v || '';
  18788. this.toSave();
  18789. }
  18790. }, {
  18791. key: 'componentDidMount',
  18792. value: function componentDidMount() {
  18793. window.addEventListener('keydown', function (e) {
  18794. if (e.keyCode === 27) {
  18795. SH_event.emit('esc');
  18796. }
  18797. }, false);
  18798. }
  18799. }, {
  18800. key: 'render',
  18801. value: function render() {
  18802. var current = this.state.current;
  18803. return _react2.default.createElement(
  18804. 'div',
  18805. { id: 'app', className: 'platform-' + platform },
  18806. _react2.default.createElement(_panel2.default, { hosts: this.state.hosts, current: current, setCurrent: this.setCurrent.bind(this) }),
  18807. _react2.default.createElement(_content2.default, { current: current, readonly: App.isReadOnly(current),
  18808. setHostContent: this.setHostContent.bind(this) }),
  18809. _react2.default.createElement(
  18810. 'div',
  18811. { className: 'frames' },
  18812. _react2.default.createElement(_sudo2.default, null),
  18813. _react2.default.createElement(_edit2.default, null),
  18814. _react2.default.createElement(_preferences2.default, null)
  18815. )
  18816. );
  18817. }
  18818. }], [{
  18819. key: 'isReadOnly',
  18820. value: function isReadOnly(host) {
  18821. return host.is_sys || host.where == 'remote';
  18822. }
  18823. }]);
  18824. return App;
  18825. }(_react2.default.Component);
  18826. exports.default = App;
  18827. /***/ },
  18828. /* 181 */
  18829. /***/ function(module, exports, __webpack_require__) {
  18830. /**
  18831. * @author oldj
  18832. * @blog http://oldj.net
  18833. */
  18834. 'use strict';
  18835. Object.defineProperty(exports, "__esModule", {
  18836. value: true
  18837. });
  18838. 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; }; }();
  18839. var _react = __webpack_require__(3);
  18840. var _react2 = _interopRequireDefault(_react);
  18841. var _buttons = __webpack_require__(182);
  18842. var _buttons2 = _interopRequireDefault(_buttons);
  18843. var _searchbar = __webpack_require__(188);
  18844. var _searchbar2 = _interopRequireDefault(_searchbar);
  18845. var _list = __webpack_require__(191);
  18846. var _list2 = _interopRequireDefault(_list);
  18847. __webpack_require__(202);
  18848. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  18849. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18850. 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; }
  18851. 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; }
  18852. var Panel = function (_React$Component) {
  18853. _inherits(Panel, _React$Component);
  18854. function Panel() {
  18855. _classCallCheck(this, Panel);
  18856. return _possibleConstructorReturn(this, (Panel.__proto__ || Object.getPrototypeOf(Panel)).apply(this, arguments));
  18857. }
  18858. _createClass(Panel, [{
  18859. key: 'render',
  18860. value: function render() {
  18861. var _props = this.props,
  18862. current = _props.current,
  18863. hosts = _props.hosts;
  18864. return _react2.default.createElement(
  18865. 'div',
  18866. { id: 'panel' },
  18867. _react2.default.createElement(_list2.default, { hosts: hosts, current: current, setCurrent: this.props.setCurrent }),
  18868. _react2.default.createElement(_searchbar2.default, null),
  18869. _react2.default.createElement(_buttons2.default, null)
  18870. );
  18871. }
  18872. }]);
  18873. return Panel;
  18874. }(_react2.default.Component);
  18875. exports.default = Panel;
  18876. /***/ },
  18877. /* 182 */
  18878. /***/ function(module, exports, __webpack_require__) {
  18879. /**
  18880. * @author oldj
  18881. * @blog http://oldj.net
  18882. */
  18883. 'use strict';
  18884. Object.defineProperty(exports, "__esModule", {
  18885. value: true
  18886. });
  18887. 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; }; }();
  18888. var _react = __webpack_require__(3);
  18889. var _react2 = _interopRequireDefault(_react);
  18890. var _classnames = __webpack_require__(183);
  18891. var _classnames2 = _interopRequireDefault(_classnames);
  18892. __webpack_require__(184);
  18893. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  18894. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18895. 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; }
  18896. 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; }
  18897. var Buttons = function (_React$Component) {
  18898. _inherits(Buttons, _React$Component);
  18899. function Buttons(props) {
  18900. _classCallCheck(this, Buttons);
  18901. var _this = _possibleConstructorReturn(this, (Buttons.__proto__ || Object.getPrototypeOf(Buttons)).call(this, props));
  18902. _this.state = {
  18903. top_toggle_on: true,
  18904. search_on: false
  18905. };
  18906. _this.on_items = null;
  18907. SH_event.on('toggle_host', function (on) {
  18908. if (on && !_this.state.top_toggle_on) {
  18909. _this.setState({
  18910. top_toggle_on: true
  18911. });
  18912. _this.on_items = null;
  18913. }
  18914. });
  18915. SH_event.on('cancel_search', function () {
  18916. _this.calcelSearch();
  18917. });
  18918. ipcRenderer.on('to_add_host', function () {
  18919. SH_event.emit('add_host');
  18920. });
  18921. return _this;
  18922. }
  18923. _createClass(Buttons, [{
  18924. key: 'btnToggle',
  18925. value: function btnToggle() {
  18926. var _this2 = this;
  18927. if (this.state.top_toggle_on) {
  18928. SH_event.emit('get_on_hosts', function (items) {
  18929. _this2.on_items = items;
  18930. });
  18931. }
  18932. this.setState({
  18933. top_toggle_on: !this.state.top_toggle_on
  18934. }, function () {
  18935. SH_event.emit('top_toggle', _this2.state.top_toggle_on, _this2.on_items);
  18936. if (_this2.state.top_toggle_on) {
  18937. _this2.on_items = null;
  18938. }
  18939. });
  18940. }
  18941. }, {
  18942. key: 'btnSearch',
  18943. value: function btnSearch() {
  18944. var _this3 = this;
  18945. this.setState({
  18946. search_on: !this.state.search_on
  18947. }, function () {
  18948. SH_event.emit(_this3.state.search_on ? 'search_on' : 'search_off');
  18949. });
  18950. }
  18951. }, {
  18952. key: 'calcelSearch',
  18953. value: function calcelSearch() {
  18954. this.setState({
  18955. search_on: false
  18956. }, function () {
  18957. SH_event.emit('search_off');
  18958. });
  18959. }
  18960. }, {
  18961. key: 'componentDidMount',
  18962. value: function componentDidMount() {
  18963. var _this4 = this;
  18964. ipcRenderer.on('to_search', function () {
  18965. _this4.btnSearch();
  18966. });
  18967. }
  18968. }, {
  18969. key: 'render',
  18970. value: function render() {
  18971. var _this5 = this;
  18972. return _react2.default.createElement(
  18973. 'div',
  18974. { id: 'sh-buttons' },
  18975. _react2.default.createElement(
  18976. 'div',
  18977. { className: 'left' },
  18978. _react2.default.createElement(
  18979. 'a',
  18980. {
  18981. className: 'btn-add',
  18982. href: '#',
  18983. onClick: function onClick() {
  18984. return Buttons.btnAdd();
  18985. }
  18986. },
  18987. '+'
  18988. )
  18989. ),
  18990. _react2.default.createElement(
  18991. 'div',
  18992. { className: 'right' },
  18993. _react2.default.createElement('i', {
  18994. className: (0, _classnames2.default)({
  18995. iconfont: 1,
  18996. 'icon-search': 1,
  18997. 'on': this.state.search_on
  18998. }),
  18999. onClick: function onClick() {
  19000. return _this5.btnSearch();
  19001. }
  19002. }),
  19003. _react2.default.createElement('i', {
  19004. className: (0, _classnames2.default)({
  19005. iconfont: 1,
  19006. 'icon-switchon': this.state.top_toggle_on,
  19007. 'icon-switchoff': !this.state.top_toggle_on
  19008. }),
  19009. onClick: function onClick() {
  19010. return _this5.btnToggle();
  19011. }
  19012. })
  19013. )
  19014. );
  19015. }
  19016. }], [{
  19017. key: 'btnAdd',
  19018. value: function btnAdd() {
  19019. SH_event.emit('add_host');
  19020. }
  19021. }]);
  19022. return Buttons;
  19023. }(_react2.default.Component);
  19024. exports.default = Buttons;
  19025. /***/ },
  19026. /* 183 */
  19027. /***/ function(module, exports, __webpack_require__) {
  19028. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  19029. Copyright (c) 2016 Jed Watson.
  19030. Licensed under the MIT License (MIT), see
  19031. http://jedwatson.github.io/classnames
  19032. */
  19033. /* global define */
  19034. (function () {
  19035. 'use strict';
  19036. var hasOwn = {}.hasOwnProperty;
  19037. function classNames () {
  19038. var classes = [];
  19039. for (var i = 0; i < arguments.length; i++) {
  19040. var arg = arguments[i];
  19041. if (!arg) continue;
  19042. var argType = typeof arg;
  19043. if (argType === 'string' || argType === 'number') {
  19044. classes.push(arg);
  19045. } else if (Array.isArray(arg)) {
  19046. classes.push(classNames.apply(null, arg));
  19047. } else if (argType === 'object') {
  19048. for (var key in arg) {
  19049. if (hasOwn.call(arg, key) && arg[key]) {
  19050. classes.push(key);
  19051. }
  19052. }
  19053. }
  19054. }
  19055. return classes.join(' ');
  19056. }
  19057. if (typeof module !== 'undefined' && module.exports) {
  19058. module.exports = classNames;
  19059. } else if (true) {
  19060. // register as 'classnames', consistent with npm package name
  19061. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {
  19062. return classNames;
  19063. }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  19064. } else {
  19065. window.classNames = classNames;
  19066. }
  19067. }());
  19068. /***/ },
  19069. /* 184 */
  19070. /***/ function(module, exports, __webpack_require__) {
  19071. // style-loader: Adds some css to the DOM by adding a <style> tag
  19072. // load the styles
  19073. var content = __webpack_require__(185);
  19074. if(typeof content === 'string') content = [[module.id, content, '']];
  19075. // add the styles to the DOM
  19076. var update = __webpack_require__(187)(content, {});
  19077. if(content.locals) module.exports = content.locals;
  19078. // Hot Module Replacement
  19079. if(false) {
  19080. // When the styles change, update the <style> tags
  19081. if(!content.locals) {
  19082. module.hot.accept("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./../../../../node_modules/.2.2.3@less-loader/index.js!./buttons.less", function() {
  19083. var newContent = require("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./../../../../node_modules/.2.2.3@less-loader/index.js!./buttons.less");
  19084. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  19085. update(newContent);
  19086. });
  19087. }
  19088. // When the module is disposed, remove the <style> tags
  19089. module.hot.dispose(function() { update(); });
  19090. }
  19091. /***/ },
  19092. /* 185 */
  19093. /***/ function(module, exports, __webpack_require__) {
  19094. exports = module.exports = __webpack_require__(186)();
  19095. // imports
  19096. // module
  19097. 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", ""]);
  19098. // exports
  19099. /***/ },
  19100. /* 186 */
  19101. /***/ function(module, exports) {
  19102. /*
  19103. MIT License http://www.opensource.org/licenses/mit-license.php
  19104. Author Tobias Koppers @sokra
  19105. */
  19106. // css base code, injected by the css-loader
  19107. module.exports = function() {
  19108. var list = [];
  19109. // return the list of modules as css string
  19110. list.toString = function toString() {
  19111. var result = [];
  19112. for(var i = 0; i < this.length; i++) {
  19113. var item = this[i];
  19114. if(item[2]) {
  19115. result.push("@media " + item[2] + "{" + item[1] + "}");
  19116. } else {
  19117. result.push(item[1]);
  19118. }
  19119. }
  19120. return result.join("");
  19121. };
  19122. // import a list of modules into the list
  19123. list.i = function(modules, mediaQuery) {
  19124. if(typeof modules === "string")
  19125. modules = [[null, modules, ""]];
  19126. var alreadyImportedModules = {};
  19127. for(var i = 0; i < this.length; i++) {
  19128. var id = this[i][0];
  19129. if(typeof id === "number")
  19130. alreadyImportedModules[id] = true;
  19131. }
  19132. for(i = 0; i < modules.length; i++) {
  19133. var item = modules[i];
  19134. // skip already imported module
  19135. // this implementation is not 100% perfect for weird media query combinations
  19136. // when a module is imported multiple times with different media queries.
  19137. // I hope this will never occur (Hey this way we have smaller bundles)
  19138. if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
  19139. if(mediaQuery && !item[2]) {
  19140. item[2] = mediaQuery;
  19141. } else if(mediaQuery) {
  19142. item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
  19143. }
  19144. list.push(item);
  19145. }
  19146. }
  19147. };
  19148. return list;
  19149. };
  19150. /***/ },
  19151. /* 187 */
  19152. /***/ function(module, exports, __webpack_require__) {
  19153. /*
  19154. MIT License http://www.opensource.org/licenses/mit-license.php
  19155. Author Tobias Koppers @sokra
  19156. */
  19157. var stylesInDom = {},
  19158. memoize = function(fn) {
  19159. var memo;
  19160. return function () {
  19161. if (typeof memo === "undefined") memo = fn.apply(this, arguments);
  19162. return memo;
  19163. };
  19164. },
  19165. isOldIE = memoize(function() {
  19166. return /msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase());
  19167. }),
  19168. getHeadElement = memoize(function () {
  19169. return document.head || document.getElementsByTagName("head")[0];
  19170. }),
  19171. singletonElement = null,
  19172. singletonCounter = 0,
  19173. styleElementsInsertedAtTop = [];
  19174. module.exports = function(list, options) {
  19175. if(false) {
  19176. if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
  19177. }
  19178. options = options || {};
  19179. // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  19180. // tags it will allow on a page
  19181. if (typeof options.singleton === "undefined") options.singleton = isOldIE();
  19182. // By default, add <style> tags to the bottom of <head>.
  19183. if (typeof options.insertAt === "undefined") options.insertAt = "bottom";
  19184. var styles = listToStyles(list);
  19185. addStylesToDom(styles, options);
  19186. return function update(newList) {
  19187. var mayRemove = [];
  19188. for(var i = 0; i < styles.length; i++) {
  19189. var item = styles[i];
  19190. var domStyle = stylesInDom[item.id];
  19191. domStyle.refs--;
  19192. mayRemove.push(domStyle);
  19193. }
  19194. if(newList) {
  19195. var newStyles = listToStyles(newList);
  19196. addStylesToDom(newStyles, options);
  19197. }
  19198. for(var i = 0; i < mayRemove.length; i++) {
  19199. var domStyle = mayRemove[i];
  19200. if(domStyle.refs === 0) {
  19201. for(var j = 0; j < domStyle.parts.length; j++)
  19202. domStyle.parts[j]();
  19203. delete stylesInDom[domStyle.id];
  19204. }
  19205. }
  19206. };
  19207. }
  19208. function addStylesToDom(styles, options) {
  19209. for(var i = 0; i < styles.length; i++) {
  19210. var item = styles[i];
  19211. var domStyle = stylesInDom[item.id];
  19212. if(domStyle) {
  19213. domStyle.refs++;
  19214. for(var j = 0; j < domStyle.parts.length; j++) {
  19215. domStyle.parts[j](item.parts[j]);
  19216. }
  19217. for(; j < item.parts.length; j++) {
  19218. domStyle.parts.push(addStyle(item.parts[j], options));
  19219. }
  19220. } else {
  19221. var parts = [];
  19222. for(var j = 0; j < item.parts.length; j++) {
  19223. parts.push(addStyle(item.parts[j], options));
  19224. }
  19225. stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
  19226. }
  19227. }
  19228. }
  19229. function listToStyles(list) {
  19230. var styles = [];
  19231. var newStyles = {};
  19232. for(var i = 0; i < list.length; i++) {
  19233. var item = list[i];
  19234. var id = item[0];
  19235. var css = item[1];
  19236. var media = item[2];
  19237. var sourceMap = item[3];
  19238. var part = {css: css, media: media, sourceMap: sourceMap};
  19239. if(!newStyles[id])
  19240. styles.push(newStyles[id] = {id: id, parts: [part]});
  19241. else
  19242. newStyles[id].parts.push(part);
  19243. }
  19244. return styles;
  19245. }
  19246. function insertStyleElement(options, styleElement) {
  19247. var head = getHeadElement();
  19248. var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];
  19249. if (options.insertAt === "top") {
  19250. if(!lastStyleElementInsertedAtTop) {
  19251. head.insertBefore(styleElement, head.firstChild);
  19252. } else if(lastStyleElementInsertedAtTop.nextSibling) {
  19253. head.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling);
  19254. } else {
  19255. head.appendChild(styleElement);
  19256. }
  19257. styleElementsInsertedAtTop.push(styleElement);
  19258. } else if (options.insertAt === "bottom") {
  19259. head.appendChild(styleElement);
  19260. } else {
  19261. throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
  19262. }
  19263. }
  19264. function removeStyleElement(styleElement) {
  19265. styleElement.parentNode.removeChild(styleElement);
  19266. var idx = styleElementsInsertedAtTop.indexOf(styleElement);
  19267. if(idx >= 0) {
  19268. styleElementsInsertedAtTop.splice(idx, 1);
  19269. }
  19270. }
  19271. function createStyleElement(options) {
  19272. var styleElement = document.createElement("style");
  19273. styleElement.type = "text/css";
  19274. insertStyleElement(options, styleElement);
  19275. return styleElement;
  19276. }
  19277. function createLinkElement(options) {
  19278. var linkElement = document.createElement("link");
  19279. linkElement.rel = "stylesheet";
  19280. insertStyleElement(options, linkElement);
  19281. return linkElement;
  19282. }
  19283. function addStyle(obj, options) {
  19284. var styleElement, update, remove;
  19285. if (options.singleton) {
  19286. var styleIndex = singletonCounter++;
  19287. styleElement = singletonElement || (singletonElement = createStyleElement(options));
  19288. update = applyToSingletonTag.bind(null, styleElement, styleIndex, false);
  19289. remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true);
  19290. } else if(obj.sourceMap &&
  19291. typeof URL === "function" &&
  19292. typeof URL.createObjectURL === "function" &&
  19293. typeof URL.revokeObjectURL === "function" &&
  19294. typeof Blob === "function" &&
  19295. typeof btoa === "function") {
  19296. styleElement = createLinkElement(options);
  19297. update = updateLink.bind(null, styleElement);
  19298. remove = function() {
  19299. removeStyleElement(styleElement);
  19300. if(styleElement.href)
  19301. URL.revokeObjectURL(styleElement.href);
  19302. };
  19303. } else {
  19304. styleElement = createStyleElement(options);
  19305. update = applyToTag.bind(null, styleElement);
  19306. remove = function() {
  19307. removeStyleElement(styleElement);
  19308. };
  19309. }
  19310. update(obj);
  19311. return function updateStyle(newObj) {
  19312. if(newObj) {
  19313. if(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap)
  19314. return;
  19315. update(obj = newObj);
  19316. } else {
  19317. remove();
  19318. }
  19319. };
  19320. }
  19321. var replaceText = (function () {
  19322. var textStore = [];
  19323. return function (index, replacement) {
  19324. textStore[index] = replacement;
  19325. return textStore.filter(Boolean).join('\n');
  19326. };
  19327. })();
  19328. function applyToSingletonTag(styleElement, index, remove, obj) {
  19329. var css = remove ? "" : obj.css;
  19330. if (styleElement.styleSheet) {
  19331. styleElement.styleSheet.cssText = replaceText(index, css);
  19332. } else {
  19333. var cssNode = document.createTextNode(css);
  19334. var childNodes = styleElement.childNodes;
  19335. if (childNodes[index]) styleElement.removeChild(childNodes[index]);
  19336. if (childNodes.length) {
  19337. styleElement.insertBefore(cssNode, childNodes[index]);
  19338. } else {
  19339. styleElement.appendChild(cssNode);
  19340. }
  19341. }
  19342. }
  19343. function applyToTag(styleElement, obj) {
  19344. var css = obj.css;
  19345. var media = obj.media;
  19346. if(media) {
  19347. styleElement.setAttribute("media", media)
  19348. }
  19349. if(styleElement.styleSheet) {
  19350. styleElement.styleSheet.cssText = css;
  19351. } else {
  19352. while(styleElement.firstChild) {
  19353. styleElement.removeChild(styleElement.firstChild);
  19354. }
  19355. styleElement.appendChild(document.createTextNode(css));
  19356. }
  19357. }
  19358. function updateLink(linkElement, obj) {
  19359. var css = obj.css;
  19360. var sourceMap = obj.sourceMap;
  19361. if(sourceMap) {
  19362. // http://stackoverflow.com/a/26603875
  19363. css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
  19364. }
  19365. var blob = new Blob([css], { type: "text/css" });
  19366. var oldSrc = linkElement.href;
  19367. linkElement.href = URL.createObjectURL(blob);
  19368. if(oldSrc)
  19369. URL.revokeObjectURL(oldSrc);
  19370. }
  19371. /***/ },
  19372. /* 188 */
  19373. /***/ function(module, exports, __webpack_require__) {
  19374. /**
  19375. * @author oldj
  19376. * @blog http://oldj.net
  19377. */
  19378. 'use strict';
  19379. Object.defineProperty(exports, "__esModule", {
  19380. value: true
  19381. });
  19382. 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; }; }();
  19383. var _react = __webpack_require__(3);
  19384. var _react2 = _interopRequireDefault(_react);
  19385. var _classnames = __webpack_require__(183);
  19386. var _classnames2 = _interopRequireDefault(_classnames);
  19387. __webpack_require__(189);
  19388. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  19389. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19390. 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; }
  19391. 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; }
  19392. var SearchBar = function (_React$Component) {
  19393. _inherits(SearchBar, _React$Component);
  19394. function SearchBar(props) {
  19395. _classCallCheck(this, SearchBar);
  19396. var _this = _possibleConstructorReturn(this, (SearchBar.__proto__ || Object.getPrototypeOf(SearchBar)).call(this, props));
  19397. _this.state = {
  19398. show: false,
  19399. keyword: ''
  19400. };
  19401. _this._t = null;
  19402. SH_event.on('search_on', function () {
  19403. _this.setState({
  19404. show: true
  19405. }, function () {
  19406. setTimeout(function () {
  19407. _this.refs.keyword.focus();
  19408. }, 100);
  19409. });
  19410. });
  19411. SH_event.on('search_off', function () {
  19412. _this.clearSearch();
  19413. });
  19414. return _this;
  19415. }
  19416. _createClass(SearchBar, [{
  19417. key: 'clearSearch',
  19418. value: function clearSearch() {
  19419. this.setState({
  19420. show: false,
  19421. keyword: ''
  19422. });
  19423. SH_event.emit('search', '');
  19424. }
  19425. }, {
  19426. key: 'doSearch',
  19427. value: function doSearch(kw) {
  19428. this.setState({
  19429. keyword: kw
  19430. });
  19431. clearTimeout(this._t);
  19432. this._t = setTimeout(function () {
  19433. SH_event.emit('search', kw);
  19434. }, 300);
  19435. }
  19436. }, {
  19437. key: 'onCancel',
  19438. value: function onCancel() {
  19439. SH_event.emit('cancel_search');
  19440. }
  19441. }, {
  19442. key: 'render',
  19443. value: function render() {
  19444. var _this2 = this;
  19445. if (!this.state.show) {
  19446. return null;
  19447. }
  19448. return _react2.default.createElement(
  19449. 'div',
  19450. { id: 'sh-searchbar' },
  19451. _react2.default.createElement('input', {
  19452. ref: 'keyword',
  19453. type: 'text',
  19454. placeholder: 'keyword',
  19455. value: this.state.keyword,
  19456. onChange: function onChange(e) {
  19457. return _this2.doSearch(e.target.value);
  19458. },
  19459. onKeyDown: function onKeyDown(e) {
  19460. return e.keyCode === 27 && _this2.onCancel();
  19461. }
  19462. })
  19463. );
  19464. }
  19465. }]);
  19466. return SearchBar;
  19467. }(_react2.default.Component);
  19468. exports.default = SearchBar;
  19469. /***/ },
  19470. /* 189 */
  19471. /***/ function(module, exports, __webpack_require__) {
  19472. // style-loader: Adds some css to the DOM by adding a <style> tag
  19473. // load the styles
  19474. var content = __webpack_require__(190);
  19475. if(typeof content === 'string') content = [[module.id, content, '']];
  19476. // add the styles to the DOM
  19477. var update = __webpack_require__(187)(content, {});
  19478. if(content.locals) module.exports = content.locals;
  19479. // Hot Module Replacement
  19480. if(false) {
  19481. // When the styles change, update the <style> tags
  19482. if(!content.locals) {
  19483. module.hot.accept("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./../../../../node_modules/.2.2.3@less-loader/index.js!./searchbar.less", function() {
  19484. var newContent = require("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./../../../../node_modules/.2.2.3@less-loader/index.js!./searchbar.less");
  19485. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  19486. update(newContent);
  19487. });
  19488. }
  19489. // When the module is disposed, remove the <style> tags
  19490. module.hot.dispose(function() { update(); });
  19491. }
  19492. /***/ },
  19493. /* 190 */
  19494. /***/ function(module, exports, __webpack_require__) {
  19495. exports = module.exports = __webpack_require__(186)();
  19496. // imports
  19497. // module
  19498. 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", ""]);
  19499. // exports
  19500. /***/ },
  19501. /* 191 */
  19502. /***/ function(module, exports, __webpack_require__) {
  19503. /**
  19504. * @author oldj
  19505. * @blog http://oldj.net
  19506. */
  19507. 'use strict';
  19508. Object.defineProperty(exports, "__esModule", {
  19509. value: true
  19510. });
  19511. 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; }; }();
  19512. var _react = __webpack_require__(3);
  19513. var _react2 = _interopRequireDefault(_react);
  19514. var _list_item = __webpack_require__(192);
  19515. var _list_item2 = _interopRequireDefault(_list_item);
  19516. var _reactAddonsUpdate = __webpack_require__(196);
  19517. var _reactAddonsUpdate2 = _interopRequireDefault(_reactAddonsUpdate);
  19518. __webpack_require__(198);
  19519. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  19520. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19521. 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; }
  19522. 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; }
  19523. var List = function (_React$Component) {
  19524. _inherits(List, _React$Component);
  19525. function List(props) {
  19526. _classCallCheck(this, List);
  19527. var _this = _possibleConstructorReturn(this, (List.__proto__ || Object.getPrototypeOf(List)).call(this, props));
  19528. _this.state = {
  19529. current: _this.props.current,
  19530. list: _this.props.hosts.list
  19531. };
  19532. _this.last_content = _this.props.hosts.sys.content;
  19533. SH_event.on('imported', function () {
  19534. _this.setState({
  19535. current: _this.props.current,
  19536. list: _this.props.hosts.list
  19537. }, function () {
  19538. SH_event.emit('change');
  19539. });
  19540. });
  19541. SH_event.on('change', function () {
  19542. SH_event.emit('save_data', _this.state.list);
  19543. var content = _this.getOnContent();
  19544. if (content !== _this.last_content) {
  19545. SH_event.emit('apply', content, function () {
  19546. _this.last_content = content;
  19547. });
  19548. }
  19549. });
  19550. SH_event.on('host_added', function (data) {
  19551. _this.setState({
  19552. list: (0, _reactAddonsUpdate2.default)(_this.state.list, { $push: [data] })
  19553. }, function () {
  19554. _this.selectOne(data);
  19555. setTimeout(function () {
  19556. SH_event.emit('change', true);
  19557. var el = _this.refs.items;
  19558. el.scrollTop = document.querySelector('.list-item.selected').offsetTop - el.offsetHeight + 50;
  19559. _this.checkUpdateHost(data);
  19560. }, 100);
  19561. });
  19562. });
  19563. SH_event.on('host_edited', function (data, host) {
  19564. var idx = _this.state.list.findIndex(function (item) {
  19565. return item == host;
  19566. });
  19567. if (idx == -1) return;
  19568. _this.setState({
  19569. list: (0, _reactAddonsUpdate2.default)(_this.state.list, { $splice: [[idx, 1, data]] })
  19570. }, function () {
  19571. _this.selectOne(data);
  19572. setTimeout(function () {
  19573. SH_event.emit('change', true);
  19574. _this.checkUpdateHost(data, true);
  19575. }, 100);
  19576. });
  19577. });
  19578. SH_event.on('host_refreshed', function (data, host) {
  19579. var idx = _this.state.list.findIndex(function (item) {
  19580. return item == host;
  19581. });
  19582. if (idx == -1) return;
  19583. _this.setState({
  19584. list: (0, _reactAddonsUpdate2.default)(_this.state.list, { $splice: [[idx, 1, data]] })
  19585. }, function () {
  19586. setTimeout(function () {
  19587. if (host === _this.state.current) {
  19588. _this.selectOne(data);
  19589. }
  19590. SH_event.emit('change', true);
  19591. }, 100);
  19592. });
  19593. });
  19594. SH_event.on('del_host', function (host) {
  19595. var list = _this.state.list;
  19596. var idx_to_del = list.findIndex(function (item) {
  19597. return host === item;
  19598. });
  19599. if (idx_to_del == -1) return;
  19600. // list.splice(idx_to_del, 1);
  19601. _this.setState({
  19602. list: (0, _reactAddonsUpdate2.default)(_this.state.list, { $splice: [[idx_to_del, 1]] })
  19603. // list: this.state.list.filter((item, idx) => idx != idx_to_del)
  19604. }, function () {
  19605. setTimeout(function () {
  19606. var list = _this.state.list;
  19607. var next_host = list[idx_to_del] || list[list.length - 1] || _this.props.hosts.sys;
  19608. if (next_host) {
  19609. _this.selectOne(next_host);
  19610. }
  19611. SH_event.emit('change');
  19612. }, 100);
  19613. });
  19614. });
  19615. SH_event.on('get_on_hosts', function (callback) {
  19616. callback(_this.getOnItems());
  19617. });
  19618. ipcRenderer.on('get_host_list', function () {
  19619. ipcRenderer.send('send_host_list', _this.state.list);
  19620. });
  19621. ipcRenderer.on('get_export_data', function (e, fn) {
  19622. var data = Object.assign({}, {
  19623. version: __webpack_require__(200).version,
  19624. list: _this.state.list.map(function (item) {
  19625. var new_item = Object.assign({}, item);
  19626. new_item.on = false;
  19627. return new_item;
  19628. })
  19629. });
  19630. ipcRenderer.send('export_data', fn, JSON.stringify(data));
  19631. });
  19632. SH_event.on('top_toggle', function (on, items) {
  19633. _this.setState({
  19634. list: _this.state.list.map(function (item) {
  19635. if (items.findIndex(function (i) {
  19636. return i == item;
  19637. }) > -1) {
  19638. item.on = on;
  19639. }
  19640. return item;
  19641. })
  19642. }, function () {
  19643. SH_event.emit('change');
  19644. });
  19645. });
  19646. SH_event.on('loading_done', function (host, data) {
  19647. SH_event.emit('host_refreshed', data, host);
  19648. // if (host == this.state.current || host._ == this.state.current) {
  19649. // setTimeout(() => {
  19650. // this.selectOne(this.state.current);
  19651. // }, 100);
  19652. // }
  19653. if (data.error) {
  19654. console.log(data.error);
  19655. }
  19656. });
  19657. // auto check refresh
  19658. setTimeout(function () {
  19659. _this.autoCheckRefresh();
  19660. }, 1000 * 5);
  19661. return _this;
  19662. }
  19663. /**
  19664. * 检查当前 host 是否需要从网络下载更新
  19665. * @param host
  19666. * @param force {Boolean} 如果为 true,则只要是 remote 且 refresh_interval != 0,则强制更新
  19667. */
  19668. _createClass(List, [{
  19669. key: 'checkUpdateHost',
  19670. value: function checkUpdateHost(host) {
  19671. var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  19672. SH_event.emit('check_host_refresh', host, force);
  19673. }
  19674. }, {
  19675. key: 'autoCheckRefresh',
  19676. value: function autoCheckRefresh() {
  19677. var _this2 = this;
  19678. var remote_idx = -1;
  19679. this.state.list.map(function (host, idx) {
  19680. if (host.where === 'remote') {
  19681. remote_idx++;
  19682. }
  19683. setTimeout(function () {
  19684. SH_event.emit('check_host_refresh', host);
  19685. }, 1000 * 5 * remote_idx + idx);
  19686. });
  19687. // let wait = 1000 * 60 * 10;
  19688. var wait = 1000 * 30; // test only
  19689. setTimeout(function () {
  19690. _this2.autoCheckRefresh();
  19691. }, wait);
  19692. }
  19693. }, {
  19694. key: 'apply',
  19695. value: function apply(content, success) {
  19696. var _this3 = this;
  19697. SH_event.emit('apply', content, function () {
  19698. _this3.last_content = content;
  19699. success();
  19700. SH_event.emit('save_data', _this3.state.list);
  19701. SH_Agent.notify({
  19702. message: 'host updated.'
  19703. });
  19704. });
  19705. }
  19706. }, {
  19707. key: 'selectOne',
  19708. value: function selectOne(host) {
  19709. this.setState({
  19710. current: host
  19711. });
  19712. this.props.setCurrent(host);
  19713. }
  19714. }, {
  19715. key: 'toggleOne',
  19716. value: function toggleOne(idx, success) {
  19717. var _this4 = this;
  19718. var content = this.getOnContent(idx);
  19719. this.apply(content, function () {
  19720. var choice_mode = SH_Agent.pref.get('choice_mode');
  19721. if (choice_mode === 'single') {
  19722. // 单选模式
  19723. _this4.setState({
  19724. list: _this4.state.list.map(function (item, _idx) {
  19725. if (idx != _idx) {
  19726. item.on = false;
  19727. }
  19728. return item;
  19729. })
  19730. });
  19731. }
  19732. if (typeof success === 'function') {
  19733. success();
  19734. }
  19735. });
  19736. }
  19737. }, {
  19738. key: 'getOnItems',
  19739. value: function getOnItems() {
  19740. var idx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
  19741. var choice_mode = SH_Agent.pref.get('choice_mode');
  19742. return this.state.list.filter(function (item, _idx) {
  19743. if (choice_mode === 'single') {
  19744. return !item.on && _idx == idx;
  19745. } else {
  19746. return item.on && _idx != idx || !item.on && _idx == idx;
  19747. }
  19748. });
  19749. }
  19750. }, {
  19751. key: 'getOnContent',
  19752. value: function getOnContent() {
  19753. var idx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
  19754. var contents = this.getOnItems(idx).map(function (item) {
  19755. return item.content || '';
  19756. });
  19757. contents.unshift('# SwitchHosts!');
  19758. return contents.join('\n\n');
  19759. }
  19760. }, {
  19761. key: 'customItems',
  19762. value: function customItems() {
  19763. var _this5 = this;
  19764. return this.state.list.map(function (item, idx) {
  19765. return _react2.default.createElement(_list_item2.default, {
  19766. data: item,
  19767. idx: idx,
  19768. selectOne: _this5.selectOne.bind(_this5),
  19769. current: _this5.state.current,
  19770. onToggle: function onToggle(success) {
  19771. return _this5.toggleOne(idx, success);
  19772. },
  19773. key: 'host-' + idx,
  19774. dragOrder: function dragOrder(sidx, tidx) {
  19775. return _this5.dragOrder(sidx, tidx);
  19776. }
  19777. });
  19778. });
  19779. }
  19780. }, {
  19781. key: 'dragOrder',
  19782. value: function dragOrder(source_idx, target_idx) {
  19783. var source = this.state.list[source_idx];
  19784. var target = this.state.list[target_idx];
  19785. var list = this.state.list.filter(function (item, idx) {
  19786. return idx != source_idx;
  19787. });
  19788. var new_target_idx = list.findIndex(function (item) {
  19789. return item == target;
  19790. });
  19791. var to_idx = void 0;
  19792. if (source_idx < target_idx) {
  19793. // append
  19794. to_idx = new_target_idx + 1;
  19795. } else {
  19796. // insert before
  19797. to_idx = new_target_idx;
  19798. }
  19799. list.splice(to_idx, 0, source);
  19800. this.setState({
  19801. list: list
  19802. });
  19803. setTimeout(function () {
  19804. SH_event.emit('change');
  19805. }, 100);
  19806. }
  19807. }, {
  19808. key: 'componentDidMount',
  19809. value: function componentDidMount() {}
  19810. }, {
  19811. key: 'render',
  19812. value: function render() {
  19813. return _react2.default.createElement(
  19814. 'div',
  19815. { id: 'sh-list' },
  19816. _react2.default.createElement(_list_item2.default, {
  19817. data: this.props.hosts.sys,
  19818. selectOne: this.selectOne.bind(this),
  19819. current: this.state.current,
  19820. sys: '1' }),
  19821. _react2.default.createElement(
  19822. 'div',
  19823. { ref: 'items', className: 'custom-items' },
  19824. this.customItems()
  19825. )
  19826. );
  19827. }
  19828. }]);
  19829. return List;
  19830. }(_react2.default.Component);
  19831. exports.default = List;
  19832. /***/ },
  19833. /* 192 */
  19834. /***/ function(module, exports, __webpack_require__) {
  19835. /**
  19836. * @author oldj
  19837. * @blog http://oldj.net
  19838. */
  19839. 'use strict';
  19840. Object.defineProperty(exports, "__esModule", {
  19841. value: true
  19842. });
  19843. 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; }; }();
  19844. var _react = __webpack_require__(3);
  19845. var _react2 = _interopRequireDefault(_react);
  19846. var _classnames = __webpack_require__(183);
  19847. var _classnames2 = _interopRequireDefault(_classnames);
  19848. var _kw = __webpack_require__(193);
  19849. __webpack_require__(194);
  19850. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  19851. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19852. 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; }
  19853. 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; }
  19854. var ListItem = function (_React$Component) {
  19855. _inherits(ListItem, _React$Component);
  19856. function ListItem(props) {
  19857. _classCallCheck(this, ListItem);
  19858. var _this = _possibleConstructorReturn(this, (ListItem.__proto__ || Object.getPrototypeOf(ListItem)).call(this, props));
  19859. _this.is_sys = !!_this.props.sys;
  19860. _this.state = {
  19861. is_selected: false,
  19862. search_kw: '',
  19863. search_re: null
  19864. };
  19865. SH_event.on('search', function (kw) {
  19866. _this.setState({
  19867. search_kw: kw,
  19868. search_re: kw ? (0, _kw.kw2re)(kw) : null
  19869. });
  19870. });
  19871. ipcRenderer.on('tray_toggle_host', function (e, idx) {
  19872. // ipcRenderer.send('send_host_list', this.state.list);
  19873. // this.toggleOne(idx);
  19874. if (idx === _this.props.idx) {
  19875. _this.toggle();
  19876. }
  19877. });
  19878. return _this;
  19879. }
  19880. _createClass(ListItem, [{
  19881. key: 'getTitle',
  19882. value: function getTitle() {
  19883. return this.is_sys ? SH_Agent.lang.sys_host_title : this.props.data.title || SH_Agent.lang.untitled;
  19884. }
  19885. }, {
  19886. key: 'beSelected',
  19887. value: function beSelected() {
  19888. // this.setState({
  19889. // is_selected: true
  19890. // });
  19891. this.props.selectOne(this.props.data);
  19892. }
  19893. }, {
  19894. key: 'toEdit',
  19895. value: function toEdit() {
  19896. SH_event.emit('edit_host', this.props.data);
  19897. }
  19898. }, {
  19899. key: 'toggle',
  19900. value: function toggle() {
  19901. var _this2 = this;
  19902. var on = !this.props.data.on;
  19903. this.props.onToggle(function () {
  19904. _this2.props.data.on = on;
  19905. _this2.forceUpdate();
  19906. });
  19907. SH_event.emit('toggle_host', on);
  19908. }
  19909. }, {
  19910. key: 'allowedDrop',
  19911. value: function allowedDrop(e) {
  19912. e.preventDefault();
  19913. }
  19914. }, {
  19915. key: 'onDrop',
  19916. value: function onDrop(e) {
  19917. if (this.props.sys) {
  19918. e.preventDefault();
  19919. return false;
  19920. }
  19921. var source_idx = parseInt(e.dataTransfer.getData('text'));
  19922. this.props.dragOrder(source_idx, this.props.idx);
  19923. }
  19924. }, {
  19925. key: 'onDrag',
  19926. value: function onDrag(e) {
  19927. e.dataTransfer.setData('text', this.props.idx);
  19928. }
  19929. }, {
  19930. key: 'isMatched',
  19931. value: function isMatched() {
  19932. if (this.props.sys) return true;
  19933. var kw = this.state.search_kw;
  19934. var re = this.state.search_re;
  19935. if (!kw || kw === '/') return true;
  19936. var _props$data = this.props.data,
  19937. title = _props$data.title,
  19938. content = _props$data.content;
  19939. if (re) {
  19940. return re.test(title) || re.test(content);
  19941. } else {
  19942. return title.indexOf(kw) > -1 || content.indexOf(kw) > -1;
  19943. }
  19944. }
  19945. }, {
  19946. key: 'render',
  19947. value: function render() {
  19948. var _this3 = this;
  19949. var _props = this.props,
  19950. data = _props.data,
  19951. sys = _props.sys,
  19952. current = _props.current;
  19953. var is_selected = data == current;
  19954. return _react2.default.createElement(
  19955. 'div',
  19956. { className: (0, _classnames2.default)({
  19957. 'list-item': 1,
  19958. 'hidden': !this.isMatched(),
  19959. 'sys-host': sys,
  19960. 'selected': is_selected
  19961. }),
  19962. onClick: this.beSelected.bind(this),
  19963. draggable: !sys,
  19964. onDragStart: function onDragStart(e) {
  19965. return _this3.onDrag(e);
  19966. },
  19967. onDragOver: function onDragOver(e) {
  19968. return _this3.allowedDrop(e);
  19969. },
  19970. onDrop: function onDrop(e) {
  19971. return _this3.onDrop(e);
  19972. }
  19973. },
  19974. sys ? null : _react2.default.createElement(
  19975. 'div',
  19976. null,
  19977. _react2.default.createElement('i', { className: (0, _classnames2.default)({
  19978. 'switch': 1,
  19979. 'iconfont': 1,
  19980. 'icon-on': data.on,
  19981. 'icon-off': !data.on
  19982. }),
  19983. onClick: this.toggle.bind(this)
  19984. }),
  19985. _react2.default.createElement('i', {
  19986. className: 'iconfont icon-edit',
  19987. onClick: this.toEdit.bind(this)
  19988. })
  19989. ),
  19990. _react2.default.createElement('i', { className: (0, _classnames2.default)({
  19991. 'iconfont': 1,
  19992. 'item-icon': 1,
  19993. 'icon-warn': !!data.error,
  19994. 'icon-doc': !sys && !data.error,
  19995. 'icon-sysserver': sys && !data.error
  19996. }),
  19997. title: data.error || ''
  19998. }),
  19999. _react2.default.createElement(
  20000. 'span',
  20001. null,
  20002. this.getTitle()
  20003. )
  20004. );
  20005. }
  20006. }]);
  20007. return ListItem;
  20008. }(_react2.default.Component);
  20009. exports.default = ListItem;
  20010. /***/ },
  20011. /* 193 */
  20012. /***/ function(module, exports) {
  20013. /**
  20014. * kw
  20015. * @author oldj
  20016. * @blog http://oldj.net
  20017. */
  20018. 'use strict';
  20019. function kw2re(kw) {
  20020. // 模糊搜索
  20021. var r = void 0;
  20022. var m = void 0;
  20023. var flag = [];
  20024. if (kw === '/') {
  20025. return;
  20026. } else if (m = kw.match(/^\/([^\/]+)\/?(\w*)$/)) {
  20027. if (m[2].indexOf('i') > -1) {
  20028. flag.push('i');
  20029. }
  20030. // if (m[2].indexOf('g') > -1) {
  20031. flag.push('g');
  20032. // }
  20033. try {
  20034. r = new RegExp(m[1], flag.join(''));
  20035. } catch (e) {}
  20036. } else if (kw.indexOf('*') > -1) {
  20037. try {
  20038. r = new RegExp(kw.replace(/\*/g, '.*'), 'ig');
  20039. } catch (e) {}
  20040. }
  20041. return r;
  20042. }
  20043. exports.findPositions = function (kw, code) {
  20044. if (!kw || kw === '/') return;
  20045. var r = kw2re(kw);
  20046. if (!r) {
  20047. try {
  20048. r = new RegExp(kw.replace(/([\.\?\*\+\^\$\(\)\-\[\]\{\}])/g, '\\$1'), 'ig');
  20049. } catch (e) {
  20050. console.log(e);
  20051. return;
  20052. }
  20053. }
  20054. var indexes = [];
  20055. var lines = code.split('\n');
  20056. lines.map(function (ln, idx) {
  20057. var match = void 0;
  20058. var max_loop = 30;
  20059. while (match = r.exec(ln)) {
  20060. indexes.push([{ line: idx, ch: match.index }, { line: idx, ch: match.index + match[0].length }]);
  20061. max_loop--;
  20062. if (max_loop < 0) break;
  20063. }
  20064. });
  20065. return indexes;
  20066. };
  20067. exports.kw2re = kw2re;
  20068. /***/ },
  20069. /* 194 */
  20070. /***/ function(module, exports, __webpack_require__) {
  20071. // style-loader: Adds some css to the DOM by adding a <style> tag
  20072. // load the styles
  20073. var content = __webpack_require__(195);
  20074. if(typeof content === 'string') content = [[module.id, content, '']];
  20075. // add the styles to the DOM
  20076. var update = __webpack_require__(187)(content, {});
  20077. if(content.locals) module.exports = content.locals;
  20078. // Hot Module Replacement
  20079. if(false) {
  20080. // When the styles change, update the <style> tags
  20081. if(!content.locals) {
  20082. module.hot.accept("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./../../../../node_modules/.2.2.3@less-loader/index.js!./list_item.less", function() {
  20083. var newContent = require("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./../../../../node_modules/.2.2.3@less-loader/index.js!./list_item.less");
  20084. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  20085. update(newContent);
  20086. });
  20087. }
  20088. // When the module is disposed, remove the <style> tags
  20089. module.hot.dispose(function() { update(); });
  20090. }
  20091. /***/ },
  20092. /* 195 */
  20093. /***/ function(module, exports, __webpack_require__) {
  20094. exports = module.exports = __webpack_require__(186)();
  20095. // imports
  20096. // module
  20097. 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", ""]);
  20098. // exports
  20099. /***/ },
  20100. /* 196 */
  20101. /***/ function(module, exports, __webpack_require__) {
  20102. module.exports = __webpack_require__(197);
  20103. /***/ },
  20104. /* 197 */
  20105. /***/ function(module, exports, __webpack_require__) {
  20106. /* WEBPACK VAR INJECTION */(function(process) {/**
  20107. * Copyright 2013-present, Facebook, Inc.
  20108. * All rights reserved.
  20109. *
  20110. * This source code is licensed under the BSD-style license found in the
  20111. * LICENSE file in the root directory of this source tree. An additional grant
  20112. * of patent rights can be found in the PATENTS file in the same directory.
  20113. *
  20114. */
  20115. /* global hasOwnProperty:true */
  20116. 'use strict';
  20117. var _prodInvariant = __webpack_require__(9),
  20118. _assign = __webpack_require__(6);
  20119. var invariant = __webpack_require__(10);
  20120. var hasOwnProperty = {}.hasOwnProperty;
  20121. function shallowCopy(x) {
  20122. if (Array.isArray(x)) {
  20123. return x.concat();
  20124. } else if (x && typeof x === 'object') {
  20125. return _assign(new x.constructor(), x);
  20126. } else {
  20127. return x;
  20128. }
  20129. }
  20130. var COMMAND_PUSH = '$push';
  20131. var COMMAND_UNSHIFT = '$unshift';
  20132. var COMMAND_SPLICE = '$splice';
  20133. var COMMAND_SET = '$set';
  20134. var COMMAND_MERGE = '$merge';
  20135. var COMMAND_APPLY = '$apply';
  20136. var ALL_COMMANDS_LIST = [COMMAND_PUSH, COMMAND_UNSHIFT, COMMAND_SPLICE, COMMAND_SET, COMMAND_MERGE, COMMAND_APPLY];
  20137. var ALL_COMMANDS_SET = {};
  20138. ALL_COMMANDS_LIST.forEach(function (command) {
  20139. ALL_COMMANDS_SET[command] = true;
  20140. });
  20141. function invariantArrayCase(value, spec, command) {
  20142. !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;
  20143. var specValue = spec[command];
  20144. !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;
  20145. }
  20146. /**
  20147. * Returns a updated shallow copy of an object without mutating the original.
  20148. * See https://facebook.github.io/react/docs/update.html for details.
  20149. */
  20150. function update(value, spec) {
  20151. !(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;
  20152. if (hasOwnProperty.call(spec, COMMAND_SET)) {
  20153. !(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;
  20154. return spec[COMMAND_SET];
  20155. }
  20156. var nextValue = shallowCopy(value);
  20157. if (hasOwnProperty.call(spec, COMMAND_MERGE)) {
  20158. var mergeObj = spec[COMMAND_MERGE];
  20159. !(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;
  20160. !(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;
  20161. _assign(nextValue, spec[COMMAND_MERGE]);
  20162. }
  20163. if (hasOwnProperty.call(spec, COMMAND_PUSH)) {
  20164. invariantArrayCase(value, spec, COMMAND_PUSH);
  20165. spec[COMMAND_PUSH].forEach(function (item) {
  20166. nextValue.push(item);
  20167. });
  20168. }
  20169. if (hasOwnProperty.call(spec, COMMAND_UNSHIFT)) {
  20170. invariantArrayCase(value, spec, COMMAND_UNSHIFT);
  20171. spec[COMMAND_UNSHIFT].forEach(function (item) {
  20172. nextValue.unshift(item);
  20173. });
  20174. }
  20175. if (hasOwnProperty.call(spec, COMMAND_SPLICE)) {
  20176. !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;
  20177. !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;
  20178. spec[COMMAND_SPLICE].forEach(function (args) {
  20179. !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;
  20180. nextValue.splice.apply(nextValue, args);
  20181. });
  20182. }
  20183. if (hasOwnProperty.call(spec, COMMAND_APPLY)) {
  20184. !(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;
  20185. nextValue = spec[COMMAND_APPLY](nextValue);
  20186. }
  20187. for (var k in spec) {
  20188. if (!(ALL_COMMANDS_SET.hasOwnProperty(k) && ALL_COMMANDS_SET[k])) {
  20189. nextValue[k] = update(value[k], spec[k]);
  20190. }
  20191. }
  20192. return nextValue;
  20193. }
  20194. module.exports = update;
  20195. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  20196. /***/ },
  20197. /* 198 */
  20198. /***/ function(module, exports, __webpack_require__) {
  20199. // style-loader: Adds some css to the DOM by adding a <style> tag
  20200. // load the styles
  20201. var content = __webpack_require__(199);
  20202. if(typeof content === 'string') content = [[module.id, content, '']];
  20203. // add the styles to the DOM
  20204. var update = __webpack_require__(187)(content, {});
  20205. if(content.locals) module.exports = content.locals;
  20206. // Hot Module Replacement
  20207. if(false) {
  20208. // When the styles change, update the <style> tags
  20209. if(!content.locals) {
  20210. module.hot.accept("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./../../../../node_modules/.2.2.3@less-loader/index.js!./list.less", function() {
  20211. var newContent = require("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./../../../../node_modules/.2.2.3@less-loader/index.js!./list.less");
  20212. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  20213. update(newContent);
  20214. });
  20215. }
  20216. // When the module is disposed, remove the <style> tags
  20217. module.hot.dispose(function() { update(); });
  20218. }
  20219. /***/ },
  20220. /* 199 */
  20221. /***/ function(module, exports, __webpack_require__) {
  20222. exports = module.exports = __webpack_require__(186)();
  20223. // imports
  20224. // module
  20225. 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", ""]);
  20226. // exports
  20227. /***/ },
  20228. /* 200 */
  20229. /***/ function(module, exports, __webpack_require__) {
  20230. /**
  20231. * configs.js
  20232. * @author oldj
  20233. * @blog http://oldj.net
  20234. */
  20235. 'use strict';
  20236. var m_ver = __webpack_require__(201).version;
  20237. exports.version = m_ver.slice(0, 3).join('.');
  20238. exports.version_full = m_ver.join('.');
  20239. /***/ },
  20240. /* 201 */
  20241. /***/ function(module, exports) {
  20242. "use strict";
  20243. exports.version = [3, 2, 2, 4212];
  20244. /***/ },
  20245. /* 202 */
  20246. /***/ function(module, exports, __webpack_require__) {
  20247. // style-loader: Adds some css to the DOM by adding a <style> tag
  20248. // load the styles
  20249. var content = __webpack_require__(203);
  20250. if(typeof content === 'string') content = [[module.id, content, '']];
  20251. // add the styles to the DOM
  20252. var update = __webpack_require__(187)(content, {});
  20253. if(content.locals) module.exports = content.locals;
  20254. // Hot Module Replacement
  20255. if(false) {
  20256. // When the styles change, update the <style> tags
  20257. if(!content.locals) {
  20258. module.hot.accept("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./../../../../node_modules/.2.2.3@less-loader/index.js!./panel.less", function() {
  20259. var newContent = require("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./../../../../node_modules/.2.2.3@less-loader/index.js!./panel.less");
  20260. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  20261. update(newContent);
  20262. });
  20263. }
  20264. // When the module is disposed, remove the <style> tags
  20265. module.hot.dispose(function() { update(); });
  20266. }
  20267. /***/ },
  20268. /* 203 */
  20269. /***/ function(module, exports, __webpack_require__) {
  20270. exports = module.exports = __webpack_require__(186)();
  20271. // imports
  20272. exports.i(__webpack_require__(204), "");
  20273. // module
  20274. exports.push([module.id, "#panel {\n width: 240px;\n height: 100%;\n background: #373d47;\n color: #979da7;\n}\n", ""]);
  20275. // exports
  20276. /***/ },
  20277. /* 204 */
  20278. /***/ function(module, exports, __webpack_require__) {
  20279. exports = module.exports = __webpack_require__(186)();
  20280. // imports
  20281. // module
  20282. exports.push([module.id, "\n@font-face {font-family: \"iconfont\";\n src: url(" + __webpack_require__(205) + "); /* IE9*/\n src: url(" + __webpack_require__(205) + "?#iefix) format('embedded-opentype'), \n url(" + __webpack_require__(206) + ") format('woff'), \n url(" + __webpack_require__(207) + ") format('truetype'), \n url(" + __webpack_require__(208) + "#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", ""]);
  20283. // exports
  20284. /***/ },
  20285. /* 205 */
  20286. /***/ function(module, exports) {
  20287. 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="
  20288. /***/ },
  20289. /* 206 */
  20290. /***/ function(module, exports) {
  20291. 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=="
  20292. /***/ },
  20293. /* 207 */
  20294. /***/ function(module, exports) {
  20295. 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"
  20296. /***/ },
  20297. /* 208 */
  20298. /***/ function(module, exports) {
  20299. 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"
  20300. /***/ },
  20301. /* 209 */
  20302. /***/ function(module, exports, __webpack_require__) {
  20303. /**
  20304. * @author oldj
  20305. * @blog http://oldj.net
  20306. */
  20307. 'use strict';
  20308. Object.defineProperty(exports, "__esModule", {
  20309. value: true
  20310. });
  20311. 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; }; }();
  20312. var _react = __webpack_require__(3);
  20313. var _react2 = _interopRequireDefault(_react);
  20314. var _editor = __webpack_require__(210);
  20315. var _editor2 = _interopRequireDefault(_editor);
  20316. var _classnames = __webpack_require__(183);
  20317. var _classnames2 = _interopRequireDefault(_classnames);
  20318. __webpack_require__(218);
  20319. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  20320. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20321. 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; }
  20322. 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; }
  20323. var Content = function (_React$Component) {
  20324. _inherits(Content, _React$Component);
  20325. function Content(props) {
  20326. _classCallCheck(this, Content);
  20327. var _this = _possibleConstructorReturn(this, (Content.__proto__ || Object.getPrototypeOf(Content)).call(this, props));
  20328. _this.codemirror = null;
  20329. _this.state = {
  20330. is_loading: _this.props.current.is_loading,
  20331. code: _this.props.current.content || ''
  20332. };
  20333. _this._t = null;
  20334. SH_event.on('loading', function (host) {
  20335. if (host === _this.props.current) {
  20336. _this.setState({
  20337. is_loading: true
  20338. });
  20339. }
  20340. });
  20341. SH_event.on('loading_done', function (host, data) {
  20342. if (host === _this.props.current) {
  20343. _this.setState({
  20344. is_loading: false,
  20345. code: data.content || ''
  20346. });
  20347. }
  20348. });
  20349. return _this;
  20350. }
  20351. _createClass(Content, [{
  20352. key: 'setValue',
  20353. value: function setValue(v) {
  20354. this.props.setHostContent(v);
  20355. }
  20356. }, {
  20357. key: 'componentWillReceiveProps',
  20358. value: function componentWillReceiveProps(next_props) {
  20359. this.setState({
  20360. is_loading: next_props.current.is_loading,
  20361. code: next_props.current.content || ''
  20362. });
  20363. }
  20364. }, {
  20365. key: 'render',
  20366. value: function render() {
  20367. var current = this.props.current;
  20368. return _react2.default.createElement(
  20369. 'div',
  20370. { id: 'sh-content' },
  20371. _react2.default.createElement(
  20372. 'div',
  20373. { className: 'inform' },
  20374. _react2.default.createElement(
  20375. 'span',
  20376. {
  20377. className: (0, _classnames2.default)({
  20378. loading: 1,
  20379. show: this.state.is_loading
  20380. })
  20381. },
  20382. 'loading...'
  20383. ),
  20384. _react2.default.createElement('i', {
  20385. className: (0, _classnames2.default)({
  20386. show: current.where === 'remote',
  20387. iconfont: 1,
  20388. 'icon-earth': 1
  20389. }),
  20390. title: SH_Agent.lang.remote_hosts
  20391. }),
  20392. _react2.default.createElement('i', {
  20393. className: (0, _classnames2.default)({
  20394. show: this.props.readonly,
  20395. iconfont: 1,
  20396. 'icon-lock2': 1
  20397. }),
  20398. title: SH_Agent.lang.readonly
  20399. })
  20400. ),
  20401. _react2.default.createElement(
  20402. 'div',
  20403. { className: (0, _classnames2.default)({
  20404. errorMessage: 1,
  20405. show: !!this.props.current.error
  20406. }) },
  20407. this.props.current.error
  20408. ),
  20409. _react2.default.createElement(_editor2.default, {
  20410. code: this.state.code,
  20411. readonly: this.props.readonly,
  20412. setValue: this.setValue.bind(this) })
  20413. );
  20414. }
  20415. }]);
  20416. return Content;
  20417. }(_react2.default.Component);
  20418. exports.default = Content;
  20419. /***/ },
  20420. /* 210 */
  20421. /***/ function(module, exports, __webpack_require__) {
  20422. /**
  20423. * @author oldj
  20424. * @blog http://oldj.net
  20425. */
  20426. 'use strict';
  20427. Object.defineProperty(exports, "__esModule", {
  20428. value: true
  20429. });
  20430. 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; }; }();
  20431. var _react = __webpack_require__(3);
  20432. var _react2 = _interopRequireDefault(_react);
  20433. var _codemirror = __webpack_require__(211);
  20434. var _codemirror2 = _interopRequireDefault(_codemirror);
  20435. __webpack_require__(212);
  20436. var _classnames = __webpack_require__(183);
  20437. var _classnames2 = _interopRequireDefault(_classnames);
  20438. var _cm_hl = __webpack_require__(213);
  20439. var _cm_hl2 = _interopRequireDefault(_cm_hl);
  20440. var _kw = __webpack_require__(193);
  20441. var _kw2 = _interopRequireDefault(_kw);
  20442. __webpack_require__(214);
  20443. __webpack_require__(216);
  20444. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  20445. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20446. 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; }
  20447. 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; }
  20448. // import '../../../node_modules/codemirror/addon/comment/comment';
  20449. var Editor = function (_React$Component) {
  20450. _inherits(Editor, _React$Component);
  20451. function Editor(props) {
  20452. _classCallCheck(this, Editor);
  20453. var _this = _possibleConstructorReturn(this, (Editor.__proto__ || Object.getPrototypeOf(Editor)).call(this, props));
  20454. _this.codemirror = null;
  20455. (0, _cm_hl2.default)();
  20456. _this.marks = [];
  20457. _this.kw = '';
  20458. SH_event.on('search', function (kw) {
  20459. _this.kw = kw;
  20460. _this.highlightKeyword();
  20461. });
  20462. return _this;
  20463. }
  20464. _createClass(Editor, [{
  20465. key: 'highlightKeyword',
  20466. value: function highlightKeyword() {
  20467. var _this2 = this;
  20468. while (this.marks.length > 0) {
  20469. this.marks.shift().clear();
  20470. }
  20471. var code = this.props.code;
  20472. var pos = _kw2.default.findPositions(this.kw, code) || [];
  20473. // this.codemirror.markText({line: 6, ch: 16}, {line: 6, ch: 22}, {className: 'cm-hl'});
  20474. pos.map(function (p) {
  20475. _this2.marks.push(_this2.codemirror.markText(p[0], p[1], { className: 'cm-hl' }));
  20476. });
  20477. }
  20478. }, {
  20479. key: 'setValue',
  20480. value: function setValue(v) {
  20481. this.props.setValue(v);
  20482. }
  20483. }, {
  20484. key: 'toComment',
  20485. value: function toComment() {
  20486. var doc = this.codemirror.getDoc();
  20487. var cur = doc.getCursor();
  20488. var line = cur.line;
  20489. var info = doc.lineInfo(line);
  20490. this.codemirror.toggleComment({
  20491. line: line,
  20492. cur: 0
  20493. }, {
  20494. line: line,
  20495. cur: info.text.length
  20496. });
  20497. }
  20498. }, {
  20499. key: 'componentDidMount',
  20500. value: function componentDidMount() {
  20501. var _this3 = this;
  20502. // console.log(this.cnt_node, this.cnt_node.value);
  20503. this.codemirror = _codemirror2.default.fromTextArea(this.cnt_node, {
  20504. lineNumbers: true,
  20505. readOnly: true,
  20506. mode: 'host'
  20507. });
  20508. this.codemirror.setSize('100%', '100%');
  20509. this.codemirror.on('change', function (a) {
  20510. var v = a.getDoc().getValue();
  20511. _this3.setValue(v);
  20512. });
  20513. this.codemirror.on('gutterClick', function (cm, n) {
  20514. if (_this3.props.readonly === true) return;
  20515. var info = cm.lineInfo(n);
  20516. //cm.setGutterMarker(n, "breakpoints", info.gutterMarkers ? null : makeMarker());
  20517. var ln = info.text;
  20518. if (/^\s*$/.test(ln)) return;
  20519. var new_ln = void 0;
  20520. if (/^#/.test(ln)) {
  20521. new_ln = ln.replace(/^#\s*/, '');
  20522. } else {
  20523. new_ln = '# ' + ln;
  20524. }
  20525. _this3.codemirror.getDoc().replaceRange(new_ln, { line: info.line, ch: 0 }, { line: info.line, ch: ln.length });
  20526. //app.caculateHosts();
  20527. });
  20528. ipcRenderer.on('to_comment', function () {
  20529. _this3.toComment();
  20530. });
  20531. }
  20532. }, {
  20533. key: 'componentWillReceiveProps',
  20534. value: function componentWillReceiveProps(next_props) {
  20535. var _this4 = this;
  20536. // console.log(next_props);
  20537. this.codemirror.getDoc().setValue(next_props.code);
  20538. this.codemirror.setOption('readOnly', next_props.readonly);
  20539. setTimeout(function () {
  20540. _this4.highlightKeyword();
  20541. }, 100);
  20542. }
  20543. }, {
  20544. key: 'render',
  20545. value: function render() {
  20546. var _this5 = this;
  20547. return _react2.default.createElement(
  20548. 'div',
  20549. { id: 'sh-editor', className: (0, _classnames2.default)({
  20550. readonly: this.props.readonly
  20551. }) },
  20552. _react2.default.createElement('textarea', {
  20553. ref: function ref(c) {
  20554. return _this5.cnt_node = c;
  20555. },
  20556. defaultValue: this.props.code || ''
  20557. })
  20558. );
  20559. }
  20560. }]);
  20561. return Editor;
  20562. }(_react2.default.Component);
  20563. exports.default = Editor;
  20564. /***/ },
  20565. /* 211 */
  20566. /***/ function(module, exports, __webpack_require__) {
  20567. // CodeMirror, copyright (c) by Marijn Haverbeke and others
  20568. // Distributed under an MIT license: http://codemirror.net/LICENSE
  20569. // This is CodeMirror (http://codemirror.net), a code editor
  20570. // implemented in JavaScript on top of the browser's DOM.
  20571. //
  20572. // You can find some technical background for some of the code below
  20573. // at http://marijnhaverbeke.nl/blog/#cm-internals .
  20574. (function (global, factory) {
  20575. true ? module.exports = factory() :
  20576. typeof define === 'function' && define.amd ? define(factory) :
  20577. (global.CodeMirror = factory());
  20578. }(this, (function () { 'use strict';
  20579. // Kludges for bugs and behavior differences that can't be feature
  20580. // detected are enabled based on userAgent etc sniffing.
  20581. var userAgent = navigator.userAgent
  20582. var platform = navigator.platform
  20583. var gecko = /gecko\/\d/i.test(userAgent)
  20584. var ie_upto10 = /MSIE \d/.test(userAgent)
  20585. var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent)
  20586. var ie = ie_upto10 || ie_11up
  20587. var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : ie_11up[1])
  20588. var webkit = /WebKit\//.test(userAgent)
  20589. var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent)
  20590. var chrome = /Chrome\//.test(userAgent)
  20591. var presto = /Opera\//.test(userAgent)
  20592. var safari = /Apple Computer/.test(navigator.vendor)
  20593. var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent)
  20594. var phantom = /PhantomJS/.test(userAgent)
  20595. var ios = /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent)
  20596. // This is woefully incomplete. Suggestions for alternative methods welcome.
  20597. var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent)
  20598. var mac = ios || /Mac/.test(platform)
  20599. var chromeOS = /\bCrOS\b/.test(userAgent)
  20600. var windows = /win/i.test(platform)
  20601. var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/)
  20602. if (presto_version) { presto_version = Number(presto_version[1]) }
  20603. if (presto_version && presto_version >= 15) { presto = false; webkit = true }
  20604. // Some browsers use the wrong event properties to signal cmd/ctrl on OS X
  20605. var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11))
  20606. var captureRightClick = gecko || (ie && ie_version >= 9)
  20607. function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*") }
  20608. var rmClass = function(node, cls) {
  20609. var current = node.className
  20610. var match = classTest(cls).exec(current)
  20611. if (match) {
  20612. var after = current.slice(match.index + match[0].length)
  20613. node.className = current.slice(0, match.index) + (after ? match[1] + after : "")
  20614. }
  20615. }
  20616. function removeChildren(e) {
  20617. for (var count = e.childNodes.length; count > 0; --count)
  20618. { e.removeChild(e.firstChild) }
  20619. return e
  20620. }
  20621. function removeChildrenAndAdd(parent, e) {
  20622. return removeChildren(parent).appendChild(e)
  20623. }
  20624. function elt(tag, content, className, style) {
  20625. var e = document.createElement(tag)
  20626. if (className) { e.className = className }
  20627. if (style) { e.style.cssText = style }
  20628. if (typeof content == "string") { e.appendChild(document.createTextNode(content)) }
  20629. else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]) } }
  20630. return e
  20631. }
  20632. var range
  20633. if (document.createRange) { range = function(node, start, end, endNode) {
  20634. var r = document.createRange()
  20635. r.setEnd(endNode || node, end)
  20636. r.setStart(node, start)
  20637. return r
  20638. } }
  20639. else { range = function(node, start, end) {
  20640. var r = document.body.createTextRange()
  20641. try { r.moveToElementText(node.parentNode) }
  20642. catch(e) { return r }
  20643. r.collapse(true)
  20644. r.moveEnd("character", end)
  20645. r.moveStart("character", start)
  20646. return r
  20647. } }
  20648. function contains(parent, child) {
  20649. if (child.nodeType == 3) // Android browser always returns false when child is a textnode
  20650. { child = child.parentNode }
  20651. if (parent.contains)
  20652. { return parent.contains(child) }
  20653. do {
  20654. if (child.nodeType == 11) { child = child.host }
  20655. if (child == parent) { return true }
  20656. } while (child = child.parentNode)
  20657. }
  20658. function activeElt() {
  20659. // IE and Edge may throw an "Unspecified Error" when accessing document.activeElement.
  20660. // IE < 10 will throw when accessed while the page is loading or in an iframe.
  20661. // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.
  20662. var activeElement
  20663. try {
  20664. activeElement = document.activeElement
  20665. } catch(e) {
  20666. activeElement = document.body || null
  20667. }
  20668. while (activeElement && activeElement.root && activeElement.root.activeElement)
  20669. { activeElement = activeElement.root.activeElement }
  20670. return activeElement
  20671. }
  20672. function addClass(node, cls) {
  20673. var current = node.className
  20674. if (!classTest(cls).test(current)) { node.className += (current ? " " : "") + cls }
  20675. }
  20676. function joinClasses(a, b) {
  20677. var as = a.split(" ")
  20678. for (var i = 0; i < as.length; i++)
  20679. { if (as[i] && !classTest(as[i]).test(b)) { b += " " + as[i] } }
  20680. return b
  20681. }
  20682. var selectInput = function(node) { node.select() }
  20683. if (ios) // Mobile Safari apparently has a bug where select() is broken.
  20684. { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length } }
  20685. else if (ie) // Suppress mysterious IE10 errors
  20686. { selectInput = function(node) { try { node.select() } catch(_e) {} } }
  20687. function bind(f) {
  20688. var args = Array.prototype.slice.call(arguments, 1)
  20689. return function(){return f.apply(null, args)}
  20690. }
  20691. function copyObj(obj, target, overwrite) {
  20692. if (!target) { target = {} }
  20693. for (var prop in obj)
  20694. { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))
  20695. { target[prop] = obj[prop] } }
  20696. return target
  20697. }
  20698. // Counts the column offset in a string, taking tabs into account.
  20699. // Used mostly to find indentation.
  20700. function countColumn(string, end, tabSize, startIndex, startValue) {
  20701. if (end == null) {
  20702. end = string.search(/[^\s\u00a0]/)
  20703. if (end == -1) { end = string.length }
  20704. }
  20705. for (var i = startIndex || 0, n = startValue || 0;;) {
  20706. var nextTab = string.indexOf("\t", i)
  20707. if (nextTab < 0 || nextTab >= end)
  20708. { return n + (end - i) }
  20709. n += nextTab - i
  20710. n += tabSize - (n % tabSize)
  20711. i = nextTab + 1
  20712. }
  20713. }
  20714. function Delayed() {this.id = null}
  20715. Delayed.prototype.set = function(ms, f) {
  20716. clearTimeout(this.id)
  20717. this.id = setTimeout(f, ms)
  20718. }
  20719. function indexOf(array, elt) {
  20720. for (var i = 0; i < array.length; ++i)
  20721. { if (array[i] == elt) { return i } }
  20722. return -1
  20723. }
  20724. // Number of pixels added to scroller and sizer to hide scrollbar
  20725. var scrollerGap = 30
  20726. // Returned or thrown by various protocols to signal 'I'm not
  20727. // handling this'.
  20728. var Pass = {toString: function(){return "CodeMirror.Pass"}}
  20729. // Reused option objects for setSelection & friends
  20730. var sel_dontScroll = {scroll: false};
  20731. var sel_mouse = {origin: "*mouse"};
  20732. var sel_move = {origin: "+move"};
  20733. // The inverse of countColumn -- find the offset that corresponds to
  20734. // a particular column.
  20735. function findColumn(string, goal, tabSize) {
  20736. for (var pos = 0, col = 0;;) {
  20737. var nextTab = string.indexOf("\t", pos)
  20738. if (nextTab == -1) { nextTab = string.length }
  20739. var skipped = nextTab - pos
  20740. if (nextTab == string.length || col + skipped >= goal)
  20741. { return pos + Math.min(skipped, goal - col) }
  20742. col += nextTab - pos
  20743. col += tabSize - (col % tabSize)
  20744. pos = nextTab + 1
  20745. if (col >= goal) { return pos }
  20746. }
  20747. }
  20748. var spaceStrs = [""]
  20749. function spaceStr(n) {
  20750. while (spaceStrs.length <= n)
  20751. { spaceStrs.push(lst(spaceStrs) + " ") }
  20752. return spaceStrs[n]
  20753. }
  20754. function lst(arr) { return arr[arr.length-1] }
  20755. function map(array, f) {
  20756. var out = []
  20757. for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i) }
  20758. return out
  20759. }
  20760. function insertSorted(array, value, score) {
  20761. var pos = 0, priority = score(value)
  20762. while (pos < array.length && score(array[pos]) <= priority) { pos++ }
  20763. array.splice(pos, 0, value)
  20764. }
  20765. function nothing() {}
  20766. function createObj(base, props) {
  20767. var inst
  20768. if (Object.create) {
  20769. inst = Object.create(base)
  20770. } else {
  20771. nothing.prototype = base
  20772. inst = new nothing()
  20773. }
  20774. if (props) { copyObj(props, inst) }
  20775. return inst
  20776. }
  20777. var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/
  20778. function isWordCharBasic(ch) {
  20779. return /\w/.test(ch) || ch > "\x80" &&
  20780. (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))
  20781. }
  20782. function isWordChar(ch, helper) {
  20783. if (!helper) { return isWordCharBasic(ch) }
  20784. if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) { return true }
  20785. return helper.test(ch)
  20786. }
  20787. function isEmpty(obj) {
  20788. for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }
  20789. return true
  20790. }
  20791. // Extending unicode characters. A series of a non-extending char +
  20792. // any number of extending chars is treated as a single unit as far
  20793. // as editing and measuring is concerned. This is not fully correct,
  20794. // since some scripts/fonts/browsers also treat other configurations
  20795. // of code points as a group.
  20796. 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]/
  20797. function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }
  20798. // The display handles the DOM integration, both for input reading
  20799. // and content drawing. It holds references to DOM nodes and
  20800. // display-related state.
  20801. function Display(place, doc, input) {
  20802. var d = this
  20803. this.input = input
  20804. // Covers bottom-right square when both scrollbars are present.
  20805. d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler")
  20806. d.scrollbarFiller.setAttribute("cm-not-content", "true")
  20807. // Covers bottom of gutter when coverGutterNextToScrollbar is on
  20808. // and h scrollbar is present.
  20809. d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler")
  20810. d.gutterFiller.setAttribute("cm-not-content", "true")
  20811. // Will contain the actual code, positioned to cover the viewport.
  20812. d.lineDiv = elt("div", null, "CodeMirror-code")
  20813. // Elements are added to these to represent selection and cursors.
  20814. d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1")
  20815. d.cursorDiv = elt("div", null, "CodeMirror-cursors")
  20816. // A visibility: hidden element used to find the size of things.
  20817. d.measure = elt("div", null, "CodeMirror-measure")
  20818. // When lines outside of the viewport are measured, they are drawn in this.
  20819. d.lineMeasure = elt("div", null, "CodeMirror-measure")
  20820. // Wraps everything that needs to exist inside the vertically-padded coordinate system
  20821. d.lineSpace = elt("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],
  20822. null, "position: relative; outline: none")
  20823. // Moved around its parent to cover visible view.
  20824. d.mover = elt("div", [elt("div", [d.lineSpace], "CodeMirror-lines")], null, "position: relative")
  20825. // Set to the height of the document, allowing scrolling.
  20826. d.sizer = elt("div", [d.mover], "CodeMirror-sizer")
  20827. d.sizerWidth = null
  20828. // Behavior of elts with overflow: auto and padding is
  20829. // inconsistent across browsers. This is used to ensure the
  20830. // scrollable area is big enough.
  20831. d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;")
  20832. // Will contain the gutters, if any.
  20833. d.gutters = elt("div", null, "CodeMirror-gutters")
  20834. d.lineGutter = null
  20835. // Actual scrollable element.
  20836. d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll")
  20837. d.scroller.setAttribute("tabIndex", "-1")
  20838. // The element in which the editor lives.
  20839. d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror")
  20840. // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)
  20841. if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0 }
  20842. if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true }
  20843. if (place) {
  20844. if (place.appendChild) { place.appendChild(d.wrapper) }
  20845. else { place(d.wrapper) }
  20846. }
  20847. // Current rendered range (may be bigger than the view window).
  20848. d.viewFrom = d.viewTo = doc.first
  20849. d.reportedViewFrom = d.reportedViewTo = doc.first
  20850. // Information about the rendered lines.
  20851. d.view = []
  20852. d.renderedView = null
  20853. // Holds info about a single rendered line when it was rendered
  20854. // for measurement, while not in view.
  20855. d.externalMeasured = null
  20856. // Empty space (in pixels) above the view
  20857. d.viewOffset = 0
  20858. d.lastWrapHeight = d.lastWrapWidth = 0
  20859. d.updateLineNumbers = null
  20860. d.nativeBarWidth = d.barHeight = d.barWidth = 0
  20861. d.scrollbarsClipped = false
  20862. // Used to only resize the line number gutter when necessary (when
  20863. // the amount of lines crosses a boundary that makes its width change)
  20864. d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null
  20865. // Set to true when a non-horizontal-scrolling line widget is
  20866. // added. As an optimization, line widget aligning is skipped when
  20867. // this is false.
  20868. d.alignWidgets = false
  20869. d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null
  20870. // Tracks the maximum line length so that the horizontal scrollbar
  20871. // can be kept static when scrolling.
  20872. d.maxLine = null
  20873. d.maxLineLength = 0
  20874. d.maxLineChanged = false
  20875. // Used for measuring wheel scrolling granularity
  20876. d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null
  20877. // True when shift is held down.
  20878. d.shift = false
  20879. // Used to track whether anything happened since the context menu
  20880. // was opened.
  20881. d.selForContextMenu = null
  20882. d.activeTouch = null
  20883. input.init(d)
  20884. }
  20885. // Find the line object corresponding to the given line number.
  20886. function getLine(doc, n) {
  20887. n -= doc.first
  20888. if (n < 0 || n >= doc.size) { throw new Error("There is no line " + (n + doc.first) + " in the document.") }
  20889. var chunk = doc
  20890. while (!chunk.lines) {
  20891. for (var i = 0;; ++i) {
  20892. var child = chunk.children[i], sz = child.chunkSize()
  20893. if (n < sz) { chunk = child; break }
  20894. n -= sz
  20895. }
  20896. }
  20897. return chunk.lines[n]
  20898. }
  20899. // Get the part of a document between two positions, as an array of
  20900. // strings.
  20901. function getBetween(doc, start, end) {
  20902. var out = [], n = start.line
  20903. doc.iter(start.line, end.line + 1, function (line) {
  20904. var text = line.text
  20905. if (n == end.line) { text = text.slice(0, end.ch) }
  20906. if (n == start.line) { text = text.slice(start.ch) }
  20907. out.push(text)
  20908. ++n
  20909. })
  20910. return out
  20911. }
  20912. // Get the lines between from and to, as array of strings.
  20913. function getLines(doc, from, to) {
  20914. var out = []
  20915. doc.iter(from, to, function (line) { out.push(line.text) }) // iter aborts when callback returns truthy value
  20916. return out
  20917. }
  20918. // Update the height of a line, propagating the height change
  20919. // upwards to parent nodes.
  20920. function updateLineHeight(line, height) {
  20921. var diff = height - line.height
  20922. if (diff) { for (var n = line; n; n = n.parent) { n.height += diff } }
  20923. }
  20924. // Given a line object, find its line number by walking up through
  20925. // its parent links.
  20926. function lineNo(line) {
  20927. if (line.parent == null) { return null }
  20928. var cur = line.parent, no = indexOf(cur.lines, line)
  20929. for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {
  20930. for (var i = 0;; ++i) {
  20931. if (chunk.children[i] == cur) { break }
  20932. no += chunk.children[i].chunkSize()
  20933. }
  20934. }
  20935. return no + cur.first
  20936. }
  20937. // Find the line at the given vertical position, using the height
  20938. // information in the document tree.
  20939. function lineAtHeight(chunk, h) {
  20940. var n = chunk.first
  20941. outer: do {
  20942. for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {
  20943. var child = chunk.children[i$1], ch = child.height
  20944. if (h < ch) { chunk = child; continue outer }
  20945. h -= ch
  20946. n += child.chunkSize()
  20947. }
  20948. return n
  20949. } while (!chunk.lines)
  20950. var i = 0
  20951. for (; i < chunk.lines.length; ++i) {
  20952. var line = chunk.lines[i], lh = line.height
  20953. if (h < lh) { break }
  20954. h -= lh
  20955. }
  20956. return n + i
  20957. }
  20958. function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}
  20959. function lineNumberFor(options, i) {
  20960. return String(options.lineNumberFormatter(i + options.firstLineNumber))
  20961. }
  20962. // A Pos instance represents a position within the text.
  20963. function Pos (line, ch) {
  20964. if (!(this instanceof Pos)) { return new Pos(line, ch) }
  20965. this.line = line; this.ch = ch
  20966. }
  20967. // Compare two positions, return 0 if they are the same, a negative
  20968. // number when a is less, and a positive number otherwise.
  20969. function cmp(a, b) { return a.line - b.line || a.ch - b.ch }
  20970. function copyPos(x) {return Pos(x.line, x.ch)}
  20971. function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }
  20972. function minPos(a, b) { return cmp(a, b) < 0 ? a : b }
  20973. // Most of the external API clips given positions to make sure they
  20974. // actually exist within the document.
  20975. function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}
  20976. function clipPos(doc, pos) {
  20977. if (pos.line < doc.first) { return Pos(doc.first, 0) }
  20978. var last = doc.first + doc.size - 1
  20979. if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }
  20980. return clipToLen(pos, getLine(doc, pos.line).text.length)
  20981. }
  20982. function clipToLen(pos, linelen) {
  20983. var ch = pos.ch
  20984. if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }
  20985. else if (ch < 0) { return Pos(pos.line, 0) }
  20986. else { return pos }
  20987. }
  20988. function clipPosArray(doc, array) {
  20989. var out = []
  20990. for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]) }
  20991. return out
  20992. }
  20993. // Optimize some code when these features are not used.
  20994. var sawReadOnlySpans = false;
  20995. var sawCollapsedSpans = false;
  20996. function seeReadOnlySpans() {
  20997. sawReadOnlySpans = true
  20998. }
  20999. function seeCollapsedSpans() {
  21000. sawCollapsedSpans = true
  21001. }
  21002. // TEXTMARKER SPANS
  21003. function MarkedSpan(marker, from, to) {
  21004. this.marker = marker
  21005. this.from = from; this.to = to
  21006. }
  21007. // Search an array of spans for a span matching the given marker.
  21008. function getMarkedSpanFor(spans, marker) {
  21009. if (spans) { for (var i = 0; i < spans.length; ++i) {
  21010. var span = spans[i]
  21011. if (span.marker == marker) { return span }
  21012. } }
  21013. }
  21014. // Remove a span from an array, returning undefined if no spans are
  21015. // left (we don't store arrays for lines without spans).
  21016. function removeMarkedSpan(spans, span) {
  21017. var r
  21018. for (var i = 0; i < spans.length; ++i)
  21019. { if (spans[i] != span) { (r || (r = [])).push(spans[i]) } }
  21020. return r
  21021. }
  21022. // Add a span to a line.
  21023. function addMarkedSpan(line, span) {
  21024. line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]
  21025. span.marker.attachLine(line)
  21026. }
  21027. // Used for the algorithm that adjusts markers for a change in the
  21028. // document. These functions cut an array of spans at a given
  21029. // character position, returning an array of remaining chunks (or
  21030. // undefined if nothing remains).
  21031. function markedSpansBefore(old, startCh, isInsert) {
  21032. var nw
  21033. if (old) { for (var i = 0; i < old.length; ++i) {
  21034. var span = old[i], marker = span.marker
  21035. var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh)
  21036. if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) {
  21037. var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)
  21038. ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to))
  21039. }
  21040. } }
  21041. return nw
  21042. }
  21043. function markedSpansAfter(old, endCh, isInsert) {
  21044. var nw
  21045. if (old) { for (var i = 0; i < old.length; ++i) {
  21046. var span = old[i], marker = span.marker
  21047. var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh)
  21048. if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) {
  21049. var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)
  21050. ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,
  21051. span.to == null ? null : span.to - endCh))
  21052. }
  21053. } }
  21054. return nw
  21055. }
  21056. // Given a change object, compute the new set of marker spans that
  21057. // cover the line in which the change took place. Removes spans
  21058. // entirely within the change, reconnects spans belonging to the
  21059. // same marker that appear on both sides of the change, and cuts off
  21060. // spans partially within the change. Returns an array of span
  21061. // arrays with one element for each line in (after) the change.
  21062. function stretchSpansOverChange(doc, change) {
  21063. if (change.full) { return null }
  21064. var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans
  21065. var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans
  21066. if (!oldFirst && !oldLast) { return null }
  21067. var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0
  21068. // Get the spans that 'stick out' on both sides
  21069. var first = markedSpansBefore(oldFirst, startCh, isInsert)
  21070. var last = markedSpansAfter(oldLast, endCh, isInsert)
  21071. // Next, merge those two ends
  21072. var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0)
  21073. if (first) {
  21074. // Fix up .to properties of first
  21075. for (var i = 0; i < first.length; ++i) {
  21076. var span = first[i]
  21077. if (span.to == null) {
  21078. var found = getMarkedSpanFor(last, span.marker)
  21079. if (!found) { span.to = startCh }
  21080. else if (sameLine) { span.to = found.to == null ? null : found.to + offset }
  21081. }
  21082. }
  21083. }
  21084. if (last) {
  21085. // Fix up .from in last (or move them into first in case of sameLine)
  21086. for (var i$1 = 0; i$1 < last.length; ++i$1) {
  21087. var span$1 = last[i$1]
  21088. if (span$1.to != null) { span$1.to += offset }
  21089. if (span$1.from == null) {
  21090. var found$1 = getMarkedSpanFor(first, span$1.marker)
  21091. if (!found$1) {
  21092. span$1.from = offset
  21093. if (sameLine) { (first || (first = [])).push(span$1) }
  21094. }
  21095. } else {
  21096. span$1.from += offset
  21097. if (sameLine) { (first || (first = [])).push(span$1) }
  21098. }
  21099. }
  21100. }
  21101. // Make sure we didn't create any zero-length spans
  21102. if (first) { first = clearEmptySpans(first) }
  21103. if (last && last != first) { last = clearEmptySpans(last) }
  21104. var newMarkers = [first]
  21105. if (!sameLine) {
  21106. // Fill gap with whole-line-spans
  21107. var gap = change.text.length - 2, gapMarkers
  21108. if (gap > 0 && first)
  21109. { for (var i$2 = 0; i$2 < first.length; ++i$2)
  21110. { if (first[i$2].to == null)
  21111. { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)) } } }
  21112. for (var i$3 = 0; i$3 < gap; ++i$3)
  21113. { newMarkers.push(gapMarkers) }
  21114. newMarkers.push(last)
  21115. }
  21116. return newMarkers
  21117. }
  21118. // Remove spans that are empty and don't have a clearWhenEmpty
  21119. // option of false.
  21120. function clearEmptySpans(spans) {
  21121. for (var i = 0; i < spans.length; ++i) {
  21122. var span = spans[i]
  21123. if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)
  21124. { spans.splice(i--, 1) }
  21125. }
  21126. if (!spans.length) { return null }
  21127. return spans
  21128. }
  21129. // Used to 'clip' out readOnly ranges when making a change.
  21130. function removeReadOnlyRanges(doc, from, to) {
  21131. var markers = null
  21132. doc.iter(from.line, to.line + 1, function (line) {
  21133. if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {
  21134. var mark = line.markedSpans[i].marker
  21135. if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))
  21136. { (markers || (markers = [])).push(mark) }
  21137. } }
  21138. })
  21139. if (!markers) { return null }
  21140. var parts = [{from: from, to: to}]
  21141. for (var i = 0; i < markers.length; ++i) {
  21142. var mk = markers[i], m = mk.find(0)
  21143. for (var j = 0; j < parts.length; ++j) {
  21144. var p = parts[j]
  21145. if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }
  21146. var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to)
  21147. if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)
  21148. { newParts.push({from: p.from, to: m.from}) }
  21149. if (dto > 0 || !mk.inclusiveRight && !dto)
  21150. { newParts.push({from: m.to, to: p.to}) }
  21151. parts.splice.apply(parts, newParts)
  21152. j += newParts.length - 1
  21153. }
  21154. }
  21155. return parts
  21156. }
  21157. // Connect or disconnect spans from a line.
  21158. function detachMarkedSpans(line) {
  21159. var spans = line.markedSpans
  21160. if (!spans) { return }
  21161. for (var i = 0; i < spans.length; ++i)
  21162. { spans[i].marker.detachLine(line) }
  21163. line.markedSpans = null
  21164. }
  21165. function attachMarkedSpans(line, spans) {
  21166. if (!spans) { return }
  21167. for (var i = 0; i < spans.length; ++i)
  21168. { spans[i].marker.attachLine(line) }
  21169. line.markedSpans = spans
  21170. }
  21171. // Helpers used when computing which overlapping collapsed span
  21172. // counts as the larger one.
  21173. function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }
  21174. function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }
  21175. // Returns a number indicating which of two overlapping collapsed
  21176. // spans is larger (and thus includes the other). Falls back to
  21177. // comparing ids when the spans cover exactly the same range.
  21178. function compareCollapsedMarkers(a, b) {
  21179. var lenDiff = a.lines.length - b.lines.length
  21180. if (lenDiff != 0) { return lenDiff }
  21181. var aPos = a.find(), bPos = b.find()
  21182. var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b)
  21183. if (fromCmp) { return -fromCmp }
  21184. var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b)
  21185. if (toCmp) { return toCmp }
  21186. return b.id - a.id
  21187. }
  21188. // Find out whether a line ends or starts in a collapsed span. If
  21189. // so, return the marker for that span.
  21190. function collapsedSpanAtSide(line, start) {
  21191. var sps = sawCollapsedSpans && line.markedSpans, found
  21192. if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {
  21193. sp = sps[i]
  21194. if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&
  21195. (!found || compareCollapsedMarkers(found, sp.marker) < 0))
  21196. { found = sp.marker }
  21197. } }
  21198. return found
  21199. }
  21200. function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }
  21201. function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }
  21202. // Test whether there exists a collapsed span that partially
  21203. // overlaps (covers the start or end, but not both) of a new span.
  21204. // Such overlap is not allowed.
  21205. function conflictingCollapsedRange(doc, lineNo, from, to, marker) {
  21206. var line = getLine(doc, lineNo)
  21207. var sps = sawCollapsedSpans && line.markedSpans
  21208. if (sps) { for (var i = 0; i < sps.length; ++i) {
  21209. var sp = sps[i]
  21210. if (!sp.marker.collapsed) { continue }
  21211. var found = sp.marker.find(0)
  21212. var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker)
  21213. var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker)
  21214. if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }
  21215. if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||
  21216. fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))
  21217. { return true }
  21218. } }
  21219. }
  21220. // A visual line is a line as drawn on the screen. Folding, for
  21221. // example, can cause multiple logical lines to appear on the same
  21222. // visual line. This finds the start of the visual line that the
  21223. // given line is part of (usually that is the line itself).
  21224. function visualLine(line) {
  21225. var merged
  21226. while (merged = collapsedSpanAtStart(line))
  21227. { line = merged.find(-1, true).line }
  21228. return line
  21229. }
  21230. // Returns an array of logical lines that continue the visual line
  21231. // started by the argument, or undefined if there are no such lines.
  21232. function visualLineContinued(line) {
  21233. var merged, lines
  21234. while (merged = collapsedSpanAtEnd(line)) {
  21235. line = merged.find(1, true).line
  21236. ;(lines || (lines = [])).push(line)
  21237. }
  21238. return lines
  21239. }
  21240. // Get the line number of the start of the visual line that the
  21241. // given line number is part of.
  21242. function visualLineNo(doc, lineN) {
  21243. var line = getLine(doc, lineN), vis = visualLine(line)
  21244. if (line == vis) { return lineN }
  21245. return lineNo(vis)
  21246. }
  21247. // Get the line number of the start of the next visual line after
  21248. // the given line.
  21249. function visualLineEndNo(doc, lineN) {
  21250. if (lineN > doc.lastLine()) { return lineN }
  21251. var line = getLine(doc, lineN), merged
  21252. if (!lineIsHidden(doc, line)) { return lineN }
  21253. while (merged = collapsedSpanAtEnd(line))
  21254. { line = merged.find(1, true).line }
  21255. return lineNo(line) + 1
  21256. }
  21257. // Compute whether a line is hidden. Lines count as hidden when they
  21258. // are part of a visual line that starts with another line, or when
  21259. // they are entirely covered by collapsed, non-widget span.
  21260. function lineIsHidden(doc, line) {
  21261. var sps = sawCollapsedSpans && line.markedSpans
  21262. if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {
  21263. sp = sps[i]
  21264. if (!sp.marker.collapsed) { continue }
  21265. if (sp.from == null) { return true }
  21266. if (sp.marker.widgetNode) { continue }
  21267. if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))
  21268. { return true }
  21269. } }
  21270. }
  21271. function lineIsHiddenInner(doc, line, span) {
  21272. if (span.to == null) {
  21273. var end = span.marker.find(1, true)
  21274. return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))
  21275. }
  21276. if (span.marker.inclusiveRight && span.to == line.text.length)
  21277. { return true }
  21278. for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {
  21279. sp = line.markedSpans[i]
  21280. if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&
  21281. (sp.to == null || sp.to != span.from) &&
  21282. (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&
  21283. lineIsHiddenInner(doc, line, sp)) { return true }
  21284. }
  21285. }
  21286. // Find the height above the given line.
  21287. function heightAtLine(lineObj) {
  21288. lineObj = visualLine(lineObj)
  21289. var h = 0, chunk = lineObj.parent
  21290. for (var i = 0; i < chunk.lines.length; ++i) {
  21291. var line = chunk.lines[i]
  21292. if (line == lineObj) { break }
  21293. else { h += line.height }
  21294. }
  21295. for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {
  21296. for (var i$1 = 0; i$1 < p.children.length; ++i$1) {
  21297. var cur = p.children[i$1]
  21298. if (cur == chunk) { break }
  21299. else { h += cur.height }
  21300. }
  21301. }
  21302. return h
  21303. }
  21304. // Compute the character length of a line, taking into account
  21305. // collapsed ranges (see markText) that might hide parts, and join
  21306. // other lines onto it.
  21307. function lineLength(line) {
  21308. if (line.height == 0) { return 0 }
  21309. var len = line.text.length, merged, cur = line
  21310. while (merged = collapsedSpanAtStart(cur)) {
  21311. var found = merged.find(0, true)
  21312. cur = found.from.line
  21313. len += found.from.ch - found.to.ch
  21314. }
  21315. cur = line
  21316. while (merged = collapsedSpanAtEnd(cur)) {
  21317. var found$1 = merged.find(0, true)
  21318. len -= cur.text.length - found$1.from.ch
  21319. cur = found$1.to.line
  21320. len += cur.text.length - found$1.to.ch
  21321. }
  21322. return len
  21323. }
  21324. // Find the longest line in the document.
  21325. function findMaxLine(cm) {
  21326. var d = cm.display, doc = cm.doc
  21327. d.maxLine = getLine(doc, doc.first)
  21328. d.maxLineLength = lineLength(d.maxLine)
  21329. d.maxLineChanged = true
  21330. doc.iter(function (line) {
  21331. var len = lineLength(line)
  21332. if (len > d.maxLineLength) {
  21333. d.maxLineLength = len
  21334. d.maxLine = line
  21335. }
  21336. })
  21337. }
  21338. // BIDI HELPERS
  21339. function iterateBidiSections(order, from, to, f) {
  21340. if (!order) { return f(from, to, "ltr") }
  21341. var found = false
  21342. for (var i = 0; i < order.length; ++i) {
  21343. var part = order[i]
  21344. if (part.from < to && part.to > from || from == to && part.to == from) {
  21345. f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr")
  21346. found = true
  21347. }
  21348. }
  21349. if (!found) { f(from, to, "ltr") }
  21350. }
  21351. function bidiLeft(part) { return part.level % 2 ? part.to : part.from }
  21352. function bidiRight(part) { return part.level % 2 ? part.from : part.to }
  21353. function lineLeft(line) { var order = getOrder(line); return order ? bidiLeft(order[0]) : 0 }
  21354. function lineRight(line) {
  21355. var order = getOrder(line)
  21356. if (!order) { return line.text.length }
  21357. return bidiRight(lst(order))
  21358. }
  21359. function compareBidiLevel(order, a, b) {
  21360. var linedir = order[0].level
  21361. if (a == linedir) { return true }
  21362. if (b == linedir) { return false }
  21363. return a < b
  21364. }
  21365. var bidiOther = null
  21366. function getBidiPartAt(order, pos) {
  21367. var found
  21368. bidiOther = null
  21369. for (var i = 0; i < order.length; ++i) {
  21370. var cur = order[i]
  21371. if (cur.from < pos && cur.to > pos) { return i }
  21372. if ((cur.from == pos || cur.to == pos)) {
  21373. if (found == null) {
  21374. found = i
  21375. } else if (compareBidiLevel(order, cur.level, order[found].level)) {
  21376. if (cur.from != cur.to) { bidiOther = found }
  21377. return i
  21378. } else {
  21379. if (cur.from != cur.to) { bidiOther = i }
  21380. return found
  21381. }
  21382. }
  21383. }
  21384. return found
  21385. }
  21386. function moveInLine(line, pos, dir, byUnit) {
  21387. if (!byUnit) { return pos + dir }
  21388. do { pos += dir }
  21389. while (pos > 0 && isExtendingChar(line.text.charAt(pos)))
  21390. return pos
  21391. }
  21392. // This is needed in order to move 'visually' through bi-directional
  21393. // text -- i.e., pressing left should make the cursor go left, even
  21394. // when in RTL text. The tricky part is the 'jumps', where RTL and
  21395. // LTR text touch each other. This often requires the cursor offset
  21396. // to move more than one unit, in order to visually move one unit.
  21397. function moveVisually(line, start, dir, byUnit) {
  21398. var bidi = getOrder(line)
  21399. if (!bidi) { return moveLogically(line, start, dir, byUnit) }
  21400. var pos = getBidiPartAt(bidi, start), part = bidi[pos]
  21401. var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit)
  21402. for (;;) {
  21403. if (target > part.from && target < part.to) { return target }
  21404. if (target == part.from || target == part.to) {
  21405. if (getBidiPartAt(bidi, target) == pos) { return target }
  21406. part = bidi[pos += dir]
  21407. return (dir > 0) == part.level % 2 ? part.to : part.from
  21408. } else {
  21409. part = bidi[pos += dir]
  21410. if (!part) { return null }
  21411. if ((dir > 0) == part.level % 2)
  21412. { target = moveInLine(line, part.to, -1, byUnit) }
  21413. else
  21414. { target = moveInLine(line, part.from, 1, byUnit) }
  21415. }
  21416. }
  21417. }
  21418. function moveLogically(line, start, dir, byUnit) {
  21419. var target = start + dir
  21420. if (byUnit) { while (target > 0 && isExtendingChar(line.text.charAt(target))) { target += dir } }
  21421. return target < 0 || target > line.text.length ? null : target
  21422. }
  21423. // Bidirectional ordering algorithm
  21424. // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm
  21425. // that this (partially) implements.
  21426. // One-char codes used for character types:
  21427. // L (L): Left-to-Right
  21428. // R (R): Right-to-Left
  21429. // r (AL): Right-to-Left Arabic
  21430. // 1 (EN): European Number
  21431. // + (ES): European Number Separator
  21432. // % (ET): European Number Terminator
  21433. // n (AN): Arabic Number
  21434. // , (CS): Common Number Separator
  21435. // m (NSM): Non-Spacing Mark
  21436. // b (BN): Boundary Neutral
  21437. // s (B): Paragraph Separator
  21438. // t (S): Segment Separator
  21439. // w (WS): Whitespace
  21440. // N (ON): Other Neutrals
  21441. // Returns null if characters are ordered as they appear
  21442. // (left-to-right), or an array of sections ({from, to, level}
  21443. // objects) in the order in which they occur visually.
  21444. var bidiOrdering = (function() {
  21445. // Character types for codepoints 0 to 0xff
  21446. var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"
  21447. // Character types for codepoints 0x600 to 0x6f9
  21448. var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111"
  21449. function charType(code) {
  21450. if (code <= 0xf7) { return lowTypes.charAt(code) }
  21451. else if (0x590 <= code && code <= 0x5f4) { return "R" }
  21452. else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }
  21453. else if (0x6ee <= code && code <= 0x8ac) { return "r" }
  21454. else if (0x2000 <= code && code <= 0x200b) { return "w" }
  21455. else if (code == 0x200c) { return "b" }
  21456. else { return "L" }
  21457. }
  21458. var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/
  21459. var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/
  21460. // Browsers seem to always treat the boundaries of block elements as being L.
  21461. var outerType = "L"
  21462. function BidiSpan(level, from, to) {
  21463. this.level = level
  21464. this.from = from; this.to = to
  21465. }
  21466. return function(str) {
  21467. if (!bidiRE.test(str)) { return false }
  21468. var len = str.length, types = []
  21469. for (var i = 0; i < len; ++i)
  21470. { types.push(charType(str.charCodeAt(i))) }
  21471. // W1. Examine each non-spacing mark (NSM) in the level run, and
  21472. // change the type of the NSM to the type of the previous
  21473. // character. If the NSM is at the start of the level run, it will
  21474. // get the type of sor.
  21475. for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {
  21476. var type = types[i$1]
  21477. if (type == "m") { types[i$1] = prev }
  21478. else { prev = type }
  21479. }
  21480. // W2. Search backwards from each instance of a European number
  21481. // until the first strong type (R, L, AL, or sor) is found. If an
  21482. // AL is found, change the type of the European number to Arabic
  21483. // number.
  21484. // W3. Change all ALs to R.
  21485. for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {
  21486. var type$1 = types[i$2]
  21487. if (type$1 == "1" && cur == "r") { types[i$2] = "n" }
  21488. else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == "r") { types[i$2] = "R" } }
  21489. }
  21490. // W4. A single European separator between two European numbers
  21491. // changes to a European number. A single common separator between
  21492. // two numbers of the same type changes to that type.
  21493. for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {
  21494. var type$2 = types[i$3]
  21495. if (type$2 == "+" && prev$1 == "1" && types[i$3+1] == "1") { types[i$3] = "1" }
  21496. else if (type$2 == "," && prev$1 == types[i$3+1] &&
  21497. (prev$1 == "1" || prev$1 == "n")) { types[i$3] = prev$1 }
  21498. prev$1 = type$2
  21499. }
  21500. // W5. A sequence of European terminators adjacent to European
  21501. // numbers changes to all European numbers.
  21502. // W6. Otherwise, separators and terminators change to Other
  21503. // Neutral.
  21504. for (var i$4 = 0; i$4 < len; ++i$4) {
  21505. var type$3 = types[i$4]
  21506. if (type$3 == ",") { types[i$4] = "N" }
  21507. else if (type$3 == "%") {
  21508. var end = (void 0)
  21509. for (end = i$4 + 1; end < len && types[end] == "%"; ++end) {}
  21510. var replace = (i$4 && types[i$4-1] == "!") || (end < len && types[end] == "1") ? "1" : "N"
  21511. for (var j = i$4; j < end; ++j) { types[j] = replace }
  21512. i$4 = end - 1
  21513. }
  21514. }
  21515. // W7. Search backwards from each instance of a European number
  21516. // until the first strong type (R, L, or sor) is found. If an L is
  21517. // found, then change the type of the European number to L.
  21518. for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {
  21519. var type$4 = types[i$5]
  21520. if (cur$1 == "L" && type$4 == "1") { types[i$5] = "L" }
  21521. else if (isStrong.test(type$4)) { cur$1 = type$4 }
  21522. }
  21523. // N1. A sequence of neutrals takes the direction of the
  21524. // surrounding strong text if the text on both sides has the same
  21525. // direction. European and Arabic numbers act as if they were R in
  21526. // terms of their influence on neutrals. Start-of-level-run (sor)
  21527. // and end-of-level-run (eor) are used at level run boundaries.
  21528. // N2. Any remaining neutrals take the embedding direction.
  21529. for (var i$6 = 0; i$6 < len; ++i$6) {
  21530. if (isNeutral.test(types[i$6])) {
  21531. var end$1 = (void 0)
  21532. for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}
  21533. var before = (i$6 ? types[i$6-1] : outerType) == "L"
  21534. var after = (end$1 < len ? types[end$1] : outerType) == "L"
  21535. var replace$1 = before || after ? "L" : "R"
  21536. for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1 }
  21537. i$6 = end$1 - 1
  21538. }
  21539. }
  21540. // Here we depart from the documented algorithm, in order to avoid
  21541. // building up an actual levels array. Since there are only three
  21542. // levels (0, 1, 2) in an implementation that doesn't take
  21543. // explicit embedding into account, we can build up the order on
  21544. // the fly, without following the level-based algorithm.
  21545. var order = [], m
  21546. for (var i$7 = 0; i$7 < len;) {
  21547. if (countsAsLeft.test(types[i$7])) {
  21548. var start = i$7
  21549. for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}
  21550. order.push(new BidiSpan(0, start, i$7))
  21551. } else {
  21552. var pos = i$7, at = order.length
  21553. for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {}
  21554. for (var j$2 = pos; j$2 < i$7;) {
  21555. if (countsAsNum.test(types[j$2])) {
  21556. if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)) }
  21557. var nstart = j$2
  21558. for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}
  21559. order.splice(at, 0, new BidiSpan(2, nstart, j$2))
  21560. pos = j$2
  21561. } else { ++j$2 }
  21562. }
  21563. if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)) }
  21564. }
  21565. }
  21566. if (order[0].level == 1 && (m = str.match(/^\s+/))) {
  21567. order[0].from = m[0].length
  21568. order.unshift(new BidiSpan(0, 0, m[0].length))
  21569. }
  21570. if (lst(order).level == 1 && (m = str.match(/\s+$/))) {
  21571. lst(order).to -= m[0].length
  21572. order.push(new BidiSpan(0, len - m[0].length, len))
  21573. }
  21574. if (order[0].level == 2)
  21575. { order.unshift(new BidiSpan(1, order[0].to, order[0].to)) }
  21576. if (order[0].level != lst(order).level)
  21577. { order.push(new BidiSpan(order[0].level, len, len)) }
  21578. return order
  21579. }
  21580. })()
  21581. // Get the bidi ordering for the given line (and cache it). Returns
  21582. // false for lines that are fully left-to-right, and an array of
  21583. // BidiSpan objects otherwise.
  21584. function getOrder(line) {
  21585. var order = line.order
  21586. if (order == null) { order = line.order = bidiOrdering(line.text) }
  21587. return order
  21588. }
  21589. // EVENT HANDLING
  21590. // Lightweight event framework. on/off also work on DOM nodes,
  21591. // registering native DOM handlers.
  21592. var noHandlers = []
  21593. var on = function(emitter, type, f) {
  21594. if (emitter.addEventListener) {
  21595. emitter.addEventListener(type, f, false)
  21596. } else if (emitter.attachEvent) {
  21597. emitter.attachEvent("on" + type, f)
  21598. } else {
  21599. var map = emitter._handlers || (emitter._handlers = {})
  21600. map[type] = (map[type] || noHandlers).concat(f)
  21601. }
  21602. }
  21603. function getHandlers(emitter, type) {
  21604. return emitter._handlers && emitter._handlers[type] || noHandlers
  21605. }
  21606. function off(emitter, type, f) {
  21607. if (emitter.removeEventListener) {
  21608. emitter.removeEventListener(type, f, false)
  21609. } else if (emitter.detachEvent) {
  21610. emitter.detachEvent("on" + type, f)
  21611. } else {
  21612. var map = emitter._handlers, arr = map && map[type]
  21613. if (arr) {
  21614. var index = indexOf(arr, f)
  21615. if (index > -1)
  21616. { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)) }
  21617. }
  21618. }
  21619. }
  21620. function signal(emitter, type /*, values...*/) {
  21621. var handlers = getHandlers(emitter, type)
  21622. if (!handlers.length) { return }
  21623. var args = Array.prototype.slice.call(arguments, 2)
  21624. for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args) }
  21625. }
  21626. // The DOM events that CodeMirror handles can be overridden by
  21627. // registering a (non-DOM) handler on the editor for the event name,
  21628. // and preventDefault-ing the event in that handler.
  21629. function signalDOMEvent(cm, e, override) {
  21630. if (typeof e == "string")
  21631. { e = {type: e, preventDefault: function() { this.defaultPrevented = true }} }
  21632. signal(cm, override || e.type, cm, e)
  21633. return e_defaultPrevented(e) || e.codemirrorIgnore
  21634. }
  21635. function signalCursorActivity(cm) {
  21636. var arr = cm._handlers && cm._handlers.cursorActivity
  21637. if (!arr) { return }
  21638. var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = [])
  21639. for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)
  21640. { set.push(arr[i]) } }
  21641. }
  21642. function hasHandler(emitter, type) {
  21643. return getHandlers(emitter, type).length > 0
  21644. }
  21645. // Add on and off methods to a constructor's prototype, to make
  21646. // registering events on such objects more convenient.
  21647. function eventMixin(ctor) {
  21648. ctor.prototype.on = function(type, f) {on(this, type, f)}
  21649. ctor.prototype.off = function(type, f) {off(this, type, f)}
  21650. }
  21651. // Due to the fact that we still support jurassic IE versions, some
  21652. // compatibility wrappers are needed.
  21653. function e_preventDefault(e) {
  21654. if (e.preventDefault) { e.preventDefault() }
  21655. else { e.returnValue = false }
  21656. }
  21657. function e_stopPropagation(e) {
  21658. if (e.stopPropagation) { e.stopPropagation() }
  21659. else { e.cancelBubble = true }
  21660. }
  21661. function e_defaultPrevented(e) {
  21662. return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false
  21663. }
  21664. function e_stop(e) {e_preventDefault(e); e_stopPropagation(e)}
  21665. function e_target(e) {return e.target || e.srcElement}
  21666. function e_button(e) {
  21667. var b = e.which
  21668. if (b == null) {
  21669. if (e.button & 1) { b = 1 }
  21670. else if (e.button & 2) { b = 3 }
  21671. else if (e.button & 4) { b = 2 }
  21672. }
  21673. if (mac && e.ctrlKey && b == 1) { b = 3 }
  21674. return b
  21675. }
  21676. // Detect drag-and-drop
  21677. var dragAndDrop = function() {
  21678. // There is *some* kind of drag-and-drop support in IE6-8, but I
  21679. // couldn't get it to work yet.
  21680. if (ie && ie_version < 9) { return false }
  21681. var div = elt('div')
  21682. return "draggable" in div || "dragDrop" in div
  21683. }()
  21684. var zwspSupported
  21685. function zeroWidthElement(measure) {
  21686. if (zwspSupported == null) {
  21687. var test = elt("span", "\u200b")
  21688. removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")]))
  21689. if (measure.firstChild.offsetHeight != 0)
  21690. { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8) }
  21691. }
  21692. var node = zwspSupported ? elt("span", "\u200b") :
  21693. elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px")
  21694. node.setAttribute("cm-text", "")
  21695. return node
  21696. }
  21697. // Feature-detect IE's crummy client rect reporting for bidi text
  21698. var badBidiRects
  21699. function hasBadBidiRects(measure) {
  21700. if (badBidiRects != null) { return badBidiRects }
  21701. var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA"))
  21702. var r0 = range(txt, 0, 1).getBoundingClientRect()
  21703. var r1 = range(txt, 1, 2).getBoundingClientRect()
  21704. removeChildren(measure)
  21705. if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)
  21706. return badBidiRects = (r1.right - r0.right < 3)
  21707. }
  21708. // See if "".split is the broken IE version, if so, provide an
  21709. // alternative way to split lines.
  21710. var splitLinesAuto = "\n\nb".split(/\n/).length != 3 ? function (string) {
  21711. var pos = 0, result = [], l = string.length
  21712. while (pos <= l) {
  21713. var nl = string.indexOf("\n", pos)
  21714. if (nl == -1) { nl = string.length }
  21715. var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl)
  21716. var rt = line.indexOf("\r")
  21717. if (rt != -1) {
  21718. result.push(line.slice(0, rt))
  21719. pos += rt + 1
  21720. } else {
  21721. result.push(line)
  21722. pos = nl + 1
  21723. }
  21724. }
  21725. return result
  21726. } : function (string) { return string.split(/\r\n?|\n/); }
  21727. var hasSelection = window.getSelection ? function (te) {
  21728. try { return te.selectionStart != te.selectionEnd }
  21729. catch(e) { return false }
  21730. } : function (te) {
  21731. var range
  21732. try {range = te.ownerDocument.selection.createRange()}
  21733. catch(e) {}
  21734. if (!range || range.parentElement() != te) { return false }
  21735. return range.compareEndPoints("StartToEnd", range) != 0
  21736. }
  21737. var hasCopyEvent = (function () {
  21738. var e = elt("div")
  21739. if ("oncopy" in e) { return true }
  21740. e.setAttribute("oncopy", "return;")
  21741. return typeof e.oncopy == "function"
  21742. })()
  21743. var badZoomedRects = null
  21744. function hasBadZoomedRects(measure) {
  21745. if (badZoomedRects != null) { return badZoomedRects }
  21746. var node = removeChildrenAndAdd(measure, elt("span", "x"))
  21747. var normal = node.getBoundingClientRect()
  21748. var fromRange = range(node, 0, 1).getBoundingClientRect()
  21749. return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1
  21750. }
  21751. var modes = {};
  21752. var mimeModes = {};
  21753. // Extra arguments are stored as the mode's dependencies, which is
  21754. // used by (legacy) mechanisms like loadmode.js to automatically
  21755. // load a mode. (Preferred mechanism is the require/define calls.)
  21756. function defineMode(name, mode) {
  21757. if (arguments.length > 2)
  21758. { mode.dependencies = Array.prototype.slice.call(arguments, 2) }
  21759. modes[name] = mode
  21760. }
  21761. function defineMIME(mime, spec) {
  21762. mimeModes[mime] = spec
  21763. }
  21764. // Given a MIME type, a {name, ...options} config object, or a name
  21765. // string, return a mode config object.
  21766. function resolveMode(spec) {
  21767. if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) {
  21768. spec = mimeModes[spec]
  21769. } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) {
  21770. var found = mimeModes[spec.name]
  21771. if (typeof found == "string") { found = {name: found} }
  21772. spec = createObj(found, spec)
  21773. spec.name = found.name
  21774. } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) {
  21775. return resolveMode("application/xml")
  21776. } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) {
  21777. return resolveMode("application/json")
  21778. }
  21779. if (typeof spec == "string") { return {name: spec} }
  21780. else { return spec || {name: "null"} }
  21781. }
  21782. // Given a mode spec (anything that resolveMode accepts), find and
  21783. // initialize an actual mode object.
  21784. function getMode(options, spec) {
  21785. spec = resolveMode(spec)
  21786. var mfactory = modes[spec.name]
  21787. if (!mfactory) { return getMode(options, "text/plain") }
  21788. var modeObj = mfactory(options, spec)
  21789. if (modeExtensions.hasOwnProperty(spec.name)) {
  21790. var exts = modeExtensions[spec.name]
  21791. for (var prop in exts) {
  21792. if (!exts.hasOwnProperty(prop)) { continue }
  21793. if (modeObj.hasOwnProperty(prop)) { modeObj["_" + prop] = modeObj[prop] }
  21794. modeObj[prop] = exts[prop]
  21795. }
  21796. }
  21797. modeObj.name = spec.name
  21798. if (spec.helperType) { modeObj.helperType = spec.helperType }
  21799. if (spec.modeProps) { for (var prop$1 in spec.modeProps)
  21800. { modeObj[prop$1] = spec.modeProps[prop$1] } }
  21801. return modeObj
  21802. }
  21803. // This can be used to attach properties to mode objects from
  21804. // outside the actual mode definition.
  21805. var modeExtensions = {}
  21806. function extendMode(mode, properties) {
  21807. var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {})
  21808. copyObj(properties, exts)
  21809. }
  21810. function copyState(mode, state) {
  21811. if (state === true) { return state }
  21812. if (mode.copyState) { return mode.copyState(state) }
  21813. var nstate = {}
  21814. for (var n in state) {
  21815. var val = state[n]
  21816. if (val instanceof Array) { val = val.concat([]) }
  21817. nstate[n] = val
  21818. }
  21819. return nstate
  21820. }
  21821. // Given a mode and a state (for that mode), find the inner mode and
  21822. // state at the position that the state refers to.
  21823. function innerMode(mode, state) {
  21824. var info
  21825. while (mode.innerMode) {
  21826. info = mode.innerMode(state)
  21827. if (!info || info.mode == mode) { break }
  21828. state = info.state
  21829. mode = info.mode
  21830. }
  21831. return info || {mode: mode, state: state}
  21832. }
  21833. function startState(mode, a1, a2) {
  21834. return mode.startState ? mode.startState(a1, a2) : true
  21835. }
  21836. // STRING STREAM
  21837. // Fed to the mode parsers, provides helper functions to make
  21838. // parsers more succinct.
  21839. var StringStream = function(string, tabSize) {
  21840. this.pos = this.start = 0
  21841. this.string = string
  21842. this.tabSize = tabSize || 8
  21843. this.lastColumnPos = this.lastColumnValue = 0
  21844. this.lineStart = 0
  21845. }
  21846. StringStream.prototype = {
  21847. eol: function() {return this.pos >= this.string.length},
  21848. sol: function() {return this.pos == this.lineStart},
  21849. peek: function() {return this.string.charAt(this.pos) || undefined},
  21850. next: function() {
  21851. if (this.pos < this.string.length)
  21852. { return this.string.charAt(this.pos++) }
  21853. },
  21854. eat: function(match) {
  21855. var ch = this.string.charAt(this.pos)
  21856. var ok
  21857. if (typeof match == "string") { ok = ch == match }
  21858. else { ok = ch && (match.test ? match.test(ch) : match(ch)) }
  21859. if (ok) {++this.pos; return ch}
  21860. },
  21861. eatWhile: function(match) {
  21862. var start = this.pos
  21863. while (this.eat(match)){}
  21864. return this.pos > start
  21865. },
  21866. eatSpace: function() {
  21867. var this$1 = this;
  21868. var start = this.pos
  21869. while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos }
  21870. return this.pos > start
  21871. },
  21872. skipToEnd: function() {this.pos = this.string.length},
  21873. skipTo: function(ch) {
  21874. var found = this.string.indexOf(ch, this.pos)
  21875. if (found > -1) {this.pos = found; return true}
  21876. },
  21877. backUp: function(n) {this.pos -= n},
  21878. column: function() {
  21879. if (this.lastColumnPos < this.start) {
  21880. this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue)
  21881. this.lastColumnPos = this.start
  21882. }
  21883. return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)
  21884. },
  21885. indentation: function() {
  21886. return countColumn(this.string, null, this.tabSize) -
  21887. (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)
  21888. },
  21889. match: function(pattern, consume, caseInsensitive) {
  21890. if (typeof pattern == "string") {
  21891. var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; }
  21892. var substr = this.string.substr(this.pos, pattern.length)
  21893. if (cased(substr) == cased(pattern)) {
  21894. if (consume !== false) { this.pos += pattern.length }
  21895. return true
  21896. }
  21897. } else {
  21898. var match = this.string.slice(this.pos).match(pattern)
  21899. if (match && match.index > 0) { return null }
  21900. if (match && consume !== false) { this.pos += match[0].length }
  21901. return match
  21902. }
  21903. },
  21904. current: function(){return this.string.slice(this.start, this.pos)},
  21905. hideFirstChars: function(n, inner) {
  21906. this.lineStart += n
  21907. try { return inner() }
  21908. finally { this.lineStart -= n }
  21909. }
  21910. }
  21911. // Compute a style array (an array starting with a mode generation
  21912. // -- for invalidation -- followed by pairs of end positions and
  21913. // style strings), which is used to highlight the tokens on the
  21914. // line.
  21915. function highlightLine(cm, line, state, forceToEnd) {
  21916. // A styles array always starts with a number identifying the
  21917. // mode/overlays that it is based on (for easy invalidation).
  21918. var st = [cm.state.modeGen], lineClasses = {}
  21919. // Compute the base array of styles
  21920. runMode(cm, line.text, cm.doc.mode, state, function (end, style) { return st.push(end, style); },
  21921. lineClasses, forceToEnd)
  21922. // Run overlays, adjust style array.
  21923. var loop = function ( o ) {
  21924. var overlay = cm.state.overlays[o], i = 1, at = 0
  21925. runMode(cm, line.text, overlay.mode, true, function (end, style) {
  21926. var start = i
  21927. // Ensure there's a token end at the current position, and that i points at it
  21928. while (at < end) {
  21929. var i_end = st[i]
  21930. if (i_end > end)
  21931. { st.splice(i, 1, end, st[i+1], i_end) }
  21932. i += 2
  21933. at = Math.min(end, i_end)
  21934. }
  21935. if (!style) { return }
  21936. if (overlay.opaque) {
  21937. st.splice(start, i - start, end, "overlay " + style)
  21938. i = start + 2
  21939. } else {
  21940. for (; start < i; start += 2) {
  21941. var cur = st[start+1]
  21942. st[start+1] = (cur ? cur + " " : "") + "overlay " + style
  21943. }
  21944. }
  21945. }, lineClasses)
  21946. };
  21947. for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );
  21948. return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}
  21949. }
  21950. function getLineStyles(cm, line, updateFrontier) {
  21951. if (!line.styles || line.styles[0] != cm.state.modeGen) {
  21952. var state = getStateBefore(cm, lineNo(line))
  21953. var result = highlightLine(cm, line, line.text.length > cm.options.maxHighlightLength ? copyState(cm.doc.mode, state) : state)
  21954. line.stateAfter = state
  21955. line.styles = result.styles
  21956. if (result.classes) { line.styleClasses = result.classes }
  21957. else if (line.styleClasses) { line.styleClasses = null }
  21958. if (updateFrontier === cm.doc.frontier) { cm.doc.frontier++ }
  21959. }
  21960. return line.styles
  21961. }
  21962. function getStateBefore(cm, n, precise) {
  21963. var doc = cm.doc, display = cm.display
  21964. if (!doc.mode.startState) { return true }
  21965. var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter
  21966. if (!state) { state = startState(doc.mode) }
  21967. else { state = copyState(doc.mode, state) }
  21968. doc.iter(pos, n, function (line) {
  21969. processLine(cm, line.text, state)
  21970. var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo
  21971. line.stateAfter = save ? copyState(doc.mode, state) : null
  21972. ++pos
  21973. })
  21974. if (precise) { doc.frontier = pos }
  21975. return state
  21976. }
  21977. // Lightweight form of highlight -- proceed over this line and
  21978. // update state, but don't save a style array. Used for lines that
  21979. // aren't currently visible.
  21980. function processLine(cm, text, state, startAt) {
  21981. var mode = cm.doc.mode
  21982. var stream = new StringStream(text, cm.options.tabSize)
  21983. stream.start = stream.pos = startAt || 0
  21984. if (text == "") { callBlankLine(mode, state) }
  21985. while (!stream.eol()) {
  21986. readToken(mode, stream, state)
  21987. stream.start = stream.pos
  21988. }
  21989. }
  21990. function callBlankLine(mode, state) {
  21991. if (mode.blankLine) { return mode.blankLine(state) }
  21992. if (!mode.innerMode) { return }
  21993. var inner = innerMode(mode, state)
  21994. if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }
  21995. }
  21996. function readToken(mode, stream, state, inner) {
  21997. for (var i = 0; i < 10; i++) {
  21998. if (inner) { inner[0] = innerMode(mode, state).mode }
  21999. var style = mode.token(stream, state)
  22000. if (stream.pos > stream.start) { return style }
  22001. }
  22002. throw new Error("Mode " + mode.name + " failed to advance stream.")
  22003. }
  22004. // Utility for getTokenAt and getLineTokens
  22005. function takeToken(cm, pos, precise, asArray) {
  22006. var getObj = function (copy) { return ({
  22007. start: stream.start, end: stream.pos,
  22008. string: stream.current(),
  22009. type: style || null,
  22010. state: copy ? copyState(doc.mode, state) : state
  22011. }); }
  22012. var doc = cm.doc, mode = doc.mode, style
  22013. pos = clipPos(doc, pos)
  22014. var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise)
  22015. var stream = new StringStream(line.text, cm.options.tabSize), tokens
  22016. if (asArray) { tokens = [] }
  22017. while ((asArray || stream.pos < pos.ch) && !stream.eol()) {
  22018. stream.start = stream.pos
  22019. style = readToken(mode, stream, state)
  22020. if (asArray) { tokens.push(getObj(true)) }
  22021. }
  22022. return asArray ? tokens : getObj()
  22023. }
  22024. function extractLineClasses(type, output) {
  22025. if (type) { for (;;) {
  22026. var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/)
  22027. if (!lineClass) { break }
  22028. type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length)
  22029. var prop = lineClass[1] ? "bgClass" : "textClass"
  22030. if (output[prop] == null)
  22031. { output[prop] = lineClass[2] }
  22032. else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop]))
  22033. { output[prop] += " " + lineClass[2] }
  22034. } }
  22035. return type
  22036. }
  22037. // Run the given mode's parser over a line, calling f for each token.
  22038. function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {
  22039. var flattenSpans = mode.flattenSpans
  22040. if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans }
  22041. var curStart = 0, curStyle = null
  22042. var stream = new StringStream(text, cm.options.tabSize), style
  22043. var inner = cm.options.addModeClass && [null]
  22044. if (text == "") { extractLineClasses(callBlankLine(mode, state), lineClasses) }
  22045. while (!stream.eol()) {
  22046. if (stream.pos > cm.options.maxHighlightLength) {
  22047. flattenSpans = false
  22048. if (forceToEnd) { processLine(cm, text, state, stream.pos) }
  22049. stream.pos = text.length
  22050. style = null
  22051. } else {
  22052. style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses)
  22053. }
  22054. if (inner) {
  22055. var mName = inner[0].name
  22056. if (mName) { style = "m-" + (style ? mName + " " + style : mName) }
  22057. }
  22058. if (!flattenSpans || curStyle != style) {
  22059. while (curStart < stream.start) {
  22060. curStart = Math.min(stream.start, curStart + 5000)
  22061. f(curStart, curStyle)
  22062. }
  22063. curStyle = style
  22064. }
  22065. stream.start = stream.pos
  22066. }
  22067. while (curStart < stream.pos) {
  22068. // Webkit seems to refuse to render text nodes longer than 57444
  22069. // characters, and returns inaccurate measurements in nodes
  22070. // starting around 5000 chars.
  22071. var pos = Math.min(stream.pos, curStart + 5000)
  22072. f(pos, curStyle)
  22073. curStart = pos
  22074. }
  22075. }
  22076. // Finds the line to start with when starting a parse. Tries to
  22077. // find a line with a stateAfter, so that it can start with a
  22078. // valid state. If that fails, it returns the line with the
  22079. // smallest indentation, which tends to need the least context to
  22080. // parse correctly.
  22081. function findStartLine(cm, n, precise) {
  22082. var minindent, minline, doc = cm.doc
  22083. var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100)
  22084. for (var search = n; search > lim; --search) {
  22085. if (search <= doc.first) { return doc.first }
  22086. var line = getLine(doc, search - 1)
  22087. if (line.stateAfter && (!precise || search <= doc.frontier)) { return search }
  22088. var indented = countColumn(line.text, null, cm.options.tabSize)
  22089. if (minline == null || minindent > indented) {
  22090. minline = search - 1
  22091. minindent = indented
  22092. }
  22093. }
  22094. return minline
  22095. }
  22096. // LINE DATA STRUCTURE
  22097. // Line objects. These hold state related to a line, including
  22098. // highlighting info (the styles array).
  22099. function Line(text, markedSpans, estimateHeight) {
  22100. this.text = text
  22101. attachMarkedSpans(this, markedSpans)
  22102. this.height = estimateHeight ? estimateHeight(this) : 1
  22103. }
  22104. eventMixin(Line)
  22105. Line.prototype.lineNo = function() { return lineNo(this) }
  22106. // Change the content (text, markers) of a line. Automatically
  22107. // invalidates cached information and tries to re-estimate the
  22108. // line's height.
  22109. function updateLine(line, text, markedSpans, estimateHeight) {
  22110. line.text = text
  22111. if (line.stateAfter) { line.stateAfter = null }
  22112. if (line.styles) { line.styles = null }
  22113. if (line.order != null) { line.order = null }
  22114. detachMarkedSpans(line)
  22115. attachMarkedSpans(line, markedSpans)
  22116. var estHeight = estimateHeight ? estimateHeight(line) : 1
  22117. if (estHeight != line.height) { updateLineHeight(line, estHeight) }
  22118. }
  22119. // Detach a line from the document tree and its markers.
  22120. function cleanUpLine(line) {
  22121. line.parent = null
  22122. detachMarkedSpans(line)
  22123. }
  22124. // Convert a style as returned by a mode (either null, or a string
  22125. // containing one or more styles) to a CSS style. This is cached,
  22126. // and also looks for line-wide styles.
  22127. var styleToClassCache = {};
  22128. var styleToClassCacheWithMode = {};
  22129. function interpretTokenStyle(style, options) {
  22130. if (!style || /^\s*$/.test(style)) { return null }
  22131. var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache
  22132. return cache[style] ||
  22133. (cache[style] = style.replace(/\S+/g, "cm-$&"))
  22134. }
  22135. // Render the DOM representation of the text of a line. Also builds
  22136. // up a 'line map', which points at the DOM nodes that represent
  22137. // specific stretches of text, and is used by the measuring code.
  22138. // The returned object contains the DOM node, this map, and
  22139. // information about line-wide styles that were set by the mode.
  22140. function buildLineContent(cm, lineView) {
  22141. // The padding-right forces the element to have a 'border', which
  22142. // is needed on Webkit to be able to get line-level bounding
  22143. // rectangles for it (in measureChar).
  22144. var content = elt("span", null, null, webkit ? "padding-right: .1px" : null)
  22145. var builder = {pre: elt("pre", [content], "CodeMirror-line"), content: content,
  22146. col: 0, pos: 0, cm: cm,
  22147. trailingSpace: false,
  22148. splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")}
  22149. // hide from accessibility tree
  22150. content.setAttribute("role", "presentation")
  22151. builder.pre.setAttribute("role", "presentation")
  22152. lineView.measure = {}
  22153. // Iterate over the logical lines that make up this visual line.
  22154. for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {
  22155. var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0)
  22156. builder.pos = 0
  22157. builder.addToken = buildToken
  22158. // Optionally wire in some hacks into the token-rendering
  22159. // algorithm, to deal with browser quirks.
  22160. if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))
  22161. { builder.addToken = buildTokenBadBidi(builder.addToken, order) }
  22162. builder.map = []
  22163. var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)
  22164. insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate))
  22165. if (line.styleClasses) {
  22166. if (line.styleClasses.bgClass)
  22167. { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || "") }
  22168. if (line.styleClasses.textClass)
  22169. { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || "") }
  22170. }
  22171. // Ensure at least a single node is present, for measuring.
  22172. if (builder.map.length == 0)
  22173. { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) }
  22174. // Store the map and a cache object for the current logical line
  22175. if (i == 0) {
  22176. lineView.measure.map = builder.map
  22177. lineView.measure.cache = {}
  22178. } else {
  22179. ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)
  22180. ;(lineView.measure.caches || (lineView.measure.caches = [])).push({})
  22181. }
  22182. }
  22183. // See issue #2901
  22184. if (webkit) {
  22185. var last = builder.content.lastChild
  22186. if (/\bcm-tab\b/.test(last.className) || (last.querySelector && last.querySelector(".cm-tab")))
  22187. { builder.content.className = "cm-tab-wrap-hack" }
  22188. }
  22189. signal(cm, "renderLine", cm, lineView.line, builder.pre)
  22190. if (builder.pre.className)
  22191. { builder.textClass = joinClasses(builder.pre.className, builder.textClass || "") }
  22192. return builder
  22193. }
  22194. function defaultSpecialCharPlaceholder(ch) {
  22195. var token = elt("span", "\u2022", "cm-invalidchar")
  22196. token.title = "\\u" + ch.charCodeAt(0).toString(16)
  22197. token.setAttribute("aria-label", token.title)
  22198. return token
  22199. }
  22200. // Build up the DOM representation for a single token, and add it to
  22201. // the line map. Takes care to render special characters separately.
  22202. function buildToken(builder, text, style, startStyle, endStyle, title, css) {
  22203. if (!text) { return }
  22204. var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text
  22205. var special = builder.cm.state.specialChars, mustWrap = false
  22206. var content
  22207. if (!special.test(text)) {
  22208. builder.col += text.length
  22209. content = document.createTextNode(displayText)
  22210. builder.map.push(builder.pos, builder.pos + text.length, content)
  22211. if (ie && ie_version < 9) { mustWrap = true }
  22212. builder.pos += text.length
  22213. } else {
  22214. content = document.createDocumentFragment()
  22215. var pos = 0
  22216. while (true) {
  22217. special.lastIndex = pos
  22218. var m = special.exec(text)
  22219. var skipped = m ? m.index - pos : text.length - pos
  22220. if (skipped) {
  22221. var txt = document.createTextNode(displayText.slice(pos, pos + skipped))
  22222. if (ie && ie_version < 9) { content.appendChild(elt("span", [txt])) }
  22223. else { content.appendChild(txt) }
  22224. builder.map.push(builder.pos, builder.pos + skipped, txt)
  22225. builder.col += skipped
  22226. builder.pos += skipped
  22227. }
  22228. if (!m) { break }
  22229. pos += skipped + 1
  22230. var txt$1 = (void 0)
  22231. if (m[0] == "\t") {
  22232. var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize
  22233. txt$1 = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab"))
  22234. txt$1.setAttribute("role", "presentation")
  22235. txt$1.setAttribute("cm-text", "\t")
  22236. builder.col += tabWidth
  22237. } else if (m[0] == "\r" || m[0] == "\n") {
  22238. txt$1 = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar"))
  22239. txt$1.setAttribute("cm-text", m[0])
  22240. builder.col += 1
  22241. } else {
  22242. txt$1 = builder.cm.options.specialCharPlaceholder(m[0])
  22243. txt$1.setAttribute("cm-text", m[0])
  22244. if (ie && ie_version < 9) { content.appendChild(elt("span", [txt$1])) }
  22245. else { content.appendChild(txt$1) }
  22246. builder.col += 1
  22247. }
  22248. builder.map.push(builder.pos, builder.pos + 1, txt$1)
  22249. builder.pos++
  22250. }
  22251. }
  22252. builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32
  22253. if (style || startStyle || endStyle || mustWrap || css) {
  22254. var fullStyle = style || ""
  22255. if (startStyle) { fullStyle += startStyle }
  22256. if (endStyle) { fullStyle += endStyle }
  22257. var token = elt("span", [content], fullStyle, css)
  22258. if (title) { token.title = title }
  22259. return builder.content.appendChild(token)
  22260. }
  22261. builder.content.appendChild(content)
  22262. }
  22263. function splitSpaces(text, trailingBefore) {
  22264. if (text.length > 1 && !/ /.test(text)) { return text }
  22265. var spaceBefore = trailingBefore, result = ""
  22266. for (var i = 0; i < text.length; i++) {
  22267. var ch = text.charAt(i)
  22268. if (ch == " " && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))
  22269. { ch = "\u00a0" }
  22270. result += ch
  22271. spaceBefore = ch == " "
  22272. }
  22273. return result
  22274. }
  22275. // Work around nonsense dimensions being reported for stretches of
  22276. // right-to-left text.
  22277. function buildTokenBadBidi(inner, order) {
  22278. return function (builder, text, style, startStyle, endStyle, title, css) {
  22279. style = style ? style + " cm-force-border" : "cm-force-border"
  22280. var start = builder.pos, end = start + text.length
  22281. for (;;) {
  22282. // Find the part that overlaps with the start of this text
  22283. var part = (void 0)
  22284. for (var i = 0; i < order.length; i++) {
  22285. part = order[i]
  22286. if (part.to > start && part.from <= start) { break }
  22287. }
  22288. if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, title, css) }
  22289. inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css)
  22290. startStyle = null
  22291. text = text.slice(part.to - start)
  22292. start = part.to
  22293. }
  22294. }
  22295. }
  22296. function buildCollapsedSpan(builder, size, marker, ignoreWidget) {
  22297. var widget = !ignoreWidget && marker.widgetNode
  22298. if (widget) { builder.map.push(builder.pos, builder.pos + size, widget) }
  22299. if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {
  22300. if (!widget)
  22301. { widget = builder.content.appendChild(document.createElement("span")) }
  22302. widget.setAttribute("cm-marker", marker.id)
  22303. }
  22304. if (widget) {
  22305. builder.cm.display.input.setUneditable(widget)
  22306. builder.content.appendChild(widget)
  22307. }
  22308. builder.pos += size
  22309. builder.trailingSpace = false
  22310. }
  22311. // Outputs a number of spans to make up a line, taking highlighting
  22312. // and marked text into account.
  22313. function insertLineContent(line, builder, styles) {
  22314. var spans = line.markedSpans, allText = line.text, at = 0
  22315. if (!spans) {
  22316. for (var i$1 = 1; i$1 < styles.length; i$1+=2)
  22317. { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) }
  22318. return
  22319. }
  22320. var len = allText.length, pos = 0, i = 1, text = "", style, css
  22321. var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed
  22322. for (;;) {
  22323. if (nextChange == pos) { // Update current marker set
  22324. spanStyle = spanEndStyle = spanStartStyle = title = css = ""
  22325. collapsed = null; nextChange = Infinity
  22326. var foundBookmarks = [], endStyles = (void 0)
  22327. for (var j = 0; j < spans.length; ++j) {
  22328. var sp = spans[j], m = sp.marker
  22329. if (m.type == "bookmark" && sp.from == pos && m.widgetNode) {
  22330. foundBookmarks.push(m)
  22331. } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {
  22332. if (sp.to != null && sp.to != pos && nextChange > sp.to) {
  22333. nextChange = sp.to
  22334. spanEndStyle = ""
  22335. }
  22336. if (m.className) { spanStyle += " " + m.className }
  22337. if (m.css) { css = (css ? css + ";" : "") + m.css }
  22338. if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle }
  22339. if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) }
  22340. if (m.title && !title) { title = m.title }
  22341. if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))
  22342. { collapsed = sp }
  22343. } else if (sp.from > pos && nextChange > sp.from) {
  22344. nextChange = sp.from
  22345. }
  22346. }
  22347. if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)
  22348. { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += " " + endStyles[j$1] } } }
  22349. if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)
  22350. { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } }
  22351. if (collapsed && (collapsed.from || 0) == pos) {
  22352. buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,
  22353. collapsed.marker, collapsed.from == null)
  22354. if (collapsed.to == null) { return }
  22355. if (collapsed.to == pos) { collapsed = false }
  22356. }
  22357. }
  22358. if (pos >= len) { break }
  22359. var upto = Math.min(len, nextChange)
  22360. while (true) {
  22361. if (text) {
  22362. var end = pos + text.length
  22363. if (!collapsed) {
  22364. var tokenText = end > upto ? text.slice(0, upto - pos) : text
  22365. builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,
  22366. spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title, css)
  22367. }
  22368. if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}
  22369. pos = end
  22370. spanStartStyle = ""
  22371. }
  22372. text = allText.slice(at, at = styles[i++])
  22373. style = interpretTokenStyle(styles[i++], builder.cm.options)
  22374. }
  22375. }
  22376. }
  22377. // These objects are used to represent the visible (currently drawn)
  22378. // part of the document. A LineView may correspond to multiple
  22379. // logical lines, if those are connected by collapsed ranges.
  22380. function LineView(doc, line, lineN) {
  22381. // The starting line
  22382. this.line = line
  22383. // Continuing lines, if any
  22384. this.rest = visualLineContinued(line)
  22385. // Number of logical lines in this visual line
  22386. this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1
  22387. this.node = this.text = null
  22388. this.hidden = lineIsHidden(doc, line)
  22389. }
  22390. // Create a range of LineView objects for the given lines.
  22391. function buildViewArray(cm, from, to) {
  22392. var array = [], nextPos
  22393. for (var pos = from; pos < to; pos = nextPos) {
  22394. var view = new LineView(cm.doc, getLine(cm.doc, pos), pos)
  22395. nextPos = pos + view.size
  22396. array.push(view)
  22397. }
  22398. return array
  22399. }
  22400. var operationGroup = null
  22401. function pushOperation(op) {
  22402. if (operationGroup) {
  22403. operationGroup.ops.push(op)
  22404. } else {
  22405. op.ownsGroup = operationGroup = {
  22406. ops: [op],
  22407. delayedCallbacks: []
  22408. }
  22409. }
  22410. }
  22411. function fireCallbacksForOps(group) {
  22412. // Calls delayed callbacks and cursorActivity handlers until no
  22413. // new ones appear
  22414. var callbacks = group.delayedCallbacks, i = 0
  22415. do {
  22416. for (; i < callbacks.length; i++)
  22417. { callbacks[i].call(null) }
  22418. for (var j = 0; j < group.ops.length; j++) {
  22419. var op = group.ops[j]
  22420. if (op.cursorActivityHandlers)
  22421. { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)
  22422. { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm) } }
  22423. }
  22424. } while (i < callbacks.length)
  22425. }
  22426. function finishOperation(op, endCb) {
  22427. var group = op.ownsGroup
  22428. if (!group) { return }
  22429. try { fireCallbacksForOps(group) }
  22430. finally {
  22431. operationGroup = null
  22432. endCb(group)
  22433. }
  22434. }
  22435. var orphanDelayedCallbacks = null
  22436. // Often, we want to signal events at a point where we are in the
  22437. // middle of some work, but don't want the handler to start calling
  22438. // other methods on the editor, which might be in an inconsistent
  22439. // state or simply not expect any other events to happen.
  22440. // signalLater looks whether there are any handlers, and schedules
  22441. // them to be executed when the last operation ends, or, if no
  22442. // operation is active, when a timeout fires.
  22443. function signalLater(emitter, type /*, values...*/) {
  22444. var arr = getHandlers(emitter, type)
  22445. if (!arr.length) { return }
  22446. var args = Array.prototype.slice.call(arguments, 2), list
  22447. if (operationGroup) {
  22448. list = operationGroup.delayedCallbacks
  22449. } else if (orphanDelayedCallbacks) {
  22450. list = orphanDelayedCallbacks
  22451. } else {
  22452. list = orphanDelayedCallbacks = []
  22453. setTimeout(fireOrphanDelayed, 0)
  22454. }
  22455. var loop = function ( i ) {
  22456. list.push(function () { return arr[i].apply(null, args); })
  22457. };
  22458. for (var i = 0; i < arr.length; ++i)
  22459. loop( i );
  22460. }
  22461. function fireOrphanDelayed() {
  22462. var delayed = orphanDelayedCallbacks
  22463. orphanDelayedCallbacks = null
  22464. for (var i = 0; i < delayed.length; ++i) { delayed[i]() }
  22465. }
  22466. // When an aspect of a line changes, a string is added to
  22467. // lineView.changes. This updates the relevant part of the line's
  22468. // DOM structure.
  22469. function updateLineForChanges(cm, lineView, lineN, dims) {
  22470. for (var j = 0; j < lineView.changes.length; j++) {
  22471. var type = lineView.changes[j]
  22472. if (type == "text") { updateLineText(cm, lineView) }
  22473. else if (type == "gutter") { updateLineGutter(cm, lineView, lineN, dims) }
  22474. else if (type == "class") { updateLineClasses(lineView) }
  22475. else if (type == "widget") { updateLineWidgets(cm, lineView, dims) }
  22476. }
  22477. lineView.changes = null
  22478. }
  22479. // Lines with gutter elements, widgets or a background class need to
  22480. // be wrapped, and have the extra elements added to the wrapper div
  22481. function ensureLineWrapped(lineView) {
  22482. if (lineView.node == lineView.text) {
  22483. lineView.node = elt("div", null, null, "position: relative")
  22484. if (lineView.text.parentNode)
  22485. { lineView.text.parentNode.replaceChild(lineView.node, lineView.text) }
  22486. lineView.node.appendChild(lineView.text)
  22487. if (ie && ie_version < 8) { lineView.node.style.zIndex = 2 }
  22488. }
  22489. return lineView.node
  22490. }
  22491. function updateLineBackground(lineView) {
  22492. var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass
  22493. if (cls) { cls += " CodeMirror-linebackground" }
  22494. if (lineView.background) {
  22495. if (cls) { lineView.background.className = cls }
  22496. else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null }
  22497. } else if (cls) {
  22498. var wrap = ensureLineWrapped(lineView)
  22499. lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild)
  22500. }
  22501. }
  22502. // Wrapper around buildLineContent which will reuse the structure
  22503. // in display.externalMeasured when possible.
  22504. function getLineContent(cm, lineView) {
  22505. var ext = cm.display.externalMeasured
  22506. if (ext && ext.line == lineView.line) {
  22507. cm.display.externalMeasured = null
  22508. lineView.measure = ext.measure
  22509. return ext.built
  22510. }
  22511. return buildLineContent(cm, lineView)
  22512. }
  22513. // Redraw the line's text. Interacts with the background and text
  22514. // classes because the mode may output tokens that influence these
  22515. // classes.
  22516. function updateLineText(cm, lineView) {
  22517. var cls = lineView.text.className
  22518. var built = getLineContent(cm, lineView)
  22519. if (lineView.text == lineView.node) { lineView.node = built.pre }
  22520. lineView.text.parentNode.replaceChild(built.pre, lineView.text)
  22521. lineView.text = built.pre
  22522. if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {
  22523. lineView.bgClass = built.bgClass
  22524. lineView.textClass = built.textClass
  22525. updateLineClasses(lineView)
  22526. } else if (cls) {
  22527. lineView.text.className = cls
  22528. }
  22529. }
  22530. function updateLineClasses(lineView) {
  22531. updateLineBackground(lineView)
  22532. if (lineView.line.wrapClass)
  22533. { ensureLineWrapped(lineView).className = lineView.line.wrapClass }
  22534. else if (lineView.node != lineView.text)
  22535. { lineView.node.className = "" }
  22536. var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass
  22537. lineView.text.className = textClass || ""
  22538. }
  22539. function updateLineGutter(cm, lineView, lineN, dims) {
  22540. if (lineView.gutter) {
  22541. lineView.node.removeChild(lineView.gutter)
  22542. lineView.gutter = null
  22543. }
  22544. if (lineView.gutterBackground) {
  22545. lineView.node.removeChild(lineView.gutterBackground)
  22546. lineView.gutterBackground = null
  22547. }
  22548. if (lineView.line.gutterClass) {
  22549. var wrap = ensureLineWrapped(lineView)
  22550. lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass,
  22551. ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px; width: " + (dims.gutterTotalWidth) + "px"))
  22552. wrap.insertBefore(lineView.gutterBackground, lineView.text)
  22553. }
  22554. var markers = lineView.line.gutterMarkers
  22555. if (cm.options.lineNumbers || markers) {
  22556. var wrap$1 = ensureLineWrapped(lineView)
  22557. var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"))
  22558. cm.display.input.setUneditable(gutterWrap)
  22559. wrap$1.insertBefore(gutterWrap, lineView.text)
  22560. if (lineView.line.gutterClass)
  22561. { gutterWrap.className += " " + lineView.line.gutterClass }
  22562. if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"]))
  22563. { lineView.lineNumber = gutterWrap.appendChild(
  22564. elt("div", lineNumberFor(cm.options, lineN),
  22565. "CodeMirror-linenumber CodeMirror-gutter-elt",
  22566. ("left: " + (dims.gutterLeft["CodeMirror-linenumbers"]) + "px; width: " + (cm.display.lineNumInnerWidth) + "px"))) }
  22567. if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) {
  22568. var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id]
  22569. if (found)
  22570. { gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt",
  22571. ("left: " + (dims.gutterLeft[id]) + "px; width: " + (dims.gutterWidth[id]) + "px"))) }
  22572. } }
  22573. }
  22574. }
  22575. function updateLineWidgets(cm, lineView, dims) {
  22576. if (lineView.alignable) { lineView.alignable = null }
  22577. for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {
  22578. next = node.nextSibling
  22579. if (node.className == "CodeMirror-linewidget")
  22580. { lineView.node.removeChild(node) }
  22581. }
  22582. insertLineWidgets(cm, lineView, dims)
  22583. }
  22584. // Build a line's DOM representation from scratch
  22585. function buildLineElement(cm, lineView, lineN, dims) {
  22586. var built = getLineContent(cm, lineView)
  22587. lineView.text = lineView.node = built.pre
  22588. if (built.bgClass) { lineView.bgClass = built.bgClass }
  22589. if (built.textClass) { lineView.textClass = built.textClass }
  22590. updateLineClasses(lineView)
  22591. updateLineGutter(cm, lineView, lineN, dims)
  22592. insertLineWidgets(cm, lineView, dims)
  22593. return lineView.node
  22594. }
  22595. // A lineView may contain multiple logical lines (when merged by
  22596. // collapsed spans). The widgets for all of them need to be drawn.
  22597. function insertLineWidgets(cm, lineView, dims) {
  22598. insertLineWidgetsFor(cm, lineView.line, lineView, dims, true)
  22599. if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)
  22600. { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false) } }
  22601. }
  22602. function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {
  22603. if (!line.widgets) { return }
  22604. var wrap = ensureLineWrapped(lineView)
  22605. for (var i = 0, ws = line.widgets; i < ws.length; ++i) {
  22606. var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget")
  22607. if (!widget.handleMouseEvents) { node.setAttribute("cm-ignore-events", "true") }
  22608. positionLineWidget(widget, node, lineView, dims)
  22609. cm.display.input.setUneditable(node)
  22610. if (allowAbove && widget.above)
  22611. { wrap.insertBefore(node, lineView.gutter || lineView.text) }
  22612. else
  22613. { wrap.appendChild(node) }
  22614. signalLater(widget, "redraw")
  22615. }
  22616. }
  22617. function positionLineWidget(widget, node, lineView, dims) {
  22618. if (widget.noHScroll) {
  22619. ;(lineView.alignable || (lineView.alignable = [])).push(node)
  22620. var width = dims.wrapperWidth
  22621. node.style.left = dims.fixedPos + "px"
  22622. if (!widget.coverGutter) {
  22623. width -= dims.gutterTotalWidth
  22624. node.style.paddingLeft = dims.gutterTotalWidth + "px"
  22625. }
  22626. node.style.width = width + "px"
  22627. }
  22628. if (widget.coverGutter) {
  22629. node.style.zIndex = 5
  22630. node.style.position = "relative"
  22631. if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + "px" }
  22632. }
  22633. }
  22634. function widgetHeight(widget) {
  22635. if (widget.height != null) { return widget.height }
  22636. var cm = widget.doc.cm
  22637. if (!cm) { return 0 }
  22638. if (!contains(document.body, widget.node)) {
  22639. var parentStyle = "position: relative;"
  22640. if (widget.coverGutter)
  22641. { parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;" }
  22642. if (widget.noHScroll)
  22643. { parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;" }
  22644. removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle))
  22645. }
  22646. return widget.height = widget.node.parentNode.offsetHeight
  22647. }
  22648. // Return true when the given mouse event happened in a widget
  22649. function eventInWidget(display, e) {
  22650. for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {
  22651. if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") ||
  22652. (n.parentNode == display.sizer && n != display.mover))
  22653. { return true }
  22654. }
  22655. }
  22656. // POSITION MEASUREMENT
  22657. function paddingTop(display) {return display.lineSpace.offsetTop}
  22658. function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}
  22659. function paddingH(display) {
  22660. if (display.cachedPaddingH) { return display.cachedPaddingH }
  22661. var e = removeChildrenAndAdd(display.measure, elt("pre", "x"))
  22662. var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle
  22663. var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}
  22664. if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data }
  22665. return data
  22666. }
  22667. function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }
  22668. function displayWidth(cm) {
  22669. return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth
  22670. }
  22671. function displayHeight(cm) {
  22672. return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight
  22673. }
  22674. // Ensure the lineView.wrapping.heights array is populated. This is
  22675. // an array of bottom offsets for the lines that make up a drawn
  22676. // line. When lineWrapping is on, there might be more than one
  22677. // height.
  22678. function ensureLineHeights(cm, lineView, rect) {
  22679. var wrapping = cm.options.lineWrapping
  22680. var curWidth = wrapping && displayWidth(cm)
  22681. if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {
  22682. var heights = lineView.measure.heights = []
  22683. if (wrapping) {
  22684. lineView.measure.width = curWidth
  22685. var rects = lineView.text.firstChild.getClientRects()
  22686. for (var i = 0; i < rects.length - 1; i++) {
  22687. var cur = rects[i], next = rects[i + 1]
  22688. if (Math.abs(cur.bottom - next.bottom) > 2)
  22689. { heights.push((cur.bottom + next.top) / 2 - rect.top) }
  22690. }
  22691. }
  22692. heights.push(rect.bottom - rect.top)
  22693. }
  22694. }
  22695. // Find a line map (mapping character offsets to text nodes) and a
  22696. // measurement cache for the given line number. (A line view might
  22697. // contain multiple lines when collapsed ranges are present.)
  22698. function mapFromLineView(lineView, line, lineN) {
  22699. if (lineView.line == line)
  22700. { return {map: lineView.measure.map, cache: lineView.measure.cache} }
  22701. for (var i = 0; i < lineView.rest.length; i++)
  22702. { if (lineView.rest[i] == line)
  22703. { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }
  22704. for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)
  22705. { if (lineNo(lineView.rest[i$1]) > lineN)
  22706. { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }
  22707. }
  22708. // Render a line into the hidden node display.externalMeasured. Used
  22709. // when measurement is needed for a line that's not in the viewport.
  22710. function updateExternalMeasurement(cm, line) {
  22711. line = visualLine(line)
  22712. var lineN = lineNo(line)
  22713. var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN)
  22714. view.lineN = lineN
  22715. var built = view.built = buildLineContent(cm, view)
  22716. view.text = built.pre
  22717. removeChildrenAndAdd(cm.display.lineMeasure, built.pre)
  22718. return view
  22719. }
  22720. // Get a {top, bottom, left, right} box (in line-local coordinates)
  22721. // for a given character.
  22722. function measureChar(cm, line, ch, bias) {
  22723. return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)
  22724. }
  22725. // Find a line view that corresponds to the given line number.
  22726. function findViewForLine(cm, lineN) {
  22727. if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)
  22728. { return cm.display.view[findViewIndex(cm, lineN)] }
  22729. var ext = cm.display.externalMeasured
  22730. if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)
  22731. { return ext }
  22732. }
  22733. // Measurement can be split in two steps, the set-up work that
  22734. // applies to the whole line, and the measurement of the actual
  22735. // character. Functions like coordsChar, that need to do a lot of
  22736. // measurements in a row, can thus ensure that the set-up work is
  22737. // only done once.
  22738. function prepareMeasureForLine(cm, line) {
  22739. var lineN = lineNo(line)
  22740. var view = findViewForLine(cm, lineN)
  22741. if (view && !view.text) {
  22742. view = null
  22743. } else if (view && view.changes) {
  22744. updateLineForChanges(cm, view, lineN, getDimensions(cm))
  22745. cm.curOp.forceUpdate = true
  22746. }
  22747. if (!view)
  22748. { view = updateExternalMeasurement(cm, line) }
  22749. var info = mapFromLineView(view, line, lineN)
  22750. return {
  22751. line: line, view: view, rect: null,
  22752. map: info.map, cache: info.cache, before: info.before,
  22753. hasHeights: false
  22754. }
  22755. }
  22756. // Given a prepared measurement object, measures the position of an
  22757. // actual character (or fetches it from the cache).
  22758. function measureCharPrepared(cm, prepared, ch, bias, varHeight) {
  22759. if (prepared.before) { ch = -1 }
  22760. var key = ch + (bias || ""), found
  22761. if (prepared.cache.hasOwnProperty(key)) {
  22762. found = prepared.cache[key]
  22763. } else {
  22764. if (!prepared.rect)
  22765. { prepared.rect = prepared.view.text.getBoundingClientRect() }
  22766. if (!prepared.hasHeights) {
  22767. ensureLineHeights(cm, prepared.view, prepared.rect)
  22768. prepared.hasHeights = true
  22769. }
  22770. found = measureCharInner(cm, prepared, ch, bias)
  22771. if (!found.bogus) { prepared.cache[key] = found }
  22772. }
  22773. return {left: found.left, right: found.right,
  22774. top: varHeight ? found.rtop : found.top,
  22775. bottom: varHeight ? found.rbottom : found.bottom}
  22776. }
  22777. var nullRect = {left: 0, right: 0, top: 0, bottom: 0}
  22778. function nodeAndOffsetInLineMap(map, ch, bias) {
  22779. var node, start, end, collapse, mStart, mEnd
  22780. // First, search the line map for the text node corresponding to,
  22781. // or closest to, the target character.
  22782. for (var i = 0; i < map.length; i += 3) {
  22783. mStart = map[i]
  22784. mEnd = map[i + 1]
  22785. if (ch < mStart) {
  22786. start = 0; end = 1
  22787. collapse = "left"
  22788. } else if (ch < mEnd) {
  22789. start = ch - mStart
  22790. end = start + 1
  22791. } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) {
  22792. end = mEnd - mStart
  22793. start = end - 1
  22794. if (ch >= mEnd) { collapse = "right" }
  22795. }
  22796. if (start != null) {
  22797. node = map[i + 2]
  22798. if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right"))
  22799. { collapse = bias }
  22800. if (bias == "left" && start == 0)
  22801. { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) {
  22802. node = map[(i -= 3) + 2]
  22803. collapse = "left"
  22804. } }
  22805. if (bias == "right" && start == mEnd - mStart)
  22806. { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) {
  22807. node = map[(i += 3) + 2]
  22808. collapse = "right"
  22809. } }
  22810. break
  22811. }
  22812. }
  22813. return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}
  22814. }
  22815. function getUsefulRect(rects, bias) {
  22816. var rect = nullRect
  22817. if (bias == "left") { for (var i = 0; i < rects.length; i++) {
  22818. if ((rect = rects[i]).left != rect.right) { break }
  22819. } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {
  22820. if ((rect = rects[i$1]).left != rect.right) { break }
  22821. } }
  22822. return rect
  22823. }
  22824. function measureCharInner(cm, prepared, ch, bias) {
  22825. var place = nodeAndOffsetInLineMap(prepared.map, ch, bias)
  22826. var node = place.node, start = place.start, end = place.end, collapse = place.collapse
  22827. var rect
  22828. if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.
  22829. for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned
  22830. while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start }
  22831. while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end }
  22832. if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)
  22833. { rect = node.parentNode.getBoundingClientRect() }
  22834. else
  22835. { rect = getUsefulRect(range(node, start, end).getClientRects(), bias) }
  22836. if (rect.left || rect.right || start == 0) { break }
  22837. end = start
  22838. start = start - 1
  22839. collapse = "right"
  22840. }
  22841. if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect) }
  22842. } else { // If it is a widget, simply get the box for the whole widget.
  22843. if (start > 0) { collapse = bias = "right" }
  22844. var rects
  22845. if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)
  22846. { rect = rects[bias == "right" ? rects.length - 1 : 0] }
  22847. else
  22848. { rect = node.getBoundingClientRect() }
  22849. }
  22850. if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {
  22851. var rSpan = node.parentNode.getClientRects()[0]
  22852. if (rSpan)
  22853. { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom} }
  22854. else
  22855. { rect = nullRect }
  22856. }
  22857. var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top
  22858. var mid = (rtop + rbot) / 2
  22859. var heights = prepared.view.measure.heights
  22860. var i = 0
  22861. for (; i < heights.length - 1; i++)
  22862. { if (mid < heights[i]) { break } }
  22863. var top = i ? heights[i - 1] : 0, bot = heights[i]
  22864. var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left,
  22865. right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left,
  22866. top: top, bottom: bot}
  22867. if (!rect.left && !rect.right) { result.bogus = true }
  22868. if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot }
  22869. return result
  22870. }
  22871. // Work around problem with bounding client rects on ranges being
  22872. // returned incorrectly when zoomed on IE10 and below.
  22873. function maybeUpdateRectForZooming(measure, rect) {
  22874. if (!window.screen || screen.logicalXDPI == null ||
  22875. screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))
  22876. { return rect }
  22877. var scaleX = screen.logicalXDPI / screen.deviceXDPI
  22878. var scaleY = screen.logicalYDPI / screen.deviceYDPI
  22879. return {left: rect.left * scaleX, right: rect.right * scaleX,
  22880. top: rect.top * scaleY, bottom: rect.bottom * scaleY}
  22881. }
  22882. function clearLineMeasurementCacheFor(lineView) {
  22883. if (lineView.measure) {
  22884. lineView.measure.cache = {}
  22885. lineView.measure.heights = null
  22886. if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)
  22887. { lineView.measure.caches[i] = {} } }
  22888. }
  22889. }
  22890. function clearLineMeasurementCache(cm) {
  22891. cm.display.externalMeasure = null
  22892. removeChildren(cm.display.lineMeasure)
  22893. for (var i = 0; i < cm.display.view.length; i++)
  22894. { clearLineMeasurementCacheFor(cm.display.view[i]) }
  22895. }
  22896. function clearCaches(cm) {
  22897. clearLineMeasurementCache(cm)
  22898. cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null
  22899. if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true }
  22900. cm.display.lineNumChars = null
  22901. }
  22902. function pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft }
  22903. function pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop }
  22904. // Converts a {top, bottom, left, right} box from line-local
  22905. // coordinates into another coordinate system. Context may be one of
  22906. // "line", "div" (display.lineDiv), "local"./null (editor), "window",
  22907. // or "page".
  22908. function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {
  22909. if (!includeWidgets && lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above) {
  22910. var size = widgetHeight(lineObj.widgets[i])
  22911. rect.top += size; rect.bottom += size
  22912. } } }
  22913. if (context == "line") { return rect }
  22914. if (!context) { context = "local" }
  22915. var yOff = heightAtLine(lineObj)
  22916. if (context == "local") { yOff += paddingTop(cm.display) }
  22917. else { yOff -= cm.display.viewOffset }
  22918. if (context == "page" || context == "window") {
  22919. var lOff = cm.display.lineSpace.getBoundingClientRect()
  22920. yOff += lOff.top + (context == "window" ? 0 : pageScrollY())
  22921. var xOff = lOff.left + (context == "window" ? 0 : pageScrollX())
  22922. rect.left += xOff; rect.right += xOff
  22923. }
  22924. rect.top += yOff; rect.bottom += yOff
  22925. return rect
  22926. }
  22927. // Coverts a box from "div" coords to another coordinate system.
  22928. // Context may be "window", "page", "div", or "local"./null.
  22929. function fromCoordSystem(cm, coords, context) {
  22930. if (context == "div") { return coords }
  22931. var left = coords.left, top = coords.top
  22932. // First move into "page" coordinate system
  22933. if (context == "page") {
  22934. left -= pageScrollX()
  22935. top -= pageScrollY()
  22936. } else if (context == "local" || !context) {
  22937. var localBox = cm.display.sizer.getBoundingClientRect()
  22938. left += localBox.left
  22939. top += localBox.top
  22940. }
  22941. var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect()
  22942. return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}
  22943. }
  22944. function charCoords(cm, pos, context, lineObj, bias) {
  22945. if (!lineObj) { lineObj = getLine(cm.doc, pos.line) }
  22946. return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)
  22947. }
  22948. // Returns a box for a given cursor position, which may have an
  22949. // 'other' property containing the position of the secondary cursor
  22950. // on a bidi boundary.
  22951. function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {
  22952. lineObj = lineObj || getLine(cm.doc, pos.line)
  22953. if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj) }
  22954. function get(ch, right) {
  22955. var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight)
  22956. if (right) { m.left = m.right; } else { m.right = m.left }
  22957. return intoCoordSystem(cm, lineObj, m, context)
  22958. }
  22959. function getBidi(ch, partPos) {
  22960. var part = order[partPos], right = part.level % 2
  22961. if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {
  22962. part = order[--partPos]
  22963. ch = bidiRight(part) - (part.level % 2 ? 0 : 1)
  22964. right = true
  22965. } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {
  22966. part = order[++partPos]
  22967. ch = bidiLeft(part) - part.level % 2
  22968. right = false
  22969. }
  22970. if (right && ch == part.to && ch > part.from) { return get(ch - 1) }
  22971. return get(ch, right)
  22972. }
  22973. var order = getOrder(lineObj), ch = pos.ch
  22974. if (!order) { return get(ch) }
  22975. var partPos = getBidiPartAt(order, ch)
  22976. var val = getBidi(ch, partPos)
  22977. if (bidiOther != null) { val.other = getBidi(ch, bidiOther) }
  22978. return val
  22979. }
  22980. // Used to cheaply estimate the coordinates for a position. Used for
  22981. // intermediate scroll updates.
  22982. function estimateCoords(cm, pos) {
  22983. var left = 0
  22984. pos = clipPos(cm.doc, pos)
  22985. if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch }
  22986. var lineObj = getLine(cm.doc, pos.line)
  22987. var top = heightAtLine(lineObj) + paddingTop(cm.display)
  22988. return {left: left, right: left, top: top, bottom: top + lineObj.height}
  22989. }
  22990. // Positions returned by coordsChar contain some extra information.
  22991. // xRel is the relative x position of the input coordinates compared
  22992. // to the found position (so xRel > 0 means the coordinates are to
  22993. // the right of the character position, for example). When outside
  22994. // is true, that means the coordinates lie outside the line's
  22995. // vertical range.
  22996. function PosWithInfo(line, ch, outside, xRel) {
  22997. var pos = Pos(line, ch)
  22998. pos.xRel = xRel
  22999. if (outside) { pos.outside = true }
  23000. return pos
  23001. }
  23002. // Compute the character position closest to the given coordinates.
  23003. // Input must be lineSpace-local ("div" coordinate system).
  23004. function coordsChar(cm, x, y) {
  23005. var doc = cm.doc
  23006. y += cm.display.viewOffset
  23007. if (y < 0) { return PosWithInfo(doc.first, 0, true, -1) }
  23008. var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1
  23009. if (lineN > last)
  23010. { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1) }
  23011. if (x < 0) { x = 0 }
  23012. var lineObj = getLine(doc, lineN)
  23013. for (;;) {
  23014. var found = coordsCharInner(cm, lineObj, lineN, x, y)
  23015. var merged = collapsedSpanAtEnd(lineObj)
  23016. var mergedPos = merged && merged.find(0, true)
  23017. if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))
  23018. { lineN = lineNo(lineObj = mergedPos.to.line) }
  23019. else
  23020. { return found }
  23021. }
  23022. }
  23023. function coordsCharInner(cm, lineObj, lineNo, x, y) {
  23024. var innerOff = y - heightAtLine(lineObj)
  23025. var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth
  23026. var preparedMeasure = prepareMeasureForLine(cm, lineObj)
  23027. function getX(ch) {
  23028. var sp = cursorCoords(cm, Pos(lineNo, ch), "line", lineObj, preparedMeasure)
  23029. wrongLine = true
  23030. if (innerOff > sp.bottom) { return sp.left - adjust }
  23031. else if (innerOff < sp.top) { return sp.left + adjust }
  23032. else { wrongLine = false }
  23033. return sp.left
  23034. }
  23035. var bidi = getOrder(lineObj), dist = lineObj.text.length
  23036. var from = lineLeft(lineObj), to = lineRight(lineObj)
  23037. var fromX = getX(from), fromOutside = wrongLine, toX = getX(to), toOutside = wrongLine
  23038. if (x > toX) { return PosWithInfo(lineNo, to, toOutside, 1) }
  23039. // Do a binary search between these bounds.
  23040. for (;;) {
  23041. if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) {
  23042. var ch = x < fromX || x - fromX <= toX - x ? from : to
  23043. var outside = ch == from ? fromOutside : toOutside
  23044. var xDiff = x - (ch == from ? fromX : toX)
  23045. // This is a kludge to handle the case where the coordinates
  23046. // are after a line-wrapped line. We should replace it with a
  23047. // more general handling of cursor positions around line
  23048. // breaks. (Issue #4078)
  23049. if (toOutside && !bidi && !/\s/.test(lineObj.text.charAt(ch)) && xDiff > 0 &&
  23050. ch < lineObj.text.length && preparedMeasure.view.measure.heights.length > 1) {
  23051. var charSize = measureCharPrepared(cm, preparedMeasure, ch, "right")
  23052. if (innerOff <= charSize.bottom && innerOff >= charSize.top && Math.abs(x - charSize.right) < xDiff) {
  23053. outside = false
  23054. ch++
  23055. xDiff = x - charSize.right
  23056. }
  23057. }
  23058. while (isExtendingChar(lineObj.text.charAt(ch))) { ++ch }
  23059. var pos = PosWithInfo(lineNo, ch, outside, xDiff < -1 ? -1 : xDiff > 1 ? 1 : 0)
  23060. return pos
  23061. }
  23062. var step = Math.ceil(dist / 2), middle = from + step
  23063. if (bidi) {
  23064. middle = from
  23065. for (var i = 0; i < step; ++i) { middle = moveVisually(lineObj, middle, 1) }
  23066. }
  23067. var middleX = getX(middle)
  23068. if (middleX > x) {to = middle; toX = middleX; if (toOutside = wrongLine) { toX += 1000; } dist = step}
  23069. else {from = middle; fromX = middleX; fromOutside = wrongLine; dist -= step}
  23070. }
  23071. }
  23072. var measureText
  23073. // Compute the default text height.
  23074. function textHeight(display) {
  23075. if (display.cachedTextHeight != null) { return display.cachedTextHeight }
  23076. if (measureText == null) {
  23077. measureText = elt("pre")
  23078. // Measure a bunch of lines, for browsers that compute
  23079. // fractional heights.
  23080. for (var i = 0; i < 49; ++i) {
  23081. measureText.appendChild(document.createTextNode("x"))
  23082. measureText.appendChild(elt("br"))
  23083. }
  23084. measureText.appendChild(document.createTextNode("x"))
  23085. }
  23086. removeChildrenAndAdd(display.measure, measureText)
  23087. var height = measureText.offsetHeight / 50
  23088. if (height > 3) { display.cachedTextHeight = height }
  23089. removeChildren(display.measure)
  23090. return height || 1
  23091. }
  23092. // Compute the default character width.
  23093. function charWidth(display) {
  23094. if (display.cachedCharWidth != null) { return display.cachedCharWidth }
  23095. var anchor = elt("span", "xxxxxxxxxx")
  23096. var pre = elt("pre", [anchor])
  23097. removeChildrenAndAdd(display.measure, pre)
  23098. var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10
  23099. if (width > 2) { display.cachedCharWidth = width }
  23100. return width || 10
  23101. }
  23102. // Do a bulk-read of the DOM positions and sizes needed to draw the
  23103. // view, so that we don't interleave reading and writing to the DOM.
  23104. function getDimensions(cm) {
  23105. var d = cm.display, left = {}, width = {}
  23106. var gutterLeft = d.gutters.clientLeft
  23107. for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {
  23108. left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft
  23109. width[cm.options.gutters[i]] = n.clientWidth
  23110. }
  23111. return {fixedPos: compensateForHScroll(d),
  23112. gutterTotalWidth: d.gutters.offsetWidth,
  23113. gutterLeft: left,
  23114. gutterWidth: width,
  23115. wrapperWidth: d.wrapper.clientWidth}
  23116. }
  23117. // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,
  23118. // but using getBoundingClientRect to get a sub-pixel-accurate
  23119. // result.
  23120. function compensateForHScroll(display) {
  23121. return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left
  23122. }
  23123. // Returns a function that estimates the height of a line, to use as
  23124. // first approximation until the line becomes visible (and is thus
  23125. // properly measurable).
  23126. function estimateHeight(cm) {
  23127. var th = textHeight(cm.display), wrapping = cm.options.lineWrapping
  23128. var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3)
  23129. return function (line) {
  23130. if (lineIsHidden(cm.doc, line)) { return 0 }
  23131. var widgetsHeight = 0
  23132. if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {
  23133. if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height }
  23134. } }
  23135. if (wrapping)
  23136. { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }
  23137. else
  23138. { return widgetsHeight + th }
  23139. }
  23140. }
  23141. function estimateLineHeights(cm) {
  23142. var doc = cm.doc, est = estimateHeight(cm)
  23143. doc.iter(function (line) {
  23144. var estHeight = est(line)
  23145. if (estHeight != line.height) { updateLineHeight(line, estHeight) }
  23146. })
  23147. }
  23148. // Given a mouse event, find the corresponding position. If liberal
  23149. // is false, it checks whether a gutter or scrollbar was clicked,
  23150. // and returns null if it was. forRect is used by rectangular
  23151. // selections, and tries to estimate a character position even for
  23152. // coordinates beyond the right of the text.
  23153. function posFromMouse(cm, e, liberal, forRect) {
  23154. var display = cm.display
  23155. if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") { return null }
  23156. var x, y, space = display.lineSpace.getBoundingClientRect()
  23157. // Fails unpredictably on IE[67] when mouse is dragged around quickly.
  23158. try { x = e.clientX - space.left; y = e.clientY - space.top }
  23159. catch (e) { return null }
  23160. var coords = coordsChar(cm, x, y), line
  23161. if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {
  23162. var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length
  23163. coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff))
  23164. }
  23165. return coords
  23166. }
  23167. // Find the view element corresponding to a given line. Return null
  23168. // when the line isn't visible.
  23169. function findViewIndex(cm, n) {
  23170. if (n >= cm.display.viewTo) { return null }
  23171. n -= cm.display.viewFrom
  23172. if (n < 0) { return null }
  23173. var view = cm.display.view
  23174. for (var i = 0; i < view.length; i++) {
  23175. n -= view[i].size
  23176. if (n < 0) { return i }
  23177. }
  23178. }
  23179. function updateSelection(cm) {
  23180. cm.display.input.showSelection(cm.display.input.prepareSelection())
  23181. }
  23182. function prepareSelection(cm, primary) {
  23183. var doc = cm.doc, result = {}
  23184. var curFragment = result.cursors = document.createDocumentFragment()
  23185. var selFragment = result.selection = document.createDocumentFragment()
  23186. for (var i = 0; i < doc.sel.ranges.length; i++) {
  23187. if (primary === false && i == doc.sel.primIndex) { continue }
  23188. var range = doc.sel.ranges[i]
  23189. if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }
  23190. var collapsed = range.empty()
  23191. if (collapsed || cm.options.showCursorWhenSelecting)
  23192. { drawSelectionCursor(cm, range.head, curFragment) }
  23193. if (!collapsed)
  23194. { drawSelectionRange(cm, range, selFragment) }
  23195. }
  23196. return result
  23197. }
  23198. // Draws a cursor for the given range
  23199. function drawSelectionCursor(cm, head, output) {
  23200. var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine)
  23201. var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor"))
  23202. cursor.style.left = pos.left + "px"
  23203. cursor.style.top = pos.top + "px"
  23204. cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"
  23205. if (pos.other) {
  23206. // Secondary cursor, shown when on a 'jump' in bi-directional text
  23207. var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor"))
  23208. otherCursor.style.display = ""
  23209. otherCursor.style.left = pos.other.left + "px"
  23210. otherCursor.style.top = pos.other.top + "px"
  23211. otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"
  23212. }
  23213. }
  23214. // Draws the given range as a highlighted selection
  23215. function drawSelectionRange(cm, range, output) {
  23216. var display = cm.display, doc = cm.doc
  23217. var fragment = document.createDocumentFragment()
  23218. var padding = paddingH(cm.display), leftSide = padding.left
  23219. var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right
  23220. function add(left, top, width, bottom) {
  23221. if (top < 0) { top = 0 }
  23222. top = Math.round(top)
  23223. bottom = Math.round(bottom)
  23224. fragment.appendChild(elt("div", null, "CodeMirror-selected", ("position: absolute; left: " + left + "px;\n top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px;\n height: " + (bottom - top) + "px")))
  23225. }
  23226. function drawForLine(line, fromArg, toArg) {
  23227. var lineObj = getLine(doc, line)
  23228. var lineLen = lineObj.text.length
  23229. var start, end
  23230. function coords(ch, bias) {
  23231. return charCoords(cm, Pos(line, ch), "div", lineObj, bias)
  23232. }
  23233. iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) {
  23234. var leftPos = coords(from, "left"), rightPos, left, right
  23235. if (from == to) {
  23236. rightPos = leftPos
  23237. left = right = leftPos.left
  23238. } else {
  23239. rightPos = coords(to - 1, "right")
  23240. if (dir == "rtl") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp }
  23241. left = leftPos.left
  23242. right = rightPos.right
  23243. }
  23244. if (fromArg == null && from == 0) { left = leftSide }
  23245. if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part
  23246. add(left, leftPos.top, null, leftPos.bottom)
  23247. left = leftSide
  23248. if (leftPos.bottom < rightPos.top) { add(left, leftPos.bottom, null, rightPos.top) }
  23249. }
  23250. if (toArg == null && to == lineLen) { right = rightSide }
  23251. if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)
  23252. { start = leftPos }
  23253. if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)
  23254. { end = rightPos }
  23255. if (left < leftSide + 1) { left = leftSide }
  23256. add(left, rightPos.top, right - left, rightPos.bottom)
  23257. })
  23258. return {start: start, end: end}
  23259. }
  23260. var sFrom = range.from(), sTo = range.to()
  23261. if (sFrom.line == sTo.line) {
  23262. drawForLine(sFrom.line, sFrom.ch, sTo.ch)
  23263. } else {
  23264. var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line)
  23265. var singleVLine = visualLine(fromLine) == visualLine(toLine)
  23266. var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end
  23267. var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start
  23268. if (singleVLine) {
  23269. if (leftEnd.top < rightStart.top - 2) {
  23270. add(leftEnd.right, leftEnd.top, null, leftEnd.bottom)
  23271. add(leftSide, rightStart.top, rightStart.left, rightStart.bottom)
  23272. } else {
  23273. add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom)
  23274. }
  23275. }
  23276. if (leftEnd.bottom < rightStart.top)
  23277. { add(leftSide, leftEnd.bottom, null, rightStart.top) }
  23278. }
  23279. output.appendChild(fragment)
  23280. }
  23281. // Cursor-blinking
  23282. function restartBlink(cm) {
  23283. if (!cm.state.focused) { return }
  23284. var display = cm.display
  23285. clearInterval(display.blinker)
  23286. var on = true
  23287. display.cursorDiv.style.visibility = ""
  23288. if (cm.options.cursorBlinkRate > 0)
  23289. { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; },
  23290. cm.options.cursorBlinkRate) }
  23291. else if (cm.options.cursorBlinkRate < 0)
  23292. { display.cursorDiv.style.visibility = "hidden" }
  23293. }
  23294. function ensureFocus(cm) {
  23295. if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm) }
  23296. }
  23297. function delayBlurEvent(cm) {
  23298. cm.state.delayingBlurEvent = true
  23299. setTimeout(function () { if (cm.state.delayingBlurEvent) {
  23300. cm.state.delayingBlurEvent = false
  23301. onBlur(cm)
  23302. } }, 100)
  23303. }
  23304. function onFocus(cm, e) {
  23305. if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false }
  23306. if (cm.options.readOnly == "nocursor") { return }
  23307. if (!cm.state.focused) {
  23308. signal(cm, "focus", cm, e)
  23309. cm.state.focused = true
  23310. addClass(cm.display.wrapper, "CodeMirror-focused")
  23311. // This test prevents this from firing when a context
  23312. // menu is closed (since the input reset would kill the
  23313. // select-all detection hack)
  23314. if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {
  23315. cm.display.input.reset()
  23316. if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20) } // Issue #1730
  23317. }
  23318. cm.display.input.receivedFocus()
  23319. }
  23320. restartBlink(cm)
  23321. }
  23322. function onBlur(cm, e) {
  23323. if (cm.state.delayingBlurEvent) { return }
  23324. if (cm.state.focused) {
  23325. signal(cm, "blur", cm, e)
  23326. cm.state.focused = false
  23327. rmClass(cm.display.wrapper, "CodeMirror-focused")
  23328. }
  23329. clearInterval(cm.display.blinker)
  23330. setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false } }, 150)
  23331. }
  23332. // Re-align line numbers and gutter marks to compensate for
  23333. // horizontal scrolling.
  23334. function alignHorizontally(cm) {
  23335. var display = cm.display, view = display.view
  23336. if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }
  23337. var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft
  23338. var gutterW = display.gutters.offsetWidth, left = comp + "px"
  23339. for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {
  23340. if (cm.options.fixedGutter) {
  23341. if (view[i].gutter)
  23342. { view[i].gutter.style.left = left }
  23343. if (view[i].gutterBackground)
  23344. { view[i].gutterBackground.style.left = left }
  23345. }
  23346. var align = view[i].alignable
  23347. if (align) { for (var j = 0; j < align.length; j++)
  23348. { align[j].style.left = left } }
  23349. } }
  23350. if (cm.options.fixedGutter)
  23351. { display.gutters.style.left = (comp + gutterW) + "px" }
  23352. }
  23353. // Used to ensure that the line number gutter is still the right
  23354. // size for the current document size. Returns true when an update
  23355. // is needed.
  23356. function maybeUpdateLineNumberWidth(cm) {
  23357. if (!cm.options.lineNumbers) { return false }
  23358. var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display
  23359. if (last.length != display.lineNumChars) {
  23360. var test = display.measure.appendChild(elt("div", [elt("div", last)],
  23361. "CodeMirror-linenumber CodeMirror-gutter-elt"))
  23362. var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW
  23363. display.lineGutter.style.width = ""
  23364. display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1
  23365. display.lineNumWidth = display.lineNumInnerWidth + padding
  23366. display.lineNumChars = display.lineNumInnerWidth ? last.length : -1
  23367. display.lineGutter.style.width = display.lineNumWidth + "px"
  23368. updateGutterSpace(cm)
  23369. return true
  23370. }
  23371. return false
  23372. }
  23373. // Read the actual heights of the rendered lines, and update their
  23374. // stored heights to match.
  23375. function updateHeightsInViewport(cm) {
  23376. var display = cm.display
  23377. var prevBottom = display.lineDiv.offsetTop
  23378. for (var i = 0; i < display.view.length; i++) {
  23379. var cur = display.view[i], height = (void 0)
  23380. if (cur.hidden) { continue }
  23381. if (ie && ie_version < 8) {
  23382. var bot = cur.node.offsetTop + cur.node.offsetHeight
  23383. height = bot - prevBottom
  23384. prevBottom = bot
  23385. } else {
  23386. var box = cur.node.getBoundingClientRect()
  23387. height = box.bottom - box.top
  23388. }
  23389. var diff = cur.line.height - height
  23390. if (height < 2) { height = textHeight(display) }
  23391. if (diff > .001 || diff < -.001) {
  23392. updateLineHeight(cur.line, height)
  23393. updateWidgetHeight(cur.line)
  23394. if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)
  23395. { updateWidgetHeight(cur.rest[j]) } }
  23396. }
  23397. }
  23398. }
  23399. // Read and store the height of line widgets associated with the
  23400. // given line.
  23401. function updateWidgetHeight(line) {
  23402. if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)
  23403. { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight } }
  23404. }
  23405. // Compute the lines that are visible in a given viewport (defaults
  23406. // the the current scroll position). viewport may contain top,
  23407. // height, and ensure (see op.scrollToPos) properties.
  23408. function visibleLines(display, doc, viewport) {
  23409. var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop
  23410. top = Math.floor(top - paddingTop(display))
  23411. var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight
  23412. var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom)
  23413. // Ensure is a {from: {line, ch}, to: {line, ch}} object, and
  23414. // forces those lines into the viewport (if possible).
  23415. if (viewport && viewport.ensure) {
  23416. var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line
  23417. if (ensureFrom < from) {
  23418. from = ensureFrom
  23419. to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight)
  23420. } else if (Math.min(ensureTo, doc.lastLine()) >= to) {
  23421. from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight)
  23422. to = ensureTo
  23423. }
  23424. }
  23425. return {from: from, to: Math.max(to, from + 1)}
  23426. }
  23427. // Sync the scrollable area and scrollbars, ensure the viewport
  23428. // covers the visible area.
  23429. function setScrollTop(cm, val) {
  23430. if (Math.abs(cm.doc.scrollTop - val) < 2) { return }
  23431. cm.doc.scrollTop = val
  23432. if (!gecko) { updateDisplaySimple(cm, {top: val}) }
  23433. if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val }
  23434. cm.display.scrollbars.setScrollTop(val)
  23435. if (gecko) { updateDisplaySimple(cm) }
  23436. startWorker(cm, 100)
  23437. }
  23438. // Sync scroller and scrollbar, ensure the gutter elements are
  23439. // aligned.
  23440. function setScrollLeft(cm, val, isScroller) {
  23441. if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) { return }
  23442. val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth)
  23443. cm.doc.scrollLeft = val
  23444. alignHorizontally(cm)
  23445. if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val }
  23446. cm.display.scrollbars.setScrollLeft(val)
  23447. }
  23448. // Since the delta values reported on mouse wheel events are
  23449. // unstandardized between browsers and even browser versions, and
  23450. // generally horribly unpredictable, this code starts by measuring
  23451. // the scroll effect that the first few mouse wheel events have,
  23452. // and, from that, detects the way it can convert deltas to pixel
  23453. // offsets afterwards.
  23454. //
  23455. // The reason we want to know the amount a wheel event will scroll
  23456. // is that it gives us a chance to update the display before the
  23457. // actual scrolling happens, reducing flickering.
  23458. var wheelSamples = 0;
  23459. var wheelPixelsPerUnit = null;
  23460. // Fill in a browser-detected starting value on browsers where we
  23461. // know one. These don't have to be accurate -- the result of them
  23462. // being wrong would just be a slight flicker on the first wheel
  23463. // scroll (if it is large enough).
  23464. if (ie) { wheelPixelsPerUnit = -.53 }
  23465. else if (gecko) { wheelPixelsPerUnit = 15 }
  23466. else if (chrome) { wheelPixelsPerUnit = -.7 }
  23467. else if (safari) { wheelPixelsPerUnit = -1/3 }
  23468. function wheelEventDelta(e) {
  23469. var dx = e.wheelDeltaX, dy = e.wheelDeltaY
  23470. if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail }
  23471. if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail }
  23472. else if (dy == null) { dy = e.wheelDelta }
  23473. return {x: dx, y: dy}
  23474. }
  23475. function wheelEventPixels(e) {
  23476. var delta = wheelEventDelta(e)
  23477. delta.x *= wheelPixelsPerUnit
  23478. delta.y *= wheelPixelsPerUnit
  23479. return delta
  23480. }
  23481. function onScrollWheel(cm, e) {
  23482. var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y
  23483. var display = cm.display, scroll = display.scroller
  23484. // Quit if there's nothing to scroll here
  23485. var canScrollX = scroll.scrollWidth > scroll.clientWidth
  23486. var canScrollY = scroll.scrollHeight > scroll.clientHeight
  23487. if (!(dx && canScrollX || dy && canScrollY)) { return }
  23488. // Webkit browsers on OS X abort momentum scrolls when the target
  23489. // of the scroll event is removed from the scrollable element.
  23490. // This hack (see related code in patchDisplay) makes sure the
  23491. // element is kept around.
  23492. if (dy && mac && webkit) {
  23493. outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {
  23494. for (var i = 0; i < view.length; i++) {
  23495. if (view[i].node == cur) {
  23496. cm.display.currentWheelTarget = cur
  23497. break outer
  23498. }
  23499. }
  23500. }
  23501. }
  23502. // On some browsers, horizontal scrolling will cause redraws to
  23503. // happen before the gutter has been realigned, causing it to
  23504. // wriggle around in a most unseemly way. When we have an
  23505. // estimated pixels/delta value, we just handle horizontal
  23506. // scrolling entirely here. It'll be slightly off from native, but
  23507. // better than glitching out.
  23508. if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {
  23509. if (dy && canScrollY)
  23510. { setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight))) }
  23511. setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth)))
  23512. // Only prevent default scrolling if vertical scrolling is
  23513. // actually possible. Otherwise, it causes vertical scroll
  23514. // jitter on OSX trackpads when deltaX is small and deltaY
  23515. // is large (issue #3579)
  23516. if (!dy || (dy && canScrollY))
  23517. { e_preventDefault(e) }
  23518. display.wheelStartX = null // Abort measurement, if in progress
  23519. return
  23520. }
  23521. // 'Project' the visible viewport to cover the area that is being
  23522. // scrolled into view (if we know enough to estimate it).
  23523. if (dy && wheelPixelsPerUnit != null) {
  23524. var pixels = dy * wheelPixelsPerUnit
  23525. var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight
  23526. if (pixels < 0) { top = Math.max(0, top + pixels - 50) }
  23527. else { bot = Math.min(cm.doc.height, bot + pixels + 50) }
  23528. updateDisplaySimple(cm, {top: top, bottom: bot})
  23529. }
  23530. if (wheelSamples < 20) {
  23531. if (display.wheelStartX == null) {
  23532. display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop
  23533. display.wheelDX = dx; display.wheelDY = dy
  23534. setTimeout(function () {
  23535. if (display.wheelStartX == null) { return }
  23536. var movedX = scroll.scrollLeft - display.wheelStartX
  23537. var movedY = scroll.scrollTop - display.wheelStartY
  23538. var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||
  23539. (movedX && display.wheelDX && movedX / display.wheelDX)
  23540. display.wheelStartX = display.wheelStartY = null
  23541. if (!sample) { return }
  23542. wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1)
  23543. ++wheelSamples
  23544. }, 200)
  23545. } else {
  23546. display.wheelDX += dx; display.wheelDY += dy
  23547. }
  23548. }
  23549. }
  23550. // SCROLLBARS
  23551. // Prepare DOM reads needed to update the scrollbars. Done in one
  23552. // shot to minimize update/measure roundtrips.
  23553. function measureForScrollbars(cm) {
  23554. var d = cm.display, gutterW = d.gutters.offsetWidth
  23555. var docH = Math.round(cm.doc.height + paddingVert(cm.display))
  23556. return {
  23557. clientHeight: d.scroller.clientHeight,
  23558. viewHeight: d.wrapper.clientHeight,
  23559. scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,
  23560. viewWidth: d.wrapper.clientWidth,
  23561. barLeft: cm.options.fixedGutter ? gutterW : 0,
  23562. docHeight: docH,
  23563. scrollHeight: docH + scrollGap(cm) + d.barHeight,
  23564. nativeBarWidth: d.nativeBarWidth,
  23565. gutterWidth: gutterW
  23566. }
  23567. }
  23568. var NativeScrollbars = function(place, scroll, cm) {
  23569. this.cm = cm
  23570. var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar")
  23571. var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar")
  23572. place(vert); place(horiz)
  23573. on(vert, "scroll", function () {
  23574. if (vert.clientHeight) { scroll(vert.scrollTop, "vertical") }
  23575. })
  23576. on(horiz, "scroll", function () {
  23577. if (horiz.clientWidth) { scroll(horiz.scrollLeft, "horizontal") }
  23578. })
  23579. this.checkedZeroWidth = false
  23580. // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).
  23581. if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = "18px" }
  23582. };
  23583. NativeScrollbars.prototype.update = function (measure) {
  23584. var needsH = measure.scrollWidth > measure.clientWidth + 1
  23585. var needsV = measure.scrollHeight > measure.clientHeight + 1
  23586. var sWidth = measure.nativeBarWidth
  23587. if (needsV) {
  23588. this.vert.style.display = "block"
  23589. this.vert.style.bottom = needsH ? sWidth + "px" : "0"
  23590. var totalHeight = measure.viewHeight - (needsH ? sWidth : 0)
  23591. // A bug in IE8 can cause this value to be negative, so guard it.
  23592. this.vert.firstChild.style.height =
  23593. Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"
  23594. } else {
  23595. this.vert.style.display = ""
  23596. this.vert.firstChild.style.height = "0"
  23597. }
  23598. if (needsH) {
  23599. this.horiz.style.display = "block"
  23600. this.horiz.style.right = needsV ? sWidth + "px" : "0"
  23601. this.horiz.style.left = measure.barLeft + "px"
  23602. var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0)
  23603. this.horiz.firstChild.style.width =
  23604. (measure.scrollWidth - measure.clientWidth + totalWidth) + "px"
  23605. } else {
  23606. this.horiz.style.display = ""
  23607. this.horiz.firstChild.style.width = "0"
  23608. }
  23609. if (!this.checkedZeroWidth && measure.clientHeight > 0) {
  23610. if (sWidth == 0) { this.zeroWidthHack() }
  23611. this.checkedZeroWidth = true
  23612. }
  23613. return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}
  23614. };
  23615. NativeScrollbars.prototype.setScrollLeft = function (pos) {
  23616. if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos }
  23617. if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz) }
  23618. };
  23619. NativeScrollbars.prototype.setScrollTop = function (pos) {
  23620. if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos }
  23621. if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert) }
  23622. };
  23623. NativeScrollbars.prototype.zeroWidthHack = function () {
  23624. var w = mac && !mac_geMountainLion ? "12px" : "18px"
  23625. this.horiz.style.height = this.vert.style.width = w
  23626. this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none"
  23627. this.disableHoriz = new Delayed
  23628. this.disableVert = new Delayed
  23629. };
  23630. NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay) {
  23631. bar.style.pointerEvents = "auto"
  23632. function maybeDisable() {
  23633. // To find out whether the scrollbar is still visible, we
  23634. // check whether the element under the pixel in the bottom
  23635. // left corner of the scrollbar box is the scrollbar box
  23636. // itself (when the bar is still visible) or its filler child
  23637. // (when the bar is hidden). If it is still visible, we keep
  23638. // it enabled, if it's hidden, we disable pointer events.
  23639. var box = bar.getBoundingClientRect()
  23640. var elt = document.elementFromPoint(box.left + 1, box.bottom - 1)
  23641. if (elt != bar) { bar.style.pointerEvents = "none" }
  23642. else { delay.set(1000, maybeDisable) }
  23643. }
  23644. delay.set(1000, maybeDisable)
  23645. };
  23646. NativeScrollbars.prototype.clear = function () {
  23647. var parent = this.horiz.parentNode
  23648. parent.removeChild(this.horiz)
  23649. parent.removeChild(this.vert)
  23650. };
  23651. var NullScrollbars = function () {};
  23652. NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };
  23653. NullScrollbars.prototype.setScrollLeft = function () {};
  23654. NullScrollbars.prototype.setScrollTop = function () {};
  23655. NullScrollbars.prototype.clear = function () {};
  23656. function updateScrollbars(cm, measure) {
  23657. if (!measure) { measure = measureForScrollbars(cm) }
  23658. var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight
  23659. updateScrollbarsInner(cm, measure)
  23660. for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {
  23661. if (startWidth != cm.display.barWidth && cm.options.lineWrapping)
  23662. { updateHeightsInViewport(cm) }
  23663. updateScrollbarsInner(cm, measureForScrollbars(cm))
  23664. startWidth = cm.display.barWidth; startHeight = cm.display.barHeight
  23665. }
  23666. }
  23667. // Re-synchronize the fake scrollbars with the actual size of the
  23668. // content.
  23669. function updateScrollbarsInner(cm, measure) {
  23670. var d = cm.display
  23671. var sizes = d.scrollbars.update(measure)
  23672. d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"
  23673. d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"
  23674. d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent"
  23675. if (sizes.right && sizes.bottom) {
  23676. d.scrollbarFiller.style.display = "block"
  23677. d.scrollbarFiller.style.height = sizes.bottom + "px"
  23678. d.scrollbarFiller.style.width = sizes.right + "px"
  23679. } else { d.scrollbarFiller.style.display = "" }
  23680. if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {
  23681. d.gutterFiller.style.display = "block"
  23682. d.gutterFiller.style.height = sizes.bottom + "px"
  23683. d.gutterFiller.style.width = measure.gutterWidth + "px"
  23684. } else { d.gutterFiller.style.display = "" }
  23685. }
  23686. var scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars}
  23687. function initScrollbars(cm) {
  23688. if (cm.display.scrollbars) {
  23689. cm.display.scrollbars.clear()
  23690. if (cm.display.scrollbars.addClass)
  23691. { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass) }
  23692. }
  23693. cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {
  23694. cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller)
  23695. // Prevent clicks in the scrollbars from killing focus
  23696. on(node, "mousedown", function () {
  23697. if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0) }
  23698. })
  23699. node.setAttribute("cm-not-content", "true")
  23700. }, function (pos, axis) {
  23701. if (axis == "horizontal") { setScrollLeft(cm, pos) }
  23702. else { setScrollTop(cm, pos) }
  23703. }, cm)
  23704. if (cm.display.scrollbars.addClass)
  23705. { addClass(cm.display.wrapper, cm.display.scrollbars.addClass) }
  23706. }
  23707. // SCROLLING THINGS INTO VIEW
  23708. // If an editor sits on the top or bottom of the window, partially
  23709. // scrolled out of view, this ensures that the cursor is visible.
  23710. function maybeScrollWindow(cm, coords) {
  23711. if (signalDOMEvent(cm, "scrollCursorIntoView")) { return }
  23712. var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null
  23713. if (coords.top + box.top < 0) { doScroll = true }
  23714. else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false }
  23715. if (doScroll != null && !phantom) {
  23716. var scrollNode = elt("div", "\u200b", null, ("position: absolute;\n top: " + (coords.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (coords.bottom - coords.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + (coords.left) + "px; width: 2px;"))
  23717. cm.display.lineSpace.appendChild(scrollNode)
  23718. scrollNode.scrollIntoView(doScroll)
  23719. cm.display.lineSpace.removeChild(scrollNode)
  23720. }
  23721. }
  23722. // Scroll a given position into view (immediately), verifying that
  23723. // it actually became visible (as line heights are accurately
  23724. // measured, the position of something may 'drift' during drawing).
  23725. function scrollPosIntoView(cm, pos, end, margin) {
  23726. if (margin == null) { margin = 0 }
  23727. var coords
  23728. for (var limit = 0; limit < 5; limit++) {
  23729. var changed = false
  23730. coords = cursorCoords(cm, pos)
  23731. var endCoords = !end || end == pos ? coords : cursorCoords(cm, end)
  23732. var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),
  23733. Math.min(coords.top, endCoords.top) - margin,
  23734. Math.max(coords.left, endCoords.left),
  23735. Math.max(coords.bottom, endCoords.bottom) + margin)
  23736. var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft
  23737. if (scrollPos.scrollTop != null) {
  23738. setScrollTop(cm, scrollPos.scrollTop)
  23739. if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true }
  23740. }
  23741. if (scrollPos.scrollLeft != null) {
  23742. setScrollLeft(cm, scrollPos.scrollLeft)
  23743. if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true }
  23744. }
  23745. if (!changed) { break }
  23746. }
  23747. return coords
  23748. }
  23749. // Scroll a given set of coordinates into view (immediately).
  23750. function scrollIntoView(cm, x1, y1, x2, y2) {
  23751. var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2)
  23752. if (scrollPos.scrollTop != null) { setScrollTop(cm, scrollPos.scrollTop) }
  23753. if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft) }
  23754. }
  23755. // Calculate a new scroll position needed to scroll the given
  23756. // rectangle into view. Returns an object with scrollTop and
  23757. // scrollLeft properties. When these are undefined, the
  23758. // vertical/horizontal position does not need to be adjusted.
  23759. function calculateScrollPos(cm, x1, y1, x2, y2) {
  23760. var display = cm.display, snapMargin = textHeight(cm.display)
  23761. if (y1 < 0) { y1 = 0 }
  23762. var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop
  23763. var screen = displayHeight(cm), result = {}
  23764. if (y2 - y1 > screen) { y2 = y1 + screen }
  23765. var docBottom = cm.doc.height + paddingVert(display)
  23766. var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin
  23767. if (y1 < screentop) {
  23768. result.scrollTop = atTop ? 0 : y1
  23769. } else if (y2 > screentop + screen) {
  23770. var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen)
  23771. if (newTop != screentop) { result.scrollTop = newTop }
  23772. }
  23773. var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft
  23774. var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0)
  23775. var tooWide = x2 - x1 > screenw
  23776. if (tooWide) { x2 = x1 + screenw }
  23777. if (x1 < 10)
  23778. { result.scrollLeft = 0 }
  23779. else if (x1 < screenleft)
  23780. { result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10)) }
  23781. else if (x2 > screenw + screenleft - 3)
  23782. { result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw }
  23783. return result
  23784. }
  23785. // Store a relative adjustment to the scroll position in the current
  23786. // operation (to be applied when the operation finishes).
  23787. function addToScrollPos(cm, left, top) {
  23788. if (left != null || top != null) { resolveScrollToPos(cm) }
  23789. if (left != null)
  23790. { cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left }
  23791. if (top != null)
  23792. { cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top }
  23793. }
  23794. // Make sure that at the end of the operation the current cursor is
  23795. // shown.
  23796. function ensureCursorVisible(cm) {
  23797. resolveScrollToPos(cm)
  23798. var cur = cm.getCursor(), from = cur, to = cur
  23799. if (!cm.options.lineWrapping) {
  23800. from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur
  23801. to = Pos(cur.line, cur.ch + 1)
  23802. }
  23803. cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true}
  23804. }
  23805. // When an operation has its scrollToPos property set, and another
  23806. // scroll action is applied before the end of the operation, this
  23807. // 'simulates' scrolling that position into view in a cheap way, so
  23808. // that the effect of intermediate scroll commands is not ignored.
  23809. function resolveScrollToPos(cm) {
  23810. var range = cm.curOp.scrollToPos
  23811. if (range) {
  23812. cm.curOp.scrollToPos = null
  23813. var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to)
  23814. var sPos = calculateScrollPos(cm, Math.min(from.left, to.left),
  23815. Math.min(from.top, to.top) - range.margin,
  23816. Math.max(from.right, to.right),
  23817. Math.max(from.bottom, to.bottom) + range.margin)
  23818. cm.scrollTo(sPos.scrollLeft, sPos.scrollTop)
  23819. }
  23820. }
  23821. // Operations are used to wrap a series of changes to the editor
  23822. // state in such a way that each change won't have to update the
  23823. // cursor and display (which would be awkward, slow, and
  23824. // error-prone). Instead, display updates are batched and then all
  23825. // combined and executed at once.
  23826. var nextOpId = 0
  23827. // Start a new operation.
  23828. function startOperation(cm) {
  23829. cm.curOp = {
  23830. cm: cm,
  23831. viewChanged: false, // Flag that indicates that lines might need to be redrawn
  23832. startHeight: cm.doc.height, // Used to detect need to update scrollbar
  23833. forceUpdate: false, // Used to force a redraw
  23834. updateInput: null, // Whether to reset the input textarea
  23835. typing: false, // Whether this reset should be careful to leave existing text (for compositing)
  23836. changeObjs: null, // Accumulated changes, for firing change events
  23837. cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on
  23838. cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already
  23839. selectionChanged: false, // Whether the selection needs to be redrawn
  23840. updateMaxLine: false, // Set when the widest line needs to be determined anew
  23841. scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet
  23842. scrollToPos: null, // Used to scroll to a specific position
  23843. focus: false,
  23844. id: ++nextOpId // Unique ID
  23845. }
  23846. pushOperation(cm.curOp)
  23847. }
  23848. // Finish an operation, updating the display and signalling delayed events
  23849. function endOperation(cm) {
  23850. var op = cm.curOp
  23851. finishOperation(op, function (group) {
  23852. for (var i = 0; i < group.ops.length; i++)
  23853. { group.ops[i].cm.curOp = null }
  23854. endOperations(group)
  23855. })
  23856. }
  23857. // The DOM updates done when an operation finishes are batched so
  23858. // that the minimum number of relayouts are required.
  23859. function endOperations(group) {
  23860. var ops = group.ops
  23861. for (var i = 0; i < ops.length; i++) // Read DOM
  23862. { endOperation_R1(ops[i]) }
  23863. for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)
  23864. { endOperation_W1(ops[i$1]) }
  23865. for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM
  23866. { endOperation_R2(ops[i$2]) }
  23867. for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)
  23868. { endOperation_W2(ops[i$3]) }
  23869. for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM
  23870. { endOperation_finish(ops[i$4]) }
  23871. }
  23872. function endOperation_R1(op) {
  23873. var cm = op.cm, display = cm.display
  23874. maybeClipScrollbars(cm)
  23875. if (op.updateMaxLine) { findMaxLine(cm) }
  23876. op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||
  23877. op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||
  23878. op.scrollToPos.to.line >= display.viewTo) ||
  23879. display.maxLineChanged && cm.options.lineWrapping
  23880. op.update = op.mustUpdate &&
  23881. new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate)
  23882. }
  23883. function endOperation_W1(op) {
  23884. op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update)
  23885. }
  23886. function endOperation_R2(op) {
  23887. var cm = op.cm, display = cm.display
  23888. if (op.updatedDisplay) { updateHeightsInViewport(cm) }
  23889. op.barMeasure = measureForScrollbars(cm)
  23890. // If the max line changed since it was last measured, measure it,
  23891. // and ensure the document's width matches it.
  23892. // updateDisplay_W2 will use these properties to do the actual resizing
  23893. if (display.maxLineChanged && !cm.options.lineWrapping) {
  23894. op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3
  23895. cm.display.sizerWidth = op.adjustWidthTo
  23896. op.barMeasure.scrollWidth =
  23897. Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth)
  23898. op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm))
  23899. }
  23900. if (op.updatedDisplay || op.selectionChanged)
  23901. { op.preparedSelection = display.input.prepareSelection(op.focus) }
  23902. }
  23903. function endOperation_W2(op) {
  23904. var cm = op.cm
  23905. if (op.adjustWidthTo != null) {
  23906. cm.display.sizer.style.minWidth = op.adjustWidthTo + "px"
  23907. if (op.maxScrollLeft < cm.doc.scrollLeft)
  23908. { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true) }
  23909. cm.display.maxLineChanged = false
  23910. }
  23911. var takeFocus = op.focus && op.focus == activeElt() && (!document.hasFocus || document.hasFocus())
  23912. if (op.preparedSelection)
  23913. { cm.display.input.showSelection(op.preparedSelection, takeFocus) }
  23914. if (op.updatedDisplay || op.startHeight != cm.doc.height)
  23915. { updateScrollbars(cm, op.barMeasure) }
  23916. if (op.updatedDisplay)
  23917. { setDocumentHeight(cm, op.barMeasure) }
  23918. if (op.selectionChanged) { restartBlink(cm) }
  23919. if (cm.state.focused && op.updateInput)
  23920. { cm.display.input.reset(op.typing) }
  23921. if (takeFocus) { ensureFocus(op.cm) }
  23922. }
  23923. function endOperation_finish(op) {
  23924. var cm = op.cm, display = cm.display, doc = cm.doc
  23925. if (op.updatedDisplay) { postUpdateDisplay(cm, op.update) }
  23926. // Abort mouse wheel delta measurement, when scrolling explicitly
  23927. if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))
  23928. { display.wheelStartX = display.wheelStartY = null }
  23929. // Propagate the scroll position to the actual DOM scroller
  23930. if (op.scrollTop != null && (display.scroller.scrollTop != op.scrollTop || op.forceScroll)) {
  23931. doc.scrollTop = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop))
  23932. display.scrollbars.setScrollTop(doc.scrollTop)
  23933. display.scroller.scrollTop = doc.scrollTop
  23934. }
  23935. if (op.scrollLeft != null && (display.scroller.scrollLeft != op.scrollLeft || op.forceScroll)) {
  23936. doc.scrollLeft = Math.max(0, Math.min(display.scroller.scrollWidth - display.scroller.clientWidth, op.scrollLeft))
  23937. display.scrollbars.setScrollLeft(doc.scrollLeft)
  23938. display.scroller.scrollLeft = doc.scrollLeft
  23939. alignHorizontally(cm)
  23940. }
  23941. // If we need to scroll a specific position into view, do so.
  23942. if (op.scrollToPos) {
  23943. var coords = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),
  23944. clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin)
  23945. if (op.scrollToPos.isCursor && cm.state.focused) { maybeScrollWindow(cm, coords) }
  23946. }
  23947. // Fire events for markers that are hidden/unidden by editing or
  23948. // undoing
  23949. var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers
  23950. if (hidden) { for (var i = 0; i < hidden.length; ++i)
  23951. { if (!hidden[i].lines.length) { signal(hidden[i], "hide") } } }
  23952. if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)
  23953. { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], "unhide") } } }
  23954. if (display.wrapper.offsetHeight)
  23955. { doc.scrollTop = cm.display.scroller.scrollTop }
  23956. // Fire change events, and delayed event handlers
  23957. if (op.changeObjs)
  23958. { signal(cm, "changes", cm, op.changeObjs) }
  23959. if (op.update)
  23960. { op.update.finish() }
  23961. }
  23962. // Run the given function in an operation
  23963. function runInOp(cm, f) {
  23964. if (cm.curOp) { return f() }
  23965. startOperation(cm)
  23966. try { return f() }
  23967. finally { endOperation(cm) }
  23968. }
  23969. // Wraps a function in an operation. Returns the wrapped function.
  23970. function operation(cm, f) {
  23971. return function() {
  23972. if (cm.curOp) { return f.apply(cm, arguments) }
  23973. startOperation(cm)
  23974. try { return f.apply(cm, arguments) }
  23975. finally { endOperation(cm) }
  23976. }
  23977. }
  23978. // Used to add methods to editor and doc instances, wrapping them in
  23979. // operations.
  23980. function methodOp(f) {
  23981. return function() {
  23982. if (this.curOp) { return f.apply(this, arguments) }
  23983. startOperation(this)
  23984. try { return f.apply(this, arguments) }
  23985. finally { endOperation(this) }
  23986. }
  23987. }
  23988. function docMethodOp(f) {
  23989. return function() {
  23990. var cm = this.cm
  23991. if (!cm || cm.curOp) { return f.apply(this, arguments) }
  23992. startOperation(cm)
  23993. try { return f.apply(this, arguments) }
  23994. finally { endOperation(cm) }
  23995. }
  23996. }
  23997. // Updates the display.view data structure for a given change to the
  23998. // document. From and to are in pre-change coordinates. Lendiff is
  23999. // the amount of lines added or subtracted by the change. This is
  24000. // used for changes that span multiple lines, or change the way
  24001. // lines are divided into visual lines. regLineChange (below)
  24002. // registers single-line changes.
  24003. function regChange(cm, from, to, lendiff) {
  24004. if (from == null) { from = cm.doc.first }
  24005. if (to == null) { to = cm.doc.first + cm.doc.size }
  24006. if (!lendiff) { lendiff = 0 }
  24007. var display = cm.display
  24008. if (lendiff && to < display.viewTo &&
  24009. (display.updateLineNumbers == null || display.updateLineNumbers > from))
  24010. { display.updateLineNumbers = from }
  24011. cm.curOp.viewChanged = true
  24012. if (from >= display.viewTo) { // Change after
  24013. if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)
  24014. { resetView(cm) }
  24015. } else if (to <= display.viewFrom) { // Change before
  24016. if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {
  24017. resetView(cm)
  24018. } else {
  24019. display.viewFrom += lendiff
  24020. display.viewTo += lendiff
  24021. }
  24022. } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap
  24023. resetView(cm)
  24024. } else if (from <= display.viewFrom) { // Top overlap
  24025. var cut = viewCuttingPoint(cm, to, to + lendiff, 1)
  24026. if (cut) {
  24027. display.view = display.view.slice(cut.index)
  24028. display.viewFrom = cut.lineN
  24029. display.viewTo += lendiff
  24030. } else {
  24031. resetView(cm)
  24032. }
  24033. } else if (to >= display.viewTo) { // Bottom overlap
  24034. var cut$1 = viewCuttingPoint(cm, from, from, -1)
  24035. if (cut$1) {
  24036. display.view = display.view.slice(0, cut$1.index)
  24037. display.viewTo = cut$1.lineN
  24038. } else {
  24039. resetView(cm)
  24040. }
  24041. } else { // Gap in the middle
  24042. var cutTop = viewCuttingPoint(cm, from, from, -1)
  24043. var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1)
  24044. if (cutTop && cutBot) {
  24045. display.view = display.view.slice(0, cutTop.index)
  24046. .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))
  24047. .concat(display.view.slice(cutBot.index))
  24048. display.viewTo += lendiff
  24049. } else {
  24050. resetView(cm)
  24051. }
  24052. }
  24053. var ext = display.externalMeasured
  24054. if (ext) {
  24055. if (to < ext.lineN)
  24056. { ext.lineN += lendiff }
  24057. else if (from < ext.lineN + ext.size)
  24058. { display.externalMeasured = null }
  24059. }
  24060. }
  24061. // Register a change to a single line. Type must be one of "text",
  24062. // "gutter", "class", "widget"
  24063. function regLineChange(cm, line, type) {
  24064. cm.curOp.viewChanged = true
  24065. var display = cm.display, ext = cm.display.externalMeasured
  24066. if (ext && line >= ext.lineN && line < ext.lineN + ext.size)
  24067. { display.externalMeasured = null }
  24068. if (line < display.viewFrom || line >= display.viewTo) { return }
  24069. var lineView = display.view[findViewIndex(cm, line)]
  24070. if (lineView.node == null) { return }
  24071. var arr = lineView.changes || (lineView.changes = [])
  24072. if (indexOf(arr, type) == -1) { arr.push(type) }
  24073. }
  24074. // Clear the view.
  24075. function resetView(cm) {
  24076. cm.display.viewFrom = cm.display.viewTo = cm.doc.first
  24077. cm.display.view = []
  24078. cm.display.viewOffset = 0
  24079. }
  24080. function viewCuttingPoint(cm, oldN, newN, dir) {
  24081. var index = findViewIndex(cm, oldN), diff, view = cm.display.view
  24082. if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)
  24083. { return {index: index, lineN: newN} }
  24084. var n = cm.display.viewFrom
  24085. for (var i = 0; i < index; i++)
  24086. { n += view[i].size }
  24087. if (n != oldN) {
  24088. if (dir > 0) {
  24089. if (index == view.length - 1) { return null }
  24090. diff = (n + view[index].size) - oldN
  24091. index++
  24092. } else {
  24093. diff = n - oldN
  24094. }
  24095. oldN += diff; newN += diff
  24096. }
  24097. while (visualLineNo(cm.doc, newN) != newN) {
  24098. if (index == (dir < 0 ? 0 : view.length - 1)) { return null }
  24099. newN += dir * view[index - (dir < 0 ? 1 : 0)].size
  24100. index += dir
  24101. }
  24102. return {index: index, lineN: newN}
  24103. }
  24104. // Force the view to cover a given range, adding empty view element
  24105. // or clipping off existing ones as needed.
  24106. function adjustView(cm, from, to) {
  24107. var display = cm.display, view = display.view
  24108. if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {
  24109. display.view = buildViewArray(cm, from, to)
  24110. display.viewFrom = from
  24111. } else {
  24112. if (display.viewFrom > from)
  24113. { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view) }
  24114. else if (display.viewFrom < from)
  24115. { display.view = display.view.slice(findViewIndex(cm, from)) }
  24116. display.viewFrom = from
  24117. if (display.viewTo < to)
  24118. { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)) }
  24119. else if (display.viewTo > to)
  24120. { display.view = display.view.slice(0, findViewIndex(cm, to)) }
  24121. }
  24122. display.viewTo = to
  24123. }
  24124. // Count the number of lines in the view whose DOM representation is
  24125. // out of date (or nonexistent).
  24126. function countDirtyView(cm) {
  24127. var view = cm.display.view, dirty = 0
  24128. for (var i = 0; i < view.length; i++) {
  24129. var lineView = view[i]
  24130. if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty }
  24131. }
  24132. return dirty
  24133. }
  24134. // HIGHLIGHT WORKER
  24135. function startWorker(cm, time) {
  24136. if (cm.doc.mode.startState && cm.doc.frontier < cm.display.viewTo)
  24137. { cm.state.highlight.set(time, bind(highlightWorker, cm)) }
  24138. }
  24139. function highlightWorker(cm) {
  24140. var doc = cm.doc
  24141. if (doc.frontier < doc.first) { doc.frontier = doc.first }
  24142. if (doc.frontier >= cm.display.viewTo) { return }
  24143. var end = +new Date + cm.options.workTime
  24144. var state = copyState(doc.mode, getStateBefore(cm, doc.frontier))
  24145. var changedLines = []
  24146. doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {
  24147. if (doc.frontier >= cm.display.viewFrom) { // Visible
  24148. var oldStyles = line.styles, tooLong = line.text.length > cm.options.maxHighlightLength
  24149. var highlighted = highlightLine(cm, line, tooLong ? copyState(doc.mode, state) : state, true)
  24150. line.styles = highlighted.styles
  24151. var oldCls = line.styleClasses, newCls = highlighted.classes
  24152. if (newCls) { line.styleClasses = newCls }
  24153. else if (oldCls) { line.styleClasses = null }
  24154. var ischange = !oldStyles || oldStyles.length != line.styles.length ||
  24155. oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass)
  24156. for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i] }
  24157. if (ischange) { changedLines.push(doc.frontier) }
  24158. line.stateAfter = tooLong ? state : copyState(doc.mode, state)
  24159. } else {
  24160. if (line.text.length <= cm.options.maxHighlightLength)
  24161. { processLine(cm, line.text, state) }
  24162. line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null
  24163. }
  24164. ++doc.frontier
  24165. if (+new Date > end) {
  24166. startWorker(cm, cm.options.workDelay)
  24167. return true
  24168. }
  24169. })
  24170. if (changedLines.length) { runInOp(cm, function () {
  24171. for (var i = 0; i < changedLines.length; i++)
  24172. { regLineChange(cm, changedLines[i], "text") }
  24173. }) }
  24174. }
  24175. // DISPLAY DRAWING
  24176. var DisplayUpdate = function(cm, viewport, force) {
  24177. var display = cm.display
  24178. this.viewport = viewport
  24179. // Store some values that we'll need later (but don't want to force a relayout for)
  24180. this.visible = visibleLines(display, cm.doc, viewport)
  24181. this.editorIsHidden = !display.wrapper.offsetWidth
  24182. this.wrapperHeight = display.wrapper.clientHeight
  24183. this.wrapperWidth = display.wrapper.clientWidth
  24184. this.oldDisplayWidth = displayWidth(cm)
  24185. this.force = force
  24186. this.dims = getDimensions(cm)
  24187. this.events = []
  24188. };
  24189. DisplayUpdate.prototype.signal = function (emitter, type) {
  24190. if (hasHandler(emitter, type))
  24191. { this.events.push(arguments) }
  24192. };
  24193. DisplayUpdate.prototype.finish = function () {
  24194. var this$1 = this;
  24195. for (var i = 0; i < this.events.length; i++)
  24196. { signal.apply(null, this$1.events[i]) }
  24197. };
  24198. function maybeClipScrollbars(cm) {
  24199. var display = cm.display
  24200. if (!display.scrollbarsClipped && display.scroller.offsetWidth) {
  24201. display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth
  24202. display.heightForcer.style.height = scrollGap(cm) + "px"
  24203. display.sizer.style.marginBottom = -display.nativeBarWidth + "px"
  24204. display.sizer.style.borderRightWidth = scrollGap(cm) + "px"
  24205. display.scrollbarsClipped = true
  24206. }
  24207. }
  24208. // Does the actual updating of the line display. Bails out
  24209. // (returning false) when there is nothing to be done and forced is
  24210. // false.
  24211. function updateDisplayIfNeeded(cm, update) {
  24212. var display = cm.display, doc = cm.doc
  24213. if (update.editorIsHidden) {
  24214. resetView(cm)
  24215. return false
  24216. }
  24217. // Bail out if the visible area is already rendered and nothing changed.
  24218. if (!update.force &&
  24219. update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&
  24220. (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&
  24221. display.renderedView == display.view && countDirtyView(cm) == 0)
  24222. { return false }
  24223. if (maybeUpdateLineNumberWidth(cm)) {
  24224. resetView(cm)
  24225. update.dims = getDimensions(cm)
  24226. }
  24227. // Compute a suitable new viewport (from & to)
  24228. var end = doc.first + doc.size
  24229. var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first)
  24230. var to = Math.min(end, update.visible.to + cm.options.viewportMargin)
  24231. if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom) }
  24232. if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo) }
  24233. if (sawCollapsedSpans) {
  24234. from = visualLineNo(cm.doc, from)
  24235. to = visualLineEndNo(cm.doc, to)
  24236. }
  24237. var different = from != display.viewFrom || to != display.viewTo ||
  24238. display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth
  24239. adjustView(cm, from, to)
  24240. display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom))
  24241. // Position the mover div to align with the current scroll position
  24242. cm.display.mover.style.top = display.viewOffset + "px"
  24243. var toUpdate = countDirtyView(cm)
  24244. if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&
  24245. (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))
  24246. { return false }
  24247. // For big changes, we hide the enclosing element during the
  24248. // update, since that speeds up the operations on most browsers.
  24249. var focused = activeElt()
  24250. if (toUpdate > 4) { display.lineDiv.style.display = "none" }
  24251. patchDisplay(cm, display.updateLineNumbers, update.dims)
  24252. if (toUpdate > 4) { display.lineDiv.style.display = "" }
  24253. display.renderedView = display.view
  24254. // There might have been a widget with a focused element that got
  24255. // hidden or updated, if so re-focus it.
  24256. if (focused && activeElt() != focused && focused.offsetHeight) { focused.focus() }
  24257. // Prevent selection and cursors from interfering with the scroll
  24258. // width and height.
  24259. removeChildren(display.cursorDiv)
  24260. removeChildren(display.selectionDiv)
  24261. display.gutters.style.height = display.sizer.style.minHeight = 0
  24262. if (different) {
  24263. display.lastWrapHeight = update.wrapperHeight
  24264. display.lastWrapWidth = update.wrapperWidth
  24265. startWorker(cm, 400)
  24266. }
  24267. display.updateLineNumbers = null
  24268. return true
  24269. }
  24270. function postUpdateDisplay(cm, update) {
  24271. var viewport = update.viewport
  24272. for (var first = true;; first = false) {
  24273. if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {
  24274. // Clip forced viewport to actual scrollable area.
  24275. if (viewport && viewport.top != null)
  24276. { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)} }
  24277. // Updated line heights might result in the drawn area not
  24278. // actually covering the viewport. Keep looping until it does.
  24279. update.visible = visibleLines(cm.display, cm.doc, viewport)
  24280. if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)
  24281. { break }
  24282. }
  24283. if (!updateDisplayIfNeeded(cm, update)) { break }
  24284. updateHeightsInViewport(cm)
  24285. var barMeasure = measureForScrollbars(cm)
  24286. updateSelection(cm)
  24287. updateScrollbars(cm, barMeasure)
  24288. setDocumentHeight(cm, barMeasure)
  24289. }
  24290. update.signal(cm, "update", cm)
  24291. if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {
  24292. update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo)
  24293. cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo
  24294. }
  24295. }
  24296. function updateDisplaySimple(cm, viewport) {
  24297. var update = new DisplayUpdate(cm, viewport)
  24298. if (updateDisplayIfNeeded(cm, update)) {
  24299. updateHeightsInViewport(cm)
  24300. postUpdateDisplay(cm, update)
  24301. var barMeasure = measureForScrollbars(cm)
  24302. updateSelection(cm)
  24303. updateScrollbars(cm, barMeasure)
  24304. setDocumentHeight(cm, barMeasure)
  24305. update.finish()
  24306. }
  24307. }
  24308. // Sync the actual display DOM structure with display.view, removing
  24309. // nodes for lines that are no longer in view, and creating the ones
  24310. // that are not there yet, and updating the ones that are out of
  24311. // date.
  24312. function patchDisplay(cm, updateNumbersFrom, dims) {
  24313. var display = cm.display, lineNumbers = cm.options.lineNumbers
  24314. var container = display.lineDiv, cur = container.firstChild
  24315. function rm(node) {
  24316. var next = node.nextSibling
  24317. // Works around a throw-scroll bug in OS X Webkit
  24318. if (webkit && mac && cm.display.currentWheelTarget == node)
  24319. { node.style.display = "none" }
  24320. else
  24321. { node.parentNode.removeChild(node) }
  24322. return next
  24323. }
  24324. var view = display.view, lineN = display.viewFrom
  24325. // Loop over the elements in the view, syncing cur (the DOM nodes
  24326. // in display.lineDiv) with the view as we go.
  24327. for (var i = 0; i < view.length; i++) {
  24328. var lineView = view[i]
  24329. if (lineView.hidden) {
  24330. } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet
  24331. var node = buildLineElement(cm, lineView, lineN, dims)
  24332. container.insertBefore(node, cur)
  24333. } else { // Already drawn
  24334. while (cur != lineView.node) { cur = rm(cur) }
  24335. var updateNumber = lineNumbers && updateNumbersFrom != null &&
  24336. updateNumbersFrom <= lineN && lineView.lineNumber
  24337. if (lineView.changes) {
  24338. if (indexOf(lineView.changes, "gutter") > -1) { updateNumber = false }
  24339. updateLineForChanges(cm, lineView, lineN, dims)
  24340. }
  24341. if (updateNumber) {
  24342. removeChildren(lineView.lineNumber)
  24343. lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)))
  24344. }
  24345. cur = lineView.node.nextSibling
  24346. }
  24347. lineN += lineView.size
  24348. }
  24349. while (cur) { cur = rm(cur) }
  24350. }
  24351. function updateGutterSpace(cm) {
  24352. var width = cm.display.gutters.offsetWidth
  24353. cm.display.sizer.style.marginLeft = width + "px"
  24354. }
  24355. function setDocumentHeight(cm, measure) {
  24356. cm.display.sizer.style.minHeight = measure.docHeight + "px"
  24357. cm.display.heightForcer.style.top = measure.docHeight + "px"
  24358. cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + "px"
  24359. }
  24360. // Rebuild the gutter elements, ensure the margin to the left of the
  24361. // code matches their width.
  24362. function updateGutters(cm) {
  24363. var gutters = cm.display.gutters, specs = cm.options.gutters
  24364. removeChildren(gutters)
  24365. var i = 0
  24366. for (; i < specs.length; ++i) {
  24367. var gutterClass = specs[i]
  24368. var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass))
  24369. if (gutterClass == "CodeMirror-linenumbers") {
  24370. cm.display.lineGutter = gElt
  24371. gElt.style.width = (cm.display.lineNumWidth || 1) + "px"
  24372. }
  24373. }
  24374. gutters.style.display = i ? "" : "none"
  24375. updateGutterSpace(cm)
  24376. }
  24377. // Make sure the gutters options contains the element
  24378. // "CodeMirror-linenumbers" when the lineNumbers option is true.
  24379. function setGuttersForLineNumbers(options) {
  24380. var found = indexOf(options.gutters, "CodeMirror-linenumbers")
  24381. if (found == -1 && options.lineNumbers) {
  24382. options.gutters = options.gutters.concat(["CodeMirror-linenumbers"])
  24383. } else if (found > -1 && !options.lineNumbers) {
  24384. options.gutters = options.gutters.slice(0)
  24385. options.gutters.splice(found, 1)
  24386. }
  24387. }
  24388. // Selection objects are immutable. A new one is created every time
  24389. // the selection changes. A selection is one or more non-overlapping
  24390. // (and non-touching) ranges, sorted, and an integer that indicates
  24391. // which one is the primary selection (the one that's scrolled into
  24392. // view, that getCursor returns, etc).
  24393. function Selection(ranges, primIndex) {
  24394. this.ranges = ranges
  24395. this.primIndex = primIndex
  24396. }
  24397. Selection.prototype = {
  24398. primary: function() { return this.ranges[this.primIndex] },
  24399. equals: function(other) {
  24400. var this$1 = this;
  24401. if (other == this) { return true }
  24402. if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }
  24403. for (var i = 0; i < this.ranges.length; i++) {
  24404. var here = this$1.ranges[i], there = other.ranges[i]
  24405. if (cmp(here.anchor, there.anchor) != 0 || cmp(here.head, there.head) != 0) { return false }
  24406. }
  24407. return true
  24408. },
  24409. deepCopy: function() {
  24410. var this$1 = this;
  24411. var out = []
  24412. for (var i = 0; i < this.ranges.length; i++)
  24413. { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)) }
  24414. return new Selection(out, this.primIndex)
  24415. },
  24416. somethingSelected: function() {
  24417. var this$1 = this;
  24418. for (var i = 0; i < this.ranges.length; i++)
  24419. { if (!this$1.ranges[i].empty()) { return true } }
  24420. return false
  24421. },
  24422. contains: function(pos, end) {
  24423. var this$1 = this;
  24424. if (!end) { end = pos }
  24425. for (var i = 0; i < this.ranges.length; i++) {
  24426. var range = this$1.ranges[i]
  24427. if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)
  24428. { return i }
  24429. }
  24430. return -1
  24431. }
  24432. }
  24433. function Range(anchor, head) {
  24434. this.anchor = anchor; this.head = head
  24435. }
  24436. Range.prototype = {
  24437. from: function() { return minPos(this.anchor, this.head) },
  24438. to: function() { return maxPos(this.anchor, this.head) },
  24439. empty: function() {
  24440. return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch
  24441. }
  24442. }
  24443. // Take an unsorted, potentially overlapping set of ranges, and
  24444. // build a selection out of it. 'Consumes' ranges array (modifying
  24445. // it).
  24446. function normalizeSelection(ranges, primIndex) {
  24447. var prim = ranges[primIndex]
  24448. ranges.sort(function (a, b) { return cmp(a.from(), b.from()); })
  24449. primIndex = indexOf(ranges, prim)
  24450. for (var i = 1; i < ranges.length; i++) {
  24451. var cur = ranges[i], prev = ranges[i - 1]
  24452. if (cmp(prev.to(), cur.from()) >= 0) {
  24453. var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to())
  24454. var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head
  24455. if (i <= primIndex) { --primIndex }
  24456. ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to))
  24457. }
  24458. }
  24459. return new Selection(ranges, primIndex)
  24460. }
  24461. function simpleSelection(anchor, head) {
  24462. return new Selection([new Range(anchor, head || anchor)], 0)
  24463. }
  24464. // Compute the position of the end of a change (its 'to' property
  24465. // refers to the pre-change end).
  24466. function changeEnd(change) {
  24467. if (!change.text) { return change.to }
  24468. return Pos(change.from.line + change.text.length - 1,
  24469. lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))
  24470. }
  24471. // Adjust a position to refer to the post-change position of the
  24472. // same text, or the end of the change if the change covers it.
  24473. function adjustForChange(pos, change) {
  24474. if (cmp(pos, change.from) < 0) { return pos }
  24475. if (cmp(pos, change.to) <= 0) { return changeEnd(change) }
  24476. var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch
  24477. if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch }
  24478. return Pos(line, ch)
  24479. }
  24480. function computeSelAfterChange(doc, change) {
  24481. var out = []
  24482. for (var i = 0; i < doc.sel.ranges.length; i++) {
  24483. var range = doc.sel.ranges[i]
  24484. out.push(new Range(adjustForChange(range.anchor, change),
  24485. adjustForChange(range.head, change)))
  24486. }
  24487. return normalizeSelection(out, doc.sel.primIndex)
  24488. }
  24489. function offsetPos(pos, old, nw) {
  24490. if (pos.line == old.line)
  24491. { return Pos(nw.line, pos.ch - old.ch + nw.ch) }
  24492. else
  24493. { return Pos(nw.line + (pos.line - old.line), pos.ch) }
  24494. }
  24495. // Used by replaceSelections to allow moving the selection to the
  24496. // start or around the replaced test. Hint may be "start" or "around".
  24497. function computeReplacedSel(doc, changes, hint) {
  24498. var out = []
  24499. var oldPrev = Pos(doc.first, 0), newPrev = oldPrev
  24500. for (var i = 0; i < changes.length; i++) {
  24501. var change = changes[i]
  24502. var from = offsetPos(change.from, oldPrev, newPrev)
  24503. var to = offsetPos(changeEnd(change), oldPrev, newPrev)
  24504. oldPrev = change.to
  24505. newPrev = to
  24506. if (hint == "around") {
  24507. var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0
  24508. out[i] = new Range(inv ? to : from, inv ? from : to)
  24509. } else {
  24510. out[i] = new Range(from, from)
  24511. }
  24512. }
  24513. return new Selection(out, doc.sel.primIndex)
  24514. }
  24515. // Used to get the editor into a consistent state again when options change.
  24516. function loadMode(cm) {
  24517. cm.doc.mode = getMode(cm.options, cm.doc.modeOption)
  24518. resetModeState(cm)
  24519. }
  24520. function resetModeState(cm) {
  24521. cm.doc.iter(function (line) {
  24522. if (line.stateAfter) { line.stateAfter = null }
  24523. if (line.styles) { line.styles = null }
  24524. })
  24525. cm.doc.frontier = cm.doc.first
  24526. startWorker(cm, 100)
  24527. cm.state.modeGen++
  24528. if (cm.curOp) { regChange(cm) }
  24529. }
  24530. // DOCUMENT DATA STRUCTURE
  24531. // By default, updates that start and end at the beginning of a line
  24532. // are treated specially, in order to make the association of line
  24533. // widgets and marker elements with the text behave more intuitive.
  24534. function isWholeLineUpdate(doc, change) {
  24535. return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" &&
  24536. (!doc.cm || doc.cm.options.wholeLineUpdateBefore)
  24537. }
  24538. // Perform a change on the document data structure.
  24539. function updateDoc(doc, change, markedSpans, estimateHeight) {
  24540. function spansFor(n) {return markedSpans ? markedSpans[n] : null}
  24541. function update(line, text, spans) {
  24542. updateLine(line, text, spans, estimateHeight)
  24543. signalLater(line, "change", line, change)
  24544. }
  24545. function linesFor(start, end) {
  24546. var result = []
  24547. for (var i = start; i < end; ++i)
  24548. { result.push(new Line(text[i], spansFor(i), estimateHeight)) }
  24549. return result
  24550. }
  24551. var from = change.from, to = change.to, text = change.text
  24552. var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line)
  24553. var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line
  24554. // Adjust the line structure
  24555. if (change.full) {
  24556. doc.insert(0, linesFor(0, text.length))
  24557. doc.remove(text.length, doc.size - text.length)
  24558. } else if (isWholeLineUpdate(doc, change)) {
  24559. // This is a whole-line replace. Treated specially to make
  24560. // sure line objects move the way they are supposed to.
  24561. var added = linesFor(0, text.length - 1)
  24562. update(lastLine, lastLine.text, lastSpans)
  24563. if (nlines) { doc.remove(from.line, nlines) }
  24564. if (added.length) { doc.insert(from.line, added) }
  24565. } else if (firstLine == lastLine) {
  24566. if (text.length == 1) {
  24567. update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans)
  24568. } else {
  24569. var added$1 = linesFor(1, text.length - 1)
  24570. added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight))
  24571. update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0))
  24572. doc.insert(from.line + 1, added$1)
  24573. }
  24574. } else if (text.length == 1) {
  24575. update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0))
  24576. doc.remove(from.line + 1, nlines)
  24577. } else {
  24578. update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0))
  24579. update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans)
  24580. var added$2 = linesFor(1, text.length - 1)
  24581. if (nlines > 1) { doc.remove(from.line + 1, nlines - 1) }
  24582. doc.insert(from.line + 1, added$2)
  24583. }
  24584. signalLater(doc, "change", doc, change)
  24585. }
  24586. // Call f for all linked documents.
  24587. function linkedDocs(doc, f, sharedHistOnly) {
  24588. function propagate(doc, skip, sharedHist) {
  24589. if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {
  24590. var rel = doc.linked[i]
  24591. if (rel.doc == skip) { continue }
  24592. var shared = sharedHist && rel.sharedHist
  24593. if (sharedHistOnly && !shared) { continue }
  24594. f(rel.doc, shared)
  24595. propagate(rel.doc, doc, shared)
  24596. } }
  24597. }
  24598. propagate(doc, null, true)
  24599. }
  24600. // Attach a document to an editor.
  24601. function attachDoc(cm, doc) {
  24602. if (doc.cm) { throw new Error("This document is already in use.") }
  24603. cm.doc = doc
  24604. doc.cm = cm
  24605. estimateLineHeights(cm)
  24606. loadMode(cm)
  24607. if (!cm.options.lineWrapping) { findMaxLine(cm) }
  24608. cm.options.mode = doc.modeOption
  24609. regChange(cm)
  24610. }
  24611. function History(startGen) {
  24612. // Arrays of change events and selections. Doing something adds an
  24613. // event to done and clears undo. Undoing moves events from done
  24614. // to undone, redoing moves them in the other direction.
  24615. this.done = []; this.undone = []
  24616. this.undoDepth = Infinity
  24617. // Used to track when changes can be merged into a single undo
  24618. // event
  24619. this.lastModTime = this.lastSelTime = 0
  24620. this.lastOp = this.lastSelOp = null
  24621. this.lastOrigin = this.lastSelOrigin = null
  24622. // Used by the isClean() method
  24623. this.generation = this.maxGeneration = startGen || 1
  24624. }
  24625. // Create a history change event from an updateDoc-style change
  24626. // object.
  24627. function historyChangeFromChange(doc, change) {
  24628. var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}
  24629. attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1)
  24630. linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true)
  24631. return histChange
  24632. }
  24633. // Pop all selection events off the end of a history array. Stop at
  24634. // a change event.
  24635. function clearSelectionEvents(array) {
  24636. while (array.length) {
  24637. var last = lst(array)
  24638. if (last.ranges) { array.pop() }
  24639. else { break }
  24640. }
  24641. }
  24642. // Find the top change event in the history. Pop off selection
  24643. // events that are in the way.
  24644. function lastChangeEvent(hist, force) {
  24645. if (force) {
  24646. clearSelectionEvents(hist.done)
  24647. return lst(hist.done)
  24648. } else if (hist.done.length && !lst(hist.done).ranges) {
  24649. return lst(hist.done)
  24650. } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {
  24651. hist.done.pop()
  24652. return lst(hist.done)
  24653. }
  24654. }
  24655. // Register a change in the history. Merges changes that are within
  24656. // a single operation, or are close together with an origin that
  24657. // allows merging (starting with "+") into a single event.
  24658. function addChangeToHistory(doc, change, selAfter, opId) {
  24659. var hist = doc.history
  24660. hist.undone.length = 0
  24661. var time = +new Date, cur
  24662. var last
  24663. if ((hist.lastOp == opId ||
  24664. hist.lastOrigin == change.origin && change.origin &&
  24665. ((change.origin.charAt(0) == "+" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) ||
  24666. change.origin.charAt(0) == "*")) &&
  24667. (cur = lastChangeEvent(hist, hist.lastOp == opId))) {
  24668. // Merge this change into the last event
  24669. last = lst(cur.changes)
  24670. if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {
  24671. // Optimized case for simple insertion -- don't want to add
  24672. // new changesets for every character typed
  24673. last.to = changeEnd(change)
  24674. } else {
  24675. // Add new sub-event
  24676. cur.changes.push(historyChangeFromChange(doc, change))
  24677. }
  24678. } else {
  24679. // Can not be merged, start a new event.
  24680. var before = lst(hist.done)
  24681. if (!before || !before.ranges)
  24682. { pushSelectionToHistory(doc.sel, hist.done) }
  24683. cur = {changes: [historyChangeFromChange(doc, change)],
  24684. generation: hist.generation}
  24685. hist.done.push(cur)
  24686. while (hist.done.length > hist.undoDepth) {
  24687. hist.done.shift()
  24688. if (!hist.done[0].ranges) { hist.done.shift() }
  24689. }
  24690. }
  24691. hist.done.push(selAfter)
  24692. hist.generation = ++hist.maxGeneration
  24693. hist.lastModTime = hist.lastSelTime = time
  24694. hist.lastOp = hist.lastSelOp = opId
  24695. hist.lastOrigin = hist.lastSelOrigin = change.origin
  24696. if (!last) { signal(doc, "historyAdded") }
  24697. }
  24698. function selectionEventCanBeMerged(doc, origin, prev, sel) {
  24699. var ch = origin.charAt(0)
  24700. return ch == "*" ||
  24701. ch == "+" &&
  24702. prev.ranges.length == sel.ranges.length &&
  24703. prev.somethingSelected() == sel.somethingSelected() &&
  24704. new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)
  24705. }
  24706. // Called whenever the selection changes, sets the new selection as
  24707. // the pending selection in the history, and pushes the old pending
  24708. // selection into the 'done' array when it was significantly
  24709. // different (in number of selected ranges, emptiness, or time).
  24710. function addSelectionToHistory(doc, sel, opId, options) {
  24711. var hist = doc.history, origin = options && options.origin
  24712. // A new event is started when the previous origin does not match
  24713. // the current, or the origins don't allow matching. Origins
  24714. // starting with * are always merged, those starting with + are
  24715. // merged when similar and close together in time.
  24716. if (opId == hist.lastSelOp ||
  24717. (origin && hist.lastSelOrigin == origin &&
  24718. (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||
  24719. selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))
  24720. { hist.done[hist.done.length - 1] = sel }
  24721. else
  24722. { pushSelectionToHistory(sel, hist.done) }
  24723. hist.lastSelTime = +new Date
  24724. hist.lastSelOrigin = origin
  24725. hist.lastSelOp = opId
  24726. if (options && options.clearRedo !== false)
  24727. { clearSelectionEvents(hist.undone) }
  24728. }
  24729. function pushSelectionToHistory(sel, dest) {
  24730. var top = lst(dest)
  24731. if (!(top && top.ranges && top.equals(sel)))
  24732. { dest.push(sel) }
  24733. }
  24734. // Used to store marked span information in the history.
  24735. function attachLocalSpans(doc, change, from, to) {
  24736. var existing = change["spans_" + doc.id], n = 0
  24737. doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {
  24738. if (line.markedSpans)
  24739. { (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans }
  24740. ++n
  24741. })
  24742. }
  24743. // When un/re-doing restores text containing marked spans, those
  24744. // that have been explicitly cleared should not be restored.
  24745. function removeClearedSpans(spans) {
  24746. if (!spans) { return null }
  24747. var out
  24748. for (var i = 0; i < spans.length; ++i) {
  24749. if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i) } }
  24750. else if (out) { out.push(spans[i]) }
  24751. }
  24752. return !out ? spans : out.length ? out : null
  24753. }
  24754. // Retrieve and filter the old marked spans stored in a change event.
  24755. function getOldSpans(doc, change) {
  24756. var found = change["spans_" + doc.id]
  24757. if (!found) { return null }
  24758. var nw = []
  24759. for (var i = 0; i < change.text.length; ++i)
  24760. { nw.push(removeClearedSpans(found[i])) }
  24761. return nw
  24762. }
  24763. // Used for un/re-doing changes from the history. Combines the
  24764. // result of computing the existing spans with the set of spans that
  24765. // existed in the history (so that deleting around a span and then
  24766. // undoing brings back the span).
  24767. function mergeOldSpans(doc, change) {
  24768. var old = getOldSpans(doc, change)
  24769. var stretched = stretchSpansOverChange(doc, change)
  24770. if (!old) { return stretched }
  24771. if (!stretched) { return old }
  24772. for (var i = 0; i < old.length; ++i) {
  24773. var oldCur = old[i], stretchCur = stretched[i]
  24774. if (oldCur && stretchCur) {
  24775. spans: for (var j = 0; j < stretchCur.length; ++j) {
  24776. var span = stretchCur[j]
  24777. for (var k = 0; k < oldCur.length; ++k)
  24778. { if (oldCur[k].marker == span.marker) { continue spans } }
  24779. oldCur.push(span)
  24780. }
  24781. } else if (stretchCur) {
  24782. old[i] = stretchCur
  24783. }
  24784. }
  24785. return old
  24786. }
  24787. // Used both to provide a JSON-safe object in .getHistory, and, when
  24788. // detaching a document, to split the history in two
  24789. function copyHistoryArray(events, newGroup, instantiateSel) {
  24790. var copy = []
  24791. for (var i = 0; i < events.length; ++i) {
  24792. var event = events[i]
  24793. if (event.ranges) {
  24794. copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event)
  24795. continue
  24796. }
  24797. var changes = event.changes, newChanges = []
  24798. copy.push({changes: newChanges})
  24799. for (var j = 0; j < changes.length; ++j) {
  24800. var change = changes[j], m = (void 0)
  24801. newChanges.push({from: change.from, to: change.to, text: change.text})
  24802. if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\d+)$/)) {
  24803. if (indexOf(newGroup, Number(m[1])) > -1) {
  24804. lst(newChanges)[prop] = change[prop]
  24805. delete change[prop]
  24806. }
  24807. } } }
  24808. }
  24809. }
  24810. return copy
  24811. }
  24812. // The 'scroll' parameter given to many of these indicated whether
  24813. // the new cursor position should be scrolled into view after
  24814. // modifying the selection.
  24815. // If shift is held or the extend flag is set, extends a range to
  24816. // include a given position (and optionally a second position).
  24817. // Otherwise, simply returns the range between the given positions.
  24818. // Used for cursor motion and such.
  24819. function extendRange(doc, range, head, other) {
  24820. if (doc.cm && doc.cm.display.shift || doc.extend) {
  24821. var anchor = range.anchor
  24822. if (other) {
  24823. var posBefore = cmp(head, anchor) < 0
  24824. if (posBefore != (cmp(other, anchor) < 0)) {
  24825. anchor = head
  24826. head = other
  24827. } else if (posBefore != (cmp(head, other) < 0)) {
  24828. head = other
  24829. }
  24830. }
  24831. return new Range(anchor, head)
  24832. } else {
  24833. return new Range(other || head, head)
  24834. }
  24835. }
  24836. // Extend the primary selection range, discard the rest.
  24837. function extendSelection(doc, head, other, options) {
  24838. setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), options)
  24839. }
  24840. // Extend all selections (pos is an array of selections with length
  24841. // equal the number of selections)
  24842. function extendSelections(doc, heads, options) {
  24843. var out = []
  24844. for (var i = 0; i < doc.sel.ranges.length; i++)
  24845. { out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null) }
  24846. var newSel = normalizeSelection(out, doc.sel.primIndex)
  24847. setSelection(doc, newSel, options)
  24848. }
  24849. // Updates a single range in the selection.
  24850. function replaceOneSelection(doc, i, range, options) {
  24851. var ranges = doc.sel.ranges.slice(0)
  24852. ranges[i] = range
  24853. setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options)
  24854. }
  24855. // Reset the selection to a single range.
  24856. function setSimpleSelection(doc, anchor, head, options) {
  24857. setSelection(doc, simpleSelection(anchor, head), options)
  24858. }
  24859. // Give beforeSelectionChange handlers a change to influence a
  24860. // selection update.
  24861. function filterSelectionChange(doc, sel, options) {
  24862. var obj = {
  24863. ranges: sel.ranges,
  24864. update: function(ranges) {
  24865. var this$1 = this;
  24866. this.ranges = []
  24867. for (var i = 0; i < ranges.length; i++)
  24868. { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),
  24869. clipPos(doc, ranges[i].head)) }
  24870. },
  24871. origin: options && options.origin
  24872. }
  24873. signal(doc, "beforeSelectionChange", doc, obj)
  24874. if (doc.cm) { signal(doc.cm, "beforeSelectionChange", doc.cm, obj) }
  24875. if (obj.ranges != sel.ranges) { return normalizeSelection(obj.ranges, obj.ranges.length - 1) }
  24876. else { return sel }
  24877. }
  24878. function setSelectionReplaceHistory(doc, sel, options) {
  24879. var done = doc.history.done, last = lst(done)
  24880. if (last && last.ranges) {
  24881. done[done.length - 1] = sel
  24882. setSelectionNoUndo(doc, sel, options)
  24883. } else {
  24884. setSelection(doc, sel, options)
  24885. }
  24886. }
  24887. // Set a new selection.
  24888. function setSelection(doc, sel, options) {
  24889. setSelectionNoUndo(doc, sel, options)
  24890. addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options)
  24891. }
  24892. function setSelectionNoUndo(doc, sel, options) {
  24893. if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange"))
  24894. { sel = filterSelectionChange(doc, sel, options) }
  24895. var bias = options && options.bias ||
  24896. (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1)
  24897. setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true))
  24898. if (!(options && options.scroll === false) && doc.cm)
  24899. { ensureCursorVisible(doc.cm) }
  24900. }
  24901. function setSelectionInner(doc, sel) {
  24902. if (sel.equals(doc.sel)) { return }
  24903. doc.sel = sel
  24904. if (doc.cm) {
  24905. doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true
  24906. signalCursorActivity(doc.cm)
  24907. }
  24908. signalLater(doc, "cursorActivity", doc)
  24909. }
  24910. // Verify that the selection does not partially select any atomic
  24911. // marked ranges.
  24912. function reCheckSelection(doc) {
  24913. setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll)
  24914. }
  24915. // Return a selection that does not partially select any atomic
  24916. // ranges.
  24917. function skipAtomicInSelection(doc, sel, bias, mayClear) {
  24918. var out
  24919. for (var i = 0; i < sel.ranges.length; i++) {
  24920. var range = sel.ranges[i]
  24921. var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i]
  24922. var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear)
  24923. var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear)
  24924. if (out || newAnchor != range.anchor || newHead != range.head) {
  24925. if (!out) { out = sel.ranges.slice(0, i) }
  24926. out[i] = new Range(newAnchor, newHead)
  24927. }
  24928. }
  24929. return out ? normalizeSelection(out, sel.primIndex) : sel
  24930. }
  24931. function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {
  24932. var line = getLine(doc, pos.line)
  24933. if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {
  24934. var sp = line.markedSpans[i], m = sp.marker
  24935. if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&
  24936. (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) {
  24937. if (mayClear) {
  24938. signal(m, "beforeCursorEnter")
  24939. if (m.explicitlyCleared) {
  24940. if (!line.markedSpans) { break }
  24941. else {--i; continue}
  24942. }
  24943. }
  24944. if (!m.atomic) { continue }
  24945. if (oldPos) {
  24946. var near = m.find(dir < 0 ? 1 : -1), diff = (void 0)
  24947. if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)
  24948. { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null) }
  24949. if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))
  24950. { return skipAtomicInner(doc, near, pos, dir, mayClear) }
  24951. }
  24952. var far = m.find(dir < 0 ? -1 : 1)
  24953. if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight)
  24954. { far = movePos(doc, far, dir, far.line == pos.line ? line : null) }
  24955. return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null
  24956. }
  24957. } }
  24958. return pos
  24959. }
  24960. // Ensure a given position is not inside an atomic range.
  24961. function skipAtomic(doc, pos, oldPos, bias, mayClear) {
  24962. var dir = bias || 1
  24963. var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||
  24964. (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||
  24965. skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||
  24966. (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true))
  24967. if (!found) {
  24968. doc.cantEdit = true
  24969. return Pos(doc.first, 0)
  24970. }
  24971. return found
  24972. }
  24973. function movePos(doc, pos, dir, line) {
  24974. if (dir < 0 && pos.ch == 0) {
  24975. if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }
  24976. else { return null }
  24977. } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {
  24978. if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }
  24979. else { return null }
  24980. } else {
  24981. return new Pos(pos.line, pos.ch + dir)
  24982. }
  24983. }
  24984. function selectAll(cm) {
  24985. cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll)
  24986. }
  24987. // UPDATING
  24988. // Allow "beforeChange" event handlers to influence a change
  24989. function filterChange(doc, change, update) {
  24990. var obj = {
  24991. canceled: false,
  24992. from: change.from,
  24993. to: change.to,
  24994. text: change.text,
  24995. origin: change.origin,
  24996. cancel: function () { return obj.canceled = true; }
  24997. }
  24998. if (update) { obj.update = function (from, to, text, origin) {
  24999. if (from) { obj.from = clipPos(doc, from) }
  25000. if (to) { obj.to = clipPos(doc, to) }
  25001. if (text) { obj.text = text }
  25002. if (origin !== undefined) { obj.origin = origin }
  25003. } }
  25004. signal(doc, "beforeChange", doc, obj)
  25005. if (doc.cm) { signal(doc.cm, "beforeChange", doc.cm, obj) }
  25006. if (obj.canceled) { return null }
  25007. return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}
  25008. }
  25009. // Apply a change to a document, and add it to the document's
  25010. // history, and propagating it to all linked documents.
  25011. function makeChange(doc, change, ignoreReadOnly) {
  25012. if (doc.cm) {
  25013. if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }
  25014. if (doc.cm.state.suppressEdits) { return }
  25015. }
  25016. if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) {
  25017. change = filterChange(doc, change, true)
  25018. if (!change) { return }
  25019. }
  25020. // Possibly split or suppress the update based on the presence
  25021. // of read-only spans in its range.
  25022. var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to)
  25023. if (split) {
  25024. for (var i = split.length - 1; i >= 0; --i)
  25025. { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text}) }
  25026. } else {
  25027. makeChangeInner(doc, change)
  25028. }
  25029. }
  25030. function makeChangeInner(doc, change) {
  25031. if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) { return }
  25032. var selAfter = computeSelAfterChange(doc, change)
  25033. addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN)
  25034. makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change))
  25035. var rebased = []
  25036. linkedDocs(doc, function (doc, sharedHist) {
  25037. if (!sharedHist && indexOf(rebased, doc.history) == -1) {
  25038. rebaseHist(doc.history, change)
  25039. rebased.push(doc.history)
  25040. }
  25041. makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change))
  25042. })
  25043. }
  25044. // Revert a change stored in a document's history.
  25045. function makeChangeFromHistory(doc, type, allowSelectionOnly) {
  25046. if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) { return }
  25047. var hist = doc.history, event, selAfter = doc.sel
  25048. var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done
  25049. // Verify that there is a useable event (so that ctrl-z won't
  25050. // needlessly clear selection events)
  25051. var i = 0
  25052. for (; i < source.length; i++) {
  25053. event = source[i]
  25054. if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)
  25055. { break }
  25056. }
  25057. if (i == source.length) { return }
  25058. hist.lastOrigin = hist.lastSelOrigin = null
  25059. for (;;) {
  25060. event = source.pop()
  25061. if (event.ranges) {
  25062. pushSelectionToHistory(event, dest)
  25063. if (allowSelectionOnly && !event.equals(doc.sel)) {
  25064. setSelection(doc, event, {clearRedo: false})
  25065. return
  25066. }
  25067. selAfter = event
  25068. }
  25069. else { break }
  25070. }
  25071. // Build up a reverse change object to add to the opposite history
  25072. // stack (redo when undoing, and vice versa).
  25073. var antiChanges = []
  25074. pushSelectionToHistory(selAfter, dest)
  25075. dest.push({changes: antiChanges, generation: hist.generation})
  25076. hist.generation = event.generation || ++hist.maxGeneration
  25077. var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")
  25078. var loop = function ( i ) {
  25079. var change = event.changes[i]
  25080. change.origin = type
  25081. if (filter && !filterChange(doc, change, false)) {
  25082. source.length = 0
  25083. return {}
  25084. }
  25085. antiChanges.push(historyChangeFromChange(doc, change))
  25086. var after = i ? computeSelAfterChange(doc, change) : lst(source)
  25087. makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change))
  25088. if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}) }
  25089. var rebased = []
  25090. // Propagate to the linked documents
  25091. linkedDocs(doc, function (doc, sharedHist) {
  25092. if (!sharedHist && indexOf(rebased, doc.history) == -1) {
  25093. rebaseHist(doc.history, change)
  25094. rebased.push(doc.history)
  25095. }
  25096. makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change))
  25097. })
  25098. };
  25099. for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {
  25100. var returned = loop( i$1 );
  25101. if ( returned ) return returned.v;
  25102. }
  25103. }
  25104. // Sub-views need their line numbers shifted when text is added
  25105. // above or below them in the parent document.
  25106. function shiftDoc(doc, distance) {
  25107. if (distance == 0) { return }
  25108. doc.first += distance
  25109. doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(
  25110. Pos(range.anchor.line + distance, range.anchor.ch),
  25111. Pos(range.head.line + distance, range.head.ch)
  25112. ); }), doc.sel.primIndex)
  25113. if (doc.cm) {
  25114. regChange(doc.cm, doc.first, doc.first - distance, distance)
  25115. for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)
  25116. { regLineChange(doc.cm, l, "gutter") }
  25117. }
  25118. }
  25119. // More lower-level change function, handling only a single document
  25120. // (not linked ones).
  25121. function makeChangeSingleDoc(doc, change, selAfter, spans) {
  25122. if (doc.cm && !doc.cm.curOp)
  25123. { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }
  25124. if (change.to.line < doc.first) {
  25125. shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line))
  25126. return
  25127. }
  25128. if (change.from.line > doc.lastLine()) { return }
  25129. // Clip the change to the size of this doc
  25130. if (change.from.line < doc.first) {
  25131. var shift = change.text.length - 1 - (doc.first - change.from.line)
  25132. shiftDoc(doc, shift)
  25133. change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),
  25134. text: [lst(change.text)], origin: change.origin}
  25135. }
  25136. var last = doc.lastLine()
  25137. if (change.to.line > last) {
  25138. change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),
  25139. text: [change.text[0]], origin: change.origin}
  25140. }
  25141. change.removed = getBetween(doc, change.from, change.to)
  25142. if (!selAfter) { selAfter = computeSelAfterChange(doc, change) }
  25143. if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans) }
  25144. else { updateDoc(doc, change, spans) }
  25145. setSelectionNoUndo(doc, selAfter, sel_dontScroll)
  25146. }
  25147. // Handle the interaction of a change to a document with the editor
  25148. // that this document is part of.
  25149. function makeChangeSingleDocInEditor(cm, change, spans) {
  25150. var doc = cm.doc, display = cm.display, from = change.from, to = change.to
  25151. var recomputeMaxLength = false, checkWidthStart = from.line
  25152. if (!cm.options.lineWrapping) {
  25153. checkWidthStart = lineNo(visualLine(getLine(doc, from.line)))
  25154. doc.iter(checkWidthStart, to.line + 1, function (line) {
  25155. if (line == display.maxLine) {
  25156. recomputeMaxLength = true
  25157. return true
  25158. }
  25159. })
  25160. }
  25161. if (doc.sel.contains(change.from, change.to) > -1)
  25162. { signalCursorActivity(cm) }
  25163. updateDoc(doc, change, spans, estimateHeight(cm))
  25164. if (!cm.options.lineWrapping) {
  25165. doc.iter(checkWidthStart, from.line + change.text.length, function (line) {
  25166. var len = lineLength(line)
  25167. if (len > display.maxLineLength) {
  25168. display.maxLine = line
  25169. display.maxLineLength = len
  25170. display.maxLineChanged = true
  25171. recomputeMaxLength = false
  25172. }
  25173. })
  25174. if (recomputeMaxLength) { cm.curOp.updateMaxLine = true }
  25175. }
  25176. // Adjust frontier, schedule worker
  25177. doc.frontier = Math.min(doc.frontier, from.line)
  25178. startWorker(cm, 400)
  25179. var lendiff = change.text.length - (to.line - from.line) - 1
  25180. // Remember that these lines changed, for updating the display
  25181. if (change.full)
  25182. { regChange(cm) }
  25183. else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))
  25184. { regLineChange(cm, from.line, "text") }
  25185. else
  25186. { regChange(cm, from.line, to.line + 1, lendiff) }
  25187. var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change")
  25188. if (changeHandler || changesHandler) {
  25189. var obj = {
  25190. from: from, to: to,
  25191. text: change.text,
  25192. removed: change.removed,
  25193. origin: change.origin
  25194. }
  25195. if (changeHandler) { signalLater(cm, "change", cm, obj) }
  25196. if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj) }
  25197. }
  25198. cm.display.selForContextMenu = null
  25199. }
  25200. function replaceRange(doc, code, from, to, origin) {
  25201. if (!to) { to = from }
  25202. if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp }
  25203. if (typeof code == "string") { code = doc.splitLines(code) }
  25204. makeChange(doc, {from: from, to: to, text: code, origin: origin})
  25205. }
  25206. // Rebasing/resetting history to deal with externally-sourced changes
  25207. function rebaseHistSelSingle(pos, from, to, diff) {
  25208. if (to < pos.line) {
  25209. pos.line += diff
  25210. } else if (from < pos.line) {
  25211. pos.line = from
  25212. pos.ch = 0
  25213. }
  25214. }
  25215. // Tries to rebase an array of history events given a change in the
  25216. // document. If the change touches the same lines as the event, the
  25217. // event, and everything 'behind' it, is discarded. If the change is
  25218. // before the event, the event's positions are updated. Uses a
  25219. // copy-on-write scheme for the positions, to avoid having to
  25220. // reallocate them all on every rebase, but also avoid problems with
  25221. // shared position objects being unsafely updated.
  25222. function rebaseHistArray(array, from, to, diff) {
  25223. for (var i = 0; i < array.length; ++i) {
  25224. var sub = array[i], ok = true
  25225. if (sub.ranges) {
  25226. if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true }
  25227. for (var j = 0; j < sub.ranges.length; j++) {
  25228. rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff)
  25229. rebaseHistSelSingle(sub.ranges[j].head, from, to, diff)
  25230. }
  25231. continue
  25232. }
  25233. for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {
  25234. var cur = sub.changes[j$1]
  25235. if (to < cur.from.line) {
  25236. cur.from = Pos(cur.from.line + diff, cur.from.ch)
  25237. cur.to = Pos(cur.to.line + diff, cur.to.ch)
  25238. } else if (from <= cur.to.line) {
  25239. ok = false
  25240. break
  25241. }
  25242. }
  25243. if (!ok) {
  25244. array.splice(0, i + 1)
  25245. i = 0
  25246. }
  25247. }
  25248. }
  25249. function rebaseHist(hist, change) {
  25250. var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1
  25251. rebaseHistArray(hist.done, from, to, diff)
  25252. rebaseHistArray(hist.undone, from, to, diff)
  25253. }
  25254. // Utility for applying a change to a line by handle or number,
  25255. // returning the number and optionally registering the line as
  25256. // changed.
  25257. function changeLine(doc, handle, changeType, op) {
  25258. var no = handle, line = handle
  25259. if (typeof handle == "number") { line = getLine(doc, clipLine(doc, handle)) }
  25260. else { no = lineNo(handle) }
  25261. if (no == null) { return null }
  25262. if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType) }
  25263. return line
  25264. }
  25265. // The document is represented as a BTree consisting of leaves, with
  25266. // chunk of lines in them, and branches, with up to ten leaves or
  25267. // other branch nodes below them. The top node is always a branch
  25268. // node, and is the document object itself (meaning it has
  25269. // additional methods and properties).
  25270. //
  25271. // All nodes have parent links. The tree is used both to go from
  25272. // line numbers to line objects, and to go from objects to numbers.
  25273. // It also indexes by height, and is used to convert between height
  25274. // and line object, and to find the total height of the document.
  25275. //
  25276. // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html
  25277. function LeafChunk(lines) {
  25278. var this$1 = this;
  25279. this.lines = lines
  25280. this.parent = null
  25281. var height = 0
  25282. for (var i = 0; i < lines.length; ++i) {
  25283. lines[i].parent = this$1
  25284. height += lines[i].height
  25285. }
  25286. this.height = height
  25287. }
  25288. LeafChunk.prototype = {
  25289. chunkSize: function() { return this.lines.length },
  25290. // Remove the n lines at offset 'at'.
  25291. removeInner: function(at, n) {
  25292. var this$1 = this;
  25293. for (var i = at, e = at + n; i < e; ++i) {
  25294. var line = this$1.lines[i]
  25295. this$1.height -= line.height
  25296. cleanUpLine(line)
  25297. signalLater(line, "delete")
  25298. }
  25299. this.lines.splice(at, n)
  25300. },
  25301. // Helper used to collapse a small branch into a single leaf.
  25302. collapse: function(lines) {
  25303. lines.push.apply(lines, this.lines)
  25304. },
  25305. // Insert the given array of lines at offset 'at', count them as
  25306. // having the given height.
  25307. insertInner: function(at, lines, height) {
  25308. var this$1 = this;
  25309. this.height += height
  25310. this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at))
  25311. for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1 }
  25312. },
  25313. // Used to iterate over a part of the tree.
  25314. iterN: function(at, n, op) {
  25315. var this$1 = this;
  25316. for (var e = at + n; at < e; ++at)
  25317. { if (op(this$1.lines[at])) { return true } }
  25318. }
  25319. }
  25320. function BranchChunk(children) {
  25321. var this$1 = this;
  25322. this.children = children
  25323. var size = 0, height = 0
  25324. for (var i = 0; i < children.length; ++i) {
  25325. var ch = children[i]
  25326. size += ch.chunkSize(); height += ch.height
  25327. ch.parent = this$1
  25328. }
  25329. this.size = size
  25330. this.height = height
  25331. this.parent = null
  25332. }
  25333. BranchChunk.prototype = {
  25334. chunkSize: function() { return this.size },
  25335. removeInner: function(at, n) {
  25336. var this$1 = this;
  25337. this.size -= n
  25338. for (var i = 0; i < this.children.length; ++i) {
  25339. var child = this$1.children[i], sz = child.chunkSize()
  25340. if (at < sz) {
  25341. var rm = Math.min(n, sz - at), oldHeight = child.height
  25342. child.removeInner(at, rm)
  25343. this$1.height -= oldHeight - child.height
  25344. if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null }
  25345. if ((n -= rm) == 0) { break }
  25346. at = 0
  25347. } else { at -= sz }
  25348. }
  25349. // If the result is smaller than 25 lines, ensure that it is a
  25350. // single leaf node.
  25351. if (this.size - n < 25 &&
  25352. (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {
  25353. var lines = []
  25354. this.collapse(lines)
  25355. this.children = [new LeafChunk(lines)]
  25356. this.children[0].parent = this
  25357. }
  25358. },
  25359. collapse: function(lines) {
  25360. var this$1 = this;
  25361. for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines) }
  25362. },
  25363. insertInner: function(at, lines, height) {
  25364. var this$1 = this;
  25365. this.size += lines.length
  25366. this.height += height
  25367. for (var i = 0; i < this.children.length; ++i) {
  25368. var child = this$1.children[i], sz = child.chunkSize()
  25369. if (at <= sz) {
  25370. child.insertInner(at, lines, height)
  25371. if (child.lines && child.lines.length > 50) {
  25372. // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.
  25373. // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.
  25374. var remaining = child.lines.length % 25 + 25
  25375. for (var pos = remaining; pos < child.lines.length;) {
  25376. var leaf = new LeafChunk(child.lines.slice(pos, pos += 25))
  25377. child.height -= leaf.height
  25378. this$1.children.splice(++i, 0, leaf)
  25379. leaf.parent = this$1
  25380. }
  25381. child.lines = child.lines.slice(0, remaining)
  25382. this$1.maybeSpill()
  25383. }
  25384. break
  25385. }
  25386. at -= sz
  25387. }
  25388. },
  25389. // When a node has grown, check whether it should be split.
  25390. maybeSpill: function() {
  25391. if (this.children.length <= 10) { return }
  25392. var me = this
  25393. do {
  25394. var spilled = me.children.splice(me.children.length - 5, 5)
  25395. var sibling = new BranchChunk(spilled)
  25396. if (!me.parent) { // Become the parent node
  25397. var copy = new BranchChunk(me.children)
  25398. copy.parent = me
  25399. me.children = [copy, sibling]
  25400. me = copy
  25401. } else {
  25402. me.size -= sibling.size
  25403. me.height -= sibling.height
  25404. var myIndex = indexOf(me.parent.children, me)
  25405. me.parent.children.splice(myIndex + 1, 0, sibling)
  25406. }
  25407. sibling.parent = me.parent
  25408. } while (me.children.length > 10)
  25409. me.parent.maybeSpill()
  25410. },
  25411. iterN: function(at, n, op) {
  25412. var this$1 = this;
  25413. for (var i = 0; i < this.children.length; ++i) {
  25414. var child = this$1.children[i], sz = child.chunkSize()
  25415. if (at < sz) {
  25416. var used = Math.min(n, sz - at)
  25417. if (child.iterN(at, used, op)) { return true }
  25418. if ((n -= used) == 0) { break }
  25419. at = 0
  25420. } else { at -= sz }
  25421. }
  25422. }
  25423. }
  25424. // Line widgets are block elements displayed above or below a line.
  25425. function LineWidget(doc, node, options) {
  25426. var this$1 = this;
  25427. if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))
  25428. { this$1[opt] = options[opt] } } }
  25429. this.doc = doc
  25430. this.node = node
  25431. }
  25432. eventMixin(LineWidget)
  25433. function adjustScrollWhenAboveVisible(cm, line, diff) {
  25434. if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))
  25435. { addToScrollPos(cm, null, diff) }
  25436. }
  25437. LineWidget.prototype.clear = function() {
  25438. var this$1 = this;
  25439. var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line)
  25440. if (no == null || !ws) { return }
  25441. for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1) } }
  25442. if (!ws.length) { line.widgets = null }
  25443. var height = widgetHeight(this)
  25444. updateLineHeight(line, Math.max(0, line.height - height))
  25445. if (cm) { runInOp(cm, function () {
  25446. adjustScrollWhenAboveVisible(cm, line, -height)
  25447. regLineChange(cm, no, "widget")
  25448. }) }
  25449. }
  25450. LineWidget.prototype.changed = function() {
  25451. var oldH = this.height, cm = this.doc.cm, line = this.line
  25452. this.height = null
  25453. var diff = widgetHeight(this) - oldH
  25454. if (!diff) { return }
  25455. updateLineHeight(line, line.height + diff)
  25456. if (cm) { runInOp(cm, function () {
  25457. cm.curOp.forceUpdate = true
  25458. adjustScrollWhenAboveVisible(cm, line, diff)
  25459. }) }
  25460. }
  25461. function addLineWidget(doc, handle, node, options) {
  25462. var widget = new LineWidget(doc, node, options)
  25463. var cm = doc.cm
  25464. if (cm && widget.noHScroll) { cm.display.alignWidgets = true }
  25465. changeLine(doc, handle, "widget", function (line) {
  25466. var widgets = line.widgets || (line.widgets = [])
  25467. if (widget.insertAt == null) { widgets.push(widget) }
  25468. else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget) }
  25469. widget.line = line
  25470. if (cm && !lineIsHidden(doc, line)) {
  25471. var aboveVisible = heightAtLine(line) < doc.scrollTop
  25472. updateLineHeight(line, line.height + widgetHeight(widget))
  25473. if (aboveVisible) { addToScrollPos(cm, null, widget.height) }
  25474. cm.curOp.forceUpdate = true
  25475. }
  25476. return true
  25477. })
  25478. return widget
  25479. }
  25480. // TEXTMARKERS
  25481. // Created with markText and setBookmark methods. A TextMarker is a
  25482. // handle that can be used to clear or find a marked position in the
  25483. // document. Line objects hold arrays (markedSpans) containing
  25484. // {from, to, marker} object pointing to such marker objects, and
  25485. // indicating that such a marker is present on that line. Multiple
  25486. // lines may point to the same marker when it spans across lines.
  25487. // The spans will have null for their from/to properties when the
  25488. // marker continues beyond the start/end of the line. Markers have
  25489. // links back to the lines they currently touch.
  25490. // Collapsed markers have unique ids, in order to be able to order
  25491. // them, which is needed for uniquely determining an outer marker
  25492. // when they overlap (they may nest, but not partially overlap).
  25493. var nextMarkerId = 0
  25494. function TextMarker(doc, type) {
  25495. this.lines = []
  25496. this.type = type
  25497. this.doc = doc
  25498. this.id = ++nextMarkerId
  25499. }
  25500. eventMixin(TextMarker)
  25501. // Clear the marker.
  25502. TextMarker.prototype.clear = function() {
  25503. var this$1 = this;
  25504. if (this.explicitlyCleared) { return }
  25505. var cm = this.doc.cm, withOp = cm && !cm.curOp
  25506. if (withOp) { startOperation(cm) }
  25507. if (hasHandler(this, "clear")) {
  25508. var found = this.find()
  25509. if (found) { signalLater(this, "clear", found.from, found.to) }
  25510. }
  25511. var min = null, max = null
  25512. for (var i = 0; i < this.lines.length; ++i) {
  25513. var line = this$1.lines[i]
  25514. var span = getMarkedSpanFor(line.markedSpans, this$1)
  25515. if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), "text") }
  25516. else if (cm) {
  25517. if (span.to != null) { max = lineNo(line) }
  25518. if (span.from != null) { min = lineNo(line) }
  25519. }
  25520. line.markedSpans = removeMarkedSpan(line.markedSpans, span)
  25521. if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm)
  25522. { updateLineHeight(line, textHeight(cm.display)) }
  25523. }
  25524. if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {
  25525. var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual)
  25526. if (len > cm.display.maxLineLength) {
  25527. cm.display.maxLine = visual
  25528. cm.display.maxLineLength = len
  25529. cm.display.maxLineChanged = true
  25530. }
  25531. } }
  25532. if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1) }
  25533. this.lines.length = 0
  25534. this.explicitlyCleared = true
  25535. if (this.atomic && this.doc.cantEdit) {
  25536. this.doc.cantEdit = false
  25537. if (cm) { reCheckSelection(cm.doc) }
  25538. }
  25539. if (cm) { signalLater(cm, "markerCleared", cm, this) }
  25540. if (withOp) { endOperation(cm) }
  25541. if (this.parent) { this.parent.clear() }
  25542. }
  25543. // Find the position of the marker in the document. Returns a {from,
  25544. // to} object by default. Side can be passed to get a specific side
  25545. // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the
  25546. // Pos objects returned contain a line object, rather than a line
  25547. // number (used to prevent looking up the same line twice).
  25548. TextMarker.prototype.find = function(side, lineObj) {
  25549. var this$1 = this;
  25550. if (side == null && this.type == "bookmark") { side = 1 }
  25551. var from, to
  25552. for (var i = 0; i < this.lines.length; ++i) {
  25553. var line = this$1.lines[i]
  25554. var span = getMarkedSpanFor(line.markedSpans, this$1)
  25555. if (span.from != null) {
  25556. from = Pos(lineObj ? line : lineNo(line), span.from)
  25557. if (side == -1) { return from }
  25558. }
  25559. if (span.to != null) {
  25560. to = Pos(lineObj ? line : lineNo(line), span.to)
  25561. if (side == 1) { return to }
  25562. }
  25563. }
  25564. return from && {from: from, to: to}
  25565. }
  25566. // Signals that the marker's widget changed, and surrounding layout
  25567. // should be recomputed.
  25568. TextMarker.prototype.changed = function() {
  25569. var pos = this.find(-1, true), widget = this, cm = this.doc.cm
  25570. if (!pos || !cm) { return }
  25571. runInOp(cm, function () {
  25572. var line = pos.line, lineN = lineNo(pos.line)
  25573. var view = findViewForLine(cm, lineN)
  25574. if (view) {
  25575. clearLineMeasurementCacheFor(view)
  25576. cm.curOp.selectionChanged = cm.curOp.forceUpdate = true
  25577. }
  25578. cm.curOp.updateMaxLine = true
  25579. if (!lineIsHidden(widget.doc, line) && widget.height != null) {
  25580. var oldHeight = widget.height
  25581. widget.height = null
  25582. var dHeight = widgetHeight(widget) - oldHeight
  25583. if (dHeight)
  25584. { updateLineHeight(line, line.height + dHeight) }
  25585. }
  25586. })
  25587. }
  25588. TextMarker.prototype.attachLine = function(line) {
  25589. if (!this.lines.length && this.doc.cm) {
  25590. var op = this.doc.cm.curOp
  25591. if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)
  25592. { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this) }
  25593. }
  25594. this.lines.push(line)
  25595. }
  25596. TextMarker.prototype.detachLine = function(line) {
  25597. this.lines.splice(indexOf(this.lines, line), 1)
  25598. if (!this.lines.length && this.doc.cm) {
  25599. var op = this.doc.cm.curOp
  25600. ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this)
  25601. }
  25602. }
  25603. // Create a marker, wire it up to the right lines, and
  25604. function markText(doc, from, to, options, type) {
  25605. // Shared markers (across linked documents) are handled separately
  25606. // (markTextShared will call out to this again, once per
  25607. // document).
  25608. if (options && options.shared) { return markTextShared(doc, from, to, options, type) }
  25609. // Ensure we are in an operation.
  25610. if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }
  25611. var marker = new TextMarker(doc, type), diff = cmp(from, to)
  25612. if (options) { copyObj(options, marker, false) }
  25613. // Don't connect empty markers unless clearWhenEmpty is false
  25614. if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)
  25615. { return marker }
  25616. if (marker.replacedWith) {
  25617. // Showing up as a widget implies collapsed (widget replaces text)
  25618. marker.collapsed = true
  25619. marker.widgetNode = elt("span", [marker.replacedWith], "CodeMirror-widget")
  25620. marker.widgetNode.setAttribute("role", "presentation") // hide from accessibility tree
  25621. if (!options.handleMouseEvents) { marker.widgetNode.setAttribute("cm-ignore-events", "true") }
  25622. if (options.insertLeft) { marker.widgetNode.insertLeft = true }
  25623. }
  25624. if (marker.collapsed) {
  25625. if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||
  25626. from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))
  25627. { throw new Error("Inserting collapsed marker partially overlapping an existing one") }
  25628. seeCollapsedSpans()
  25629. }
  25630. if (marker.addToHistory)
  25631. { addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN) }
  25632. var curLine = from.line, cm = doc.cm, updateMaxLine
  25633. doc.iter(curLine, to.line + 1, function (line) {
  25634. if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)
  25635. { updateMaxLine = true }
  25636. if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0) }
  25637. addMarkedSpan(line, new MarkedSpan(marker,
  25638. curLine == from.line ? from.ch : null,
  25639. curLine == to.line ? to.ch : null))
  25640. ++curLine
  25641. })
  25642. // lineIsHidden depends on the presence of the spans, so needs a second pass
  25643. if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {
  25644. if (lineIsHidden(doc, line)) { updateLineHeight(line, 0) }
  25645. }) }
  25646. if (marker.clearOnEnter) { on(marker, "beforeCursorEnter", function () { return marker.clear(); }) }
  25647. if (marker.readOnly) {
  25648. seeReadOnlySpans()
  25649. if (doc.history.done.length || doc.history.undone.length)
  25650. { doc.clearHistory() }
  25651. }
  25652. if (marker.collapsed) {
  25653. marker.id = ++nextMarkerId
  25654. marker.atomic = true
  25655. }
  25656. if (cm) {
  25657. // Sync editor state
  25658. if (updateMaxLine) { cm.curOp.updateMaxLine = true }
  25659. if (marker.collapsed)
  25660. { regChange(cm, from.line, to.line + 1) }
  25661. else if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.css)
  25662. { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, "text") } }
  25663. if (marker.atomic) { reCheckSelection(cm.doc) }
  25664. signalLater(cm, "markerAdded", cm, marker)
  25665. }
  25666. return marker
  25667. }
  25668. // SHARED TEXTMARKERS
  25669. // A shared marker spans multiple linked documents. It is
  25670. // implemented as a meta-marker-object controlling multiple normal
  25671. // markers.
  25672. function SharedTextMarker(markers, primary) {
  25673. var this$1 = this;
  25674. this.markers = markers
  25675. this.primary = primary
  25676. for (var i = 0; i < markers.length; ++i)
  25677. { markers[i].parent = this$1 }
  25678. }
  25679. eventMixin(SharedTextMarker)
  25680. SharedTextMarker.prototype.clear = function() {
  25681. var this$1 = this;
  25682. if (this.explicitlyCleared) { return }
  25683. this.explicitlyCleared = true
  25684. for (var i = 0; i < this.markers.length; ++i)
  25685. { this$1.markers[i].clear() }
  25686. signalLater(this, "clear")
  25687. }
  25688. SharedTextMarker.prototype.find = function(side, lineObj) {
  25689. return this.primary.find(side, lineObj)
  25690. }
  25691. function markTextShared(doc, from, to, options, type) {
  25692. options = copyObj(options)
  25693. options.shared = false
  25694. var markers = [markText(doc, from, to, options, type)], primary = markers[0]
  25695. var widget = options.widgetNode
  25696. linkedDocs(doc, function (doc) {
  25697. if (widget) { options.widgetNode = widget.cloneNode(true) }
  25698. markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type))
  25699. for (var i = 0; i < doc.linked.length; ++i)
  25700. { if (doc.linked[i].isParent) { return } }
  25701. primary = lst(markers)
  25702. })
  25703. return new SharedTextMarker(markers, primary)
  25704. }
  25705. function findSharedMarkers(doc) {
  25706. return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })
  25707. }
  25708. function copySharedMarkers(doc, markers) {
  25709. for (var i = 0; i < markers.length; i++) {
  25710. var marker = markers[i], pos = marker.find()
  25711. var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to)
  25712. if (cmp(mFrom, mTo)) {
  25713. var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type)
  25714. marker.markers.push(subMark)
  25715. subMark.parent = marker
  25716. }
  25717. }
  25718. }
  25719. function detachSharedMarkers(markers) {
  25720. var loop = function ( i ) {
  25721. var marker = markers[i], linked = [marker.primary.doc]
  25722. linkedDocs(marker.primary.doc, function (d) { return linked.push(d); })
  25723. for (var j = 0; j < marker.markers.length; j++) {
  25724. var subMarker = marker.markers[j]
  25725. if (indexOf(linked, subMarker.doc) == -1) {
  25726. subMarker.parent = null
  25727. marker.markers.splice(j--, 1)
  25728. }
  25729. }
  25730. };
  25731. for (var i = 0; i < markers.length; i++) loop( i );
  25732. }
  25733. var nextDocId = 0
  25734. var Doc = function(text, mode, firstLine, lineSep) {
  25735. if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep) }
  25736. if (firstLine == null) { firstLine = 0 }
  25737. BranchChunk.call(this, [new LeafChunk([new Line("", null)])])
  25738. this.first = firstLine
  25739. this.scrollTop = this.scrollLeft = 0
  25740. this.cantEdit = false
  25741. this.cleanGeneration = 1
  25742. this.frontier = firstLine
  25743. var start = Pos(firstLine, 0)
  25744. this.sel = simpleSelection(start)
  25745. this.history = new History(null)
  25746. this.id = ++nextDocId
  25747. this.modeOption = mode
  25748. this.lineSep = lineSep
  25749. this.extend = false
  25750. if (typeof text == "string") { text = this.splitLines(text) }
  25751. updateDoc(this, {from: start, to: start, text: text})
  25752. setSelection(this, simpleSelection(start), sel_dontScroll)
  25753. }
  25754. Doc.prototype = createObj(BranchChunk.prototype, {
  25755. constructor: Doc,
  25756. // Iterate over the document. Supports two forms -- with only one
  25757. // argument, it calls that for each line in the document. With
  25758. // three, it iterates over the range given by the first two (with
  25759. // the second being non-inclusive).
  25760. iter: function(from, to, op) {
  25761. if (op) { this.iterN(from - this.first, to - from, op) }
  25762. else { this.iterN(this.first, this.first + this.size, from) }
  25763. },
  25764. // Non-public interface for adding and removing lines.
  25765. insert: function(at, lines) {
  25766. var height = 0
  25767. for (var i = 0; i < lines.length; ++i) { height += lines[i].height }
  25768. this.insertInner(at - this.first, lines, height)
  25769. },
  25770. remove: function(at, n) { this.removeInner(at - this.first, n) },
  25771. // From here, the methods are part of the public interface. Most
  25772. // are also available from CodeMirror (editor) instances.
  25773. getValue: function(lineSep) {
  25774. var lines = getLines(this, this.first, this.first + this.size)
  25775. if (lineSep === false) { return lines }
  25776. return lines.join(lineSep || this.lineSeparator())
  25777. },
  25778. setValue: docMethodOp(function(code) {
  25779. var top = Pos(this.first, 0), last = this.first + this.size - 1
  25780. makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),
  25781. text: this.splitLines(code), origin: "setValue", full: true}, true)
  25782. setSelection(this, simpleSelection(top))
  25783. }),
  25784. replaceRange: function(code, from, to, origin) {
  25785. from = clipPos(this, from)
  25786. to = to ? clipPos(this, to) : from
  25787. replaceRange(this, code, from, to, origin)
  25788. },
  25789. getRange: function(from, to, lineSep) {
  25790. var lines = getBetween(this, clipPos(this, from), clipPos(this, to))
  25791. if (lineSep === false) { return lines }
  25792. return lines.join(lineSep || this.lineSeparator())
  25793. },
  25794. getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},
  25795. getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},
  25796. getLineNumber: function(line) {return lineNo(line)},
  25797. getLineHandleVisualStart: function(line) {
  25798. if (typeof line == "number") { line = getLine(this, line) }
  25799. return visualLine(line)
  25800. },
  25801. lineCount: function() {return this.size},
  25802. firstLine: function() {return this.first},
  25803. lastLine: function() {return this.first + this.size - 1},
  25804. clipPos: function(pos) {return clipPos(this, pos)},
  25805. getCursor: function(start) {
  25806. var range = this.sel.primary(), pos
  25807. if (start == null || start == "head") { pos = range.head }
  25808. else if (start == "anchor") { pos = range.anchor }
  25809. else if (start == "end" || start == "to" || start === false) { pos = range.to() }
  25810. else { pos = range.from() }
  25811. return pos
  25812. },
  25813. listSelections: function() { return this.sel.ranges },
  25814. somethingSelected: function() {return this.sel.somethingSelected()},
  25815. setCursor: docMethodOp(function(line, ch, options) {
  25816. setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options)
  25817. }),
  25818. setSelection: docMethodOp(function(anchor, head, options) {
  25819. setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options)
  25820. }),
  25821. extendSelection: docMethodOp(function(head, other, options) {
  25822. extendSelection(this, clipPos(this, head), other && clipPos(this, other), options)
  25823. }),
  25824. extendSelections: docMethodOp(function(heads, options) {
  25825. extendSelections(this, clipPosArray(this, heads), options)
  25826. }),
  25827. extendSelectionsBy: docMethodOp(function(f, options) {
  25828. var heads = map(this.sel.ranges, f)
  25829. extendSelections(this, clipPosArray(this, heads), options)
  25830. }),
  25831. setSelections: docMethodOp(function(ranges, primary, options) {
  25832. var this$1 = this;
  25833. if (!ranges.length) { return }
  25834. var out = []
  25835. for (var i = 0; i < ranges.length; i++)
  25836. { out[i] = new Range(clipPos(this$1, ranges[i].anchor),
  25837. clipPos(this$1, ranges[i].head)) }
  25838. if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex) }
  25839. setSelection(this, normalizeSelection(out, primary), options)
  25840. }),
  25841. addSelection: docMethodOp(function(anchor, head, options) {
  25842. var ranges = this.sel.ranges.slice(0)
  25843. ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)))
  25844. setSelection(this, normalizeSelection(ranges, ranges.length - 1), options)
  25845. }),
  25846. getSelection: function(lineSep) {
  25847. var this$1 = this;
  25848. var ranges = this.sel.ranges, lines
  25849. for (var i = 0; i < ranges.length; i++) {
  25850. var sel = getBetween(this$1, ranges[i].from(), ranges[i].to())
  25851. lines = lines ? lines.concat(sel) : sel
  25852. }
  25853. if (lineSep === false) { return lines }
  25854. else { return lines.join(lineSep || this.lineSeparator()) }
  25855. },
  25856. getSelections: function(lineSep) {
  25857. var this$1 = this;
  25858. var parts = [], ranges = this.sel.ranges
  25859. for (var i = 0; i < ranges.length; i++) {
  25860. var sel = getBetween(this$1, ranges[i].from(), ranges[i].to())
  25861. if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()) }
  25862. parts[i] = sel
  25863. }
  25864. return parts
  25865. },
  25866. replaceSelection: function(code, collapse, origin) {
  25867. var dup = []
  25868. for (var i = 0; i < this.sel.ranges.length; i++)
  25869. { dup[i] = code }
  25870. this.replaceSelections(dup, collapse, origin || "+input")
  25871. },
  25872. replaceSelections: docMethodOp(function(code, collapse, origin) {
  25873. var this$1 = this;
  25874. var changes = [], sel = this.sel
  25875. for (var i = 0; i < sel.ranges.length; i++) {
  25876. var range = sel.ranges[i]
  25877. changes[i] = {from: range.from(), to: range.to(), text: this$1.splitLines(code[i]), origin: origin}
  25878. }
  25879. var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse)
  25880. for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)
  25881. { makeChange(this$1, changes[i$1]) }
  25882. if (newSel) { setSelectionReplaceHistory(this, newSel) }
  25883. else if (this.cm) { ensureCursorVisible(this.cm) }
  25884. }),
  25885. undo: docMethodOp(function() {makeChangeFromHistory(this, "undo")}),
  25886. redo: docMethodOp(function() {makeChangeFromHistory(this, "redo")}),
  25887. undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true)}),
  25888. redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true)}),
  25889. setExtending: function(val) {this.extend = val},
  25890. getExtending: function() {return this.extend},
  25891. historySize: function() {
  25892. var hist = this.history, done = 0, undone = 0
  25893. for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done } }
  25894. for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone } }
  25895. return {undo: done, redo: undone}
  25896. },
  25897. clearHistory: function() {this.history = new History(this.history.maxGeneration)},
  25898. markClean: function() {
  25899. this.cleanGeneration = this.changeGeneration(true)
  25900. },
  25901. changeGeneration: function(forceSplit) {
  25902. if (forceSplit)
  25903. { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null }
  25904. return this.history.generation
  25905. },
  25906. isClean: function (gen) {
  25907. return this.history.generation == (gen || this.cleanGeneration)
  25908. },
  25909. getHistory: function() {
  25910. return {done: copyHistoryArray(this.history.done),
  25911. undone: copyHistoryArray(this.history.undone)}
  25912. },
  25913. setHistory: function(histData) {
  25914. var hist = this.history = new History(this.history.maxGeneration)
  25915. hist.done = copyHistoryArray(histData.done.slice(0), null, true)
  25916. hist.undone = copyHistoryArray(histData.undone.slice(0), null, true)
  25917. },
  25918. setGutterMarker: docMethodOp(function(line, gutterID, value) {
  25919. return changeLine(this, line, "gutter", function (line) {
  25920. var markers = line.gutterMarkers || (line.gutterMarkers = {})
  25921. markers[gutterID] = value
  25922. if (!value && isEmpty(markers)) { line.gutterMarkers = null }
  25923. return true
  25924. })
  25925. }),
  25926. clearGutter: docMethodOp(function(gutterID) {
  25927. var this$1 = this;
  25928. this.iter(function (line) {
  25929. if (line.gutterMarkers && line.gutterMarkers[gutterID]) {
  25930. changeLine(this$1, line, "gutter", function () {
  25931. line.gutterMarkers[gutterID] = null
  25932. if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null }
  25933. return true
  25934. })
  25935. }
  25936. })
  25937. }),
  25938. lineInfo: function(line) {
  25939. var n
  25940. if (typeof line == "number") {
  25941. if (!isLine(this, line)) { return null }
  25942. n = line
  25943. line = getLine(this, line)
  25944. if (!line) { return null }
  25945. } else {
  25946. n = lineNo(line)
  25947. if (n == null) { return null }
  25948. }
  25949. return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,
  25950. textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,
  25951. widgets: line.widgets}
  25952. },
  25953. addLineClass: docMethodOp(function(handle, where, cls) {
  25954. return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) {
  25955. var prop = where == "text" ? "textClass"
  25956. : where == "background" ? "bgClass"
  25957. : where == "gutter" ? "gutterClass" : "wrapClass"
  25958. if (!line[prop]) { line[prop] = cls }
  25959. else if (classTest(cls).test(line[prop])) { return false }
  25960. else { line[prop] += " " + cls }
  25961. return true
  25962. })
  25963. }),
  25964. removeLineClass: docMethodOp(function(handle, where, cls) {
  25965. return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) {
  25966. var prop = where == "text" ? "textClass"
  25967. : where == "background" ? "bgClass"
  25968. : where == "gutter" ? "gutterClass" : "wrapClass"
  25969. var cur = line[prop]
  25970. if (!cur) { return false }
  25971. else if (cls == null) { line[prop] = null }
  25972. else {
  25973. var found = cur.match(classTest(cls))
  25974. if (!found) { return false }
  25975. var end = found.index + found[0].length
  25976. line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null
  25977. }
  25978. return true
  25979. })
  25980. }),
  25981. addLineWidget: docMethodOp(function(handle, node, options) {
  25982. return addLineWidget(this, handle, node, options)
  25983. }),
  25984. removeLineWidget: function(widget) { widget.clear() },
  25985. markText: function(from, to, options) {
  25986. return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range")
  25987. },
  25988. setBookmark: function(pos, options) {
  25989. var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),
  25990. insertLeft: options && options.insertLeft,
  25991. clearWhenEmpty: false, shared: options && options.shared,
  25992. handleMouseEvents: options && options.handleMouseEvents}
  25993. pos = clipPos(this, pos)
  25994. return markText(this, pos, pos, realOpts, "bookmark")
  25995. },
  25996. findMarksAt: function(pos) {
  25997. pos = clipPos(this, pos)
  25998. var markers = [], spans = getLine(this, pos.line).markedSpans
  25999. if (spans) { for (var i = 0; i < spans.length; ++i) {
  26000. var span = spans[i]
  26001. if ((span.from == null || span.from <= pos.ch) &&
  26002. (span.to == null || span.to >= pos.ch))
  26003. { markers.push(span.marker.parent || span.marker) }
  26004. } }
  26005. return markers
  26006. },
  26007. findMarks: function(from, to, filter) {
  26008. from = clipPos(this, from); to = clipPos(this, to)
  26009. var found = [], lineNo = from.line
  26010. this.iter(from.line, to.line + 1, function (line) {
  26011. var spans = line.markedSpans
  26012. if (spans) { for (var i = 0; i < spans.length; i++) {
  26013. var span = spans[i]
  26014. if (!(span.to != null && lineNo == from.line && from.ch >= span.to ||
  26015. span.from == null && lineNo != from.line ||
  26016. span.from != null && lineNo == to.line && span.from >= to.ch) &&
  26017. (!filter || filter(span.marker)))
  26018. { found.push(span.marker.parent || span.marker) }
  26019. } }
  26020. ++lineNo
  26021. })
  26022. return found
  26023. },
  26024. getAllMarks: function() {
  26025. var markers = []
  26026. this.iter(function (line) {
  26027. var sps = line.markedSpans
  26028. if (sps) { for (var i = 0; i < sps.length; ++i)
  26029. { if (sps[i].from != null) { markers.push(sps[i].marker) } } }
  26030. })
  26031. return markers
  26032. },
  26033. posFromIndex: function(off) {
  26034. var ch, lineNo = this.first, sepSize = this.lineSeparator().length
  26035. this.iter(function (line) {
  26036. var sz = line.text.length + sepSize
  26037. if (sz > off) { ch = off; return true }
  26038. off -= sz
  26039. ++lineNo
  26040. })
  26041. return clipPos(this, Pos(lineNo, ch))
  26042. },
  26043. indexFromPos: function (coords) {
  26044. coords = clipPos(this, coords)
  26045. var index = coords.ch
  26046. if (coords.line < this.first || coords.ch < 0) { return 0 }
  26047. var sepSize = this.lineSeparator().length
  26048. this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value
  26049. index += line.text.length + sepSize
  26050. })
  26051. return index
  26052. },
  26053. copy: function(copyHistory) {
  26054. var doc = new Doc(getLines(this, this.first, this.first + this.size),
  26055. this.modeOption, this.first, this.lineSep)
  26056. doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft
  26057. doc.sel = this.sel
  26058. doc.extend = false
  26059. if (copyHistory) {
  26060. doc.history.undoDepth = this.history.undoDepth
  26061. doc.setHistory(this.getHistory())
  26062. }
  26063. return doc
  26064. },
  26065. linkedDoc: function(options) {
  26066. if (!options) { options = {} }
  26067. var from = this.first, to = this.first + this.size
  26068. if (options.from != null && options.from > from) { from = options.from }
  26069. if (options.to != null && options.to < to) { to = options.to }
  26070. var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep)
  26071. if (options.sharedHist) { copy.history = this.history
  26072. ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist})
  26073. copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]
  26074. copySharedMarkers(copy, findSharedMarkers(this))
  26075. return copy
  26076. },
  26077. unlinkDoc: function(other) {
  26078. var this$1 = this;
  26079. if (other instanceof CodeMirror) { other = other.doc }
  26080. if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {
  26081. var link = this$1.linked[i]
  26082. if (link.doc != other) { continue }
  26083. this$1.linked.splice(i, 1)
  26084. other.unlinkDoc(this$1)
  26085. detachSharedMarkers(findSharedMarkers(this$1))
  26086. break
  26087. } }
  26088. // If the histories were shared, split them again
  26089. if (other.history == this.history) {
  26090. var splitIds = [other.id]
  26091. linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true)
  26092. other.history = new History(null)
  26093. other.history.done = copyHistoryArray(this.history.done, splitIds)
  26094. other.history.undone = copyHistoryArray(this.history.undone, splitIds)
  26095. }
  26096. },
  26097. iterLinkedDocs: function(f) {linkedDocs(this, f)},
  26098. getMode: function() {return this.mode},
  26099. getEditor: function() {return this.cm},
  26100. splitLines: function(str) {
  26101. if (this.lineSep) { return str.split(this.lineSep) }
  26102. return splitLinesAuto(str)
  26103. },
  26104. lineSeparator: function() { return this.lineSep || "\n" }
  26105. })
  26106. // Public alias.
  26107. Doc.prototype.eachLine = Doc.prototype.iter
  26108. // Kludge to work around strange IE behavior where it'll sometimes
  26109. // re-fire a series of drag-related events right after the drop (#1551)
  26110. var lastDrop = 0
  26111. function onDrop(e) {
  26112. var cm = this
  26113. clearDragCursor(cm)
  26114. if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))
  26115. { return }
  26116. e_preventDefault(e)
  26117. if (ie) { lastDrop = +new Date }
  26118. var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files
  26119. if (!pos || cm.isReadOnly()) { return }
  26120. // Might be a file drop, in which case we simply extract the text
  26121. // and insert it.
  26122. if (files && files.length && window.FileReader && window.File) {
  26123. var n = files.length, text = Array(n), read = 0
  26124. var loadFile = function (file, i) {
  26125. if (cm.options.allowDropFileTypes &&
  26126. indexOf(cm.options.allowDropFileTypes, file.type) == -1)
  26127. { return }
  26128. var reader = new FileReader
  26129. reader.onload = operation(cm, function () {
  26130. var content = reader.result
  26131. if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) { content = "" }
  26132. text[i] = content
  26133. if (++read == n) {
  26134. pos = clipPos(cm.doc, pos)
  26135. var change = {from: pos, to: pos,
  26136. text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),
  26137. origin: "paste"}
  26138. makeChange(cm.doc, change)
  26139. setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)))
  26140. }
  26141. })
  26142. reader.readAsText(file)
  26143. }
  26144. for (var i = 0; i < n; ++i) { loadFile(files[i], i) }
  26145. } else { // Normal drop
  26146. // Don't do a replace if the drop happened inside of the selected text.
  26147. if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {
  26148. cm.state.draggingText(e)
  26149. // Ensure the editor is re-focused
  26150. setTimeout(function () { return cm.display.input.focus(); }, 20)
  26151. return
  26152. }
  26153. try {
  26154. var text$1 = e.dataTransfer.getData("Text")
  26155. if (text$1) {
  26156. var selected
  26157. if (cm.state.draggingText && !cm.state.draggingText.copy)
  26158. { selected = cm.listSelections() }
  26159. setSelectionNoUndo(cm.doc, simpleSelection(pos, pos))
  26160. if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)
  26161. { replaceRange(cm.doc, "", selected[i$1].anchor, selected[i$1].head, "drag") } }
  26162. cm.replaceSelection(text$1, "around", "paste")
  26163. cm.display.input.focus()
  26164. }
  26165. }
  26166. catch(e){}
  26167. }
  26168. }
  26169. function onDragStart(cm, e) {
  26170. if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }
  26171. if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }
  26172. e.dataTransfer.setData("Text", cm.getSelection())
  26173. e.dataTransfer.effectAllowed = "copyMove"
  26174. // Use dummy image instead of default browsers image.
  26175. // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.
  26176. if (e.dataTransfer.setDragImage && !safari) {
  26177. var img = elt("img", null, null, "position: fixed; left: 0; top: 0;")
  26178. img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
  26179. if (presto) {
  26180. img.width = img.height = 1
  26181. cm.display.wrapper.appendChild(img)
  26182. // Force a relayout, or Opera won't use our image for some obscure reason
  26183. img._top = img.offsetTop
  26184. }
  26185. e.dataTransfer.setDragImage(img, 0, 0)
  26186. if (presto) { img.parentNode.removeChild(img) }
  26187. }
  26188. }
  26189. function onDragOver(cm, e) {
  26190. var pos = posFromMouse(cm, e)
  26191. if (!pos) { return }
  26192. var frag = document.createDocumentFragment()
  26193. drawSelectionCursor(cm, pos, frag)
  26194. if (!cm.display.dragCursor) {
  26195. cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors")
  26196. cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv)
  26197. }
  26198. removeChildrenAndAdd(cm.display.dragCursor, frag)
  26199. }
  26200. function clearDragCursor(cm) {
  26201. if (cm.display.dragCursor) {
  26202. cm.display.lineSpace.removeChild(cm.display.dragCursor)
  26203. cm.display.dragCursor = null
  26204. }
  26205. }
  26206. // These must be handled carefully, because naively registering a
  26207. // handler for each editor will cause the editors to never be
  26208. // garbage collected.
  26209. function forEachCodeMirror(f) {
  26210. if (!document.body.getElementsByClassName) { return }
  26211. var byClass = document.body.getElementsByClassName("CodeMirror")
  26212. for (var i = 0; i < byClass.length; i++) {
  26213. var cm = byClass[i].CodeMirror
  26214. if (cm) { f(cm) }
  26215. }
  26216. }
  26217. var globalsRegistered = false
  26218. function ensureGlobalHandlers() {
  26219. if (globalsRegistered) { return }
  26220. registerGlobalHandlers()
  26221. globalsRegistered = true
  26222. }
  26223. function registerGlobalHandlers() {
  26224. // When the window resizes, we need to refresh active editors.
  26225. var resizeTimer
  26226. on(window, "resize", function () {
  26227. if (resizeTimer == null) { resizeTimer = setTimeout(function () {
  26228. resizeTimer = null
  26229. forEachCodeMirror(onResize)
  26230. }, 100) }
  26231. })
  26232. // When the window loses focus, we want to show the editor as blurred
  26233. on(window, "blur", function () { return forEachCodeMirror(onBlur); })
  26234. }
  26235. // Called when the window resizes
  26236. function onResize(cm) {
  26237. var d = cm.display
  26238. if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth)
  26239. { return }
  26240. // Might be a text scaling operation, clear size caches.
  26241. d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null
  26242. d.scrollbarsClipped = false
  26243. cm.setSize()
  26244. }
  26245. var keyNames = {
  26246. 3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt",
  26247. 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End",
  26248. 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert",
  26249. 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod",
  26250. 106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 127: "Delete",
  26251. 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\",
  26252. 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete",
  26253. 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert"
  26254. }
  26255. // Number keys
  26256. for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i) }
  26257. // Alphabetic keys
  26258. for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1) }
  26259. // Function keys
  26260. for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = "F" + i$2 }
  26261. var keyMap = {}
  26262. keyMap.basic = {
  26263. "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown",
  26264. "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown",
  26265. "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore",
  26266. "Tab": "defaultTab", "Shift-Tab": "indentAuto",
  26267. "Enter": "newlineAndIndent", "Insert": "toggleOverwrite",
  26268. "Esc": "singleSelection"
  26269. }
  26270. // Note that the save and find-related commands aren't defined by
  26271. // default. User code or addons can define them. Unknown commands
  26272. // are simply ignored.
  26273. keyMap.pcDefault = {
  26274. "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo",
  26275. "Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown",
  26276. "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd",
  26277. "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find",
  26278. "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll",
  26279. "Ctrl-[": "indentLess", "Ctrl-]": "indentMore",
  26280. "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection",
  26281. fallthrough: "basic"
  26282. }
  26283. // Very basic readline/emacs-style bindings, which are standard on Mac.
  26284. keyMap.emacsy = {
  26285. "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown",
  26286. "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
  26287. "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore",
  26288. "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars",
  26289. "Ctrl-O": "openLine"
  26290. }
  26291. keyMap.macDefault = {
  26292. "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo",
  26293. "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft",
  26294. "Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore",
  26295. "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find",
  26296. "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll",
  26297. "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight",
  26298. "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd",
  26299. fallthrough: ["basic", "emacsy"]
  26300. }
  26301. keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault
  26302. // KEYMAP DISPATCH
  26303. function normalizeKeyName(name) {
  26304. var parts = name.split(/-(?!$)/)
  26305. name = parts[parts.length - 1]
  26306. var alt, ctrl, shift, cmd
  26307. for (var i = 0; i < parts.length - 1; i++) {
  26308. var mod = parts[i]
  26309. if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true }
  26310. else if (/^a(lt)?$/i.test(mod)) { alt = true }
  26311. else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true }
  26312. else if (/^s(hift)?$/i.test(mod)) { shift = true }
  26313. else { throw new Error("Unrecognized modifier name: " + mod) }
  26314. }
  26315. if (alt) { name = "Alt-" + name }
  26316. if (ctrl) { name = "Ctrl-" + name }
  26317. if (cmd) { name = "Cmd-" + name }
  26318. if (shift) { name = "Shift-" + name }
  26319. return name
  26320. }
  26321. // This is a kludge to keep keymaps mostly working as raw objects
  26322. // (backwards compatibility) while at the same time support features
  26323. // like normalization and multi-stroke key bindings. It compiles a
  26324. // new normalized keymap, and then updates the old object to reflect
  26325. // this.
  26326. function normalizeKeyMap(keymap) {
  26327. var copy = {}
  26328. for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {
  26329. var value = keymap[keyname]
  26330. if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }
  26331. if (value == "...") { delete keymap[keyname]; continue }
  26332. var keys = map(keyname.split(" "), normalizeKeyName)
  26333. for (var i = 0; i < keys.length; i++) {
  26334. var val = (void 0), name = (void 0)
  26335. if (i == keys.length - 1) {
  26336. name = keys.join(" ")
  26337. val = value
  26338. } else {
  26339. name = keys.slice(0, i + 1).join(" ")
  26340. val = "..."
  26341. }
  26342. var prev = copy[name]
  26343. if (!prev) { copy[name] = val }
  26344. else if (prev != val) { throw new Error("Inconsistent bindings for " + name) }
  26345. }
  26346. delete keymap[keyname]
  26347. } }
  26348. for (var prop in copy) { keymap[prop] = copy[prop] }
  26349. return keymap
  26350. }
  26351. function lookupKey(key, map, handle, context) {
  26352. map = getKeyMap(map)
  26353. var found = map.call ? map.call(key, context) : map[key]
  26354. if (found === false) { return "nothing" }
  26355. if (found === "...") { return "multi" }
  26356. if (found != null && handle(found)) { return "handled" }
  26357. if (map.fallthrough) {
  26358. if (Object.prototype.toString.call(map.fallthrough) != "[object Array]")
  26359. { return lookupKey(key, map.fallthrough, handle, context) }
  26360. for (var i = 0; i < map.fallthrough.length; i++) {
  26361. var result = lookupKey(key, map.fallthrough[i], handle, context)
  26362. if (result) { return result }
  26363. }
  26364. }
  26365. }
  26366. // Modifier key presses don't count as 'real' key presses for the
  26367. // purpose of keymap fallthrough.
  26368. function isModifierKey(value) {
  26369. var name = typeof value == "string" ? value : keyNames[value.keyCode]
  26370. return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"
  26371. }
  26372. // Look up the name of a key as indicated by an event object.
  26373. function keyName(event, noShift) {
  26374. if (presto && event.keyCode == 34 && event["char"]) { return false }
  26375. var base = keyNames[event.keyCode], name = base
  26376. if (name == null || event.altGraphKey) { return false }
  26377. if (event.altKey && base != "Alt") { name = "Alt-" + name }
  26378. if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { name = "Ctrl-" + name }
  26379. if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") { name = "Cmd-" + name }
  26380. if (!noShift && event.shiftKey && base != "Shift") { name = "Shift-" + name }
  26381. return name
  26382. }
  26383. function getKeyMap(val) {
  26384. return typeof val == "string" ? keyMap[val] : val
  26385. }
  26386. // Helper for deleting text near the selection(s), used to implement
  26387. // backspace, delete, and similar functionality.
  26388. function deleteNearSelection(cm, compute) {
  26389. var ranges = cm.doc.sel.ranges, kill = []
  26390. // Build up a set of ranges to kill first, merging overlapping
  26391. // ranges.
  26392. for (var i = 0; i < ranges.length; i++) {
  26393. var toKill = compute(ranges[i])
  26394. while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {
  26395. var replaced = kill.pop()
  26396. if (cmp(replaced.from, toKill.from) < 0) {
  26397. toKill.from = replaced.from
  26398. break
  26399. }
  26400. }
  26401. kill.push(toKill)
  26402. }
  26403. // Next, remove those actual ranges.
  26404. runInOp(cm, function () {
  26405. for (var i = kill.length - 1; i >= 0; i--)
  26406. { replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete") }
  26407. ensureCursorVisible(cm)
  26408. })
  26409. }
  26410. // Commands are parameter-less actions that can be performed on an
  26411. // editor, mostly used for keybindings.
  26412. var commands = {
  26413. selectAll: selectAll,
  26414. singleSelection: function (cm) { return cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); },
  26415. killLine: function (cm) { return deleteNearSelection(cm, function (range) {
  26416. if (range.empty()) {
  26417. var len = getLine(cm.doc, range.head.line).text.length
  26418. if (range.head.ch == len && range.head.line < cm.lastLine())
  26419. { return {from: range.head, to: Pos(range.head.line + 1, 0)} }
  26420. else
  26421. { return {from: range.head, to: Pos(range.head.line, len)} }
  26422. } else {
  26423. return {from: range.from(), to: range.to()}
  26424. }
  26425. }); },
  26426. deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({
  26427. from: Pos(range.from().line, 0),
  26428. to: clipPos(cm.doc, Pos(range.to().line + 1, 0))
  26429. }); }); },
  26430. delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({
  26431. from: Pos(range.from().line, 0), to: range.from()
  26432. }); }); },
  26433. delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {
  26434. var top = cm.charCoords(range.head, "div").top + 5
  26435. var leftPos = cm.coordsChar({left: 0, top: top}, "div")
  26436. return {from: leftPos, to: range.from()}
  26437. }); },
  26438. delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {
  26439. var top = cm.charCoords(range.head, "div").top + 5
  26440. var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div")
  26441. return {from: range.from(), to: rightPos }
  26442. }); },
  26443. undo: function (cm) { return cm.undo(); },
  26444. redo: function (cm) { return cm.redo(); },
  26445. undoSelection: function (cm) { return cm.undoSelection(); },
  26446. redoSelection: function (cm) { return cm.redoSelection(); },
  26447. goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },
  26448. goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },
  26449. goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },
  26450. {origin: "+move", bias: 1}
  26451. ); },
  26452. goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },
  26453. {origin: "+move", bias: 1}
  26454. ); },
  26455. goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },
  26456. {origin: "+move", bias: -1}
  26457. ); },
  26458. goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {
  26459. var top = cm.charCoords(range.head, "div").top + 5
  26460. return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div")
  26461. }, sel_move); },
  26462. goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {
  26463. var top = cm.charCoords(range.head, "div").top + 5
  26464. return cm.coordsChar({left: 0, top: top}, "div")
  26465. }, sel_move); },
  26466. goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {
  26467. var top = cm.charCoords(range.head, "div").top + 5
  26468. var pos = cm.coordsChar({left: 0, top: top}, "div")
  26469. if (pos.ch < cm.getLine(pos.line).search(/\S/)) { return lineStartSmart(cm, range.head) }
  26470. return pos
  26471. }, sel_move); },
  26472. goLineUp: function (cm) { return cm.moveV(-1, "line"); },
  26473. goLineDown: function (cm) { return cm.moveV(1, "line"); },
  26474. goPageUp: function (cm) { return cm.moveV(-1, "page"); },
  26475. goPageDown: function (cm) { return cm.moveV(1, "page"); },
  26476. goCharLeft: function (cm) { return cm.moveH(-1, "char"); },
  26477. goCharRight: function (cm) { return cm.moveH(1, "char"); },
  26478. goColumnLeft: function (cm) { return cm.moveH(-1, "column"); },
  26479. goColumnRight: function (cm) { return cm.moveH(1, "column"); },
  26480. goWordLeft: function (cm) { return cm.moveH(-1, "word"); },
  26481. goGroupRight: function (cm) { return cm.moveH(1, "group"); },
  26482. goGroupLeft: function (cm) { return cm.moveH(-1, "group"); },
  26483. goWordRight: function (cm) { return cm.moveH(1, "word"); },
  26484. delCharBefore: function (cm) { return cm.deleteH(-1, "char"); },
  26485. delCharAfter: function (cm) { return cm.deleteH(1, "char"); },
  26486. delWordBefore: function (cm) { return cm.deleteH(-1, "word"); },
  26487. delWordAfter: function (cm) { return cm.deleteH(1, "word"); },
  26488. delGroupBefore: function (cm) { return cm.deleteH(-1, "group"); },
  26489. delGroupAfter: function (cm) { return cm.deleteH(1, "group"); },
  26490. indentAuto: function (cm) { return cm.indentSelection("smart"); },
  26491. indentMore: function (cm) { return cm.indentSelection("add"); },
  26492. indentLess: function (cm) { return cm.indentSelection("subtract"); },
  26493. insertTab: function (cm) { return cm.replaceSelection("\t"); },
  26494. insertSoftTab: function (cm) {
  26495. var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize
  26496. for (var i = 0; i < ranges.length; i++) {
  26497. var pos = ranges[i].from()
  26498. var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize)
  26499. spaces.push(spaceStr(tabSize - col % tabSize))
  26500. }
  26501. cm.replaceSelections(spaces)
  26502. },
  26503. defaultTab: function (cm) {
  26504. if (cm.somethingSelected()) { cm.indentSelection("add") }
  26505. else { cm.execCommand("insertTab") }
  26506. },
  26507. // Swap the two chars left and right of each selection's head.
  26508. // Move cursor behind the two swapped characters afterwards.
  26509. //
  26510. // Doesn't consider line feeds a character.
  26511. // Doesn't scan more than one line above to find a character.
  26512. // Doesn't do anything on an empty line.
  26513. // Doesn't do anything with non-empty selections.
  26514. transposeChars: function (cm) { return runInOp(cm, function () {
  26515. var ranges = cm.listSelections(), newSel = []
  26516. for (var i = 0; i < ranges.length; i++) {
  26517. if (!ranges[i].empty()) { continue }
  26518. var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text
  26519. if (line) {
  26520. if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1) }
  26521. if (cur.ch > 0) {
  26522. cur = new Pos(cur.line, cur.ch + 1)
  26523. cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),
  26524. Pos(cur.line, cur.ch - 2), cur, "+transpose")
  26525. } else if (cur.line > cm.doc.first) {
  26526. var prev = getLine(cm.doc, cur.line - 1).text
  26527. if (prev) {
  26528. cur = new Pos(cur.line, 1)
  26529. cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +
  26530. prev.charAt(prev.length - 1),
  26531. Pos(cur.line - 1, prev.length - 1), cur, "+transpose")
  26532. }
  26533. }
  26534. }
  26535. newSel.push(new Range(cur, cur))
  26536. }
  26537. cm.setSelections(newSel)
  26538. }); },
  26539. newlineAndIndent: function (cm) { return runInOp(cm, function () {
  26540. var sels = cm.listSelections()
  26541. for (var i = sels.length - 1; i >= 0; i--)
  26542. { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, "+input") }
  26543. sels = cm.listSelections()
  26544. for (var i$1 = 0; i$1 < sels.length; i$1++)
  26545. { cm.indentLine(sels[i$1].from().line, null, true) }
  26546. ensureCursorVisible(cm)
  26547. }); },
  26548. openLine: function (cm) { return cm.replaceSelection("\n", "start"); },
  26549. toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }
  26550. }
  26551. function lineStart(cm, lineN) {
  26552. var line = getLine(cm.doc, lineN)
  26553. var visual = visualLine(line)
  26554. if (visual != line) { lineN = lineNo(visual) }
  26555. var order = getOrder(visual)
  26556. var ch = !order ? 0 : order[0].level % 2 ? lineRight(visual) : lineLeft(visual)
  26557. return Pos(lineN, ch)
  26558. }
  26559. function lineEnd(cm, lineN) {
  26560. var merged, line = getLine(cm.doc, lineN)
  26561. while (merged = collapsedSpanAtEnd(line)) {
  26562. line = merged.find(1, true).line
  26563. lineN = null
  26564. }
  26565. var order = getOrder(line)
  26566. var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line)
  26567. return Pos(lineN == null ? lineNo(line) : lineN, ch)
  26568. }
  26569. function lineStartSmart(cm, pos) {
  26570. var start = lineStart(cm, pos.line)
  26571. var line = getLine(cm.doc, start.line)
  26572. var order = getOrder(line)
  26573. if (!order || order[0].level == 0) {
  26574. var firstNonWS = Math.max(0, line.text.search(/\S/))
  26575. var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch
  26576. return Pos(start.line, inWS ? 0 : firstNonWS)
  26577. }
  26578. return start
  26579. }
  26580. // Run a handler that was bound to a key.
  26581. function doHandleBinding(cm, bound, dropShift) {
  26582. if (typeof bound == "string") {
  26583. bound = commands[bound]
  26584. if (!bound) { return false }
  26585. }
  26586. // Ensure previous input has been read, so that the handler sees a
  26587. // consistent view of the document
  26588. cm.display.input.ensurePolled()
  26589. var prevShift = cm.display.shift, done = false
  26590. try {
  26591. if (cm.isReadOnly()) { cm.state.suppressEdits = true }
  26592. if (dropShift) { cm.display.shift = false }
  26593. done = bound(cm) != Pass
  26594. } finally {
  26595. cm.display.shift = prevShift
  26596. cm.state.suppressEdits = false
  26597. }
  26598. return done
  26599. }
  26600. function lookupKeyForEditor(cm, name, handle) {
  26601. for (var i = 0; i < cm.state.keyMaps.length; i++) {
  26602. var result = lookupKey(name, cm.state.keyMaps[i], handle, cm)
  26603. if (result) { return result }
  26604. }
  26605. return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))
  26606. || lookupKey(name, cm.options.keyMap, handle, cm)
  26607. }
  26608. var stopSeq = new Delayed
  26609. function dispatchKey(cm, name, e, handle) {
  26610. var seq = cm.state.keySeq
  26611. if (seq) {
  26612. if (isModifierKey(name)) { return "handled" }
  26613. stopSeq.set(50, function () {
  26614. if (cm.state.keySeq == seq) {
  26615. cm.state.keySeq = null
  26616. cm.display.input.reset()
  26617. }
  26618. })
  26619. name = seq + " " + name
  26620. }
  26621. var result = lookupKeyForEditor(cm, name, handle)
  26622. if (result == "multi")
  26623. { cm.state.keySeq = name }
  26624. if (result == "handled")
  26625. { signalLater(cm, "keyHandled", cm, name, e) }
  26626. if (result == "handled" || result == "multi") {
  26627. e_preventDefault(e)
  26628. restartBlink(cm)
  26629. }
  26630. if (seq && !result && /\'$/.test(name)) {
  26631. e_preventDefault(e)
  26632. return true
  26633. }
  26634. return !!result
  26635. }
  26636. // Handle a key from the keydown event.
  26637. function handleKeyBinding(cm, e) {
  26638. var name = keyName(e, true)
  26639. if (!name) { return false }
  26640. if (e.shiftKey && !cm.state.keySeq) {
  26641. // First try to resolve full name (including 'Shift-'). Failing
  26642. // that, see if there is a cursor-motion command (starting with
  26643. // 'go') bound to the keyname without 'Shift-'.
  26644. return dispatchKey(cm, "Shift-" + name, e, function (b) { return doHandleBinding(cm, b, true); })
  26645. || dispatchKey(cm, name, e, function (b) {
  26646. if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion)
  26647. { return doHandleBinding(cm, b) }
  26648. })
  26649. } else {
  26650. return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })
  26651. }
  26652. }
  26653. // Handle a key from the keypress event
  26654. function handleCharBinding(cm, e, ch) {
  26655. return dispatchKey(cm, "'" + ch + "'", e, function (b) { return doHandleBinding(cm, b, true); })
  26656. }
  26657. var lastStoppedKey = null
  26658. function onKeyDown(e) {
  26659. var cm = this
  26660. cm.curOp.focus = activeElt()
  26661. if (signalDOMEvent(cm, e)) { return }
  26662. // IE does strange things with escape.
  26663. if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false }
  26664. var code = e.keyCode
  26665. cm.display.shift = code == 16 || e.shiftKey
  26666. var handled = handleKeyBinding(cm, e)
  26667. if (presto) {
  26668. lastStoppedKey = handled ? code : null
  26669. // Opera has no cut event... we try to at least catch the key combo
  26670. if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))
  26671. { cm.replaceSelection("", null, "cut") }
  26672. }
  26673. // Turn mouse into crosshair when Alt is held on Mac.
  26674. if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className))
  26675. { showCrossHair(cm) }
  26676. }
  26677. function showCrossHair(cm) {
  26678. var lineDiv = cm.display.lineDiv
  26679. addClass(lineDiv, "CodeMirror-crosshair")
  26680. function up(e) {
  26681. if (e.keyCode == 18 || !e.altKey) {
  26682. rmClass(lineDiv, "CodeMirror-crosshair")
  26683. off(document, "keyup", up)
  26684. off(document, "mouseover", up)
  26685. }
  26686. }
  26687. on(document, "keyup", up)
  26688. on(document, "mouseover", up)
  26689. }
  26690. function onKeyUp(e) {
  26691. if (e.keyCode == 16) { this.doc.sel.shift = false }
  26692. signalDOMEvent(this, e)
  26693. }
  26694. function onKeyPress(e) {
  26695. var cm = this
  26696. if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }
  26697. var keyCode = e.keyCode, charCode = e.charCode
  26698. if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}
  26699. if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }
  26700. var ch = String.fromCharCode(charCode == null ? keyCode : charCode)
  26701. // Some browsers fire keypress events for backspace
  26702. if (ch == "\x08") { return }
  26703. if (handleCharBinding(cm, e, ch)) { return }
  26704. cm.display.input.onKeyPress(e)
  26705. }
  26706. // A mouse down can be a single click, double click, triple click,
  26707. // start of selection drag, start of text drag, new cursor
  26708. // (ctrl-click), rectangle drag (alt-drag), or xwin
  26709. // middle-click-paste. Or it might be a click on something we should
  26710. // not interfere with, such as a scrollbar or widget.
  26711. function onMouseDown(e) {
  26712. var cm = this, display = cm.display
  26713. if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }
  26714. display.input.ensurePolled()
  26715. display.shift = e.shiftKey
  26716. if (eventInWidget(display, e)) {
  26717. if (!webkit) {
  26718. // Briefly turn off draggability, to allow widgets to do
  26719. // normal dragging things.
  26720. display.scroller.draggable = false
  26721. setTimeout(function () { return display.scroller.draggable = true; }, 100)
  26722. }
  26723. return
  26724. }
  26725. if (clickInGutter(cm, e)) { return }
  26726. var start = posFromMouse(cm, e)
  26727. window.focus()
  26728. switch (e_button(e)) {
  26729. case 1:
  26730. // #3261: make sure, that we're not starting a second selection
  26731. if (cm.state.selectingText)
  26732. { cm.state.selectingText(e) }
  26733. else if (start)
  26734. { leftButtonDown(cm, e, start) }
  26735. else if (e_target(e) == display.scroller)
  26736. { e_preventDefault(e) }
  26737. break
  26738. case 2:
  26739. if (webkit) { cm.state.lastMiddleDown = +new Date }
  26740. if (start) { extendSelection(cm.doc, start) }
  26741. setTimeout(function () { return display.input.focus(); }, 20)
  26742. e_preventDefault(e)
  26743. break
  26744. case 3:
  26745. if (captureRightClick) { onContextMenu(cm, e) }
  26746. else { delayBlurEvent(cm) }
  26747. break
  26748. }
  26749. }
  26750. var lastClick;
  26751. var lastDoubleClick;
  26752. function leftButtonDown(cm, e, start) {
  26753. if (ie) { setTimeout(bind(ensureFocus, cm), 0) }
  26754. else { cm.curOp.focus = activeElt() }
  26755. var now = +new Date, type
  26756. if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) {
  26757. type = "triple"
  26758. } else if (lastClick && lastClick.time > now - 400 && cmp(lastClick.pos, start) == 0) {
  26759. type = "double"
  26760. lastDoubleClick = {time: now, pos: start}
  26761. } else {
  26762. type = "single"
  26763. lastClick = {time: now, pos: start}
  26764. }
  26765. var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey, contained
  26766. if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&
  26767. type == "single" && (contained = sel.contains(start)) > -1 &&
  26768. (cmp((contained = sel.ranges[contained]).from(), start) < 0 || start.xRel > 0) &&
  26769. (cmp(contained.to(), start) > 0 || start.xRel < 0))
  26770. { leftButtonStartDrag(cm, e, start, modifier) }
  26771. else
  26772. { leftButtonSelect(cm, e, start, type, modifier) }
  26773. }
  26774. // Start a text drag. When it ends, see if any dragging actually
  26775. // happen, and treat as a click if it didn't.
  26776. function leftButtonStartDrag(cm, e, start, modifier) {
  26777. var display = cm.display, startTime = +new Date
  26778. var dragEnd = operation(cm, function (e2) {
  26779. if (webkit) { display.scroller.draggable = false }
  26780. cm.state.draggingText = false
  26781. off(document, "mouseup", dragEnd)
  26782. off(display.scroller, "drop", dragEnd)
  26783. if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) {
  26784. e_preventDefault(e2)
  26785. if (!modifier && +new Date - 200 < startTime)
  26786. { extendSelection(cm.doc, start) }
  26787. // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)
  26788. if (webkit || ie && ie_version == 9)
  26789. { setTimeout(function () {document.body.focus(); display.input.focus()}, 20) }
  26790. else
  26791. { display.input.focus() }
  26792. }
  26793. })
  26794. // Let the drag handler handle this.
  26795. if (webkit) { display.scroller.draggable = true }
  26796. cm.state.draggingText = dragEnd
  26797. dragEnd.copy = mac ? e.altKey : e.ctrlKey
  26798. // IE's approach to draggable
  26799. if (display.scroller.dragDrop) { display.scroller.dragDrop() }
  26800. on(document, "mouseup", dragEnd)
  26801. on(display.scroller, "drop", dragEnd)
  26802. }
  26803. // Normal selection, as opposed to text dragging.
  26804. function leftButtonSelect(cm, e, start, type, addNew) {
  26805. var display = cm.display, doc = cm.doc
  26806. e_preventDefault(e)
  26807. var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges
  26808. if (addNew && !e.shiftKey) {
  26809. ourIndex = doc.sel.contains(start)
  26810. if (ourIndex > -1)
  26811. { ourRange = ranges[ourIndex] }
  26812. else
  26813. { ourRange = new Range(start, start) }
  26814. } else {
  26815. ourRange = doc.sel.primary()
  26816. ourIndex = doc.sel.primIndex
  26817. }
  26818. if (chromeOS ? e.shiftKey && e.metaKey : e.altKey) {
  26819. type = "rect"
  26820. if (!addNew) { ourRange = new Range(start, start) }
  26821. start = posFromMouse(cm, e, true, true)
  26822. ourIndex = -1
  26823. } else if (type == "double") {
  26824. var word = cm.findWordAt(start)
  26825. if (cm.display.shift || doc.extend)
  26826. { ourRange = extendRange(doc, ourRange, word.anchor, word.head) }
  26827. else
  26828. { ourRange = word }
  26829. } else if (type == "triple") {
  26830. var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)))
  26831. if (cm.display.shift || doc.extend)
  26832. { ourRange = extendRange(doc, ourRange, line.anchor, line.head) }
  26833. else
  26834. { ourRange = line }
  26835. } else {
  26836. ourRange = extendRange(doc, ourRange, start)
  26837. }
  26838. if (!addNew) {
  26839. ourIndex = 0
  26840. setSelection(doc, new Selection([ourRange], 0), sel_mouse)
  26841. startSel = doc.sel
  26842. } else if (ourIndex == -1) {
  26843. ourIndex = ranges.length
  26844. setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),
  26845. {scroll: false, origin: "*mouse"})
  26846. } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == "single" && !e.shiftKey) {
  26847. setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),
  26848. {scroll: false, origin: "*mouse"})
  26849. startSel = doc.sel
  26850. } else {
  26851. replaceOneSelection(doc, ourIndex, ourRange, sel_mouse)
  26852. }
  26853. var lastPos = start
  26854. function extendTo(pos) {
  26855. if (cmp(lastPos, pos) == 0) { return }
  26856. lastPos = pos
  26857. if (type == "rect") {
  26858. var ranges = [], tabSize = cm.options.tabSize
  26859. var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize)
  26860. var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize)
  26861. var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol)
  26862. for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));
  26863. line <= end; line++) {
  26864. var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize)
  26865. if (left == right)
  26866. { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))) }
  26867. else if (text.length > leftPos)
  26868. { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))) }
  26869. }
  26870. if (!ranges.length) { ranges.push(new Range(start, start)) }
  26871. setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),
  26872. {origin: "*mouse", scroll: false})
  26873. cm.scrollIntoView(pos)
  26874. } else {
  26875. var oldRange = ourRange
  26876. var anchor = oldRange.anchor, head = pos
  26877. if (type != "single") {
  26878. var range
  26879. if (type == "double")
  26880. { range = cm.findWordAt(pos) }
  26881. else
  26882. { range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0))) }
  26883. if (cmp(range.anchor, anchor) > 0) {
  26884. head = range.head
  26885. anchor = minPos(oldRange.from(), range.anchor)
  26886. } else {
  26887. head = range.anchor
  26888. anchor = maxPos(oldRange.to(), range.head)
  26889. }
  26890. }
  26891. var ranges$1 = startSel.ranges.slice(0)
  26892. ranges$1[ourIndex] = new Range(clipPos(doc, anchor), head)
  26893. setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse)
  26894. }
  26895. }
  26896. var editorSize = display.wrapper.getBoundingClientRect()
  26897. // Used to ensure timeout re-tries don't fire when another extend
  26898. // happened in the meantime (clearTimeout isn't reliable -- at
  26899. // least on Chrome, the timeouts still happen even when cleared,
  26900. // if the clear happens after their scheduled firing time).
  26901. var counter = 0
  26902. function extend(e) {
  26903. var curCount = ++counter
  26904. var cur = posFromMouse(cm, e, true, type == "rect")
  26905. if (!cur) { return }
  26906. if (cmp(cur, lastPos) != 0) {
  26907. cm.curOp.focus = activeElt()
  26908. extendTo(cur)
  26909. var visible = visibleLines(display, doc)
  26910. if (cur.line >= visible.to || cur.line < visible.from)
  26911. { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e) }}), 150) }
  26912. } else {
  26913. var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0
  26914. if (outside) { setTimeout(operation(cm, function () {
  26915. if (counter != curCount) { return }
  26916. display.scroller.scrollTop += outside
  26917. extend(e)
  26918. }), 50) }
  26919. }
  26920. }
  26921. function done(e) {
  26922. cm.state.selectingText = false
  26923. counter = Infinity
  26924. e_preventDefault(e)
  26925. display.input.focus()
  26926. off(document, "mousemove", move)
  26927. off(document, "mouseup", up)
  26928. doc.history.lastSelOrigin = null
  26929. }
  26930. var move = operation(cm, function (e) {
  26931. if (!e_button(e)) { done(e) }
  26932. else { extend(e) }
  26933. })
  26934. var up = operation(cm, done)
  26935. cm.state.selectingText = up
  26936. on(document, "mousemove", move)
  26937. on(document, "mouseup", up)
  26938. }
  26939. // Determines whether an event happened in the gutter, and fires the
  26940. // handlers for the corresponding event.
  26941. function gutterEvent(cm, e, type, prevent) {
  26942. var mX, mY
  26943. try { mX = e.clientX; mY = e.clientY }
  26944. catch(e) { return false }
  26945. if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }
  26946. if (prevent) { e_preventDefault(e) }
  26947. var display = cm.display
  26948. var lineBox = display.lineDiv.getBoundingClientRect()
  26949. if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }
  26950. mY -= lineBox.top - display.viewOffset
  26951. for (var i = 0; i < cm.options.gutters.length; ++i) {
  26952. var g = display.gutters.childNodes[i]
  26953. if (g && g.getBoundingClientRect().right >= mX) {
  26954. var line = lineAtHeight(cm.doc, mY)
  26955. var gutter = cm.options.gutters[i]
  26956. signal(cm, type, cm, line, gutter, e)
  26957. return e_defaultPrevented(e)
  26958. }
  26959. }
  26960. }
  26961. function clickInGutter(cm, e) {
  26962. return gutterEvent(cm, e, "gutterClick", true)
  26963. }
  26964. // CONTEXT MENU HANDLING
  26965. // To make the context menu work, we need to briefly unhide the
  26966. // textarea (making it as unobtrusive as possible) to let the
  26967. // right-click take effect on it.
  26968. function onContextMenu(cm, e) {
  26969. if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }
  26970. if (signalDOMEvent(cm, e, "contextmenu")) { return }
  26971. cm.display.input.onContextMenu(e)
  26972. }
  26973. function contextMenuInGutter(cm, e) {
  26974. if (!hasHandler(cm, "gutterContextMenu")) { return false }
  26975. return gutterEvent(cm, e, "gutterContextMenu", false)
  26976. }
  26977. function themeChanged(cm) {
  26978. cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") +
  26979. cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-")
  26980. clearCaches(cm)
  26981. }
  26982. var Init = {toString: function(){return "CodeMirror.Init"}}
  26983. var defaults = {}
  26984. var optionHandlers = {}
  26985. function defineOptions(CodeMirror) {
  26986. var optionHandlers = CodeMirror.optionHandlers
  26987. function option(name, deflt, handle, notOnInit) {
  26988. CodeMirror.defaults[name] = deflt
  26989. if (handle) { optionHandlers[name] =
  26990. notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old) }} : handle }
  26991. }
  26992. CodeMirror.defineOption = option
  26993. // Passed to option handlers when there is no old value.
  26994. CodeMirror.Init = Init
  26995. // These two are, on init, called from the constructor because they
  26996. // have to be initialized before the editor can start at all.
  26997. option("value", "", function (cm, val) { return cm.setValue(val); }, true)
  26998. option("mode", null, function (cm, val) {
  26999. cm.doc.modeOption = val
  27000. loadMode(cm)
  27001. }, true)
  27002. option("indentUnit", 2, loadMode, true)
  27003. option("indentWithTabs", false)
  27004. option("smartIndent", true)
  27005. option("tabSize", 4, function (cm) {
  27006. resetModeState(cm)
  27007. clearCaches(cm)
  27008. regChange(cm)
  27009. }, true)
  27010. option("lineSeparator", null, function (cm, val) {
  27011. cm.doc.lineSep = val
  27012. if (!val) { return }
  27013. var newBreaks = [], lineNo = cm.doc.first
  27014. cm.doc.iter(function (line) {
  27015. for (var pos = 0;;) {
  27016. var found = line.text.indexOf(val, pos)
  27017. if (found == -1) { break }
  27018. pos = found + val.length
  27019. newBreaks.push(Pos(lineNo, found))
  27020. }
  27021. lineNo++
  27022. })
  27023. for (var i = newBreaks.length - 1; i >= 0; i--)
  27024. { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)) }
  27025. })
  27026. option("specialChars", /[\u0000-\u001f\u007f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g, function (cm, val, old) {
  27027. cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g")
  27028. if (old != Init) { cm.refresh() }
  27029. })
  27030. option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true)
  27031. option("electricChars", true)
  27032. option("inputStyle", mobile ? "contenteditable" : "textarea", function () {
  27033. throw new Error("inputStyle can not (yet) be changed in a running editor") // FIXME
  27034. }, true)
  27035. option("spellcheck", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true)
  27036. option("rtlMoveVisually", !windows)
  27037. option("wholeLineUpdateBefore", true)
  27038. option("theme", "default", function (cm) {
  27039. themeChanged(cm)
  27040. guttersChanged(cm)
  27041. }, true)
  27042. option("keyMap", "default", function (cm, val, old) {
  27043. var next = getKeyMap(val)
  27044. var prev = old != Init && getKeyMap(old)
  27045. if (prev && prev.detach) { prev.detach(cm, next) }
  27046. if (next.attach) { next.attach(cm, prev || null) }
  27047. })
  27048. option("extraKeys", null)
  27049. option("lineWrapping", false, wrappingChanged, true)
  27050. option("gutters", [], function (cm) {
  27051. setGuttersForLineNumbers(cm.options)
  27052. guttersChanged(cm)
  27053. }, true)
  27054. option("fixedGutter", true, function (cm, val) {
  27055. cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0"
  27056. cm.refresh()
  27057. }, true)
  27058. option("coverGutterNextToScrollbar", false, function (cm) { return updateScrollbars(cm); }, true)
  27059. option("scrollbarStyle", "native", function (cm) {
  27060. initScrollbars(cm)
  27061. updateScrollbars(cm)
  27062. cm.display.scrollbars.setScrollTop(cm.doc.scrollTop)
  27063. cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft)
  27064. }, true)
  27065. option("lineNumbers", false, function (cm) {
  27066. setGuttersForLineNumbers(cm.options)
  27067. guttersChanged(cm)
  27068. }, true)
  27069. option("firstLineNumber", 1, guttersChanged, true)
  27070. option("lineNumberFormatter", function (integer) { return integer; }, guttersChanged, true)
  27071. option("showCursorWhenSelecting", false, updateSelection, true)
  27072. option("resetSelectionOnContextMenu", true)
  27073. option("lineWiseCopyCut", true)
  27074. option("readOnly", false, function (cm, val) {
  27075. if (val == "nocursor") {
  27076. onBlur(cm)
  27077. cm.display.input.blur()
  27078. cm.display.disabled = true
  27079. } else {
  27080. cm.display.disabled = false
  27081. }
  27082. cm.display.input.readOnlyChanged(val)
  27083. })
  27084. option("disableInput", false, function (cm, val) {if (!val) { cm.display.input.reset() }}, true)
  27085. option("dragDrop", true, dragDropChanged)
  27086. option("allowDropFileTypes", null)
  27087. option("cursorBlinkRate", 530)
  27088. option("cursorScrollMargin", 0)
  27089. option("cursorHeight", 1, updateSelection, true)
  27090. option("singleCursorHeightPerLine", true, updateSelection, true)
  27091. option("workTime", 100)
  27092. option("workDelay", 100)
  27093. option("flattenSpans", true, resetModeState, true)
  27094. option("addModeClass", false, resetModeState, true)
  27095. option("pollInterval", 100)
  27096. option("undoDepth", 200, function (cm, val) { return cm.doc.history.undoDepth = val; })
  27097. option("historyEventDelay", 1250)
  27098. option("viewportMargin", 10, function (cm) { return cm.refresh(); }, true)
  27099. option("maxHighlightLength", 10000, resetModeState, true)
  27100. option("moveInputWithCursor", true, function (cm, val) {
  27101. if (!val) { cm.display.input.resetPosition() }
  27102. })
  27103. option("tabindex", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || ""; })
  27104. option("autofocus", null)
  27105. }
  27106. function guttersChanged(cm) {
  27107. updateGutters(cm)
  27108. regChange(cm)
  27109. alignHorizontally(cm)
  27110. }
  27111. function dragDropChanged(cm, value, old) {
  27112. var wasOn = old && old != Init
  27113. if (!value != !wasOn) {
  27114. var funcs = cm.display.dragFunctions
  27115. var toggle = value ? on : off
  27116. toggle(cm.display.scroller, "dragstart", funcs.start)
  27117. toggle(cm.display.scroller, "dragenter", funcs.enter)
  27118. toggle(cm.display.scroller, "dragover", funcs.over)
  27119. toggle(cm.display.scroller, "dragleave", funcs.leave)
  27120. toggle(cm.display.scroller, "drop", funcs.drop)
  27121. }
  27122. }
  27123. function wrappingChanged(cm) {
  27124. if (cm.options.lineWrapping) {
  27125. addClass(cm.display.wrapper, "CodeMirror-wrap")
  27126. cm.display.sizer.style.minWidth = ""
  27127. cm.display.sizerWidth = null
  27128. } else {
  27129. rmClass(cm.display.wrapper, "CodeMirror-wrap")
  27130. findMaxLine(cm)
  27131. }
  27132. estimateLineHeights(cm)
  27133. regChange(cm)
  27134. clearCaches(cm)
  27135. setTimeout(function () { return updateScrollbars(cm); }, 100)
  27136. }
  27137. // A CodeMirror instance represents an editor. This is the object
  27138. // that user code is usually dealing with.
  27139. function CodeMirror(place, options) {
  27140. var this$1 = this;
  27141. if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }
  27142. this.options = options = options ? copyObj(options) : {}
  27143. // Determine effective options based on given values and defaults.
  27144. copyObj(defaults, options, false)
  27145. setGuttersForLineNumbers(options)
  27146. var doc = options.value
  27147. if (typeof doc == "string") { doc = new Doc(doc, options.mode, null, options.lineSeparator) }
  27148. this.doc = doc
  27149. var input = new CodeMirror.inputStyles[options.inputStyle](this)
  27150. var display = this.display = new Display(place, doc, input)
  27151. display.wrapper.CodeMirror = this
  27152. updateGutters(this)
  27153. themeChanged(this)
  27154. if (options.lineWrapping)
  27155. { this.display.wrapper.className += " CodeMirror-wrap" }
  27156. initScrollbars(this)
  27157. this.state = {
  27158. keyMaps: [], // stores maps added by addKeyMap
  27159. overlays: [], // highlighting overlays, as added by addOverlay
  27160. modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info
  27161. overwrite: false,
  27162. delayingBlurEvent: false,
  27163. focused: false,
  27164. suppressEdits: false, // used to disable editing during key handlers when in readOnly mode
  27165. pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in input.poll
  27166. selectingText: false,
  27167. draggingText: false,
  27168. highlight: new Delayed(), // stores highlight worker timeout
  27169. keySeq: null, // Unfinished key sequence
  27170. specialChars: null
  27171. }
  27172. if (options.autofocus && !mobile) { display.input.focus() }
  27173. // Override magic textarea content restore that IE sometimes does
  27174. // on our hidden textarea on reload
  27175. if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20) }
  27176. registerEventHandlers(this)
  27177. ensureGlobalHandlers()
  27178. startOperation(this)
  27179. this.curOp.forceUpdate = true
  27180. attachDoc(this, doc)
  27181. if ((options.autofocus && !mobile) || this.hasFocus())
  27182. { setTimeout(bind(onFocus, this), 20) }
  27183. else
  27184. { onBlur(this) }
  27185. for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))
  27186. { optionHandlers[opt](this$1, options[opt], Init) } }
  27187. maybeUpdateLineNumberWidth(this)
  27188. if (options.finishInit) { options.finishInit(this) }
  27189. for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1) }
  27190. endOperation(this)
  27191. // Suppress optimizelegibility in Webkit, since it breaks text
  27192. // measuring on line wrapping boundaries.
  27193. if (webkit && options.lineWrapping &&
  27194. getComputedStyle(display.lineDiv).textRendering == "optimizelegibility")
  27195. { display.lineDiv.style.textRendering = "auto" }
  27196. }
  27197. // The default configuration options.
  27198. CodeMirror.defaults = defaults
  27199. // Functions to run when options are changed.
  27200. CodeMirror.optionHandlers = optionHandlers
  27201. // Attach the necessary event handlers when initializing the editor
  27202. function registerEventHandlers(cm) {
  27203. var d = cm.display
  27204. on(d.scroller, "mousedown", operation(cm, onMouseDown))
  27205. // Older IE's will not fire a second mousedown for a double click
  27206. if (ie && ie_version < 11)
  27207. { on(d.scroller, "dblclick", operation(cm, function (e) {
  27208. if (signalDOMEvent(cm, e)) { return }
  27209. var pos = posFromMouse(cm, e)
  27210. if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }
  27211. e_preventDefault(e)
  27212. var word = cm.findWordAt(pos)
  27213. extendSelection(cm.doc, word.anchor, word.head)
  27214. })) }
  27215. else
  27216. { on(d.scroller, "dblclick", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }) }
  27217. // Some browsers fire contextmenu *after* opening the menu, at
  27218. // which point we can't mess with it anymore. Context menu is
  27219. // handled in onMouseDown for these browsers.
  27220. if (!captureRightClick) { on(d.scroller, "contextmenu", function (e) { return onContextMenu(cm, e); }) }
  27221. // Used to suppress mouse event handling when a touch happens
  27222. var touchFinished, prevTouch = {end: 0}
  27223. function finishTouch() {
  27224. if (d.activeTouch) {
  27225. touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000)
  27226. prevTouch = d.activeTouch
  27227. prevTouch.end = +new Date
  27228. }
  27229. }
  27230. function isMouseLikeTouchEvent(e) {
  27231. if (e.touches.length != 1) { return false }
  27232. var touch = e.touches[0]
  27233. return touch.radiusX <= 1 && touch.radiusY <= 1
  27234. }
  27235. function farAway(touch, other) {
  27236. if (other.left == null) { return true }
  27237. var dx = other.left - touch.left, dy = other.top - touch.top
  27238. return dx * dx + dy * dy > 20 * 20
  27239. }
  27240. on(d.scroller, "touchstart", function (e) {
  27241. if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {
  27242. d.input.ensurePolled()
  27243. clearTimeout(touchFinished)
  27244. var now = +new Date
  27245. d.activeTouch = {start: now, moved: false,
  27246. prev: now - prevTouch.end <= 300 ? prevTouch : null}
  27247. if (e.touches.length == 1) {
  27248. d.activeTouch.left = e.touches[0].pageX
  27249. d.activeTouch.top = e.touches[0].pageY
  27250. }
  27251. }
  27252. })
  27253. on(d.scroller, "touchmove", function () {
  27254. if (d.activeTouch) { d.activeTouch.moved = true }
  27255. })
  27256. on(d.scroller, "touchend", function (e) {
  27257. var touch = d.activeTouch
  27258. if (touch && !eventInWidget(d, e) && touch.left != null &&
  27259. !touch.moved && new Date - touch.start < 300) {
  27260. var pos = cm.coordsChar(d.activeTouch, "page"), range
  27261. if (!touch.prev || farAway(touch, touch.prev)) // Single tap
  27262. { range = new Range(pos, pos) }
  27263. else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap
  27264. { range = cm.findWordAt(pos) }
  27265. else // Triple tap
  27266. { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }
  27267. cm.setSelection(range.anchor, range.head)
  27268. cm.focus()
  27269. e_preventDefault(e)
  27270. }
  27271. finishTouch()
  27272. })
  27273. on(d.scroller, "touchcancel", finishTouch)
  27274. // Sync scrolling between fake scrollbars and real scrollable
  27275. // area, ensure viewport is updated when scrolling.
  27276. on(d.scroller, "scroll", function () {
  27277. if (d.scroller.clientHeight) {
  27278. setScrollTop(cm, d.scroller.scrollTop)
  27279. setScrollLeft(cm, d.scroller.scrollLeft, true)
  27280. signal(cm, "scroll", cm)
  27281. }
  27282. })
  27283. // Listen to wheel events in order to try and update the viewport on time.
  27284. on(d.scroller, "mousewheel", function (e) { return onScrollWheel(cm, e); })
  27285. on(d.scroller, "DOMMouseScroll", function (e) { return onScrollWheel(cm, e); })
  27286. // Prevent wrapper from ever scrolling
  27287. on(d.wrapper, "scroll", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; })
  27288. d.dragFunctions = {
  27289. enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e) }},
  27290. over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e) }},
  27291. start: function (e) { return onDragStart(cm, e); },
  27292. drop: operation(cm, onDrop),
  27293. leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm) }}
  27294. }
  27295. var inp = d.input.getField()
  27296. on(inp, "keyup", function (e) { return onKeyUp.call(cm, e); })
  27297. on(inp, "keydown", operation(cm, onKeyDown))
  27298. on(inp, "keypress", operation(cm, onKeyPress))
  27299. on(inp, "focus", function (e) { return onFocus(cm, e); })
  27300. on(inp, "blur", function (e) { return onBlur(cm, e); })
  27301. }
  27302. var initHooks = []
  27303. CodeMirror.defineInitHook = function (f) { return initHooks.push(f); }
  27304. // Indent the given line. The how parameter can be "smart",
  27305. // "add"/null, "subtract", or "prev". When aggressive is false
  27306. // (typically set to true for forced single-line indents), empty
  27307. // lines are not indented, and places where the mode returns Pass
  27308. // are left alone.
  27309. function indentLine(cm, n, how, aggressive) {
  27310. var doc = cm.doc, state
  27311. if (how == null) { how = "add" }
  27312. if (how == "smart") {
  27313. // Fall back to "prev" when the mode doesn't have an indentation
  27314. // method.
  27315. if (!doc.mode.indent) { how = "prev" }
  27316. else { state = getStateBefore(cm, n) }
  27317. }
  27318. var tabSize = cm.options.tabSize
  27319. var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize)
  27320. if (line.stateAfter) { line.stateAfter = null }
  27321. var curSpaceString = line.text.match(/^\s*/)[0], indentation
  27322. if (!aggressive && !/\S/.test(line.text)) {
  27323. indentation = 0
  27324. how = "not"
  27325. } else if (how == "smart") {
  27326. indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text)
  27327. if (indentation == Pass || indentation > 150) {
  27328. if (!aggressive) { return }
  27329. how = "prev"
  27330. }
  27331. }
  27332. if (how == "prev") {
  27333. if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize) }
  27334. else { indentation = 0 }
  27335. } else if (how == "add") {
  27336. indentation = curSpace + cm.options.indentUnit
  27337. } else if (how == "subtract") {
  27338. indentation = curSpace - cm.options.indentUnit
  27339. } else if (typeof how == "number") {
  27340. indentation = curSpace + how
  27341. }
  27342. indentation = Math.max(0, indentation)
  27343. var indentString = "", pos = 0
  27344. if (cm.options.indentWithTabs)
  27345. { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t"} }
  27346. if (pos < indentation) { indentString += spaceStr(indentation - pos) }
  27347. if (indentString != curSpaceString) {
  27348. replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input")
  27349. line.stateAfter = null
  27350. return true
  27351. } else {
  27352. // Ensure that, if the cursor was in the whitespace at the start
  27353. // of the line, it is moved to the end of that space.
  27354. for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {
  27355. var range = doc.sel.ranges[i$1]
  27356. if (range.head.line == n && range.head.ch < curSpaceString.length) {
  27357. var pos$1 = Pos(n, curSpaceString.length)
  27358. replaceOneSelection(doc, i$1, new Range(pos$1, pos$1))
  27359. break
  27360. }
  27361. }
  27362. }
  27363. }
  27364. // This will be set to a {lineWise: bool, text: [string]} object, so
  27365. // that, when pasting, we know what kind of selections the copied
  27366. // text was made out of.
  27367. var lastCopied = null
  27368. function setLastCopied(newLastCopied) {
  27369. lastCopied = newLastCopied
  27370. }
  27371. function applyTextInput(cm, inserted, deleted, sel, origin) {
  27372. var doc = cm.doc
  27373. cm.display.shift = false
  27374. if (!sel) { sel = doc.sel }
  27375. var paste = cm.state.pasteIncoming || origin == "paste"
  27376. var textLines = splitLinesAuto(inserted), multiPaste = null
  27377. // When pasing N lines into N selections, insert one line per selection
  27378. if (paste && sel.ranges.length > 1) {
  27379. if (lastCopied && lastCopied.text.join("\n") == inserted) {
  27380. if (sel.ranges.length % lastCopied.text.length == 0) {
  27381. multiPaste = []
  27382. for (var i = 0; i < lastCopied.text.length; i++)
  27383. { multiPaste.push(doc.splitLines(lastCopied.text[i])) }
  27384. }
  27385. } else if (textLines.length == sel.ranges.length) {
  27386. multiPaste = map(textLines, function (l) { return [l]; })
  27387. }
  27388. }
  27389. var updateInput
  27390. // Normal behavior is to insert the new text into every selection
  27391. for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {
  27392. var range = sel.ranges[i$1]
  27393. var from = range.from(), to = range.to()
  27394. if (range.empty()) {
  27395. if (deleted && deleted > 0) // Handle deletion
  27396. { from = Pos(from.line, from.ch - deleted) }
  27397. else if (cm.state.overwrite && !paste) // Handle overwrite
  27398. { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)) }
  27399. else if (lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == inserted)
  27400. { from = to = Pos(from.line, 0) }
  27401. }
  27402. updateInput = cm.curOp.updateInput
  27403. var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,
  27404. origin: origin || (paste ? "paste" : cm.state.cutIncoming ? "cut" : "+input")}
  27405. makeChange(cm.doc, changeEvent)
  27406. signalLater(cm, "inputRead", cm, changeEvent)
  27407. }
  27408. if (inserted && !paste)
  27409. { triggerElectric(cm, inserted) }
  27410. ensureCursorVisible(cm)
  27411. cm.curOp.updateInput = updateInput
  27412. cm.curOp.typing = true
  27413. cm.state.pasteIncoming = cm.state.cutIncoming = false
  27414. }
  27415. function handlePaste(e, cm) {
  27416. var pasted = e.clipboardData && e.clipboardData.getData("Text")
  27417. if (pasted) {
  27418. e.preventDefault()
  27419. if (!cm.isReadOnly() && !cm.options.disableInput)
  27420. { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, "paste"); }) }
  27421. return true
  27422. }
  27423. }
  27424. function triggerElectric(cm, inserted) {
  27425. // When an 'electric' character is inserted, immediately trigger a reindent
  27426. if (!cm.options.electricChars || !cm.options.smartIndent) { return }
  27427. var sel = cm.doc.sel
  27428. for (var i = sel.ranges.length - 1; i >= 0; i--) {
  27429. var range = sel.ranges[i]
  27430. if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue }
  27431. var mode = cm.getModeAt(range.head)
  27432. var indented = false
  27433. if (mode.electricChars) {
  27434. for (var j = 0; j < mode.electricChars.length; j++)
  27435. { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {
  27436. indented = indentLine(cm, range.head.line, "smart")
  27437. break
  27438. } }
  27439. } else if (mode.electricInput) {
  27440. if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch)))
  27441. { indented = indentLine(cm, range.head.line, "smart") }
  27442. }
  27443. if (indented) { signalLater(cm, "electricInput", cm, range.head.line) }
  27444. }
  27445. }
  27446. function copyableRanges(cm) {
  27447. var text = [], ranges = []
  27448. for (var i = 0; i < cm.doc.sel.ranges.length; i++) {
  27449. var line = cm.doc.sel.ranges[i].head.line
  27450. var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)}
  27451. ranges.push(lineRange)
  27452. text.push(cm.getRange(lineRange.anchor, lineRange.head))
  27453. }
  27454. return {text: text, ranges: ranges}
  27455. }
  27456. function disableBrowserMagic(field, spellcheck) {
  27457. field.setAttribute("autocorrect", "off")
  27458. field.setAttribute("autocapitalize", "off")
  27459. field.setAttribute("spellcheck", !!spellcheck)
  27460. }
  27461. function hiddenTextarea() {
  27462. var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none")
  27463. var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;")
  27464. // The textarea is kept positioned near the cursor to prevent the
  27465. // fact that it'll be scrolled into view on input from scrolling
  27466. // our fake cursor out of view. On webkit, when wrap=off, paste is
  27467. // very slow. So make the area wide instead.
  27468. if (webkit) { te.style.width = "1000px" }
  27469. else { te.setAttribute("wrap", "off") }
  27470. // If border: 0; -- iOS fails to open keyboard (issue #1287)
  27471. if (ios) { te.style.border = "1px solid black" }
  27472. disableBrowserMagic(te)
  27473. return div
  27474. }
  27475. // The publicly visible API. Note that methodOp(f) means
  27476. // 'wrap f in an operation, performed on its `this` parameter'.
  27477. // This is not the complete set of editor methods. Most of the
  27478. // methods defined on the Doc type are also injected into
  27479. // CodeMirror.prototype, for backwards compatibility and
  27480. // convenience.
  27481. function addEditorMethods(CodeMirror) {
  27482. var optionHandlers = CodeMirror.optionHandlers
  27483. var helpers = CodeMirror.helpers = {}
  27484. CodeMirror.prototype = {
  27485. constructor: CodeMirror,
  27486. focus: function(){window.focus(); this.display.input.focus()},
  27487. setOption: function(option, value) {
  27488. var options = this.options, old = options[option]
  27489. if (options[option] == value && option != "mode") { return }
  27490. options[option] = value
  27491. if (optionHandlers.hasOwnProperty(option))
  27492. { operation(this, optionHandlers[option])(this, value, old) }
  27493. signal(this, "optionChange", this, option)
  27494. },
  27495. getOption: function(option) {return this.options[option]},
  27496. getDoc: function() {return this.doc},
  27497. addKeyMap: function(map, bottom) {
  27498. this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map))
  27499. },
  27500. removeKeyMap: function(map) {
  27501. var maps = this.state.keyMaps
  27502. for (var i = 0; i < maps.length; ++i)
  27503. { if (maps[i] == map || maps[i].name == map) {
  27504. maps.splice(i, 1)
  27505. return true
  27506. } }
  27507. },
  27508. addOverlay: methodOp(function(spec, options) {
  27509. var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec)
  27510. if (mode.startState) { throw new Error("Overlays may not be stateful.") }
  27511. insertSorted(this.state.overlays,
  27512. {mode: mode, modeSpec: spec, opaque: options && options.opaque,
  27513. priority: (options && options.priority) || 0},
  27514. function (overlay) { return overlay.priority; })
  27515. this.state.modeGen++
  27516. regChange(this)
  27517. }),
  27518. removeOverlay: methodOp(function(spec) {
  27519. var this$1 = this;
  27520. var overlays = this.state.overlays
  27521. for (var i = 0; i < overlays.length; ++i) {
  27522. var cur = overlays[i].modeSpec
  27523. if (cur == spec || typeof spec == "string" && cur.name == spec) {
  27524. overlays.splice(i, 1)
  27525. this$1.state.modeGen++
  27526. regChange(this$1)
  27527. return
  27528. }
  27529. }
  27530. }),
  27531. indentLine: methodOp(function(n, dir, aggressive) {
  27532. if (typeof dir != "string" && typeof dir != "number") {
  27533. if (dir == null) { dir = this.options.smartIndent ? "smart" : "prev" }
  27534. else { dir = dir ? "add" : "subtract" }
  27535. }
  27536. if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive) }
  27537. }),
  27538. indentSelection: methodOp(function(how) {
  27539. var this$1 = this;
  27540. var ranges = this.doc.sel.ranges, end = -1
  27541. for (var i = 0; i < ranges.length; i++) {
  27542. var range = ranges[i]
  27543. if (!range.empty()) {
  27544. var from = range.from(), to = range.to()
  27545. var start = Math.max(end, from.line)
  27546. end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1
  27547. for (var j = start; j < end; ++j)
  27548. { indentLine(this$1, j, how) }
  27549. var newRanges = this$1.doc.sel.ranges
  27550. if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)
  27551. { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll) }
  27552. } else if (range.head.line > end) {
  27553. indentLine(this$1, range.head.line, how, true)
  27554. end = range.head.line
  27555. if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1) }
  27556. }
  27557. }
  27558. }),
  27559. // Fetch the parser token for a given character. Useful for hacks
  27560. // that want to inspect the mode state (say, for completion).
  27561. getTokenAt: function(pos, precise) {
  27562. return takeToken(this, pos, precise)
  27563. },
  27564. getLineTokens: function(line, precise) {
  27565. return takeToken(this, Pos(line), precise, true)
  27566. },
  27567. getTokenTypeAt: function(pos) {
  27568. pos = clipPos(this.doc, pos)
  27569. var styles = getLineStyles(this, getLine(this.doc, pos.line))
  27570. var before = 0, after = (styles.length - 1) / 2, ch = pos.ch
  27571. var type
  27572. if (ch == 0) { type = styles[2] }
  27573. else { for (;;) {
  27574. var mid = (before + after) >> 1
  27575. if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid }
  27576. else if (styles[mid * 2 + 1] < ch) { before = mid + 1 }
  27577. else { type = styles[mid * 2 + 2]; break }
  27578. } }
  27579. var cut = type ? type.indexOf("overlay ") : -1
  27580. return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)
  27581. },
  27582. getModeAt: function(pos) {
  27583. var mode = this.doc.mode
  27584. if (!mode.innerMode) { return mode }
  27585. return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode
  27586. },
  27587. getHelper: function(pos, type) {
  27588. return this.getHelpers(pos, type)[0]
  27589. },
  27590. getHelpers: function(pos, type) {
  27591. var this$1 = this;
  27592. var found = []
  27593. if (!helpers.hasOwnProperty(type)) { return found }
  27594. var help = helpers[type], mode = this.getModeAt(pos)
  27595. if (typeof mode[type] == "string") {
  27596. if (help[mode[type]]) { found.push(help[mode[type]]) }
  27597. } else if (mode[type]) {
  27598. for (var i = 0; i < mode[type].length; i++) {
  27599. var val = help[mode[type][i]]
  27600. if (val) { found.push(val) }
  27601. }
  27602. } else if (mode.helperType && help[mode.helperType]) {
  27603. found.push(help[mode.helperType])
  27604. } else if (help[mode.name]) {
  27605. found.push(help[mode.name])
  27606. }
  27607. for (var i$1 = 0; i$1 < help._global.length; i$1++) {
  27608. var cur = help._global[i$1]
  27609. if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)
  27610. { found.push(cur.val) }
  27611. }
  27612. return found
  27613. },
  27614. getStateAfter: function(line, precise) {
  27615. var doc = this.doc
  27616. line = clipLine(doc, line == null ? doc.first + doc.size - 1: line)
  27617. return getStateBefore(this, line + 1, precise)
  27618. },
  27619. cursorCoords: function(start, mode) {
  27620. var pos, range = this.doc.sel.primary()
  27621. if (start == null) { pos = range.head }
  27622. else if (typeof start == "object") { pos = clipPos(this.doc, start) }
  27623. else { pos = start ? range.from() : range.to() }
  27624. return cursorCoords(this, pos, mode || "page")
  27625. },
  27626. charCoords: function(pos, mode) {
  27627. return charCoords(this, clipPos(this.doc, pos), mode || "page")
  27628. },
  27629. coordsChar: function(coords, mode) {
  27630. coords = fromCoordSystem(this, coords, mode || "page")
  27631. return coordsChar(this, coords.left, coords.top)
  27632. },
  27633. lineAtHeight: function(height, mode) {
  27634. height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top
  27635. return lineAtHeight(this.doc, height + this.display.viewOffset)
  27636. },
  27637. heightAtLine: function(line, mode, includeWidgets) {
  27638. var end = false, lineObj
  27639. if (typeof line == "number") {
  27640. var last = this.doc.first + this.doc.size - 1
  27641. if (line < this.doc.first) { line = this.doc.first }
  27642. else if (line > last) { line = last; end = true }
  27643. lineObj = getLine(this.doc, line)
  27644. } else {
  27645. lineObj = line
  27646. }
  27647. return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page", includeWidgets).top +
  27648. (end ? this.doc.height - heightAtLine(lineObj) : 0)
  27649. },
  27650. defaultTextHeight: function() { return textHeight(this.display) },
  27651. defaultCharWidth: function() { return charWidth(this.display) },
  27652. getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},
  27653. addWidget: function(pos, node, scroll, vert, horiz) {
  27654. var display = this.display
  27655. pos = cursorCoords(this, clipPos(this.doc, pos))
  27656. var top = pos.bottom, left = pos.left
  27657. node.style.position = "absolute"
  27658. node.setAttribute("cm-ignore-events", "true")
  27659. this.display.input.setUneditable(node)
  27660. display.sizer.appendChild(node)
  27661. if (vert == "over") {
  27662. top = pos.top
  27663. } else if (vert == "above" || vert == "near") {
  27664. var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),
  27665. hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth)
  27666. // Default to positioning above (if specified and possible); otherwise default to positioning below
  27667. if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)
  27668. { top = pos.top - node.offsetHeight }
  27669. else if (pos.bottom + node.offsetHeight <= vspace)
  27670. { top = pos.bottom }
  27671. if (left + node.offsetWidth > hspace)
  27672. { left = hspace - node.offsetWidth }
  27673. }
  27674. node.style.top = top + "px"
  27675. node.style.left = node.style.right = ""
  27676. if (horiz == "right") {
  27677. left = display.sizer.clientWidth - node.offsetWidth
  27678. node.style.right = "0px"
  27679. } else {
  27680. if (horiz == "left") { left = 0 }
  27681. else if (horiz == "middle") { left = (display.sizer.clientWidth - node.offsetWidth) / 2 }
  27682. node.style.left = left + "px"
  27683. }
  27684. if (scroll)
  27685. { scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight) }
  27686. },
  27687. triggerOnKeyDown: methodOp(onKeyDown),
  27688. triggerOnKeyPress: methodOp(onKeyPress),
  27689. triggerOnKeyUp: onKeyUp,
  27690. execCommand: function(cmd) {
  27691. if (commands.hasOwnProperty(cmd))
  27692. { return commands[cmd].call(null, this) }
  27693. },
  27694. triggerElectric: methodOp(function(text) { triggerElectric(this, text) }),
  27695. findPosH: function(from, amount, unit, visually) {
  27696. var this$1 = this;
  27697. var dir = 1
  27698. if (amount < 0) { dir = -1; amount = -amount }
  27699. var cur = clipPos(this.doc, from)
  27700. for (var i = 0; i < amount; ++i) {
  27701. cur = findPosH(this$1.doc, cur, dir, unit, visually)
  27702. if (cur.hitSide) { break }
  27703. }
  27704. return cur
  27705. },
  27706. moveH: methodOp(function(dir, unit) {
  27707. var this$1 = this;
  27708. this.extendSelectionsBy(function (range) {
  27709. if (this$1.display.shift || this$1.doc.extend || range.empty())
  27710. { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }
  27711. else
  27712. { return dir < 0 ? range.from() : range.to() }
  27713. }, sel_move)
  27714. }),
  27715. deleteH: methodOp(function(dir, unit) {
  27716. var sel = this.doc.sel, doc = this.doc
  27717. if (sel.somethingSelected())
  27718. { doc.replaceSelection("", null, "+delete") }
  27719. else
  27720. { deleteNearSelection(this, function (range) {
  27721. var other = findPosH(doc, range.head, dir, unit, false)
  27722. return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}
  27723. }) }
  27724. }),
  27725. findPosV: function(from, amount, unit, goalColumn) {
  27726. var this$1 = this;
  27727. var dir = 1, x = goalColumn
  27728. if (amount < 0) { dir = -1; amount = -amount }
  27729. var cur = clipPos(this.doc, from)
  27730. for (var i = 0; i < amount; ++i) {
  27731. var coords = cursorCoords(this$1, cur, "div")
  27732. if (x == null) { x = coords.left }
  27733. else { coords.left = x }
  27734. cur = findPosV(this$1, coords, dir, unit)
  27735. if (cur.hitSide) { break }
  27736. }
  27737. return cur
  27738. },
  27739. moveV: methodOp(function(dir, unit) {
  27740. var this$1 = this;
  27741. var doc = this.doc, goals = []
  27742. var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected()
  27743. doc.extendSelectionsBy(function (range) {
  27744. if (collapse)
  27745. { return dir < 0 ? range.from() : range.to() }
  27746. var headPos = cursorCoords(this$1, range.head, "div")
  27747. if (range.goalColumn != null) { headPos.left = range.goalColumn }
  27748. goals.push(headPos.left)
  27749. var pos = findPosV(this$1, headPos, dir, unit)
  27750. if (unit == "page" && range == doc.sel.primary())
  27751. { addToScrollPos(this$1, null, charCoords(this$1, pos, "div").top - headPos.top) }
  27752. return pos
  27753. }, sel_move)
  27754. if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)
  27755. { doc.sel.ranges[i].goalColumn = goals[i] } }
  27756. }),
  27757. // Find the word at the given position (as returned by coordsChar).
  27758. findWordAt: function(pos) {
  27759. var doc = this.doc, line = getLine(doc, pos.line).text
  27760. var start = pos.ch, end = pos.ch
  27761. if (line) {
  27762. var helper = this.getHelper(pos, "wordChars")
  27763. if ((pos.xRel < 0 || end == line.length) && start) { --start; } else { ++end }
  27764. var startChar = line.charAt(start)
  27765. var check = isWordChar(startChar, helper)
  27766. ? function (ch) { return isWordChar(ch, helper); }
  27767. : /\s/.test(startChar) ? function (ch) { return /\s/.test(ch); }
  27768. : function (ch) { return (!/\s/.test(ch) && !isWordChar(ch)); }
  27769. while (start > 0 && check(line.charAt(start - 1))) { --start }
  27770. while (end < line.length && check(line.charAt(end))) { ++end }
  27771. }
  27772. return new Range(Pos(pos.line, start), Pos(pos.line, end))
  27773. },
  27774. toggleOverwrite: function(value) {
  27775. if (value != null && value == this.state.overwrite) { return }
  27776. if (this.state.overwrite = !this.state.overwrite)
  27777. { addClass(this.display.cursorDiv, "CodeMirror-overwrite") }
  27778. else
  27779. { rmClass(this.display.cursorDiv, "CodeMirror-overwrite") }
  27780. signal(this, "overwriteToggle", this, this.state.overwrite)
  27781. },
  27782. hasFocus: function() { return this.display.input.getField() == activeElt() },
  27783. isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },
  27784. scrollTo: methodOp(function(x, y) {
  27785. if (x != null || y != null) { resolveScrollToPos(this) }
  27786. if (x != null) { this.curOp.scrollLeft = x }
  27787. if (y != null) { this.curOp.scrollTop = y }
  27788. }),
  27789. getScrollInfo: function() {
  27790. var scroller = this.display.scroller
  27791. return {left: scroller.scrollLeft, top: scroller.scrollTop,
  27792. height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,
  27793. width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,
  27794. clientHeight: displayHeight(this), clientWidth: displayWidth(this)}
  27795. },
  27796. scrollIntoView: methodOp(function(range, margin) {
  27797. if (range == null) {
  27798. range = {from: this.doc.sel.primary().head, to: null}
  27799. if (margin == null) { margin = this.options.cursorScrollMargin }
  27800. } else if (typeof range == "number") {
  27801. range = {from: Pos(range, 0), to: null}
  27802. } else if (range.from == null) {
  27803. range = {from: range, to: null}
  27804. }
  27805. if (!range.to) { range.to = range.from }
  27806. range.margin = margin || 0
  27807. if (range.from.line != null) {
  27808. resolveScrollToPos(this)
  27809. this.curOp.scrollToPos = range
  27810. } else {
  27811. var sPos = calculateScrollPos(this, Math.min(range.from.left, range.to.left),
  27812. Math.min(range.from.top, range.to.top) - range.margin,
  27813. Math.max(range.from.right, range.to.right),
  27814. Math.max(range.from.bottom, range.to.bottom) + range.margin)
  27815. this.scrollTo(sPos.scrollLeft, sPos.scrollTop)
  27816. }
  27817. }),
  27818. setSize: methodOp(function(width, height) {
  27819. var this$1 = this;
  27820. var interpret = function (val) { return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; }
  27821. if (width != null) { this.display.wrapper.style.width = interpret(width) }
  27822. if (height != null) { this.display.wrapper.style.height = interpret(height) }
  27823. if (this.options.lineWrapping) { clearLineMeasurementCache(this) }
  27824. var lineNo = this.display.viewFrom
  27825. this.doc.iter(lineNo, this.display.viewTo, function (line) {
  27826. if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)
  27827. { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, "widget"); break } } }
  27828. ++lineNo
  27829. })
  27830. this.curOp.forceUpdate = true
  27831. signal(this, "refresh", this)
  27832. }),
  27833. operation: function(f){return runInOp(this, f)},
  27834. refresh: methodOp(function() {
  27835. var oldHeight = this.display.cachedTextHeight
  27836. regChange(this)
  27837. this.curOp.forceUpdate = true
  27838. clearCaches(this)
  27839. this.scrollTo(this.doc.scrollLeft, this.doc.scrollTop)
  27840. updateGutterSpace(this)
  27841. if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)
  27842. { estimateLineHeights(this) }
  27843. signal(this, "refresh", this)
  27844. }),
  27845. swapDoc: methodOp(function(doc) {
  27846. var old = this.doc
  27847. old.cm = null
  27848. attachDoc(this, doc)
  27849. clearCaches(this)
  27850. this.display.input.reset()
  27851. this.scrollTo(doc.scrollLeft, doc.scrollTop)
  27852. this.curOp.forceScroll = true
  27853. signalLater(this, "swapDoc", this, old)
  27854. return old
  27855. }),
  27856. getInputField: function(){return this.display.input.getField()},
  27857. getWrapperElement: function(){return this.display.wrapper},
  27858. getScrollerElement: function(){return this.display.scroller},
  27859. getGutterElement: function(){return this.display.gutters}
  27860. }
  27861. eventMixin(CodeMirror)
  27862. CodeMirror.registerHelper = function(type, name, value) {
  27863. if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []} }
  27864. helpers[type][name] = value
  27865. }
  27866. CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {
  27867. CodeMirror.registerHelper(type, name, value)
  27868. helpers[type]._global.push({pred: predicate, val: value})
  27869. }
  27870. }
  27871. // Used for horizontal relative motion. Dir is -1 or 1 (left or
  27872. // right), unit can be "char", "column" (like char, but doesn't
  27873. // cross line boundaries), "word" (across next word), or "group" (to
  27874. // the start of next group of word or non-word-non-whitespace
  27875. // chars). The visually param controls whether, in right-to-left
  27876. // text, direction 1 means to move towards the next index in the
  27877. // string, or towards the character to the right of the current
  27878. // position. The resulting position will have a hitSide=true
  27879. // property if it reached the end of the document.
  27880. function findPosH(doc, pos, dir, unit, visually) {
  27881. var line = pos.line, ch = pos.ch, origDir = dir
  27882. var lineObj = getLine(doc, line)
  27883. function findNextLine() {
  27884. var l = line + dir
  27885. if (l < doc.first || l >= doc.first + doc.size) { return false }
  27886. line = l
  27887. return lineObj = getLine(doc, l)
  27888. }
  27889. function moveOnce(boundToLine) {
  27890. var next = (visually ? moveVisually : moveLogically)(lineObj, ch, dir, true)
  27891. if (next == null) {
  27892. if (!boundToLine && findNextLine()) {
  27893. if (visually) { ch = (dir < 0 ? lineRight : lineLeft)(lineObj) }
  27894. else { ch = dir < 0 ? lineObj.text.length : 0 }
  27895. } else { return false }
  27896. } else { ch = next }
  27897. return true
  27898. }
  27899. if (unit == "char") {
  27900. moveOnce()
  27901. } else if (unit == "column") {
  27902. moveOnce(true)
  27903. } else if (unit == "word" || unit == "group") {
  27904. var sawType = null, group = unit == "group"
  27905. var helper = doc.cm && doc.cm.getHelper(pos, "wordChars")
  27906. for (var first = true;; first = false) {
  27907. if (dir < 0 && !moveOnce(!first)) { break }
  27908. var cur = lineObj.text.charAt(ch) || "\n"
  27909. var type = isWordChar(cur, helper) ? "w"
  27910. : group && cur == "\n" ? "n"
  27911. : !group || /\s/.test(cur) ? null
  27912. : "p"
  27913. if (group && !first && !type) { type = "s" }
  27914. if (sawType && sawType != type) {
  27915. if (dir < 0) {dir = 1; moveOnce()}
  27916. break
  27917. }
  27918. if (type) { sawType = type }
  27919. if (dir > 0 && !moveOnce(!first)) { break }
  27920. }
  27921. }
  27922. var result = skipAtomic(doc, Pos(line, ch), pos, origDir, true)
  27923. if (!cmp(pos, result)) { result.hitSide = true }
  27924. return result
  27925. }
  27926. // For relative vertical movement. Dir may be -1 or 1. Unit can be
  27927. // "page" or "line". The resulting position will have a hitSide=true
  27928. // property if it reached the end of the document.
  27929. function findPosV(cm, pos, dir, unit) {
  27930. var doc = cm.doc, x = pos.left, y
  27931. if (unit == "page") {
  27932. var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight)
  27933. var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3)
  27934. y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount
  27935. } else if (unit == "line") {
  27936. y = dir > 0 ? pos.bottom + 3 : pos.top - 3
  27937. }
  27938. var target
  27939. for (;;) {
  27940. target = coordsChar(cm, x, y)
  27941. if (!target.outside) { break }
  27942. if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }
  27943. y += dir * 5
  27944. }
  27945. return target
  27946. }
  27947. // CONTENTEDITABLE INPUT STYLE
  27948. var ContentEditableInput = function(cm) {
  27949. this.cm = cm
  27950. this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null
  27951. this.polling = new Delayed()
  27952. this.composing = null
  27953. this.gracePeriod = false
  27954. this.readDOMTimeout = null
  27955. };
  27956. ContentEditableInput.prototype.init = function (display) {
  27957. var this$1 = this;
  27958. var input = this, cm = input.cm
  27959. var div = input.div = display.lineDiv
  27960. disableBrowserMagic(div, cm.options.spellcheck)
  27961. on(div, "paste", function (e) {
  27962. if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }
  27963. // IE doesn't fire input events, so we schedule a read for the pasted content in this way
  27964. if (ie_version <= 11) { setTimeout(operation(cm, function () {
  27965. if (!input.pollContent()) { regChange(cm) }
  27966. }), 20) }
  27967. })
  27968. on(div, "compositionstart", function (e) {
  27969. this$1.composing = {data: e.data, done: false}
  27970. })
  27971. on(div, "compositionupdate", function (e) {
  27972. if (!this$1.composing) { this$1.composing = {data: e.data, done: false} }
  27973. })
  27974. on(div, "compositionend", function (e) {
  27975. if (this$1.composing) {
  27976. if (e.data != this$1.composing.data) { this$1.readFromDOMSoon() }
  27977. this$1.composing.done = true
  27978. }
  27979. })
  27980. on(div, "touchstart", function () { return input.forceCompositionEnd(); })
  27981. on(div, "input", function () {
  27982. if (!this$1.composing) { this$1.readFromDOMSoon() }
  27983. })
  27984. function onCopyCut(e) {
  27985. if (signalDOMEvent(cm, e)) { return }
  27986. if (cm.somethingSelected()) {
  27987. setLastCopied({lineWise: false, text: cm.getSelections()})
  27988. if (e.type == "cut") { cm.replaceSelection("", null, "cut") }
  27989. } else if (!cm.options.lineWiseCopyCut) {
  27990. return
  27991. } else {
  27992. var ranges = copyableRanges(cm)
  27993. setLastCopied({lineWise: true, text: ranges.text})
  27994. if (e.type == "cut") {
  27995. cm.operation(function () {
  27996. cm.setSelections(ranges.ranges, 0, sel_dontScroll)
  27997. cm.replaceSelection("", null, "cut")
  27998. })
  27999. }
  28000. }
  28001. if (e.clipboardData) {
  28002. e.clipboardData.clearData()
  28003. var content = lastCopied.text.join("\n")
  28004. // iOS exposes the clipboard API, but seems to discard content inserted into it
  28005. e.clipboardData.setData("Text", content)
  28006. if (e.clipboardData.getData("Text") == content) {
  28007. e.preventDefault()
  28008. return
  28009. }
  28010. }
  28011. // Old-fashioned briefly-focus-a-textarea hack
  28012. var kludge = hiddenTextarea(), te = kludge.firstChild
  28013. cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild)
  28014. te.value = lastCopied.text.join("\n")
  28015. var hadFocus = document.activeElement
  28016. selectInput(te)
  28017. setTimeout(function () {
  28018. cm.display.lineSpace.removeChild(kludge)
  28019. hadFocus.focus()
  28020. if (hadFocus == div) { input.showPrimarySelection() }
  28021. }, 50)
  28022. }
  28023. on(div, "copy", onCopyCut)
  28024. on(div, "cut", onCopyCut)
  28025. };
  28026. ContentEditableInput.prototype.prepareSelection = function () {
  28027. var result = prepareSelection(this.cm, false)
  28028. result.focus = this.cm.state.focused
  28029. return result
  28030. };
  28031. ContentEditableInput.prototype.showSelection = function (info, takeFocus) {
  28032. if (!info || !this.cm.display.view.length) { return }
  28033. if (info.focus || takeFocus) { this.showPrimarySelection() }
  28034. this.showMultipleSelections(info)
  28035. };
  28036. ContentEditableInput.prototype.showPrimarySelection = function () {
  28037. var sel = window.getSelection(), prim = this.cm.doc.sel.primary()
  28038. var curAnchor = domToPos(this.cm, sel.anchorNode, sel.anchorOffset)
  28039. var curFocus = domToPos(this.cm, sel.focusNode, sel.focusOffset)
  28040. if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&
  28041. cmp(minPos(curAnchor, curFocus), prim.from()) == 0 &&
  28042. cmp(maxPos(curAnchor, curFocus), prim.to()) == 0)
  28043. { return }
  28044. var start = posToDOM(this.cm, prim.from())
  28045. var end = posToDOM(this.cm, prim.to())
  28046. if (!start && !end) { return }
  28047. var view = this.cm.display.view
  28048. var old = sel.rangeCount && sel.getRangeAt(0)
  28049. if (!start) {
  28050. start = {node: view[0].measure.map[2], offset: 0}
  28051. } else if (!end) { // FIXME dangerously hacky
  28052. var measure = view[view.length - 1].measure
  28053. var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map
  28054. end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]}
  28055. }
  28056. var rng
  28057. try { rng = range(start.node, start.offset, end.offset, end.node) }
  28058. catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible
  28059. if (rng) {
  28060. if (!gecko && this.cm.state.focused) {
  28061. sel.collapse(start.node, start.offset)
  28062. if (!rng.collapsed) {
  28063. sel.removeAllRanges()
  28064. sel.addRange(rng)
  28065. }
  28066. } else {
  28067. sel.removeAllRanges()
  28068. sel.addRange(rng)
  28069. }
  28070. if (old && sel.anchorNode == null) { sel.addRange(old) }
  28071. else if (gecko) { this.startGracePeriod() }
  28072. }
  28073. this.rememberSelection()
  28074. };
  28075. ContentEditableInput.prototype.startGracePeriod = function () {
  28076. var this$1 = this;
  28077. clearTimeout(this.gracePeriod)
  28078. this.gracePeriod = setTimeout(function () {
  28079. this$1.gracePeriod = false
  28080. if (this$1.selectionChanged())
  28081. { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }) }
  28082. }, 20)
  28083. };
  28084. ContentEditableInput.prototype.showMultipleSelections = function (info) {
  28085. removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors)
  28086. removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection)
  28087. };
  28088. ContentEditableInput.prototype.rememberSelection = function () {
  28089. var sel = window.getSelection()
  28090. this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset
  28091. this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset
  28092. };
  28093. ContentEditableInput.prototype.selectionInEditor = function () {
  28094. var sel = window.getSelection()
  28095. if (!sel.rangeCount) { return false }
  28096. var node = sel.getRangeAt(0).commonAncestorContainer
  28097. return contains(this.div, node)
  28098. };
  28099. ContentEditableInput.prototype.focus = function () {
  28100. if (this.cm.options.readOnly != "nocursor") {
  28101. if (!this.selectionInEditor())
  28102. { this.showSelection(this.prepareSelection(), true) }
  28103. this.div.focus()
  28104. }
  28105. };
  28106. ContentEditableInput.prototype.blur = function () { this.div.blur() };
  28107. ContentEditableInput.prototype.getField = function () { return this.div };
  28108. ContentEditableInput.prototype.supportsTouch = function () { return true };
  28109. ContentEditableInput.prototype.receivedFocus = function () {
  28110. var input = this
  28111. if (this.selectionInEditor())
  28112. { this.pollSelection() }
  28113. else
  28114. { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }) }
  28115. function poll() {
  28116. if (input.cm.state.focused) {
  28117. input.pollSelection()
  28118. input.polling.set(input.cm.options.pollInterval, poll)
  28119. }
  28120. }
  28121. this.polling.set(this.cm.options.pollInterval, poll)
  28122. };
  28123. ContentEditableInput.prototype.selectionChanged = function () {
  28124. var sel = window.getSelection()
  28125. return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||
  28126. sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset
  28127. };
  28128. ContentEditableInput.prototype.pollSelection = function () {
  28129. if (!this.composing && this.readDOMTimeout == null && !this.gracePeriod && this.selectionChanged()) {
  28130. var sel = window.getSelection(), cm = this.cm
  28131. this.rememberSelection()
  28132. var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset)
  28133. var head = domToPos(cm, sel.focusNode, sel.focusOffset)
  28134. if (anchor && head) { runInOp(cm, function () {
  28135. setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll)
  28136. if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true }
  28137. }) }
  28138. }
  28139. };
  28140. ContentEditableInput.prototype.pollContent = function () {
  28141. if (this.readDOMTimeout != null) {
  28142. clearTimeout(this.readDOMTimeout)
  28143. this.readDOMTimeout = null
  28144. }
  28145. var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary()
  28146. var from = sel.from(), to = sel.to()
  28147. if (from.ch == 0 && from.line > cm.firstLine())
  28148. { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length) }
  28149. if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())
  28150. { to = Pos(to.line + 1, 0) }
  28151. if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }
  28152. var fromIndex, fromLine, fromNode
  28153. if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {
  28154. fromLine = lineNo(display.view[0].line)
  28155. fromNode = display.view[0].node
  28156. } else {
  28157. fromLine = lineNo(display.view[fromIndex].line)
  28158. fromNode = display.view[fromIndex - 1].node.nextSibling
  28159. }
  28160. var toIndex = findViewIndex(cm, to.line)
  28161. var toLine, toNode
  28162. if (toIndex == display.view.length - 1) {
  28163. toLine = display.viewTo - 1
  28164. toNode = display.lineDiv.lastChild
  28165. } else {
  28166. toLine = lineNo(display.view[toIndex + 1].line) - 1
  28167. toNode = display.view[toIndex + 1].node.previousSibling
  28168. }
  28169. if (!fromNode) { return false }
  28170. var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine))
  28171. var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length))
  28172. while (newText.length > 1 && oldText.length > 1) {
  28173. if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine-- }
  28174. else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++ }
  28175. else { break }
  28176. }
  28177. var cutFront = 0, cutEnd = 0
  28178. var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length)
  28179. while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))
  28180. { ++cutFront }
  28181. var newBot = lst(newText), oldBot = lst(oldText)
  28182. var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),
  28183. oldBot.length - (oldText.length == 1 ? cutFront : 0))
  28184. while (cutEnd < maxCutEnd &&
  28185. newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))
  28186. { ++cutEnd }
  28187. newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\u200b+/, "")
  28188. newText[0] = newText[0].slice(cutFront).replace(/\u200b+$/, "")
  28189. var chFrom = Pos(fromLine, cutFront)
  28190. var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0)
  28191. if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {
  28192. replaceRange(cm.doc, newText, chFrom, chTo, "+input")
  28193. return true
  28194. }
  28195. };
  28196. ContentEditableInput.prototype.ensurePolled = function () {
  28197. this.forceCompositionEnd()
  28198. };
  28199. ContentEditableInput.prototype.reset = function () {
  28200. this.forceCompositionEnd()
  28201. };
  28202. ContentEditableInput.prototype.forceCompositionEnd = function () {
  28203. if (!this.composing) { return }
  28204. clearTimeout(this.readDOMTimeout)
  28205. this.composing = null
  28206. if (!this.pollContent()) { regChange(this.cm) }
  28207. this.div.blur()
  28208. this.div.focus()
  28209. };
  28210. ContentEditableInput.prototype.readFromDOMSoon = function () {
  28211. var this$1 = this;
  28212. if (this.readDOMTimeout != null) { return }
  28213. this.readDOMTimeout = setTimeout(function () {
  28214. this$1.readDOMTimeout = null
  28215. if (this$1.composing) {
  28216. if (this$1.composing.done) { this$1.composing = null }
  28217. else { return }
  28218. }
  28219. if (this$1.cm.isReadOnly() || !this$1.pollContent())
  28220. { runInOp(this$1.cm, function () { return regChange(this$1.cm); }) }
  28221. }, 80)
  28222. };
  28223. ContentEditableInput.prototype.setUneditable = function (node) {
  28224. node.contentEditable = "false"
  28225. };
  28226. ContentEditableInput.prototype.onKeyPress = function (e) {
  28227. e.preventDefault()
  28228. if (!this.cm.isReadOnly())
  28229. { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0) }
  28230. };
  28231. ContentEditableInput.prototype.readOnlyChanged = function (val) {
  28232. this.div.contentEditable = String(val != "nocursor")
  28233. };
  28234. ContentEditableInput.prototype.onContextMenu = function () {};
  28235. ContentEditableInput.prototype.resetPosition = function () {};
  28236. ContentEditableInput.prototype.needsContentAttribute = true
  28237. function posToDOM(cm, pos) {
  28238. var view = findViewForLine(cm, pos.line)
  28239. if (!view || view.hidden) { return null }
  28240. var line = getLine(cm.doc, pos.line)
  28241. var info = mapFromLineView(view, line, pos.line)
  28242. var order = getOrder(line), side = "left"
  28243. if (order) {
  28244. var partPos = getBidiPartAt(order, pos.ch)
  28245. side = partPos % 2 ? "right" : "left"
  28246. }
  28247. var result = nodeAndOffsetInLineMap(info.map, pos.ch, side)
  28248. result.offset = result.collapse == "right" ? result.end : result.start
  28249. return result
  28250. }
  28251. function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }
  28252. function domTextBetween(cm, from, to, fromLine, toLine) {
  28253. var text = "", closing = false, lineSep = cm.doc.lineSeparator()
  28254. function recognizeMarker(id) { return function (marker) { return marker.id == id; } }
  28255. function walk(node) {
  28256. if (node.nodeType == 1) {
  28257. var cmText = node.getAttribute("cm-text")
  28258. if (cmText != null) {
  28259. if (cmText == "") { text += node.textContent.replace(/\u200b/g, "") }
  28260. else { text += cmText }
  28261. return
  28262. }
  28263. var markerID = node.getAttribute("cm-marker"), range
  28264. if (markerID) {
  28265. var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID))
  28266. if (found.length && (range = found[0].find()))
  28267. { text += getBetween(cm.doc, range.from, range.to).join(lineSep) }
  28268. return
  28269. }
  28270. if (node.getAttribute("contenteditable") == "false") { return }
  28271. for (var i = 0; i < node.childNodes.length; i++)
  28272. { walk(node.childNodes[i]) }
  28273. if (/^(pre|div|p)$/i.test(node.nodeName))
  28274. { closing = true }
  28275. } else if (node.nodeType == 3) {
  28276. var val = node.nodeValue
  28277. if (!val) { return }
  28278. if (closing) {
  28279. text += lineSep
  28280. closing = false
  28281. }
  28282. text += val
  28283. }
  28284. }
  28285. for (;;) {
  28286. walk(from)
  28287. if (from == to) { break }
  28288. from = from.nextSibling
  28289. }
  28290. return text
  28291. }
  28292. function domToPos(cm, node, offset) {
  28293. var lineNode
  28294. if (node == cm.display.lineDiv) {
  28295. lineNode = cm.display.lineDiv.childNodes[offset]
  28296. if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }
  28297. node = null; offset = 0
  28298. } else {
  28299. for (lineNode = node;; lineNode = lineNode.parentNode) {
  28300. if (!lineNode || lineNode == cm.display.lineDiv) { return null }
  28301. if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }
  28302. }
  28303. }
  28304. for (var i = 0; i < cm.display.view.length; i++) {
  28305. var lineView = cm.display.view[i]
  28306. if (lineView.node == lineNode)
  28307. { return locateNodeInLineView(lineView, node, offset) }
  28308. }
  28309. }
  28310. function locateNodeInLineView(lineView, node, offset) {
  28311. var wrapper = lineView.text.firstChild, bad = false
  28312. if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }
  28313. if (node == wrapper) {
  28314. bad = true
  28315. node = wrapper.childNodes[offset]
  28316. offset = 0
  28317. if (!node) {
  28318. var line = lineView.rest ? lst(lineView.rest) : lineView.line
  28319. return badPos(Pos(lineNo(line), line.text.length), bad)
  28320. }
  28321. }
  28322. var textNode = node.nodeType == 3 ? node : null, topNode = node
  28323. if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {
  28324. textNode = node.firstChild
  28325. if (offset) { offset = textNode.nodeValue.length }
  28326. }
  28327. while (topNode.parentNode != wrapper) { topNode = topNode.parentNode }
  28328. var measure = lineView.measure, maps = measure.maps
  28329. function find(textNode, topNode, offset) {
  28330. for (var i = -1; i < (maps ? maps.length : 0); i++) {
  28331. var map = i < 0 ? measure.map : maps[i]
  28332. for (var j = 0; j < map.length; j += 3) {
  28333. var curNode = map[j + 2]
  28334. if (curNode == textNode || curNode == topNode) {
  28335. var line = lineNo(i < 0 ? lineView.line : lineView.rest[i])
  28336. var ch = map[j] + offset
  28337. if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)] }
  28338. return Pos(line, ch)
  28339. }
  28340. }
  28341. }
  28342. }
  28343. var found = find(textNode, topNode, offset)
  28344. if (found) { return badPos(found, bad) }
  28345. // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems
  28346. for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {
  28347. found = find(after, after.firstChild, 0)
  28348. if (found)
  28349. { return badPos(Pos(found.line, found.ch - dist), bad) }
  28350. else
  28351. { dist += after.textContent.length }
  28352. }
  28353. for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {
  28354. found = find(before, before.firstChild, -1)
  28355. if (found)
  28356. { return badPos(Pos(found.line, found.ch + dist$1), bad) }
  28357. else
  28358. { dist$1 += before.textContent.length }
  28359. }
  28360. }
  28361. // TEXTAREA INPUT STYLE
  28362. var TextareaInput = function(cm) {
  28363. this.cm = cm
  28364. // See input.poll and input.reset
  28365. this.prevInput = ""
  28366. // Flag that indicates whether we expect input to appear real soon
  28367. // now (after some event like 'keypress' or 'input') and are
  28368. // polling intensively.
  28369. this.pollingFast = false
  28370. // Self-resetting timeout for the poller
  28371. this.polling = new Delayed()
  28372. // Tracks when input.reset has punted to just putting a short
  28373. // string into the textarea instead of the full selection.
  28374. this.inaccurateSelection = false
  28375. // Used to work around IE issue with selection being forgotten when focus moves away from textarea
  28376. this.hasSelection = false
  28377. this.composing = null
  28378. };
  28379. TextareaInput.prototype.init = function (display) {
  28380. var this$1 = this;
  28381. var input = this, cm = this.cm
  28382. // Wraps and hides input textarea
  28383. var div = this.wrapper = hiddenTextarea()
  28384. // The semihidden textarea that is focused when the editor is
  28385. // focused, and receives input.
  28386. var te = this.textarea = div.firstChild
  28387. display.wrapper.insertBefore(div, display.wrapper.firstChild)
  28388. // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)
  28389. if (ios) { te.style.width = "0px" }
  28390. on(te, "input", function () {
  28391. if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null }
  28392. input.poll()
  28393. })
  28394. on(te, "paste", function (e) {
  28395. if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }
  28396. cm.state.pasteIncoming = true
  28397. input.fastPoll()
  28398. })
  28399. function prepareCopyCut(e) {
  28400. if (signalDOMEvent(cm, e)) { return }
  28401. if (cm.somethingSelected()) {
  28402. setLastCopied({lineWise: false, text: cm.getSelections()})
  28403. if (input.inaccurateSelection) {
  28404. input.prevInput = ""
  28405. input.inaccurateSelection = false
  28406. te.value = lastCopied.text.join("\n")
  28407. selectInput(te)
  28408. }
  28409. } else if (!cm.options.lineWiseCopyCut) {
  28410. return
  28411. } else {
  28412. var ranges = copyableRanges(cm)
  28413. setLastCopied({lineWise: true, text: ranges.text})
  28414. if (e.type == "cut") {
  28415. cm.setSelections(ranges.ranges, null, sel_dontScroll)
  28416. } else {
  28417. input.prevInput = ""
  28418. te.value = ranges.text.join("\n")
  28419. selectInput(te)
  28420. }
  28421. }
  28422. if (e.type == "cut") { cm.state.cutIncoming = true }
  28423. }
  28424. on(te, "cut", prepareCopyCut)
  28425. on(te, "copy", prepareCopyCut)
  28426. on(display.scroller, "paste", function (e) {
  28427. if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }
  28428. cm.state.pasteIncoming = true
  28429. input.focus()
  28430. })
  28431. // Prevent normal selection in the editor (we handle our own)
  28432. on(display.lineSpace, "selectstart", function (e) {
  28433. if (!eventInWidget(display, e)) { e_preventDefault(e) }
  28434. })
  28435. on(te, "compositionstart", function () {
  28436. var start = cm.getCursor("from")
  28437. if (input.composing) { input.composing.range.clear() }
  28438. input.composing = {
  28439. start: start,
  28440. range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"})
  28441. }
  28442. })
  28443. on(te, "compositionend", function () {
  28444. if (input.composing) {
  28445. input.poll()
  28446. input.composing.range.clear()
  28447. input.composing = null
  28448. }
  28449. })
  28450. };
  28451. TextareaInput.prototype.prepareSelection = function () {
  28452. // Redraw the selection and/or cursor
  28453. var cm = this.cm, display = cm.display, doc = cm.doc
  28454. var result = prepareSelection(cm)
  28455. // Move the hidden textarea near the cursor to prevent scrolling artifacts
  28456. if (cm.options.moveInputWithCursor) {
  28457. var headPos = cursorCoords(cm, doc.sel.primary().head, "div")
  28458. var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect()
  28459. result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,
  28460. headPos.top + lineOff.top - wrapOff.top))
  28461. result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,
  28462. headPos.left + lineOff.left - wrapOff.left))
  28463. }
  28464. return result
  28465. };
  28466. TextareaInput.prototype.showSelection = function (drawn) {
  28467. var cm = this.cm, display = cm.display
  28468. removeChildrenAndAdd(display.cursorDiv, drawn.cursors)
  28469. removeChildrenAndAdd(display.selectionDiv, drawn.selection)
  28470. if (drawn.teTop != null) {
  28471. this.wrapper.style.top = drawn.teTop + "px"
  28472. this.wrapper.style.left = drawn.teLeft + "px"
  28473. }
  28474. };
  28475. // Reset the input to correspond to the selection (or to be empty,
  28476. // when not typing and nothing is selected)
  28477. TextareaInput.prototype.reset = function (typing) {
  28478. if (this.contextMenuPending) { return }
  28479. var minimal, selected, cm = this.cm, doc = cm.doc
  28480. if (cm.somethingSelected()) {
  28481. this.prevInput = ""
  28482. var range = doc.sel.primary()
  28483. minimal = hasCopyEvent &&
  28484. (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000)
  28485. var content = minimal ? "-" : selected || cm.getSelection()
  28486. this.textarea.value = content
  28487. if (cm.state.focused) { selectInput(this.textarea) }
  28488. if (ie && ie_version >= 9) { this.hasSelection = content }
  28489. } else if (!typing) {
  28490. this.prevInput = this.textarea.value = ""
  28491. if (ie && ie_version >= 9) { this.hasSelection = null }
  28492. }
  28493. this.inaccurateSelection = minimal
  28494. };
  28495. TextareaInput.prototype.getField = function () { return this.textarea };
  28496. TextareaInput.prototype.supportsTouch = function () { return false };
  28497. TextareaInput.prototype.focus = function () {
  28498. if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) {
  28499. try { this.textarea.focus() }
  28500. catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM
  28501. }
  28502. };
  28503. TextareaInput.prototype.blur = function () { this.textarea.blur() };
  28504. TextareaInput.prototype.resetPosition = function () {
  28505. this.wrapper.style.top = this.wrapper.style.left = 0
  28506. };
  28507. TextareaInput.prototype.receivedFocus = function () { this.slowPoll() };
  28508. // Poll for input changes, using the normal rate of polling. This
  28509. // runs as long as the editor is focused.
  28510. TextareaInput.prototype.slowPoll = function () {
  28511. var this$1 = this;
  28512. if (this.pollingFast) { return }
  28513. this.polling.set(this.cm.options.pollInterval, function () {
  28514. this$1.poll()
  28515. if (this$1.cm.state.focused) { this$1.slowPoll() }
  28516. })
  28517. };
  28518. // When an event has just come in that is likely to add or change
  28519. // something in the input textarea, we poll faster, to ensure that
  28520. // the change appears on the screen quickly.
  28521. TextareaInput.prototype.fastPoll = function () {
  28522. var missed = false, input = this
  28523. input.pollingFast = true
  28524. function p() {
  28525. var changed = input.poll()
  28526. if (!changed && !missed) {missed = true; input.polling.set(60, p)}
  28527. else {input.pollingFast = false; input.slowPoll()}
  28528. }
  28529. input.polling.set(20, p)
  28530. };
  28531. // Read input from the textarea, and update the document to match.
  28532. // When something is selected, it is present in the textarea, and
  28533. // selected (unless it is huge, in which case a placeholder is
  28534. // used). When nothing is selected, the cursor sits after previously
  28535. // seen text (can be empty), which is stored in prevInput (we must
  28536. // not reset the textarea when typing, because that breaks IME).
  28537. TextareaInput.prototype.poll = function () {
  28538. var this$1 = this;
  28539. var cm = this.cm, input = this.textarea, prevInput = this.prevInput
  28540. // Since this is called a *lot*, try to bail out as cheaply as
  28541. // possible when it is clear that nothing happened. hasSelection
  28542. // will be the case when there is a lot of text in the textarea,
  28543. // in which case reading its value would be expensive.
  28544. if (this.contextMenuPending || !cm.state.focused ||
  28545. (hasSelection(input) && !prevInput && !this.composing) ||
  28546. cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)
  28547. { return false }
  28548. var text = input.value
  28549. // If nothing changed, bail.
  28550. if (text == prevInput && !cm.somethingSelected()) { return false }
  28551. // Work around nonsensical selection resetting in IE9/10, and
  28552. // inexplicable appearance of private area unicode characters on
  28553. // some key combos in Mac (#2689).
  28554. if (ie && ie_version >= 9 && this.hasSelection === text ||
  28555. mac && /[\uf700-\uf7ff]/.test(text)) {
  28556. cm.display.input.reset()
  28557. return false
  28558. }
  28559. if (cm.doc.sel == cm.display.selForContextMenu) {
  28560. var first = text.charCodeAt(0)
  28561. if (first == 0x200b && !prevInput) { prevInput = "\u200b" }
  28562. if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo") }
  28563. }
  28564. // Find the part of the input that is actually new
  28565. var same = 0, l = Math.min(prevInput.length, text.length)
  28566. while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same }
  28567. runInOp(cm, function () {
  28568. applyTextInput(cm, text.slice(same), prevInput.length - same,
  28569. null, this$1.composing ? "*compose" : null)
  28570. // Don't leave long text in the textarea, since it makes further polling slow
  28571. if (text.length > 1000 || text.indexOf("\n") > -1) { input.value = this$1.prevInput = "" }
  28572. else { this$1.prevInput = text }
  28573. if (this$1.composing) {
  28574. this$1.composing.range.clear()
  28575. this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor("to"),
  28576. {className: "CodeMirror-composing"})
  28577. }
  28578. })
  28579. return true
  28580. };
  28581. TextareaInput.prototype.ensurePolled = function () {
  28582. if (this.pollingFast && this.poll()) { this.pollingFast = false }
  28583. };
  28584. TextareaInput.prototype.onKeyPress = function () {
  28585. if (ie && ie_version >= 9) { this.hasSelection = null }
  28586. this.fastPoll()
  28587. };
  28588. TextareaInput.prototype.onContextMenu = function (e) {
  28589. var input = this, cm = input.cm, display = cm.display, te = input.textarea
  28590. var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop
  28591. if (!pos || presto) { return } // Opera is difficult.
  28592. // Reset the current text selection only if the click is done outside of the selection
  28593. // and 'resetSelectionOnContextMenu' option is true.
  28594. var reset = cm.options.resetSelectionOnContextMenu
  28595. if (reset && cm.doc.sel.contains(pos) == -1)
  28596. { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll) }
  28597. var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText
  28598. input.wrapper.style.cssText = "position: absolute"
  28599. var wrapperBox = input.wrapper.getBoundingClientRect()
  28600. te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"
  28601. var oldScrollY
  28602. if (webkit) { oldScrollY = window.scrollY } // Work around Chrome issue (#2712)
  28603. display.input.focus()
  28604. if (webkit) { window.scrollTo(null, oldScrollY) }
  28605. display.input.reset()
  28606. // Adds "Select all" to context menu in FF
  28607. if (!cm.somethingSelected()) { te.value = input.prevInput = " " }
  28608. input.contextMenuPending = true
  28609. display.selForContextMenu = cm.doc.sel
  28610. clearTimeout(display.detectingSelectAll)
  28611. // Select-all will be greyed out if there's nothing to select, so
  28612. // this adds a zero-width space so that we can later check whether
  28613. // it got selected.
  28614. function prepareSelectAllHack() {
  28615. if (te.selectionStart != null) {
  28616. var selected = cm.somethingSelected()
  28617. var extval = "\u200b" + (selected ? te.value : "")
  28618. te.value = "\u21da" // Used to catch context-menu undo
  28619. te.value = extval
  28620. input.prevInput = selected ? "" : "\u200b"
  28621. te.selectionStart = 1; te.selectionEnd = extval.length
  28622. // Re-set this, in case some other handler touched the
  28623. // selection in the meantime.
  28624. display.selForContextMenu = cm.doc.sel
  28625. }
  28626. }
  28627. function rehide() {
  28628. input.contextMenuPending = false
  28629. input.wrapper.style.cssText = oldWrapperCSS
  28630. te.style.cssText = oldCSS
  28631. if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos) }
  28632. // Try to detect the user choosing select-all
  28633. if (te.selectionStart != null) {
  28634. if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack() }
  28635. var i = 0, poll = function () {
  28636. if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&
  28637. te.selectionEnd > 0 && input.prevInput == "\u200b")
  28638. { operation(cm, selectAll)(cm) }
  28639. else if (i++ < 10) { display.detectingSelectAll = setTimeout(poll, 500) }
  28640. else { display.input.reset() }
  28641. }
  28642. display.detectingSelectAll = setTimeout(poll, 200)
  28643. }
  28644. }
  28645. if (ie && ie_version >= 9) { prepareSelectAllHack() }
  28646. if (captureRightClick) {
  28647. e_stop(e)
  28648. var mouseup = function () {
  28649. off(window, "mouseup", mouseup)
  28650. setTimeout(rehide, 20)
  28651. }
  28652. on(window, "mouseup", mouseup)
  28653. } else {
  28654. setTimeout(rehide, 50)
  28655. }
  28656. };
  28657. TextareaInput.prototype.readOnlyChanged = function (val) {
  28658. if (!val) { this.reset() }
  28659. };
  28660. TextareaInput.prototype.setUneditable = function () {};
  28661. TextareaInput.prototype.needsContentAttribute = false
  28662. function fromTextArea(textarea, options) {
  28663. options = options ? copyObj(options) : {}
  28664. options.value = textarea.value
  28665. if (!options.tabindex && textarea.tabIndex)
  28666. { options.tabindex = textarea.tabIndex }
  28667. if (!options.placeholder && textarea.placeholder)
  28668. { options.placeholder = textarea.placeholder }
  28669. // Set autofocus to true if this textarea is focused, or if it has
  28670. // autofocus and no other element is focused.
  28671. if (options.autofocus == null) {
  28672. var hasFocus = activeElt()
  28673. options.autofocus = hasFocus == textarea ||
  28674. textarea.getAttribute("autofocus") != null && hasFocus == document.body
  28675. }
  28676. function save() {textarea.value = cm.getValue()}
  28677. var realSubmit
  28678. if (textarea.form) {
  28679. on(textarea.form, "submit", save)
  28680. // Deplorable hack to make the submit method do the right thing.
  28681. if (!options.leaveSubmitMethodAlone) {
  28682. var form = textarea.form
  28683. realSubmit = form.submit
  28684. try {
  28685. var wrappedSubmit = form.submit = function () {
  28686. save()
  28687. form.submit = realSubmit
  28688. form.submit()
  28689. form.submit = wrappedSubmit
  28690. }
  28691. } catch(e) {}
  28692. }
  28693. }
  28694. options.finishInit = function (cm) {
  28695. cm.save = save
  28696. cm.getTextArea = function () { return textarea; }
  28697. cm.toTextArea = function () {
  28698. cm.toTextArea = isNaN // Prevent this from being ran twice
  28699. save()
  28700. textarea.parentNode.removeChild(cm.getWrapperElement())
  28701. textarea.style.display = ""
  28702. if (textarea.form) {
  28703. off(textarea.form, "submit", save)
  28704. if (typeof textarea.form.submit == "function")
  28705. { textarea.form.submit = realSubmit }
  28706. }
  28707. }
  28708. }
  28709. textarea.style.display = "none"
  28710. var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },
  28711. options)
  28712. return cm
  28713. }
  28714. function addLegacyProps(CodeMirror) {
  28715. CodeMirror.off = off
  28716. CodeMirror.on = on
  28717. CodeMirror.wheelEventPixels = wheelEventPixels
  28718. CodeMirror.Doc = Doc
  28719. CodeMirror.splitLines = splitLinesAuto
  28720. CodeMirror.countColumn = countColumn
  28721. CodeMirror.findColumn = findColumn
  28722. CodeMirror.isWordChar = isWordCharBasic
  28723. CodeMirror.Pass = Pass
  28724. CodeMirror.signal = signal
  28725. CodeMirror.Line = Line
  28726. CodeMirror.changeEnd = changeEnd
  28727. CodeMirror.scrollbarModel = scrollbarModel
  28728. CodeMirror.Pos = Pos
  28729. CodeMirror.cmpPos = cmp
  28730. CodeMirror.modes = modes
  28731. CodeMirror.mimeModes = mimeModes
  28732. CodeMirror.resolveMode = resolveMode
  28733. CodeMirror.getMode = getMode
  28734. CodeMirror.modeExtensions = modeExtensions
  28735. CodeMirror.extendMode = extendMode
  28736. CodeMirror.copyState = copyState
  28737. CodeMirror.startState = startState
  28738. CodeMirror.innerMode = innerMode
  28739. CodeMirror.commands = commands
  28740. CodeMirror.keyMap = keyMap
  28741. CodeMirror.keyName = keyName
  28742. CodeMirror.isModifierKey = isModifierKey
  28743. CodeMirror.lookupKey = lookupKey
  28744. CodeMirror.normalizeKeyMap = normalizeKeyMap
  28745. CodeMirror.StringStream = StringStream
  28746. CodeMirror.SharedTextMarker = SharedTextMarker
  28747. CodeMirror.TextMarker = TextMarker
  28748. CodeMirror.LineWidget = LineWidget
  28749. CodeMirror.e_preventDefault = e_preventDefault
  28750. CodeMirror.e_stopPropagation = e_stopPropagation
  28751. CodeMirror.e_stop = e_stop
  28752. CodeMirror.addClass = addClass
  28753. CodeMirror.contains = contains
  28754. CodeMirror.rmClass = rmClass
  28755. CodeMirror.keyNames = keyNames
  28756. }
  28757. // EDITOR CONSTRUCTOR
  28758. defineOptions(CodeMirror)
  28759. addEditorMethods(CodeMirror)
  28760. // Set up methods on CodeMirror's prototype to redirect to the editor's document.
  28761. var dontDelegate = "iter insert remove copy getEditor constructor".split(" ")
  28762. for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)
  28763. { CodeMirror.prototype[prop] = (function(method) {
  28764. return function() {return method.apply(this.doc, arguments)}
  28765. })(Doc.prototype[prop]) } }
  28766. eventMixin(Doc)
  28767. // INPUT HANDLING
  28768. CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput}
  28769. // MODE DEFINITION AND QUERYING
  28770. // Extra arguments are stored as the mode's dependencies, which is
  28771. // used by (legacy) mechanisms like loadmode.js to automatically
  28772. // load a mode. (Preferred mechanism is the require/define calls.)
  28773. CodeMirror.defineMode = function(name/*, mode, …*/) {
  28774. if (!CodeMirror.defaults.mode && name != "null") { CodeMirror.defaults.mode = name }
  28775. defineMode.apply(this, arguments)
  28776. }
  28777. CodeMirror.defineMIME = defineMIME
  28778. // Minimal default mode.
  28779. CodeMirror.defineMode("null", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); })
  28780. CodeMirror.defineMIME("text/plain", "null")
  28781. // EXTENSIONS
  28782. CodeMirror.defineExtension = function (name, func) {
  28783. CodeMirror.prototype[name] = func
  28784. }
  28785. CodeMirror.defineDocExtension = function (name, func) {
  28786. Doc.prototype[name] = func
  28787. }
  28788. CodeMirror.fromTextArea = fromTextArea
  28789. addLegacyProps(CodeMirror)
  28790. CodeMirror.version = "5.23.0"
  28791. return CodeMirror;
  28792. })));
  28793. /***/ },
  28794. /* 212 */
  28795. /***/ function(module, exports, __webpack_require__) {
  28796. // CodeMirror, copyright (c) by Marijn Haverbeke and others
  28797. // Distributed under an MIT license: http://codemirror.net/LICENSE
  28798. (function(mod) {
  28799. if (true) // CommonJS
  28800. mod(__webpack_require__(211));
  28801. else if (typeof define == "function" && define.amd) // AMD
  28802. define(["../../lib/codemirror"], mod);
  28803. else // Plain browser env
  28804. mod(CodeMirror);
  28805. })(function(CodeMirror) {
  28806. "use strict";
  28807. var noOptions = {};
  28808. var nonWS = /[^\s\u00a0]/;
  28809. var Pos = CodeMirror.Pos;
  28810. function firstNonWS(str) {
  28811. var found = str.search(nonWS);
  28812. return found == -1 ? 0 : found;
  28813. }
  28814. CodeMirror.commands.toggleComment = function(cm) {
  28815. cm.toggleComment();
  28816. };
  28817. CodeMirror.defineExtension("toggleComment", function(options) {
  28818. if (!options) options = noOptions;
  28819. var cm = this;
  28820. var minLine = Infinity, ranges = this.listSelections(), mode = null;
  28821. for (var i = ranges.length - 1; i >= 0; i--) {
  28822. var from = ranges[i].from(), to = ranges[i].to();
  28823. if (from.line >= minLine) continue;
  28824. if (to.line >= minLine) to = Pos(minLine, 0);
  28825. minLine = from.line;
  28826. if (mode == null) {
  28827. if (cm.uncomment(from, to, options)) mode = "un";
  28828. else { cm.lineComment(from, to, options); mode = "line"; }
  28829. } else if (mode == "un") {
  28830. cm.uncomment(from, to, options);
  28831. } else {
  28832. cm.lineComment(from, to, options);
  28833. }
  28834. }
  28835. });
  28836. // Rough heuristic to try and detect lines that are part of multi-line string
  28837. function probablyInsideString(cm, pos, line) {
  28838. return /\bstring\b/.test(cm.getTokenTypeAt(Pos(pos.line, 0))) && !/^[\'\"`]/.test(line)
  28839. }
  28840. CodeMirror.defineExtension("lineComment", function(from, to, options) {
  28841. if (!options) options = noOptions;
  28842. var self = this, mode = self.getModeAt(from);
  28843. var firstLine = self.getLine(from.line);
  28844. if (firstLine == null || probablyInsideString(self, from, firstLine)) return;
  28845. var commentString = options.lineComment || mode.lineComment;
  28846. if (!commentString) {
  28847. if (options.blockCommentStart || mode.blockCommentStart) {
  28848. options.fullLines = true;
  28849. self.blockComment(from, to, options);
  28850. }
  28851. return;
  28852. }
  28853. var end = Math.min(to.ch != 0 || to.line == from.line ? to.line + 1 : to.line, self.lastLine() + 1);
  28854. var pad = options.padding == null ? " " : options.padding;
  28855. var blankLines = options.commentBlankLines || from.line == to.line;
  28856. self.operation(function() {
  28857. if (options.indent) {
  28858. var baseString = null;
  28859. for (var i = from.line; i < end; ++i) {
  28860. var line = self.getLine(i);
  28861. var whitespace = line.slice(0, firstNonWS(line));
  28862. if (baseString == null || baseString.length > whitespace.length) {
  28863. baseString = whitespace;
  28864. }
  28865. }
  28866. for (var i = from.line; i < end; ++i) {
  28867. var line = self.getLine(i), cut = baseString.length;
  28868. if (!blankLines && !nonWS.test(line)) continue;
  28869. if (line.slice(0, cut) != baseString) cut = firstNonWS(line);
  28870. self.replaceRange(baseString + commentString + pad, Pos(i, 0), Pos(i, cut));
  28871. }
  28872. } else {
  28873. for (var i = from.line; i < end; ++i) {
  28874. if (blankLines || nonWS.test(self.getLine(i)))
  28875. self.replaceRange(commentString + pad, Pos(i, 0));
  28876. }
  28877. }
  28878. });
  28879. });
  28880. CodeMirror.defineExtension("blockComment", function(from, to, options) {
  28881. if (!options) options = noOptions;
  28882. var self = this, mode = self.getModeAt(from);
  28883. var startString = options.blockCommentStart || mode.blockCommentStart;
  28884. var endString = options.blockCommentEnd || mode.blockCommentEnd;
  28885. if (!startString || !endString) {
  28886. if ((options.lineComment || mode.lineComment) && options.fullLines != false)
  28887. self.lineComment(from, to, options);
  28888. return;
  28889. }
  28890. if (/\bcomment\b/.test(self.getTokenTypeAt(Pos(from.line, 0)))) return
  28891. var end = Math.min(to.line, self.lastLine());
  28892. if (end != from.line && to.ch == 0 && nonWS.test(self.getLine(end))) --end;
  28893. var pad = options.padding == null ? " " : options.padding;
  28894. if (from.line > end) return;
  28895. self.operation(function() {
  28896. if (options.fullLines != false) {
  28897. var lastLineHasText = nonWS.test(self.getLine(end));
  28898. self.replaceRange(pad + endString, Pos(end));
  28899. self.replaceRange(startString + pad, Pos(from.line, 0));
  28900. var lead = options.blockCommentLead || mode.blockCommentLead;
  28901. if (lead != null) for (var i = from.line + 1; i <= end; ++i)
  28902. if (i != end || lastLineHasText)
  28903. self.replaceRange(lead + pad, Pos(i, 0));
  28904. } else {
  28905. self.replaceRange(endString, to);
  28906. self.replaceRange(startString, from);
  28907. }
  28908. });
  28909. });
  28910. CodeMirror.defineExtension("uncomment", function(from, to, options) {
  28911. if (!options) options = noOptions;
  28912. var self = this, mode = self.getModeAt(from);
  28913. var end = Math.min(to.ch != 0 || to.line == from.line ? to.line : to.line - 1, self.lastLine()), start = Math.min(from.line, end);
  28914. // Try finding line comments
  28915. var lineString = options.lineComment || mode.lineComment, lines = [];
  28916. var pad = options.padding == null ? " " : options.padding, didSomething;
  28917. lineComment: {
  28918. if (!lineString) break lineComment;
  28919. for (var i = start; i <= end; ++i) {
  28920. var line = self.getLine(i);
  28921. var found = line.indexOf(lineString);
  28922. if (found > -1 && !/comment/.test(self.getTokenTypeAt(Pos(i, found + 1)))) found = -1;
  28923. if (found == -1 && nonWS.test(line)) break lineComment;
  28924. if (found > -1 && nonWS.test(line.slice(0, found))) break lineComment;
  28925. lines.push(line);
  28926. }
  28927. self.operation(function() {
  28928. for (var i = start; i <= end; ++i) {
  28929. var line = lines[i - start];
  28930. var pos = line.indexOf(lineString), endPos = pos + lineString.length;
  28931. if (pos < 0) continue;
  28932. if (line.slice(endPos, endPos + pad.length) == pad) endPos += pad.length;
  28933. didSomething = true;
  28934. self.replaceRange("", Pos(i, pos), Pos(i, endPos));
  28935. }
  28936. });
  28937. if (didSomething) return true;
  28938. }
  28939. // Try block comments
  28940. var startString = options.blockCommentStart || mode.blockCommentStart;
  28941. var endString = options.blockCommentEnd || mode.blockCommentEnd;
  28942. if (!startString || !endString) return false;
  28943. var lead = options.blockCommentLead || mode.blockCommentLead;
  28944. var startLine = self.getLine(start), open = startLine.indexOf(startString)
  28945. if (open == -1) return false
  28946. var endLine = end == start ? startLine : self.getLine(end)
  28947. var close = endLine.indexOf(endString, end == start ? open + startString.length : 0);
  28948. if (close == -1 && start != end) {
  28949. endLine = self.getLine(--end);
  28950. close = endLine.indexOf(endString);
  28951. }
  28952. if (close == -1 ||
  28953. !/comment/.test(self.getTokenTypeAt(Pos(start, open + 1))) ||
  28954. !/comment/.test(self.getTokenTypeAt(Pos(end, close + 1))))
  28955. return false;
  28956. // Avoid killing block comments completely outside the selection.
  28957. // Positions of the last startString before the start of the selection, and the first endString after it.
  28958. var lastStart = startLine.lastIndexOf(startString, from.ch);
  28959. var firstEnd = lastStart == -1 ? -1 : startLine.slice(0, from.ch).indexOf(endString, lastStart + startString.length);
  28960. if (lastStart != -1 && firstEnd != -1 && firstEnd + endString.length != from.ch) return false;
  28961. // Positions of the first endString after the end of the selection, and the last startString before it.
  28962. firstEnd = endLine.indexOf(endString, to.ch);
  28963. var almostLastStart = endLine.slice(to.ch).lastIndexOf(startString, firstEnd - to.ch);
  28964. lastStart = (firstEnd == -1 || almostLastStart == -1) ? -1 : to.ch + almostLastStart;
  28965. if (firstEnd != -1 && lastStart != -1 && lastStart != to.ch) return false;
  28966. self.operation(function() {
  28967. self.replaceRange("", Pos(end, close - (pad && endLine.slice(close - pad.length, close) == pad ? pad.length : 0)),
  28968. Pos(end, close + endString.length));
  28969. var openEnd = open + startString.length;
  28970. if (pad && startLine.slice(openEnd, openEnd + pad.length) == pad) openEnd += pad.length;
  28971. self.replaceRange("", Pos(start, open), Pos(start, openEnd));
  28972. if (lead) for (var i = start + 1; i <= end; ++i) {
  28973. var line = self.getLine(i), found = line.indexOf(lead);
  28974. if (found == -1 || nonWS.test(line.slice(0, found))) continue;
  28975. var foundEnd = found + lead.length;
  28976. if (pad && line.slice(foundEnd, foundEnd + pad.length) == pad) foundEnd += pad.length;
  28977. self.replaceRange("", Pos(i, found), Pos(i, foundEnd));
  28978. }
  28979. });
  28980. return true;
  28981. });
  28982. });
  28983. /***/ },
  28984. /* 213 */
  28985. /***/ function(module, exports, __webpack_require__) {
  28986. // custom mode
  28987. 'use strict';
  28988. Object.defineProperty(exports, "__esModule", {
  28989. value: true
  28990. });
  28991. exports.default = function () {
  28992. _codemirror2.default.defineMode('host', function () {
  28993. function tokenBase(stream) {
  28994. if (stream.eatSpace()) return null;
  28995. var sol = stream.sol();
  28996. var ch = stream.next();
  28997. var s = stream.string;
  28998. if (ch === '#') {
  28999. stream.skipToEnd();
  29000. return 'comment';
  29001. }
  29002. if (!s.match(/^\s*([\d\.]+|[\da-f:\.%lo]+)\s+\w/i)) {
  29003. return 'error';
  29004. }
  29005. if (sol && ch.match(/[\w\.:%]/)) {
  29006. stream.eatWhile(/[\w\.:%]/);
  29007. return 'ip';
  29008. }
  29009. return null;
  29010. }
  29011. function tokenize(stream, state) {
  29012. return (state.tokens[0] || tokenBase)(stream, state);
  29013. }
  29014. return {
  29015. startState: function startState() {
  29016. return { tokens: [] };
  29017. },
  29018. token: function token(stream, state) {
  29019. return tokenize(stream, state);
  29020. },
  29021. lineComment: '#'
  29022. };
  29023. });
  29024. //CodeMirror.defineMIME('text/x-host', 'host');
  29025. };
  29026. var _codemirror = __webpack_require__(211);
  29027. var _codemirror2 = _interopRequireDefault(_codemirror);
  29028. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  29029. /***/ },
  29030. /* 214 */
  29031. /***/ function(module, exports, __webpack_require__) {
  29032. // style-loader: Adds some css to the DOM by adding a <style> tag
  29033. // load the styles
  29034. var content = __webpack_require__(215);
  29035. if(typeof content === 'string') content = [[module.id, content, '']];
  29036. // add the styles to the DOM
  29037. var update = __webpack_require__(187)(content, {});
  29038. if(content.locals) module.exports = content.locals;
  29039. // Hot Module Replacement
  29040. if(false) {
  29041. // When the styles change, update the <style> tags
  29042. if(!content.locals) {
  29043. module.hot.accept("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./codemirror.css", function() {
  29044. var newContent = require("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./codemirror.css");
  29045. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  29046. update(newContent);
  29047. });
  29048. }
  29049. // When the module is disposed, remove the <style> tags
  29050. module.hot.dispose(function() { update(); });
  29051. }
  29052. /***/ },
  29053. /* 215 */
  29054. /***/ function(module, exports, __webpack_require__) {
  29055. exports = module.exports = __webpack_require__(186)();
  29056. // imports
  29057. // module
  29058. 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}\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: contextual;\n font-variant-ligatures: contextual;\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/* 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", ""]);
  29059. // exports
  29060. /***/ },
  29061. /* 216 */
  29062. /***/ function(module, exports, __webpack_require__) {
  29063. // style-loader: Adds some css to the DOM by adding a <style> tag
  29064. // load the styles
  29065. var content = __webpack_require__(217);
  29066. if(typeof content === 'string') content = [[module.id, content, '']];
  29067. // add the styles to the DOM
  29068. var update = __webpack_require__(187)(content, {});
  29069. if(content.locals) module.exports = content.locals;
  29070. // Hot Module Replacement
  29071. if(false) {
  29072. // When the styles change, update the <style> tags
  29073. if(!content.locals) {
  29074. module.hot.accept("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./../../../../node_modules/.2.2.3@less-loader/index.js!./editor.less", function() {
  29075. var newContent = require("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./../../../../node_modules/.2.2.3@less-loader/index.js!./editor.less");
  29076. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  29077. update(newContent);
  29078. });
  29079. }
  29080. // When the module is disposed, remove the <style> tags
  29081. module.hot.dispose(function() { update(); });
  29082. }
  29083. /***/ },
  29084. /* 217 */
  29085. /***/ function(module, exports, __webpack_require__) {
  29086. exports = module.exports = __webpack_require__(186)();
  29087. // imports
  29088. // module
  29089. 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", ""]);
  29090. // exports
  29091. /***/ },
  29092. /* 218 */
  29093. /***/ function(module, exports, __webpack_require__) {
  29094. // style-loader: Adds some css to the DOM by adding a <style> tag
  29095. // load the styles
  29096. var content = __webpack_require__(219);
  29097. if(typeof content === 'string') content = [[module.id, content, '']];
  29098. // add the styles to the DOM
  29099. var update = __webpack_require__(187)(content, {});
  29100. if(content.locals) module.exports = content.locals;
  29101. // Hot Module Replacement
  29102. if(false) {
  29103. // When the styles change, update the <style> tags
  29104. if(!content.locals) {
  29105. module.hot.accept("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./../../../../node_modules/.2.2.3@less-loader/index.js!./content.less", function() {
  29106. var newContent = require("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./../../../../node_modules/.2.2.3@less-loader/index.js!./content.less");
  29107. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  29108. update(newContent);
  29109. });
  29110. }
  29111. // When the module is disposed, remove the <style> tags
  29112. module.hot.dispose(function() { update(); });
  29113. }
  29114. /***/ },
  29115. /* 219 */
  29116. /***/ function(module, exports, __webpack_require__) {
  29117. exports = module.exports = __webpack_require__(186)();
  29118. // imports
  29119. // module
  29120. 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#sh-content .errorMessage {\n display: none;\n position: absolute;\n z-index: 101;\n top: 0;\n left: 0;\n right: 0;\n padding: 4px 40px;\n text-align: center;\n background: rgba(153, 0, 0, 0.5);\n color: #fff;\n transition: 0.5s;\n}\n#sh-content .errorMessage.show {\n display: block;\n}\n.platform-win32 #sh-content .inform {\n right: 20px;\n}\n", ""]);
  29121. // exports
  29122. /***/ },
  29123. /* 220 */
  29124. /***/ function(module, exports, __webpack_require__) {
  29125. /**
  29126. * @author oldj
  29127. * @blog http://oldj.net
  29128. */
  29129. 'use strict';
  29130. Object.defineProperty(exports, "__esModule", {
  29131. value: true
  29132. });
  29133. 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; }; }();
  29134. var _react = __webpack_require__(3);
  29135. var _react2 = _interopRequireDefault(_react);
  29136. var _frame = __webpack_require__(221);
  29137. var _frame2 = _interopRequireDefault(_frame);
  29138. __webpack_require__(224);
  29139. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  29140. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29141. 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; }
  29142. 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; }
  29143. var SudoPrompt = function (_React$Component) {
  29144. _inherits(SudoPrompt, _React$Component);
  29145. function SudoPrompt(props) {
  29146. _classCallCheck(this, SudoPrompt);
  29147. var _this = _possibleConstructorReturn(this, (SudoPrompt.__proto__ || Object.getPrototypeOf(SudoPrompt)).call(this, props));
  29148. _this.onSuccess = null;
  29149. _this.state = {
  29150. show: false,
  29151. pswd: ''
  29152. };
  29153. return _this;
  29154. }
  29155. _createClass(SudoPrompt, [{
  29156. key: 'componentDidMount',
  29157. value: function componentDidMount() {
  29158. var _this2 = this;
  29159. SH_event.on('sudo_prompt', function (success) {
  29160. _this2.setState({ show: true });
  29161. _this2.onSuccess = success;
  29162. setTimeout(function () {
  29163. var el = _this2.refs.body;
  29164. el && el.querySelector('input').focus();
  29165. }, 100);
  29166. });
  29167. }
  29168. }, {
  29169. key: 'onOK',
  29170. value: function onOK() {
  29171. var pswd = this.refs.pswd.value;
  29172. if (!pswd) return;
  29173. this.setState({
  29174. show: false,
  29175. pswd: pswd
  29176. });
  29177. SH_event.emit('sudo_pswd', pswd);
  29178. if (typeof this.onSuccess === 'function') {
  29179. this.onSuccess(pswd);
  29180. }
  29181. this.onSuccess = null;
  29182. }
  29183. }, {
  29184. key: 'onCancel',
  29185. value: function onCancel() {
  29186. this.setState({
  29187. show: false
  29188. });
  29189. this.onSuccess = null;
  29190. }
  29191. }, {
  29192. key: 'body',
  29193. value: function body() {
  29194. var _this3 = this;
  29195. return _react2.default.createElement(
  29196. 'div',
  29197. { ref: 'body' },
  29198. _react2.default.createElement(
  29199. 'div',
  29200. { className: 'ln' },
  29201. _react2.default.createElement(
  29202. 'div',
  29203. { className: 'title' },
  29204. SH_Agent.lang.sudo_pswd
  29205. ),
  29206. _react2.default.createElement(
  29207. 'div',
  29208. { className: 'cnt' },
  29209. _react2.default.createElement('input', {
  29210. type: 'password',
  29211. ref: 'pswd',
  29212. onKeyDown: function onKeyDown(e) {
  29213. return e.keyCode === 13 && _this3.onOK() || e.keyCode === 27 && _this3.onCancel();
  29214. }
  29215. })
  29216. )
  29217. )
  29218. );
  29219. }
  29220. }, {
  29221. key: 'render',
  29222. value: function render() {
  29223. var _this4 = this;
  29224. return _react2.default.createElement(_frame2.default, {
  29225. show: this.state.show,
  29226. head: SH_Agent.lang.input_sudo_pswd,
  29227. body: this.body(),
  29228. onOK: function onOK() {
  29229. return _this4.onOK();
  29230. },
  29231. onCancel: function onCancel() {
  29232. return _this4.onCancel();
  29233. }
  29234. });
  29235. }
  29236. }]);
  29237. return SudoPrompt;
  29238. }(_react2.default.Component);
  29239. exports.default = SudoPrompt;
  29240. /***/ },
  29241. /* 221 */
  29242. /***/ function(module, exports, __webpack_require__) {
  29243. /**
  29244. * @author oldj
  29245. * @blog http://oldj.net
  29246. */
  29247. 'use strict';
  29248. Object.defineProperty(exports, "__esModule", {
  29249. value: true
  29250. });
  29251. 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; }; }();
  29252. var _react = __webpack_require__(3);
  29253. var _react2 = _interopRequireDefault(_react);
  29254. __webpack_require__(222);
  29255. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  29256. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29257. 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; }
  29258. 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; }
  29259. var Frame = function (_React$Component) {
  29260. _inherits(Frame, _React$Component);
  29261. function Frame(props) {
  29262. _classCallCheck(this, Frame);
  29263. return _possibleConstructorReturn(this, (Frame.__proto__ || Object.getPrototypeOf(Frame)).call(this, props));
  29264. }
  29265. _createClass(Frame, [{
  29266. key: 'componentDidMount',
  29267. value: function componentDidMount() {
  29268. var _this2 = this;
  29269. SH_event.on('esc', function () {
  29270. _this2.onCancel();
  29271. });
  29272. }
  29273. }, {
  29274. key: 'onOK',
  29275. value: function onOK() {
  29276. this.props.onOK();
  29277. }
  29278. }, {
  29279. key: 'onCancel',
  29280. value: function onCancel() {
  29281. this.props.onCancel();
  29282. }
  29283. }, {
  29284. key: 'renderFootButtons',
  29285. value: function renderFootButtons() {
  29286. var html = [];
  29287. html.push(_react2.default.createElement(
  29288. 'div',
  29289. {
  29290. className: 'button btn-cancel',
  29291. key: 'btn-cancel',
  29292. onClick: this.onCancel.bind(this)
  29293. },
  29294. this.props.cancel_title || SH_Agent.lang.cancel
  29295. ));
  29296. html.push(_react2.default.createElement(
  29297. 'div',
  29298. {
  29299. className: 'button btn-ok btn-default',
  29300. key: 'btn-ok',
  29301. onClick: this.onOK.bind(this)
  29302. },
  29303. this.props.ok_title || SH_Agent.lang.ok
  29304. ));
  29305. return html;
  29306. }
  29307. }, {
  29308. key: 'render',
  29309. value: function render() {
  29310. if (!this.props.show) {
  29311. return null;
  29312. }
  29313. return _react2.default.createElement(
  29314. 'div',
  29315. { className: 'frame', ref: 'frame' },
  29316. _react2.default.createElement('div', { className: 'overlay' }),
  29317. _react2.default.createElement(
  29318. 'div',
  29319. { className: 'prompt' },
  29320. _react2.default.createElement(
  29321. 'div',
  29322. { className: 'head' },
  29323. this.props.head
  29324. ),
  29325. _react2.default.createElement(
  29326. 'div',
  29327. { className: 'body' },
  29328. this.props.body
  29329. ),
  29330. _react2.default.createElement(
  29331. 'div',
  29332. { className: 'foot' },
  29333. this.renderFootButtons()
  29334. )
  29335. )
  29336. );
  29337. }
  29338. }]);
  29339. return Frame;
  29340. }(_react2.default.Component);
  29341. exports.default = Frame;
  29342. /***/ },
  29343. /* 222 */
  29344. /***/ function(module, exports, __webpack_require__) {
  29345. // style-loader: Adds some css to the DOM by adding a <style> tag
  29346. // load the styles
  29347. var content = __webpack_require__(223);
  29348. if(typeof content === 'string') content = [[module.id, content, '']];
  29349. // add the styles to the DOM
  29350. var update = __webpack_require__(187)(content, {});
  29351. if(content.locals) module.exports = content.locals;
  29352. // Hot Module Replacement
  29353. if(false) {
  29354. // When the styles change, update the <style> tags
  29355. if(!content.locals) {
  29356. module.hot.accept("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./../../../../node_modules/.2.2.3@less-loader/index.js!./frame.less", function() {
  29357. var newContent = require("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./../../../../node_modules/.2.2.3@less-loader/index.js!./frame.less");
  29358. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  29359. update(newContent);
  29360. });
  29361. }
  29362. // When the module is disposed, remove the <style> tags
  29363. module.hot.dispose(function() { update(); });
  29364. }
  29365. /***/ },
  29366. /* 223 */
  29367. /***/ function(module, exports, __webpack_require__) {
  29368. exports = module.exports = __webpack_require__(186)();
  29369. // imports
  29370. // module
  29371. 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 position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\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 {\n margin-left: 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 .ln .inform {\n color: #999;\n line-height: 18px;\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", ""]);
  29372. // exports
  29373. /***/ },
  29374. /* 224 */
  29375. /***/ function(module, exports, __webpack_require__) {
  29376. // style-loader: Adds some css to the DOM by adding a <style> tag
  29377. // load the styles
  29378. var content = __webpack_require__(225);
  29379. if(typeof content === 'string') content = [[module.id, content, '']];
  29380. // add the styles to the DOM
  29381. var update = __webpack_require__(187)(content, {});
  29382. if(content.locals) module.exports = content.locals;
  29383. // Hot Module Replacement
  29384. if(false) {
  29385. // When the styles change, update the <style> tags
  29386. if(!content.locals) {
  29387. module.hot.accept("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./../../../../node_modules/.2.2.3@less-loader/index.js!./sudo.less", function() {
  29388. var newContent = require("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./../../../../node_modules/.2.2.3@less-loader/index.js!./sudo.less");
  29389. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  29390. update(newContent);
  29391. });
  29392. }
  29393. // When the module is disposed, remove the <style> tags
  29394. module.hot.dispose(function() { update(); });
  29395. }
  29396. /***/ },
  29397. /* 225 */
  29398. /***/ function(module, exports, __webpack_require__) {
  29399. exports = module.exports = __webpack_require__(186)();
  29400. // imports
  29401. // module
  29402. 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 position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\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 {\n margin-left: 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 .ln .inform {\n color: #999;\n line-height: 18px;\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", ""]);
  29403. // exports
  29404. /***/ },
  29405. /* 226 */
  29406. /***/ function(module, exports, __webpack_require__) {
  29407. /**
  29408. * @author oldj
  29409. * @blog http://oldj.net
  29410. */
  29411. 'use strict';
  29412. Object.defineProperty(exports, "__esModule", {
  29413. value: true
  29414. });
  29415. 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"); } }; }();
  29416. 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; }; }();
  29417. var _react = __webpack_require__(3);
  29418. var _react2 = _interopRequireDefault(_react);
  29419. var _frame = __webpack_require__(221);
  29420. var _frame2 = _interopRequireDefault(_frame);
  29421. var _classnames = __webpack_require__(183);
  29422. var _classnames2 = _interopRequireDefault(_classnames);
  29423. __webpack_require__(227);
  29424. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  29425. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29426. 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; }
  29427. 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; }
  29428. var EditPrompt = function (_React$Component) {
  29429. _inherits(EditPrompt, _React$Component);
  29430. function EditPrompt(props) {
  29431. _classCallCheck(this, EditPrompt);
  29432. var _this = _possibleConstructorReturn(this, (EditPrompt.__proto__ || Object.getPrototypeOf(EditPrompt)).call(this, props));
  29433. _this.state = {
  29434. show: false,
  29435. add: true,
  29436. where: 'local',
  29437. title: '',
  29438. url: '',
  29439. last_refresh: null,
  29440. refresh_interval: 0,
  29441. is_loading: false
  29442. };
  29443. _this.current_host = null;
  29444. return _this;
  29445. }
  29446. _createClass(EditPrompt, [{
  29447. key: 'tryToFocus',
  29448. value: function tryToFocus() {
  29449. var el = this.refs.body && this.refs.body.querySelector('input[type=text]');
  29450. el && el.focus();
  29451. }
  29452. }, {
  29453. key: 'clear',
  29454. value: function clear() {
  29455. this.setState({
  29456. where: 'local',
  29457. title: '',
  29458. url: '',
  29459. last_refresh: null,
  29460. refresh_interval: 0
  29461. });
  29462. }
  29463. }, {
  29464. key: 'componentDidMount',
  29465. value: function componentDidMount() {
  29466. var _this2 = this;
  29467. SH_event.on('add_host', function () {
  29468. _this2.setState({
  29469. show: true,
  29470. add: true
  29471. });
  29472. setTimeout(function () {
  29473. _this2.tryToFocus();
  29474. }, 100);
  29475. });
  29476. SH_event.on('edit_host', function (host) {
  29477. _this2.current_host = host;
  29478. _this2.setState({
  29479. show: true,
  29480. add: false,
  29481. where: host.where || 'local',
  29482. title: host.title || '',
  29483. url: host.url || '',
  29484. last_refresh: host.last_refresh || null,
  29485. refresh_interval: host.refresh_interval || 0
  29486. });
  29487. setTimeout(function () {
  29488. _this2.tryToFocus();
  29489. }, 100);
  29490. });
  29491. SH_event.on('loading_done', function (old_host, data) {
  29492. if (old_host === _this2.current_host) {
  29493. _this2.setState({
  29494. last_refresh: data.last_refresh,
  29495. is_loading: false
  29496. });
  29497. SH_event.emit('host_refreshed', data, _this2.current_host);
  29498. }
  29499. });
  29500. }
  29501. }, {
  29502. key: 'onOK',
  29503. value: function onOK() {
  29504. this.setState({
  29505. title: (this.state.title || '').replace(/^\s+|\s+$/g, ''),
  29506. url: (this.state.url || '').replace(/^\s+|\s+$/g, '')
  29507. });
  29508. if (this.state.title === '') {
  29509. this.refs.title.focus();
  29510. return false;
  29511. }
  29512. if (this.state.where === 'remote' && this.state.url === '') {
  29513. this.refs.url.focus();
  29514. return false;
  29515. }
  29516. var data = Object.assign({}, this.current_host, this.state, this.state.add ? {
  29517. content: '# ' + this.state.title,
  29518. on: false
  29519. } : {});
  29520. delete data['add'];
  29521. SH_event.emit('host_' + (this.state.add ? 'add' : 'edit') + 'ed', data, this.current_host);
  29522. this.setState({
  29523. show: false
  29524. });
  29525. this.clear();
  29526. }
  29527. }, {
  29528. key: 'onCancel',
  29529. value: function onCancel() {
  29530. this.setState({
  29531. show: false
  29532. });
  29533. this.clear();
  29534. }
  29535. }, {
  29536. key: 'confirmDel',
  29537. value: function confirmDel() {
  29538. if (!confirm(SH_Agent.lang.confirm_del)) return;
  29539. SH_event.emit('del_host', this.current_host);
  29540. this.setState({
  29541. show: false
  29542. });
  29543. this.clear();
  29544. }
  29545. }, {
  29546. key: 'getEditOperations',
  29547. value: function getEditOperations() {
  29548. if (this.state.add) return null;
  29549. return _react2.default.createElement(
  29550. 'div',
  29551. null,
  29552. _react2.default.createElement(
  29553. 'div',
  29554. { className: 'ln' },
  29555. _react2.default.createElement(
  29556. 'a',
  29557. { href: '#', className: 'del',
  29558. onClick: this.confirmDel.bind(this)
  29559. },
  29560. _react2.default.createElement('i', { className: 'iconfont icon-delete' }),
  29561. _react2.default.createElement(
  29562. 'span',
  29563. null,
  29564. SH_Agent.lang.del_host
  29565. )
  29566. )
  29567. )
  29568. );
  29569. }
  29570. }, {
  29571. key: 'refresh',
  29572. value: function refresh() {
  29573. var _this3 = this;
  29574. if (this.state.is_loading) return;
  29575. SH_event.emit('check_host_refresh', this.current_host, true);
  29576. this.setState({
  29577. is_loading: true
  29578. }, function () {
  29579. setTimeout(function () {
  29580. _this3.setState({
  29581. is_loading: false
  29582. });
  29583. }, 1000);
  29584. });
  29585. }
  29586. }, {
  29587. key: 'renderRemoteInputs',
  29588. value: function renderRemoteInputs() {
  29589. var _this4 = this;
  29590. if (this.state.where !== 'remote') return null;
  29591. return _react2.default.createElement(
  29592. 'div',
  29593. { className: 'remote-ipts' },
  29594. _react2.default.createElement(
  29595. 'div',
  29596. { className: 'ln' },
  29597. _react2.default.createElement(
  29598. 'div',
  29599. { className: 'title' },
  29600. SH_Agent.lang.url
  29601. ),
  29602. _react2.default.createElement(
  29603. 'div',
  29604. { className: 'cnt' },
  29605. _react2.default.createElement('input', {
  29606. type: 'text',
  29607. ref: 'url',
  29608. value: this.state.url,
  29609. placeholder: 'http://',
  29610. onChange: function onChange(e) {
  29611. return _this4.setState({ url: e.target.value });
  29612. },
  29613. onKeyDown: function onKeyDown(e) {
  29614. return e.keyCode === 13 && _this4.onOK() || e.keyCode === 27 && _this4.onCancel();
  29615. }
  29616. })
  29617. )
  29618. ),
  29619. _react2.default.createElement(
  29620. 'div',
  29621. { className: 'ln' },
  29622. _react2.default.createElement(
  29623. 'div',
  29624. { className: 'title' },
  29625. SH_Agent.lang.auto_refresh
  29626. ),
  29627. _react2.default.createElement(
  29628. 'div',
  29629. { className: 'cnt' },
  29630. _react2.default.createElement(
  29631. 'select',
  29632. {
  29633. value: this.state.refresh_interval,
  29634. onChange: function onChange(e) {
  29635. return _this4.setState({ refresh_interval: parseFloat(e.target.value) || 0 });
  29636. }
  29637. },
  29638. EditPrompt.getRefreshOptions()
  29639. ),
  29640. _react2.default.createElement('i', {
  29641. className: (0, _classnames2.default)({
  29642. iconfont: 1,
  29643. 'icon-refresh': 1,
  29644. 'invisible': !this.current_host || this.state.url != this.current_host.url,
  29645. 'loading': this.state.is_loading
  29646. }),
  29647. title: SH_Agent.lang.refresh,
  29648. onClick: function onClick() {
  29649. return _this4.refresh();
  29650. }
  29651. }),
  29652. _react2.default.createElement(
  29653. 'span',
  29654. { className: 'last-refresh' },
  29655. SH_Agent.lang.last_refresh,
  29656. this.state.last_refresh || 'N/A'
  29657. )
  29658. )
  29659. )
  29660. );
  29661. }
  29662. }, {
  29663. key: 'body',
  29664. value: function body() {
  29665. var _this5 = this;
  29666. return _react2.default.createElement(
  29667. 'div',
  29668. { ref: 'body' },
  29669. _react2.default.createElement(
  29670. 'div',
  29671. { className: 'ln' },
  29672. _react2.default.createElement('input', { id: 'ipt-local', type: 'radio', name: 'where', value: 'local',
  29673. checked: this.state.where === 'local',
  29674. onChange: function onChange(e) {
  29675. return _this5.setState({ where: e.target.value });
  29676. }
  29677. }),
  29678. _react2.default.createElement(
  29679. 'label',
  29680. { htmlFor: 'ipt-local' },
  29681. SH_Agent.lang.where_local
  29682. ),
  29683. _react2.default.createElement('input', { id: 'ipt-remote', type: 'radio', name: 'where', value: 'remote',
  29684. checked: this.state.where === 'remote',
  29685. onChange: function onChange(e) {
  29686. return _this5.setState({ where: e.target.value });
  29687. }
  29688. }),
  29689. _react2.default.createElement(
  29690. 'label',
  29691. { htmlFor: 'ipt-remote' },
  29692. SH_Agent.lang.where_remote
  29693. )
  29694. ),
  29695. _react2.default.createElement(
  29696. 'div',
  29697. { className: 'ln' },
  29698. _react2.default.createElement(
  29699. 'div',
  29700. { className: 'title' },
  29701. SH_Agent.lang.host_title
  29702. ),
  29703. _react2.default.createElement(
  29704. 'div',
  29705. { className: 'cnt' },
  29706. _react2.default.createElement('input', {
  29707. type: 'text',
  29708. ref: 'title',
  29709. name: 'text',
  29710. value: this.state.title,
  29711. onChange: function onChange(e) {
  29712. return _this5.setState({ title: e.target.value });
  29713. },
  29714. onKeyDown: function onKeyDown(e) {
  29715. return e.keyCode === 13 && _this5.onOK() || e.keyCode === 27 && _this5.onCancel();
  29716. }
  29717. })
  29718. )
  29719. ),
  29720. this.renderRemoteInputs(),
  29721. this.getEditOperations()
  29722. );
  29723. }
  29724. }, {
  29725. key: 'render',
  29726. value: function render() {
  29727. var _this6 = this;
  29728. return _react2.default.createElement(_frame2.default, {
  29729. show: this.state.show,
  29730. head: SH_Agent.lang[this.state.add ? 'add_host' : 'edit_host'],
  29731. body: this.body(),
  29732. onOK: function onOK() {
  29733. return _this6.onOK();
  29734. },
  29735. onCancel: function onCancel() {
  29736. return _this6.onCancel();
  29737. }
  29738. });
  29739. }
  29740. }], [{
  29741. key: 'getRefreshOptions',
  29742. value: function getRefreshOptions() {
  29743. 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]];
  29744. if (IS_DEV) {
  29745. k.splice(1, 0, [0.002778, '10s (for DEV)']); // dev test only
  29746. }
  29747. return k.map(function (_ref, idx) {
  29748. var _ref2 = _slicedToArray(_ref, 2),
  29749. v = _ref2[0],
  29750. n = _ref2[1];
  29751. return _react2.default.createElement(
  29752. 'option',
  29753. { value: v, key: idx },
  29754. n
  29755. );
  29756. });
  29757. }
  29758. }]);
  29759. return EditPrompt;
  29760. }(_react2.default.Component);
  29761. exports.default = EditPrompt;
  29762. /***/ },
  29763. /* 227 */
  29764. /***/ function(module, exports, __webpack_require__) {
  29765. // style-loader: Adds some css to the DOM by adding a <style> tag
  29766. // load the styles
  29767. var content = __webpack_require__(228);
  29768. if(typeof content === 'string') content = [[module.id, content, '']];
  29769. // add the styles to the DOM
  29770. var update = __webpack_require__(187)(content, {});
  29771. if(content.locals) module.exports = content.locals;
  29772. // Hot Module Replacement
  29773. if(false) {
  29774. // When the styles change, update the <style> tags
  29775. if(!content.locals) {
  29776. module.hot.accept("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./../../../../node_modules/.2.2.3@less-loader/index.js!./edit.less", function() {
  29777. var newContent = require("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./../../../../node_modules/.2.2.3@less-loader/index.js!./edit.less");
  29778. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  29779. update(newContent);
  29780. });
  29781. }
  29782. // When the module is disposed, remove the <style> tags
  29783. module.hot.dispose(function() { update(); });
  29784. }
  29785. /***/ },
  29786. /* 228 */
  29787. /***/ function(module, exports, __webpack_require__) {
  29788. exports = module.exports = __webpack_require__(186)();
  29789. // imports
  29790. // module
  29791. exports.push([module.id, "@keyframes loading {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n.frame label {\n padding: 0 4em 0 0.5em;\n}\n.frame .spiner {\n transform-origin: right center;\n animation: spin 1s;\n animation-iteration-count: 1;\n -webkit-animation-iteration-count: 1;\n}\n.frame .ln i.icon-refresh {\n display: inline-block;\n color: #999;\n margin: 0 0.6em;\n cursor: pointer;\n}\n.frame .ln i.icon-refresh:hover {\n color: #333;\n}\n.frame .ln i.icon-refresh.loading {\n animation: loading 1s infinite linear;\n}\n.frame .ln i.icon-refresh.invisible {\n visibility: hidden;\n}\n.frame .last-refresh {\n color: #999;\n}\n.frame a.del {\n color: red;\n}\n.frame a.del span {\n padding-left: 0.5em;\n}\n", ""]);
  29792. // exports
  29793. /***/ },
  29794. /* 229 */
  29795. /***/ function(module, exports, __webpack_require__) {
  29796. /**
  29797. * @author oldj
  29798. * @blog http://oldj.net
  29799. */
  29800. 'use strict';
  29801. Object.defineProperty(exports, "__esModule", {
  29802. value: true
  29803. });
  29804. 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; }; }();
  29805. var _react = __webpack_require__(3);
  29806. var _react2 = _interopRequireDefault(_react);
  29807. var _frame = __webpack_require__(221);
  29808. var _frame2 = _interopRequireDefault(_frame);
  29809. __webpack_require__(230);
  29810. var _lang = __webpack_require__(232);
  29811. var _lang2 = _interopRequireDefault(_lang);
  29812. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  29813. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29814. 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; }
  29815. 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; }
  29816. // import classnames from 'classnames';
  29817. var AUTO_LAUNCH = 'auto_launch';
  29818. var PreferencesPrompt = function (_React$Component) {
  29819. _inherits(PreferencesPrompt, _React$Component);
  29820. function PreferencesPrompt(props) {
  29821. _classCallCheck(this, PreferencesPrompt);
  29822. var _this = _possibleConstructorReturn(this, (PreferencesPrompt.__proto__ || Object.getPrototypeOf(PreferencesPrompt)).call(this, props));
  29823. var choice_mode = SH_Agent.pref.get('choice_mode');
  29824. if (!choice_mode || choice_mode != 'multiple' && choice_mode != 'single') {
  29825. choice_mode = 'multiple';
  29826. }
  29827. console.log(AUTO_LAUNCH, SH_Agent.pref.get(AUTO_LAUNCH));
  29828. _this.state = {
  29829. show: false,
  29830. lang_key: SH_Agent.lang_key,
  29831. after_cmd: SH_Agent.pref.get('after_cmd') || '',
  29832. choice_mode: choice_mode,
  29833. auto_launch: !!SH_Agent.pref.get(AUTO_LAUNCH)
  29834. };
  29835. return _this;
  29836. }
  29837. _createClass(PreferencesPrompt, [{
  29838. key: 'componentDidMount',
  29839. value: function componentDidMount() {
  29840. var _this2 = this;
  29841. SH_event.on('show_preferences', function () {
  29842. _this2.setState({
  29843. show: true
  29844. });
  29845. });
  29846. ipcRenderer.on('show_preferences', function () {
  29847. _this2.setState({
  29848. show: true
  29849. });
  29850. });
  29851. }
  29852. }, {
  29853. key: 'onOK',
  29854. value: function onOK() {
  29855. this.setState({
  29856. show: false
  29857. }, function () {
  29858. setTimeout(function () {
  29859. SH_Agent.relaunch();
  29860. }, 200);
  29861. });
  29862. }
  29863. }, {
  29864. key: 'onCancel',
  29865. value: function onCancel() {
  29866. this.setState({
  29867. show: false
  29868. });
  29869. }
  29870. }, {
  29871. key: 'updateLangKey',
  29872. value: function updateLangKey(v) {
  29873. SH_Agent.lang_key = v;
  29874. SH_Agent.pref.set('user_language', v);
  29875. this.setState({
  29876. lange_key: v
  29877. });
  29878. }
  29879. }, {
  29880. key: 'updateChoiceMode',
  29881. value: function updateChoiceMode(v) {
  29882. SH_Agent.pref.set('choice_mode', v);
  29883. this.setState({
  29884. choice_mode: v
  29885. });
  29886. }
  29887. }, {
  29888. key: 'updateAfterCmd',
  29889. value: function updateAfterCmd(v) {
  29890. SH_Agent.pref.set('after_cmd', v);
  29891. this.setState({
  29892. after_cmd: v
  29893. });
  29894. }
  29895. }, {
  29896. key: 'updateAutoLaunch',
  29897. value: function updateAutoLaunch(v) {
  29898. SH_Agent.pref.set(AUTO_LAUNCH, v);
  29899. this.setState({
  29900. auto_launch: v
  29901. });
  29902. // todo set auto launch
  29903. }
  29904. }, {
  29905. key: 'prefLanguage',
  29906. value: function prefLanguage() {
  29907. var _this3 = this;
  29908. return _react2.default.createElement(
  29909. 'div',
  29910. { className: 'ln' },
  29911. _react2.default.createElement(
  29912. 'div',
  29913. { className: 'title' },
  29914. SH_Agent.lang.language
  29915. ),
  29916. _react2.default.createElement(
  29917. 'div',
  29918. { className: 'cnt' },
  29919. _react2.default.createElement(
  29920. 'select',
  29921. {
  29922. value: SH_Agent.lang_key,
  29923. onChange: function onChange(e) {
  29924. return _this3.updateLangKey(e.target.value);
  29925. }
  29926. },
  29927. PreferencesPrompt.getLanguageOptions()
  29928. ),
  29929. _react2.default.createElement(
  29930. 'div',
  29931. { className: 'inform' },
  29932. SH_Agent.lang.should_restart_after_change_language
  29933. )
  29934. )
  29935. );
  29936. }
  29937. }, {
  29938. key: 'prefChoiceMode',
  29939. value: function prefChoiceMode() {
  29940. var _this4 = this;
  29941. return _react2.default.createElement(
  29942. 'div',
  29943. { className: 'ln' },
  29944. _react2.default.createElement(
  29945. 'div',
  29946. { className: 'title' },
  29947. SH_Agent.lang.pref_choice_mode
  29948. ),
  29949. _react2.default.createElement(
  29950. 'div',
  29951. { className: 'cnt' },
  29952. _react2.default.createElement('input', { type: 'radio', id: 'pref-choice-mode-single', name: 'choice_mode', value: 'single',
  29953. defaultChecked: this.state.choice_mode === 'single',
  29954. onChange: function onChange(e) {
  29955. return _this4.updateChoiceMode(e.target.value);
  29956. }
  29957. }),
  29958. _react2.default.createElement(
  29959. 'label',
  29960. { htmlFor: 'pref-choice-mode-single' },
  29961. SH_Agent.lang.pref_choice_mode_single
  29962. ),
  29963. _react2.default.createElement('input', { type: 'radio', id: 'pref-choice-mode-multiple', name: 'choice_mode', value: 'multiple',
  29964. defaultChecked: this.state.choice_mode === 'multiple',
  29965. onChange: function onChange(e) {
  29966. return _this4.updateChoiceMode(e.target.value);
  29967. }
  29968. }),
  29969. _react2.default.createElement(
  29970. 'label',
  29971. { htmlFor: 'pref-choice-mode-multiple' },
  29972. SH_Agent.lang.pref_choice_mode_multiple
  29973. )
  29974. )
  29975. );
  29976. }
  29977. }, {
  29978. key: 'prefAfterCmd',
  29979. value: function prefAfterCmd() {
  29980. var _this5 = this;
  29981. return _react2.default.createElement(
  29982. 'div',
  29983. { className: 'ln' },
  29984. _react2.default.createElement(
  29985. 'div',
  29986. { className: 'title' },
  29987. SH_Agent.lang.pref_after_cmd
  29988. ),
  29989. _react2.default.createElement(
  29990. 'div',
  29991. { className: 'cnt' },
  29992. _react2.default.createElement(
  29993. 'div',
  29994. { className: 'inform' },
  29995. SH_Agent.lang.pref_after_cmd_info
  29996. ),
  29997. _react2.default.createElement('textarea', {
  29998. name: '',
  29999. defaultValue: this.state.after_cmd,
  30000. placeholder: SH_Agent.lang.pref_after_cmd_placeholder,
  30001. onChange: function onChange(e) {
  30002. return _this5.updateAfterCmd(e.target.value);
  30003. }
  30004. })
  30005. )
  30006. );
  30007. }
  30008. }, {
  30009. key: 'prefAutoLaunch',
  30010. value: function prefAutoLaunch() {
  30011. var _this6 = this;
  30012. return _react2.default.createElement(
  30013. 'div',
  30014. { className: 'ln' },
  30015. _react2.default.createElement(
  30016. 'div',
  30017. { className: 'title' },
  30018. SH_Agent.lang.auto_launch
  30019. ),
  30020. _react2.default.createElement(
  30021. 'div',
  30022. { className: 'cnt' },
  30023. _react2.default.createElement('input', { type: 'checkbox', name: '',
  30024. defaultChecked: this.state.auto_launch,
  30025. onChange: function onChange(e) {
  30026. return _this6.updateAutoLaunch(e.target.checked);
  30027. }
  30028. })
  30029. )
  30030. );
  30031. }
  30032. }, {
  30033. key: 'body',
  30034. value: function body() {
  30035. return _react2.default.createElement(
  30036. 'div',
  30037. { ref: 'body' },
  30038. this.prefLanguage(),
  30039. this.prefChoiceMode(),
  30040. this.prefAfterCmd()
  30041. );
  30042. }
  30043. }, {
  30044. key: 'render',
  30045. value: function render() {
  30046. var _this7 = this;
  30047. return _react2.default.createElement(_frame2.default, {
  30048. show: this.state.show,
  30049. head: SH_Agent.lang.preferences,
  30050. body: this.body(),
  30051. onOK: function onOK() {
  30052. return _this7.onOK();
  30053. },
  30054. onCancel: function onCancel() {
  30055. return _this7.onCancel();
  30056. },
  30057. cancel_title: SH_Agent.lang.set_and_back,
  30058. ok_title: SH_Agent.lang.set_and_relaunch_app
  30059. });
  30060. }
  30061. }], [{
  30062. key: 'getLanguageOptions',
  30063. value: function getLanguageOptions() {
  30064. return _lang2.default.lang_list.map(function (_ref, idx) {
  30065. var key = _ref.key,
  30066. name = _ref.name;
  30067. return _react2.default.createElement(
  30068. 'option',
  30069. { value: key, key: idx },
  30070. name
  30071. );
  30072. });
  30073. }
  30074. }]);
  30075. return PreferencesPrompt;
  30076. }(_react2.default.Component);
  30077. exports.default = PreferencesPrompt;
  30078. /***/ },
  30079. /* 230 */
  30080. /***/ function(module, exports, __webpack_require__) {
  30081. // style-loader: Adds some css to the DOM by adding a <style> tag
  30082. // load the styles
  30083. var content = __webpack_require__(231);
  30084. if(typeof content === 'string') content = [[module.id, content, '']];
  30085. // add the styles to the DOM
  30086. var update = __webpack_require__(187)(content, {});
  30087. if(content.locals) module.exports = content.locals;
  30088. // Hot Module Replacement
  30089. if(false) {
  30090. // When the styles change, update the <style> tags
  30091. if(!content.locals) {
  30092. module.hot.accept("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./../../../../node_modules/.2.2.3@less-loader/index.js!./preferences.less", function() {
  30093. var newContent = require("!!./../../../../node_modules/.0.26.1@css-loader/index.js!./../../../../node_modules/.2.2.3@less-loader/index.js!./preferences.less");
  30094. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  30095. update(newContent);
  30096. });
  30097. }
  30098. // When the module is disposed, remove the <style> tags
  30099. module.hot.dispose(function() { update(); });
  30100. }
  30101. /***/ },
  30102. /* 231 */
  30103. /***/ function(module, exports, __webpack_require__) {
  30104. exports = module.exports = __webpack_require__(186)();
  30105. // imports
  30106. // module
  30107. exports.push([module.id, ".frame textarea {\n width: 300px;\n height: 80px;\n padding: 2px 4px;\n outline: none;\n border: solid 1px #ccc;\n}\n", ""]);
  30108. // exports
  30109. /***/ },
  30110. /* 232 */
  30111. /***/ function(module, exports, __webpack_require__) {
  30112. /**
  30113. * @author oldj
  30114. * @blog http://oldj.net
  30115. */
  30116. "use strict";
  30117. var languages = {
  30118. 'en': __webpack_require__(233).content,
  30119. 'cn': __webpack_require__(234).content
  30120. };
  30121. module.exports = {
  30122. languages: languages,
  30123. lang_list: function () {
  30124. var list = [];
  30125. for (var k in languages) {
  30126. if (languages.hasOwnProperty(k)) {
  30127. list.push({
  30128. key: k,
  30129. name: languages[k]._lang_name
  30130. });
  30131. }
  30132. }
  30133. return list;
  30134. }(),
  30135. getLang: function getLang(lang) {
  30136. lang = lang.toLowerCase();
  30137. if (lang == 'cn' || lang == 'zh-cn') {
  30138. lang = 'cn';
  30139. } else {
  30140. lang = 'en';
  30141. }
  30142. return languages[lang] || languages['en'];
  30143. }
  30144. };
  30145. /***/ },
  30146. /* 233 */
  30147. /***/ function(module, exports) {
  30148. /**
  30149. * @author oldj
  30150. * @blog http://oldj.net
  30151. */
  30152. 'use strict';
  30153. exports.content = {
  30154. _lang_name: 'English',
  30155. add: 'Add',
  30156. auto_launch: 'Run at login',
  30157. comment: 'Comment',
  30158. new: 'New',
  30159. quit: 'Quit',
  30160. cancel: 'Cancel',
  30161. ok: 'OK',
  30162. set_and_back: 'Set and back',
  30163. set_and_relaunch_app: 'Set and Relaunch App',
  30164. add_host: 'Add new rules',
  30165. edit_host: 'Edit host',
  30166. import: 'Import',
  30167. export: 'Export',
  30168. host_title: 'Host title',
  30169. host_title_cant_be_empty: 'Host title could not be empty!',
  30170. sys_host_title: 'System Hosts',
  30171. input_sudo_pswd: 'Input your sudo password',
  30172. sudo_pswd: 'Password',
  30173. del_host: 'Delete current host',
  30174. confirm_del: 'Are you sure you want to delete this host?',
  30175. tmp_clean: 'Temporarily turn off all rules.',
  30176. tmp_recover: 'Recover rules.',
  30177. new_version_available: 'New version available, download now?',
  30178. is_updated_title: 'You are up to date!',
  30179. is_updated: 'You already have the latest version of SwitchHosts! installed.',
  30180. readonly: 'Read only',
  30181. where_local: 'local',
  30182. where_remote: 'remote',
  30183. remote_hosts: 'Remote hosts',
  30184. url: 'URL',
  30185. bad_url: 'URL is not valid.',
  30186. auto_refresh: 'Auto refresh',
  30187. last_refresh: 'Last refresh: ',
  30188. refresh: 'Refresh',
  30189. never: 'never',
  30190. hour: 'hour',
  30191. hours: 'hours',
  30192. day: 'day',
  30193. days: 'days',
  30194. feedback: 'Feedback',
  30195. homepage: 'Homepage',
  30196. hide_dock_icon: 'Hide Dock Icon',
  30197. show_dock_icon: 'Show Dock Icon',
  30198. toggle_dock_icon: 'Toggle Dock Icon',
  30199. no_valid_host_found: 'There is no valid host in the file.',
  30200. confirm_import: 'You sure you want to import it? The original rules will be overwriten, this operation can not be undone.',
  30201. please_run_as_admin: 'Please run SwitchHosts! as an Administrator.',
  30202. preferences: 'Preferences',
  30203. language: 'Language',
  30204. should_restart_after_change_language: 'Should relaunch this App after changing language.',
  30205. untitled: 'untitled',
  30206. file: 'File',
  30207. edit: 'Edit',
  30208. view: 'View',
  30209. window: 'Window',
  30210. help: 'Help',
  30211. pref_after_cmd: 'Command after Host applied',
  30212. pref_after_cmd_info: 'The following system commands will be executed when Host applied:',
  30213. pref_after_cmd_placeholder: 'input your commands here',
  30214. pref_choice_mode: 'Choide mode',
  30215. pref_choice_mode_single: 'Single choice',
  30216. pref_choice_mode_multiple: 'Multiple choice',
  30217. search: 'Search'
  30218. };
  30219. /***/ },
  30220. /* 234 */
  30221. /***/ function(module, exports) {
  30222. /**
  30223. * @author oldj
  30224. * @blog http://oldj.net
  30225. */
  30226. 'use strict';
  30227. exports.content = {
  30228. _lang_name: '简体中文',
  30229. add: '添加',
  30230. auto_launch: '随系统一起启动',
  30231. comment: '注释',
  30232. new: '新建',
  30233. quit: '退出',
  30234. cancel: '取消',
  30235. ok: '确定',
  30236. set_and_back: '设置并返回',
  30237. set_and_relaunch_app: '确定并重启程序',
  30238. add_host: '添加 host 规则',
  30239. edit_host: '修改 host',
  30240. import: '导入',
  30241. export: '导出',
  30242. host_title: 'host 方案名',
  30243. host_title_cant_be_empty: 'Host 方案名不能为空!',
  30244. sys_host_title: '系统 Hosts',
  30245. input_sudo_pswd: '请输入您的开机密码(sudo 密码)',
  30246. sudo_pswd: '密码',
  30247. del_host: '删除当前 host',
  30248. confirm_del: '确定要删除此 host 吗?',
  30249. tmp_clean: '临时去掉所有绑定',
  30250. tmp_recover: '恢复绑定',
  30251. new_version_available: '检测到新版本,立刻下载?',
  30252. is_updated_title: '已是最新',
  30253. is_updated: '当前版本是最新版本。',
  30254. readonly: '只读',
  30255. where_local: '本地',
  30256. where_remote: '远程',
  30257. remote_hosts: '远程方案',
  30258. url: 'URL 地址',
  30259. bad_url: 'URL 地址有误。',
  30260. auto_refresh: '自动更新',
  30261. last_refresh: '上次更新:',
  30262. refresh: '刷新',
  30263. never: '从不',
  30264. hour: '小时',
  30265. hours: '小时',
  30266. day: '天',
  30267. days: '天',
  30268. feedback: '反馈',
  30269. homepage: '主页',
  30270. hide_dock_icon: '隐藏 Dock 图标',
  30271. show_dock_icon: '显示 Dock 图标',
  30272. toggle_dock_icon: '显示/隐藏 Dock 图标',
  30273. no_valid_host_found: '所指定的文件中未找到合法的 host 配置',
  30274. confirm_import: '确定要导入吗?原方案列表将被覆盖,此操作不可撤销。',
  30275. please_run_as_admin: '请以管理员身份运行 SwitchHosts!',
  30276. preferences: '设置',
  30277. language: '语言',
  30278. should_restart_after_change_language: '修改语言后需要重启应用方可生效。',
  30279. untitled: '未命名',
  30280. file: '文件',
  30281. edit: '编辑',
  30282. view: '视图',
  30283. window: '窗口',
  30284. help: '帮助',
  30285. pref_after_cmd: 'Host 应用后命令',
  30286. pref_after_cmd_info: '每次 Host 应用后将执行下面的系统命令:',
  30287. pref_after_cmd_placeholder: '在这儿输入你的命令',
  30288. pref_choice_mode: '选择模式',
  30289. pref_choice_mode_single: '单选',
  30290. pref_choice_mode_multiple: '多选',
  30291. search: '搜索'
  30292. };
  30293. /***/ },
  30294. /* 235 */
  30295. /***/ function(module, exports, __webpack_require__) {
  30296. // style-loader: Adds some css to the DOM by adding a <style> tag
  30297. // load the styles
  30298. var content = __webpack_require__(236);
  30299. if(typeof content === 'string') content = [[module.id, content, '']];
  30300. // add the styles to the DOM
  30301. var update = __webpack_require__(187)(content, {});
  30302. if(content.locals) module.exports = content.locals;
  30303. // Hot Module Replacement
  30304. if(false) {
  30305. // When the styles change, update the <style> tags
  30306. if(!content.locals) {
  30307. module.hot.accept("!!./../../../node_modules/.0.26.1@css-loader/index.js!./../../../node_modules/.2.2.3@less-loader/index.js!./app.less", function() {
  30308. var newContent = require("!!./../../../node_modules/.0.26.1@css-loader/index.js!./../../../node_modules/.2.2.3@less-loader/index.js!./app.less");
  30309. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  30310. update(newContent);
  30311. });
  30312. }
  30313. // When the module is disposed, remove the <style> tags
  30314. module.hot.dispose(function() { update(); });
  30315. }
  30316. /***/ },
  30317. /* 236 */
  30318. /***/ function(module, exports, __webpack_require__) {
  30319. exports = module.exports = __webpack_require__(186)();
  30320. // imports
  30321. // module
  30322. 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", ""]);
  30323. // exports
  30324. /***/ }
  30325. /******/ ]);
  30326. //# sourceMappingURL=bundle.js.map