basic.js 335 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  3. typeof define === 'function' && define.amd ? define(factory) :
  4. (global = global || self, global.renderVueComponentToString = factory());
  5. }(this, function () { 'use strict';
  6. /* */
  7. var emptyObject = Object.freeze({});
  8. // These helpers produce better VM code in JS engines due to their
  9. // explicitness and function inlining.
  10. function isUndef (v) {
  11. return v === undefined || v === null
  12. }
  13. function isDef (v) {
  14. return v !== undefined && v !== null
  15. }
  16. function isTrue (v) {
  17. return v === true
  18. }
  19. function isFalse (v) {
  20. return v === false
  21. }
  22. /**
  23. * Check if value is primitive.
  24. */
  25. function isPrimitive (value) {
  26. return (
  27. typeof value === 'string' ||
  28. typeof value === 'number' ||
  29. // $flow-disable-line
  30. typeof value === 'symbol' ||
  31. typeof value === 'boolean'
  32. )
  33. }
  34. /**
  35. * Quick object check - this is primarily used to tell
  36. * Objects from primitive values when we know the value
  37. * is a JSON-compliant type.
  38. */
  39. function isObject (obj) {
  40. return obj !== null && typeof obj === 'object'
  41. }
  42. /**
  43. * Get the raw type string of a value, e.g., [object Object].
  44. */
  45. var _toString = Object.prototype.toString;
  46. function toRawType (value) {
  47. return _toString.call(value).slice(8, -1)
  48. }
  49. /**
  50. * Strict object type check. Only returns true
  51. * for plain JavaScript objects.
  52. */
  53. function isPlainObject (obj) {
  54. return _toString.call(obj) === '[object Object]'
  55. }
  56. /**
  57. * Check if val is a valid array index.
  58. */
  59. function isValidArrayIndex (val) {
  60. var n = parseFloat(String(val));
  61. return n >= 0 && Math.floor(n) === n && isFinite(val)
  62. }
  63. function isPromise (val) {
  64. return (
  65. isDef(val) &&
  66. typeof val.then === 'function' &&
  67. typeof val.catch === 'function'
  68. )
  69. }
  70. /**
  71. * Convert a value to a string that is actually rendered.
  72. */
  73. function toString (val) {
  74. return val == null
  75. ? ''
  76. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  77. ? JSON.stringify(val, null, 2)
  78. : String(val)
  79. }
  80. /**
  81. * Convert an input value to a number for persistence.
  82. * If the conversion fails, return original string.
  83. */
  84. function toNumber (val) {
  85. var n = parseFloat(val);
  86. return isNaN(n) ? val : n
  87. }
  88. /**
  89. * Make a map and return a function for checking if a key
  90. * is in that map.
  91. */
  92. function makeMap (
  93. str,
  94. expectsLowerCase
  95. ) {
  96. var map = Object.create(null);
  97. var list = str.split(',');
  98. for (var i = 0; i < list.length; i++) {
  99. map[list[i]] = true;
  100. }
  101. return expectsLowerCase
  102. ? function (val) { return map[val.toLowerCase()]; }
  103. : function (val) { return map[val]; }
  104. }
  105. /**
  106. * Check if a tag is a built-in tag.
  107. */
  108. var isBuiltInTag = makeMap('slot,component', true);
  109. /**
  110. * Check if an attribute is a reserved attribute.
  111. */
  112. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  113. /**
  114. * Remove an item from an array.
  115. */
  116. function remove (arr, item) {
  117. if (arr.length) {
  118. var index = arr.indexOf(item);
  119. if (index > -1) {
  120. return arr.splice(index, 1)
  121. }
  122. }
  123. }
  124. /**
  125. * Check whether an object has the property.
  126. */
  127. var hasOwnProperty = Object.prototype.hasOwnProperty;
  128. function hasOwn (obj, key) {
  129. return hasOwnProperty.call(obj, key)
  130. }
  131. /**
  132. * Create a cached version of a pure function.
  133. */
  134. function cached (fn) {
  135. var cache = Object.create(null);
  136. return (function cachedFn (str) {
  137. var hit = cache[str];
  138. return hit || (cache[str] = fn(str))
  139. })
  140. }
  141. /**
  142. * Camelize a hyphen-delimited string.
  143. */
  144. var camelizeRE = /-(\w)/g;
  145. var camelize = cached(function (str) {
  146. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  147. });
  148. /**
  149. * Capitalize a string.
  150. */
  151. var capitalize = cached(function (str) {
  152. return str.charAt(0).toUpperCase() + str.slice(1)
  153. });
  154. /**
  155. * Hyphenate a camelCase string.
  156. */
  157. var hyphenateRE = /\B([A-Z])/g;
  158. var hyphenate = cached(function (str) {
  159. return str.replace(hyphenateRE, '-$1').toLowerCase()
  160. });
  161. /**
  162. * Simple bind polyfill for environments that do not support it,
  163. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  164. * since native bind is now performant enough in most browsers.
  165. * But removing it would mean breaking code that was able to run in
  166. * PhantomJS 1.x, so this must be kept for backward compatibility.
  167. */
  168. /* istanbul ignore next */
  169. function polyfillBind (fn, ctx) {
  170. function boundFn (a) {
  171. var l = arguments.length;
  172. return l
  173. ? l > 1
  174. ? fn.apply(ctx, arguments)
  175. : fn.call(ctx, a)
  176. : fn.call(ctx)
  177. }
  178. boundFn._length = fn.length;
  179. return boundFn
  180. }
  181. function nativeBind (fn, ctx) {
  182. return fn.bind(ctx)
  183. }
  184. var bind = Function.prototype.bind
  185. ? nativeBind
  186. : polyfillBind;
  187. /**
  188. * Mix properties into target object.
  189. */
  190. function extend (to, _from) {
  191. for (var key in _from) {
  192. to[key] = _from[key];
  193. }
  194. return to
  195. }
  196. /**
  197. * Merge an Array of Objects into a single Object.
  198. */
  199. function toObject (arr) {
  200. var res = {};
  201. for (var i = 0; i < arr.length; i++) {
  202. if (arr[i]) {
  203. extend(res, arr[i]);
  204. }
  205. }
  206. return res
  207. }
  208. /* eslint-disable no-unused-vars */
  209. /**
  210. * Perform no operation.
  211. * Stubbing args to make Flow happy without leaving useless transpiled code
  212. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  213. */
  214. function noop (a, b, c) {}
  215. /**
  216. * Always return false.
  217. */
  218. var no = function (a, b, c) { return false; };
  219. /* eslint-enable no-unused-vars */
  220. /**
  221. * Return the same value.
  222. */
  223. var identity = function (_) { return _; };
  224. /**
  225. * Generate a string containing static keys from compiler modules.
  226. */
  227. function genStaticKeys (modules) {
  228. return modules.reduce(function (keys, m) {
  229. return keys.concat(m.staticKeys || [])
  230. }, []).join(',')
  231. }
  232. /**
  233. * Check if two values are loosely equal - that is,
  234. * if they are plain objects, do they have the same shape?
  235. */
  236. function looseEqual (a, b) {
  237. if (a === b) { return true }
  238. var isObjectA = isObject(a);
  239. var isObjectB = isObject(b);
  240. if (isObjectA && isObjectB) {
  241. try {
  242. var isArrayA = Array.isArray(a);
  243. var isArrayB = Array.isArray(b);
  244. if (isArrayA && isArrayB) {
  245. return a.length === b.length && a.every(function (e, i) {
  246. return looseEqual(e, b[i])
  247. })
  248. } else if (a instanceof Date && b instanceof Date) {
  249. return a.getTime() === b.getTime()
  250. } else if (!isArrayA && !isArrayB) {
  251. var keysA = Object.keys(a);
  252. var keysB = Object.keys(b);
  253. return keysA.length === keysB.length && keysA.every(function (key) {
  254. return looseEqual(a[key], b[key])
  255. })
  256. } else {
  257. /* istanbul ignore next */
  258. return false
  259. }
  260. } catch (e) {
  261. /* istanbul ignore next */
  262. return false
  263. }
  264. } else if (!isObjectA && !isObjectB) {
  265. return String(a) === String(b)
  266. } else {
  267. return false
  268. }
  269. }
  270. /**
  271. * Return the first index at which a loosely equal value can be
  272. * found in the array (if value is a plain object, the array must
  273. * contain an object of the same shape), or -1 if it is not present.
  274. */
  275. function looseIndexOf (arr, val) {
  276. for (var i = 0; i < arr.length; i++) {
  277. if (looseEqual(arr[i], val)) { return i }
  278. }
  279. return -1
  280. }
  281. /**
  282. * Ensure a function is called only once.
  283. */
  284. function once (fn) {
  285. var called = false;
  286. return function () {
  287. if (!called) {
  288. called = true;
  289. fn.apply(this, arguments);
  290. }
  291. }
  292. }
  293. /* */
  294. var isAttr = makeMap(
  295. 'accept,accept-charset,accesskey,action,align,alt,async,autocomplete,' +
  296. 'autofocus,autoplay,autosave,bgcolor,border,buffered,challenge,charset,' +
  297. 'checked,cite,class,code,codebase,color,cols,colspan,content,' +
  298. 'contenteditable,contextmenu,controls,coords,data,datetime,default,' +
  299. 'defer,dir,dirname,disabled,download,draggable,dropzone,enctype,for,' +
  300. 'form,formaction,headers,height,hidden,high,href,hreflang,http-equiv,' +
  301. 'icon,id,ismap,itemprop,keytype,kind,label,lang,language,list,loop,low,' +
  302. 'manifest,max,maxlength,media,method,GET,POST,min,multiple,email,file,' +
  303. 'muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,' +
  304. 'preload,radiogroup,readonly,rel,required,reversed,rows,rowspan,sandbox,' +
  305. 'scope,scoped,seamless,selected,shape,size,type,text,password,sizes,span,' +
  306. 'spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,' +
  307. 'target,title,usemap,value,width,wrap'
  308. );
  309. var unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/; // eslint-disable-line no-control-regex
  310. var isSSRUnsafeAttr = function (name) {
  311. return unsafeAttrCharRE.test(name)
  312. };
  313. /* istanbul ignore next */
  314. var isRenderableAttr = function (name) {
  315. return (
  316. isAttr(name) ||
  317. name.indexOf('data-') === 0 ||
  318. name.indexOf('aria-') === 0
  319. )
  320. };
  321. var propsToAttrMap = {
  322. acceptCharset: 'accept-charset',
  323. className: 'class',
  324. htmlFor: 'for',
  325. httpEquiv: 'http-equiv'
  326. };
  327. var ESC = {
  328. '<': '&lt;',
  329. '>': '&gt;',
  330. '"': '&quot;',
  331. '&': '&amp;'
  332. };
  333. function escape (s) {
  334. return s.replace(/[<>"&]/g, escapeChar)
  335. }
  336. function escapeChar (a) {
  337. return ESC[a] || a
  338. }
  339. var noUnitNumericStyleProps = {
  340. "animation-iteration-count": true,
  341. "border-image-outset": true,
  342. "border-image-slice": true,
  343. "border-image-width": true,
  344. "box-flex": true,
  345. "box-flex-group": true,
  346. "box-ordinal-group": true,
  347. "column-count": true,
  348. "columns": true,
  349. "flex": true,
  350. "flex-grow": true,
  351. "flex-positive": true,
  352. "flex-shrink": true,
  353. "flex-negative": true,
  354. "flex-order": true,
  355. "grid-row": true,
  356. "grid-row-end": true,
  357. "grid-row-span": true,
  358. "grid-row-start": true,
  359. "grid-column": true,
  360. "grid-column-end": true,
  361. "grid-column-span": true,
  362. "grid-column-start": true,
  363. "font-weight": true,
  364. "line-clamp": true,
  365. "line-height": true,
  366. "opacity": true,
  367. "order": true,
  368. "orphans": true,
  369. "tab-size": true,
  370. "widows": true,
  371. "z-index": true,
  372. "zoom": true,
  373. // SVG
  374. "fill-opacity": true,
  375. "flood-opacity": true,
  376. "stop-opacity": true,
  377. "stroke-dasharray": true,
  378. "stroke-dashoffset": true,
  379. "stroke-miterlimit": true,
  380. "stroke-opacity": true,
  381. "stroke-width": true
  382. };
  383. /* */
  384. // these are reserved for web because they are directly compiled away
  385. // during template compilation
  386. var isReservedAttr = makeMap('style,class');
  387. // attributes that should be using props for binding
  388. var acceptValue = makeMap('input,textarea,option,select,progress');
  389. var mustUseProp = function (tag, type, attr) {
  390. return (
  391. (attr === 'value' && acceptValue(tag)) && type !== 'button' ||
  392. (attr === 'selected' && tag === 'option') ||
  393. (attr === 'checked' && tag === 'input') ||
  394. (attr === 'muted' && tag === 'video')
  395. )
  396. };
  397. var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
  398. var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');
  399. var convertEnumeratedValue = function (key, value) {
  400. return isFalsyAttrValue(value) || value === 'false'
  401. ? 'false'
  402. // allow arbitrary string value for contenteditable
  403. : key === 'contenteditable' && isValidContentEditableValue(value)
  404. ? value
  405. : 'true'
  406. };
  407. var isBooleanAttr = makeMap(
  408. 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
  409. 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
  410. 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
  411. 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
  412. 'required,reversed,scoped,seamless,selected,sortable,' +
  413. 'truespeed,typemustmatch,visible'
  414. );
  415. var isFalsyAttrValue = function (val) {
  416. return val == null || val === false
  417. };
  418. /* */
  419. function renderAttrs (node) {
  420. var attrs = node.data.attrs;
  421. var res = '';
  422. var opts = node.parent && node.parent.componentOptions;
  423. if (isUndef(opts) || opts.Ctor.options.inheritAttrs !== false) {
  424. var parent = node.parent;
  425. while (isDef(parent)) {
  426. // Stop fallthrough in case parent has inheritAttrs option set to false
  427. if (parent.componentOptions && parent.componentOptions.Ctor.options.inheritAttrs === false) {
  428. break;
  429. }
  430. if (isDef(parent.data) && isDef(parent.data.attrs)) {
  431. attrs = extend(extend({}, attrs), parent.data.attrs);
  432. }
  433. parent = parent.parent;
  434. }
  435. }
  436. if (isUndef(attrs)) {
  437. return res
  438. }
  439. for (var key in attrs) {
  440. if (isSSRUnsafeAttr(key)) {
  441. continue
  442. }
  443. if (key === 'style') {
  444. // leave it to the style module
  445. continue
  446. }
  447. res += renderAttr(key, attrs[key]);
  448. }
  449. return res
  450. }
  451. function renderAttr (key, value) {
  452. if (isBooleanAttr(key)) {
  453. if (!isFalsyAttrValue(value)) {
  454. return (" " + key + "=\"" + key + "\"")
  455. }
  456. } else if (isEnumeratedAttr(key)) {
  457. return (" " + key + "=\"" + (escape(convertEnumeratedValue(key, value))) + "\"")
  458. } else if (!isFalsyAttrValue(value)) {
  459. return (" " + key + "=\"" + (escape(String(value))) + "\"")
  460. }
  461. return ''
  462. }
  463. /* */
  464. var VNode = function VNode (
  465. tag,
  466. data,
  467. children,
  468. text,
  469. elm,
  470. context,
  471. componentOptions,
  472. asyncFactory
  473. ) {
  474. this.tag = tag;
  475. this.data = data;
  476. this.children = children;
  477. this.text = text;
  478. this.elm = elm;
  479. this.ns = undefined;
  480. this.context = context;
  481. this.fnContext = undefined;
  482. this.fnOptions = undefined;
  483. this.fnScopeId = undefined;
  484. this.key = data && data.key;
  485. this.componentOptions = componentOptions;
  486. this.componentInstance = undefined;
  487. this.parent = undefined;
  488. this.raw = false;
  489. this.isStatic = false;
  490. this.isRootInsert = true;
  491. this.isComment = false;
  492. this.isCloned = false;
  493. this.isOnce = false;
  494. this.asyncFactory = asyncFactory;
  495. this.asyncMeta = undefined;
  496. this.isAsyncPlaceholder = false;
  497. };
  498. var prototypeAccessors = { child: { configurable: true } };
  499. // DEPRECATED: alias for componentInstance for backwards compat.
  500. /* istanbul ignore next */
  501. prototypeAccessors.child.get = function () {
  502. return this.componentInstance
  503. };
  504. Object.defineProperties( VNode.prototype, prototypeAccessors );
  505. var createEmptyVNode = function (text) {
  506. if ( text === void 0 ) text = '';
  507. var node = new VNode();
  508. node.text = text;
  509. node.isComment = true;
  510. return node
  511. };
  512. function createTextVNode (val) {
  513. return new VNode(undefined, undefined, undefined, String(val))
  514. }
  515. // optimized shallow clone
  516. // used for static nodes and slot nodes because they may be reused across
  517. // multiple renders, cloning them avoids errors when DOM manipulations rely
  518. // on their elm reference.
  519. function cloneVNode (vnode) {
  520. var cloned = new VNode(
  521. vnode.tag,
  522. vnode.data,
  523. // #7975
  524. // clone children array to avoid mutating original in case of cloning
  525. // a child.
  526. vnode.children && vnode.children.slice(),
  527. vnode.text,
  528. vnode.elm,
  529. vnode.context,
  530. vnode.componentOptions,
  531. vnode.asyncFactory
  532. );
  533. cloned.ns = vnode.ns;
  534. cloned.isStatic = vnode.isStatic;
  535. cloned.key = vnode.key;
  536. cloned.isComment = vnode.isComment;
  537. cloned.fnContext = vnode.fnContext;
  538. cloned.fnOptions = vnode.fnOptions;
  539. cloned.fnScopeId = vnode.fnScopeId;
  540. cloned.asyncMeta = vnode.asyncMeta;
  541. cloned.isCloned = true;
  542. return cloned
  543. }
  544. /* */
  545. function renderDOMProps (node) {
  546. var props = node.data.domProps;
  547. var res = '';
  548. var parent = node.parent;
  549. while (isDef(parent)) {
  550. if (parent.data && parent.data.domProps) {
  551. props = extend(extend({}, props), parent.data.domProps);
  552. }
  553. parent = parent.parent;
  554. }
  555. if (isUndef(props)) {
  556. return res
  557. }
  558. var attrs = node.data.attrs;
  559. for (var key in props) {
  560. if (key === 'innerHTML') {
  561. setText(node, props[key], true);
  562. } else if (key === 'textContent') {
  563. setText(node, props[key], false);
  564. } else if (key === 'value' && node.tag === 'textarea') {
  565. setText(node, toString(props[key]), false);
  566. } else {
  567. // $flow-disable-line (WTF?)
  568. var attr = propsToAttrMap[key] || key.toLowerCase();
  569. if (isRenderableAttr(attr) &&
  570. // avoid rendering double-bound props/attrs twice
  571. !(isDef(attrs) && isDef(attrs[attr]))
  572. ) {
  573. res += renderAttr(attr, props[key]);
  574. }
  575. }
  576. }
  577. return res
  578. }
  579. function setText (node, text, raw) {
  580. var child = new VNode(undefined, undefined, undefined, text);
  581. child.raw = raw;
  582. node.children = [child];
  583. }
  584. /* */
  585. /**
  586. * unicode letters used for parsing html tags, component names and property paths.
  587. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  588. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  589. */
  590. var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
  591. /**
  592. * Define a property.
  593. */
  594. function def (obj, key, val, enumerable) {
  595. Object.defineProperty(obj, key, {
  596. value: val,
  597. enumerable: !!enumerable,
  598. writable: true,
  599. configurable: true
  600. });
  601. }
  602. /* */
  603. // can we use __proto__?
  604. var hasProto = '__proto__' in {};
  605. // Browser environment sniffing
  606. var inBrowser = typeof window !== 'undefined';
  607. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  608. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  609. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  610. var isIE = UA && /msie|trident/.test(UA);
  611. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  612. var isEdge = UA && UA.indexOf('edge/') > 0;
  613. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  614. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  615. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  616. var isPhantomJS = UA && /phantomjs/.test(UA);
  617. var isFF = UA && UA.match(/firefox\/(\d+)/);
  618. // Firefox has a "watch" function on Object.prototype...
  619. var nativeWatch = ({}).watch;
  620. if (inBrowser) {
  621. try {
  622. var opts = {};
  623. Object.defineProperty(opts, 'passive', ({
  624. get: function get () {
  625. }
  626. })); // https://github.com/facebook/flow/issues/285
  627. window.addEventListener('test-passive', null, opts);
  628. } catch (e) {}
  629. }
  630. // this needs to be lazy-evaled because vue may be required before
  631. // vue-server-renderer can set VUE_ENV
  632. var _isServer;
  633. var isServerRendering = function () {
  634. if (_isServer === undefined) {
  635. /* istanbul ignore if */
  636. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  637. // detect presence of vue-server-renderer and avoid
  638. // Webpack shimming the process
  639. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  640. } else {
  641. _isServer = false;
  642. }
  643. }
  644. return _isServer
  645. };
  646. // detect devtools
  647. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  648. /* istanbul ignore next */
  649. function isNative (Ctor) {
  650. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  651. }
  652. var hasSymbol =
  653. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  654. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  655. var _Set;
  656. /* istanbul ignore if */ // $flow-disable-line
  657. if (typeof Set !== 'undefined' && isNative(Set)) {
  658. // use native Set when available.
  659. _Set = Set;
  660. } else {
  661. // a non-standard Set polyfill that only works with primitive keys.
  662. _Set = /*@__PURE__*/(function () {
  663. function Set () {
  664. this.set = Object.create(null);
  665. }
  666. Set.prototype.has = function has (key) {
  667. return this.set[key] === true
  668. };
  669. Set.prototype.add = function add (key) {
  670. this.set[key] = true;
  671. };
  672. Set.prototype.clear = function clear () {
  673. this.set = Object.create(null);
  674. };
  675. return Set;
  676. }());
  677. }
  678. var SSR_ATTR = 'data-server-rendered';
  679. var ASSET_TYPES = [
  680. 'component',
  681. 'directive',
  682. 'filter'
  683. ];
  684. var LIFECYCLE_HOOKS = [
  685. 'beforeCreate',
  686. 'created',
  687. 'beforeMount',
  688. 'mounted',
  689. 'beforeUpdate',
  690. 'updated',
  691. 'beforeDestroy',
  692. 'destroyed',
  693. 'activated',
  694. 'deactivated',
  695. 'errorCaptured',
  696. 'serverPrefetch'
  697. ];
  698. /* */
  699. var config = ({
  700. /**
  701. * Option merge strategies (used in core/util/options)
  702. */
  703. // $flow-disable-line
  704. optionMergeStrategies: Object.create(null),
  705. /**
  706. * Whether to suppress warnings.
  707. */
  708. silent: false,
  709. /**
  710. * Show production mode tip message on boot?
  711. */
  712. productionTip: "development" !== 'production',
  713. /**
  714. * Whether to enable devtools
  715. */
  716. devtools: "development" !== 'production',
  717. /**
  718. * Whether to record perf
  719. */
  720. performance: false,
  721. /**
  722. * Error handler for watcher errors
  723. */
  724. errorHandler: null,
  725. /**
  726. * Warn handler for watcher warns
  727. */
  728. warnHandler: null,
  729. /**
  730. * Ignore certain custom elements
  731. */
  732. ignoredElements: [],
  733. /**
  734. * Custom user key aliases for v-on
  735. */
  736. // $flow-disable-line
  737. keyCodes: Object.create(null),
  738. /**
  739. * Check if a tag is reserved so that it cannot be registered as a
  740. * component. This is platform-dependent and may be overwritten.
  741. */
  742. isReservedTag: no,
  743. /**
  744. * Check if an attribute is reserved so that it cannot be used as a component
  745. * prop. This is platform-dependent and may be overwritten.
  746. */
  747. isReservedAttr: no,
  748. /**
  749. * Check if a tag is an unknown element.
  750. * Platform-dependent.
  751. */
  752. isUnknownElement: no,
  753. /**
  754. * Get the namespace of an element
  755. */
  756. getTagNamespace: noop,
  757. /**
  758. * Parse the real tag name for the specific platform.
  759. */
  760. parsePlatformTagName: identity,
  761. /**
  762. * Check if an attribute must be bound using property, e.g. value
  763. * Platform-dependent.
  764. */
  765. mustUseProp: no,
  766. /**
  767. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  768. * This will significantly reduce performance if set to false.
  769. */
  770. async: true,
  771. /**
  772. * Exposed for legacy reasons
  773. */
  774. _lifecycleHooks: LIFECYCLE_HOOKS
  775. });
  776. /* */
  777. var warn = noop;
  778. var tip = noop;
  779. var generateComponentTrace = (noop); // work around flow check
  780. var formatComponentName = (noop);
  781. {
  782. var hasConsole = typeof console !== 'undefined';
  783. var classifyRE = /(?:^|[-_])(\w)/g;
  784. var classify = function (str) { return str
  785. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  786. .replace(/[-_]/g, ''); };
  787. warn = function (msg, vm) {
  788. var trace = vm ? generateComponentTrace(vm) : '';
  789. if (hasConsole && (!config.silent)) {
  790. console.error(("[Vue warn]: " + msg + trace));
  791. }
  792. };
  793. tip = function (msg, vm) {
  794. if (hasConsole && (!config.silent)) {
  795. console.warn("[Vue tip]: " + msg + (
  796. vm ? generateComponentTrace(vm) : ''
  797. ));
  798. }
  799. };
  800. formatComponentName = function (vm, includeFile) {
  801. if (vm.$root === vm) {
  802. return '<Root>'
  803. }
  804. var options = typeof vm === 'function' && vm.cid != null
  805. ? vm.options
  806. : vm._isVue
  807. ? vm.$options || vm.constructor.options
  808. : vm;
  809. var name = options.name || options._componentTag;
  810. var file = options.__file;
  811. if (!name && file) {
  812. var match = file.match(/([^/\\]+)\.vue$/);
  813. name = match && match[1];
  814. }
  815. return (
  816. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  817. (file && includeFile !== false ? (" at " + file) : '')
  818. )
  819. };
  820. var repeat = function (str, n) {
  821. var res = '';
  822. while (n) {
  823. if (n % 2 === 1) { res += str; }
  824. if (n > 1) { str += str; }
  825. n >>= 1;
  826. }
  827. return res
  828. };
  829. generateComponentTrace = function (vm) {
  830. if (vm._isVue && vm.$parent) {
  831. var tree = [];
  832. var currentRecursiveSequence = 0;
  833. while (vm) {
  834. if (tree.length > 0) {
  835. var last = tree[tree.length - 1];
  836. if (last.constructor === vm.constructor) {
  837. currentRecursiveSequence++;
  838. vm = vm.$parent;
  839. continue
  840. } else if (currentRecursiveSequence > 0) {
  841. tree[tree.length - 1] = [last, currentRecursiveSequence];
  842. currentRecursiveSequence = 0;
  843. }
  844. }
  845. tree.push(vm);
  846. vm = vm.$parent;
  847. }
  848. return '\n\nfound in\n\n' + tree
  849. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  850. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  851. : formatComponentName(vm))); })
  852. .join('\n')
  853. } else {
  854. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  855. }
  856. };
  857. }
  858. /* */
  859. var uid = 0;
  860. /**
  861. * A dep is an observable that can have multiple
  862. * directives subscribing to it.
  863. */
  864. var Dep = function Dep () {
  865. this.id = uid++;
  866. this.subs = [];
  867. };
  868. Dep.prototype.addSub = function addSub (sub) {
  869. this.subs.push(sub);
  870. };
  871. Dep.prototype.removeSub = function removeSub (sub) {
  872. remove(this.subs, sub);
  873. };
  874. Dep.prototype.depend = function depend () {
  875. if (Dep.target) {
  876. Dep.target.addDep(this);
  877. }
  878. };
  879. Dep.prototype.notify = function notify () {
  880. // stabilize the subscriber list first
  881. var subs = this.subs.slice();
  882. for (var i = 0, l = subs.length; i < l; i++) {
  883. subs[i].update();
  884. }
  885. };
  886. // The current target watcher being evaluated.
  887. // This is globally unique because only one watcher
  888. // can be evaluated at a time.
  889. Dep.target = null;
  890. var targetStack = [];
  891. function pushTarget (target) {
  892. targetStack.push(target);
  893. Dep.target = target;
  894. }
  895. function popTarget () {
  896. targetStack.pop();
  897. Dep.target = targetStack[targetStack.length - 1];
  898. }
  899. /*
  900. * not type checking this file because flow doesn't play well with
  901. * dynamically accessing methods on Array prototype
  902. */
  903. var arrayProto = Array.prototype;
  904. var arrayMethods = Object.create(arrayProto);
  905. var methodsToPatch = [
  906. 'push',
  907. 'pop',
  908. 'shift',
  909. 'unshift',
  910. 'splice',
  911. 'sort',
  912. 'reverse'
  913. ];
  914. /**
  915. * Intercept mutating methods and emit events
  916. */
  917. methodsToPatch.forEach(function (method) {
  918. // cache original method
  919. var original = arrayProto[method];
  920. def(arrayMethods, method, function mutator () {
  921. var args = [], len = arguments.length;
  922. while ( len-- ) args[ len ] = arguments[ len ];
  923. var result = original.apply(this, args);
  924. var ob = this.__ob__;
  925. var inserted;
  926. switch (method) {
  927. case 'push':
  928. case 'unshift':
  929. inserted = args;
  930. break
  931. case 'splice':
  932. inserted = args.slice(2);
  933. break
  934. }
  935. if (inserted) { ob.observeArray(inserted); }
  936. // notify change
  937. ob.dep.notify();
  938. return result
  939. });
  940. });
  941. /* */
  942. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  943. /**
  944. * In some cases we may want to disable observation inside a component's
  945. * update computation.
  946. */
  947. var shouldObserve = true;
  948. function toggleObserving (value) {
  949. shouldObserve = value;
  950. }
  951. /**
  952. * Observer class that is attached to each observed
  953. * object. Once attached, the observer converts the target
  954. * object's property keys into getter/setters that
  955. * collect dependencies and dispatch updates.
  956. */
  957. var Observer = function Observer (value) {
  958. this.value = value;
  959. this.dep = new Dep();
  960. this.vmCount = 0;
  961. def(value, '__ob__', this);
  962. if (Array.isArray(value)) {
  963. if (hasProto) {
  964. protoAugment(value, arrayMethods);
  965. } else {
  966. copyAugment(value, arrayMethods, arrayKeys);
  967. }
  968. this.observeArray(value);
  969. } else {
  970. this.walk(value);
  971. }
  972. };
  973. /**
  974. * Walk through all properties and convert them into
  975. * getter/setters. This method should only be called when
  976. * value type is Object.
  977. */
  978. Observer.prototype.walk = function walk (obj) {
  979. var keys = Object.keys(obj);
  980. for (var i = 0; i < keys.length; i++) {
  981. defineReactive$$1(obj, keys[i]);
  982. }
  983. };
  984. /**
  985. * Observe a list of Array items.
  986. */
  987. Observer.prototype.observeArray = function observeArray (items) {
  988. for (var i = 0, l = items.length; i < l; i++) {
  989. observe(items[i]);
  990. }
  991. };
  992. // helpers
  993. /**
  994. * Augment a target Object or Array by intercepting
  995. * the prototype chain using __proto__
  996. */
  997. function protoAugment (target, src) {
  998. /* eslint-disable no-proto */
  999. target.__proto__ = src;
  1000. /* eslint-enable no-proto */
  1001. }
  1002. /**
  1003. * Augment a target Object or Array by defining
  1004. * hidden properties.
  1005. */
  1006. /* istanbul ignore next */
  1007. function copyAugment (target, src, keys) {
  1008. for (var i = 0, l = keys.length; i < l; i++) {
  1009. var key = keys[i];
  1010. def(target, key, src[key]);
  1011. }
  1012. }
  1013. /**
  1014. * Attempt to create an observer instance for a value,
  1015. * returns the new observer if successfully observed,
  1016. * or the existing observer if the value already has one.
  1017. */
  1018. function observe (value, asRootData) {
  1019. if (!isObject(value) || value instanceof VNode) {
  1020. return
  1021. }
  1022. var ob;
  1023. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  1024. ob = value.__ob__;
  1025. } else if (
  1026. shouldObserve &&
  1027. !isServerRendering() &&
  1028. (Array.isArray(value) || isPlainObject(value)) &&
  1029. Object.isExtensible(value) &&
  1030. !value._isVue
  1031. ) {
  1032. ob = new Observer(value);
  1033. }
  1034. if (asRootData && ob) {
  1035. ob.vmCount++;
  1036. }
  1037. return ob
  1038. }
  1039. /**
  1040. * Define a reactive property on an Object.
  1041. */
  1042. function defineReactive$$1 (
  1043. obj,
  1044. key,
  1045. val,
  1046. customSetter,
  1047. shallow
  1048. ) {
  1049. var dep = new Dep();
  1050. var property = Object.getOwnPropertyDescriptor(obj, key);
  1051. if (property && property.configurable === false) {
  1052. return
  1053. }
  1054. // cater for pre-defined getter/setters
  1055. var getter = property && property.get;
  1056. var setter = property && property.set;
  1057. if ((!getter || setter) && arguments.length === 2) {
  1058. val = obj[key];
  1059. }
  1060. var childOb = !shallow && observe(val);
  1061. Object.defineProperty(obj, key, {
  1062. enumerable: true,
  1063. configurable: true,
  1064. get: function reactiveGetter () {
  1065. var value = getter ? getter.call(obj) : val;
  1066. if (Dep.target) {
  1067. dep.depend();
  1068. if (childOb) {
  1069. childOb.dep.depend();
  1070. if (Array.isArray(value)) {
  1071. dependArray(value);
  1072. }
  1073. }
  1074. }
  1075. return value
  1076. },
  1077. set: function reactiveSetter (newVal) {
  1078. var value = getter ? getter.call(obj) : val;
  1079. /* eslint-disable no-self-compare */
  1080. if (newVal === value || (newVal !== newVal && value !== value)) {
  1081. return
  1082. }
  1083. /* eslint-enable no-self-compare */
  1084. if (customSetter) {
  1085. customSetter();
  1086. }
  1087. // #7981: for accessor properties without setter
  1088. if (getter && !setter) { return }
  1089. if (setter) {
  1090. setter.call(obj, newVal);
  1091. } else {
  1092. val = newVal;
  1093. }
  1094. childOb = !shallow && observe(newVal);
  1095. dep.notify();
  1096. }
  1097. });
  1098. }
  1099. /**
  1100. * Set a property on an object. Adds the new property and
  1101. * triggers change notification if the property doesn't
  1102. * already exist.
  1103. */
  1104. function set (target, key, val) {
  1105. if (isUndef(target) || isPrimitive(target)
  1106. ) {
  1107. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  1108. }
  1109. if (Array.isArray(target) && isValidArrayIndex(key)) {
  1110. target.length = Math.max(target.length, key);
  1111. target.splice(key, 1, val);
  1112. return val
  1113. }
  1114. if (key in target && !(key in Object.prototype)) {
  1115. target[key] = val;
  1116. return val
  1117. }
  1118. var ob = (target).__ob__;
  1119. if (target._isVue || (ob && ob.vmCount)) {
  1120. warn(
  1121. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  1122. 'at runtime - declare it upfront in the data option.'
  1123. );
  1124. return val
  1125. }
  1126. if (!ob) {
  1127. target[key] = val;
  1128. return val
  1129. }
  1130. defineReactive$$1(ob.value, key, val);
  1131. ob.dep.notify();
  1132. return val
  1133. }
  1134. /**
  1135. * Collect dependencies on array elements when the array is touched, since
  1136. * we cannot intercept array element access like property getters.
  1137. */
  1138. function dependArray (value) {
  1139. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  1140. e = value[i];
  1141. e && e.__ob__ && e.__ob__.dep.depend();
  1142. if (Array.isArray(e)) {
  1143. dependArray(e);
  1144. }
  1145. }
  1146. }
  1147. /* */
  1148. /**
  1149. * Option overwriting strategies are functions that handle
  1150. * how to merge a parent option value and a child option
  1151. * value into the final value.
  1152. */
  1153. var strats = config.optionMergeStrategies;
  1154. /**
  1155. * Options with restrictions
  1156. */
  1157. {
  1158. strats.el = strats.propsData = function (parent, child, vm, key) {
  1159. if (!vm) {
  1160. warn(
  1161. "option \"" + key + "\" can only be used during instance " +
  1162. 'creation with the `new` keyword.'
  1163. );
  1164. }
  1165. return defaultStrat(parent, child)
  1166. };
  1167. }
  1168. /**
  1169. * Helper that recursively merges two data objects together.
  1170. */
  1171. function mergeData (to, from) {
  1172. if (!from) { return to }
  1173. var key, toVal, fromVal;
  1174. var keys = hasSymbol
  1175. ? Reflect.ownKeys(from)
  1176. : Object.keys(from);
  1177. for (var i = 0; i < keys.length; i++) {
  1178. key = keys[i];
  1179. // in case the object is already observed...
  1180. if (key === '__ob__') { continue }
  1181. toVal = to[key];
  1182. fromVal = from[key];
  1183. if (!hasOwn(to, key)) {
  1184. set(to, key, fromVal);
  1185. } else if (
  1186. toVal !== fromVal &&
  1187. isPlainObject(toVal) &&
  1188. isPlainObject(fromVal)
  1189. ) {
  1190. mergeData(toVal, fromVal);
  1191. }
  1192. }
  1193. return to
  1194. }
  1195. /**
  1196. * Data
  1197. */
  1198. function mergeDataOrFn (
  1199. parentVal,
  1200. childVal,
  1201. vm
  1202. ) {
  1203. if (!vm) {
  1204. // in a Vue.extend merge, both should be functions
  1205. if (!childVal) {
  1206. return parentVal
  1207. }
  1208. if (!parentVal) {
  1209. return childVal
  1210. }
  1211. // when parentVal & childVal are both present,
  1212. // we need to return a function that returns the
  1213. // merged result of both functions... no need to
  1214. // check if parentVal is a function here because
  1215. // it has to be a function to pass previous merges.
  1216. return function mergedDataFn () {
  1217. return mergeData(
  1218. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  1219. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  1220. )
  1221. }
  1222. } else {
  1223. return function mergedInstanceDataFn () {
  1224. // instance merge
  1225. var instanceData = typeof childVal === 'function'
  1226. ? childVal.call(vm, vm)
  1227. : childVal;
  1228. var defaultData = typeof parentVal === 'function'
  1229. ? parentVal.call(vm, vm)
  1230. : parentVal;
  1231. if (instanceData) {
  1232. return mergeData(instanceData, defaultData)
  1233. } else {
  1234. return defaultData
  1235. }
  1236. }
  1237. }
  1238. }
  1239. strats.data = function (
  1240. parentVal,
  1241. childVal,
  1242. vm
  1243. ) {
  1244. if (!vm) {
  1245. if (childVal && typeof childVal !== 'function') {
  1246. warn(
  1247. 'The "data" option should be a function ' +
  1248. 'that returns a per-instance value in component ' +
  1249. 'definitions.',
  1250. vm
  1251. );
  1252. return parentVal
  1253. }
  1254. return mergeDataOrFn(parentVal, childVal)
  1255. }
  1256. return mergeDataOrFn(parentVal, childVal, vm)
  1257. };
  1258. /**
  1259. * Hooks and props are merged as arrays.
  1260. */
  1261. function mergeHook (
  1262. parentVal,
  1263. childVal
  1264. ) {
  1265. var res = childVal
  1266. ? parentVal
  1267. ? parentVal.concat(childVal)
  1268. : Array.isArray(childVal)
  1269. ? childVal
  1270. : [childVal]
  1271. : parentVal;
  1272. return res
  1273. ? dedupeHooks(res)
  1274. : res
  1275. }
  1276. function dedupeHooks (hooks) {
  1277. var res = [];
  1278. for (var i = 0; i < hooks.length; i++) {
  1279. if (res.indexOf(hooks[i]) === -1) {
  1280. res.push(hooks[i]);
  1281. }
  1282. }
  1283. return res
  1284. }
  1285. LIFECYCLE_HOOKS.forEach(function (hook) {
  1286. strats[hook] = mergeHook;
  1287. });
  1288. /**
  1289. * Assets
  1290. *
  1291. * When a vm is present (instance creation), we need to do
  1292. * a three-way merge between constructor options, instance
  1293. * options and parent options.
  1294. */
  1295. function mergeAssets (
  1296. parentVal,
  1297. childVal,
  1298. vm,
  1299. key
  1300. ) {
  1301. var res = Object.create(parentVal || null);
  1302. if (childVal) {
  1303. assertObjectType(key, childVal, vm);
  1304. return extend(res, childVal)
  1305. } else {
  1306. return res
  1307. }
  1308. }
  1309. ASSET_TYPES.forEach(function (type) {
  1310. strats[type + 's'] = mergeAssets;
  1311. });
  1312. /**
  1313. * Watchers.
  1314. *
  1315. * Watchers hashes should not overwrite one
  1316. * another, so we merge them as arrays.
  1317. */
  1318. strats.watch = function (
  1319. parentVal,
  1320. childVal,
  1321. vm,
  1322. key
  1323. ) {
  1324. // work around Firefox's Object.prototype.watch...
  1325. if (parentVal === nativeWatch) { parentVal = undefined; }
  1326. if (childVal === nativeWatch) { childVal = undefined; }
  1327. /* istanbul ignore if */
  1328. if (!childVal) { return Object.create(parentVal || null) }
  1329. {
  1330. assertObjectType(key, childVal, vm);
  1331. }
  1332. if (!parentVal) { return childVal }
  1333. var ret = {};
  1334. extend(ret, parentVal);
  1335. for (var key$1 in childVal) {
  1336. var parent = ret[key$1];
  1337. var child = childVal[key$1];
  1338. if (parent && !Array.isArray(parent)) {
  1339. parent = [parent];
  1340. }
  1341. ret[key$1] = parent
  1342. ? parent.concat(child)
  1343. : Array.isArray(child) ? child : [child];
  1344. }
  1345. return ret
  1346. };
  1347. /**
  1348. * Other object hashes.
  1349. */
  1350. strats.props =
  1351. strats.methods =
  1352. strats.inject =
  1353. strats.computed = function (
  1354. parentVal,
  1355. childVal,
  1356. vm,
  1357. key
  1358. ) {
  1359. if (childVal && "development" !== 'production') {
  1360. assertObjectType(key, childVal, vm);
  1361. }
  1362. if (!parentVal) { return childVal }
  1363. var ret = Object.create(null);
  1364. extend(ret, parentVal);
  1365. if (childVal) { extend(ret, childVal); }
  1366. return ret
  1367. };
  1368. strats.provide = mergeDataOrFn;
  1369. /**
  1370. * Default strategy.
  1371. */
  1372. var defaultStrat = function (parentVal, childVal) {
  1373. return childVal === undefined
  1374. ? parentVal
  1375. : childVal
  1376. };
  1377. /**
  1378. * Validate component names
  1379. */
  1380. function checkComponents (options) {
  1381. for (var key in options.components) {
  1382. validateComponentName(key);
  1383. }
  1384. }
  1385. function validateComponentName (name) {
  1386. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  1387. warn(
  1388. 'Invalid component name: "' + name + '". Component names ' +
  1389. 'should conform to valid custom element name in html5 specification.'
  1390. );
  1391. }
  1392. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  1393. warn(
  1394. 'Do not use built-in or reserved HTML elements as component ' +
  1395. 'id: ' + name
  1396. );
  1397. }
  1398. }
  1399. /**
  1400. * Ensure all props option syntax are normalized into the
  1401. * Object-based format.
  1402. */
  1403. function normalizeProps (options, vm) {
  1404. var props = options.props;
  1405. if (!props) { return }
  1406. var res = {};
  1407. var i, val, name;
  1408. if (Array.isArray(props)) {
  1409. i = props.length;
  1410. while (i--) {
  1411. val = props[i];
  1412. if (typeof val === 'string') {
  1413. name = camelize(val);
  1414. res[name] = { type: null };
  1415. } else {
  1416. warn('props must be strings when using array syntax.');
  1417. }
  1418. }
  1419. } else if (isPlainObject(props)) {
  1420. for (var key in props) {
  1421. val = props[key];
  1422. name = camelize(key);
  1423. res[name] = isPlainObject(val)
  1424. ? val
  1425. : { type: val };
  1426. }
  1427. } else {
  1428. warn(
  1429. "Invalid value for option \"props\": expected an Array or an Object, " +
  1430. "but got " + (toRawType(props)) + ".",
  1431. vm
  1432. );
  1433. }
  1434. options.props = res;
  1435. }
  1436. /**
  1437. * Normalize all injections into Object-based format
  1438. */
  1439. function normalizeInject (options, vm) {
  1440. var inject = options.inject;
  1441. if (!inject) { return }
  1442. var normalized = options.inject = {};
  1443. if (Array.isArray(inject)) {
  1444. for (var i = 0; i < inject.length; i++) {
  1445. normalized[inject[i]] = { from: inject[i] };
  1446. }
  1447. } else if (isPlainObject(inject)) {
  1448. for (var key in inject) {
  1449. var val = inject[key];
  1450. normalized[key] = isPlainObject(val)
  1451. ? extend({ from: key }, val)
  1452. : { from: val };
  1453. }
  1454. } else {
  1455. warn(
  1456. "Invalid value for option \"inject\": expected an Array or an Object, " +
  1457. "but got " + (toRawType(inject)) + ".",
  1458. vm
  1459. );
  1460. }
  1461. }
  1462. /**
  1463. * Normalize raw function directives into object format.
  1464. */
  1465. function normalizeDirectives (options) {
  1466. var dirs = options.directives;
  1467. if (dirs) {
  1468. for (var key in dirs) {
  1469. var def$$1 = dirs[key];
  1470. if (typeof def$$1 === 'function') {
  1471. dirs[key] = { bind: def$$1, update: def$$1 };
  1472. }
  1473. }
  1474. }
  1475. }
  1476. function assertObjectType (name, value, vm) {
  1477. if (!isPlainObject(value)) {
  1478. warn(
  1479. "Invalid value for option \"" + name + "\": expected an Object, " +
  1480. "but got " + (toRawType(value)) + ".",
  1481. vm
  1482. );
  1483. }
  1484. }
  1485. /**
  1486. * Merge two option objects into a new one.
  1487. * Core utility used in both instantiation and inheritance.
  1488. */
  1489. function mergeOptions (
  1490. parent,
  1491. child,
  1492. vm
  1493. ) {
  1494. {
  1495. checkComponents(child);
  1496. }
  1497. if (typeof child === 'function') {
  1498. child = child.options;
  1499. }
  1500. normalizeProps(child, vm);
  1501. normalizeInject(child, vm);
  1502. normalizeDirectives(child);
  1503. // Apply extends and mixins on the child options,
  1504. // but only if it is a raw options object that isn't
  1505. // the result of another mergeOptions call.
  1506. // Only merged options has the _base property.
  1507. if (!child._base) {
  1508. if (child.extends) {
  1509. parent = mergeOptions(parent, child.extends, vm);
  1510. }
  1511. if (child.mixins) {
  1512. for (var i = 0, l = child.mixins.length; i < l; i++) {
  1513. parent = mergeOptions(parent, child.mixins[i], vm);
  1514. }
  1515. }
  1516. }
  1517. var options = {};
  1518. var key;
  1519. for (key in parent) {
  1520. mergeField(key);
  1521. }
  1522. for (key in child) {
  1523. if (!hasOwn(parent, key)) {
  1524. mergeField(key);
  1525. }
  1526. }
  1527. function mergeField (key) {
  1528. var strat = strats[key] || defaultStrat;
  1529. options[key] = strat(parent[key], child[key], vm, key);
  1530. }
  1531. return options
  1532. }
  1533. /**
  1534. * Resolve an asset.
  1535. * This function is used because child instances need access
  1536. * to assets defined in its ancestor chain.
  1537. */
  1538. function resolveAsset (
  1539. options,
  1540. type,
  1541. id,
  1542. warnMissing
  1543. ) {
  1544. /* istanbul ignore if */
  1545. if (typeof id !== 'string') {
  1546. return
  1547. }
  1548. var assets = options[type];
  1549. // check local registration variations first
  1550. if (hasOwn(assets, id)) { return assets[id] }
  1551. var camelizedId = camelize(id);
  1552. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  1553. var PascalCaseId = capitalize(camelizedId);
  1554. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  1555. // fallback to prototype chain
  1556. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  1557. if (warnMissing && !res) {
  1558. warn(
  1559. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  1560. options
  1561. );
  1562. }
  1563. return res
  1564. }
  1565. /* */
  1566. function validateProp (
  1567. key,
  1568. propOptions,
  1569. propsData,
  1570. vm
  1571. ) {
  1572. var prop = propOptions[key];
  1573. var absent = !hasOwn(propsData, key);
  1574. var value = propsData[key];
  1575. // boolean casting
  1576. var booleanIndex = getTypeIndex(Boolean, prop.type);
  1577. if (booleanIndex > -1) {
  1578. if (absent && !hasOwn(prop, 'default')) {
  1579. value = false;
  1580. } else if (value === '' || value === hyphenate(key)) {
  1581. // only cast empty string / same name to boolean if
  1582. // boolean has higher priority
  1583. var stringIndex = getTypeIndex(String, prop.type);
  1584. if (stringIndex < 0 || booleanIndex < stringIndex) {
  1585. value = true;
  1586. }
  1587. }
  1588. }
  1589. // check default value
  1590. if (value === undefined) {
  1591. value = getPropDefaultValue(vm, prop, key);
  1592. // since the default value is a fresh copy,
  1593. // make sure to observe it.
  1594. var prevShouldObserve = shouldObserve;
  1595. toggleObserving(true);
  1596. observe(value);
  1597. toggleObserving(prevShouldObserve);
  1598. }
  1599. {
  1600. assertProp(prop, key, value, vm, absent);
  1601. }
  1602. return value
  1603. }
  1604. /**
  1605. * Get the default value of a prop.
  1606. */
  1607. function getPropDefaultValue (vm, prop, key) {
  1608. // no default, return undefined
  1609. if (!hasOwn(prop, 'default')) {
  1610. return undefined
  1611. }
  1612. var def = prop.default;
  1613. // warn against non-factory defaults for Object & Array
  1614. if (isObject(def)) {
  1615. warn(
  1616. 'Invalid default value for prop "' + key + '": ' +
  1617. 'Props with type Object/Array must use a factory function ' +
  1618. 'to return the default value.',
  1619. vm
  1620. );
  1621. }
  1622. // the raw prop value was also undefined from previous render,
  1623. // return previous default value to avoid unnecessary watcher trigger
  1624. if (vm && vm.$options.propsData &&
  1625. vm.$options.propsData[key] === undefined &&
  1626. vm._props[key] !== undefined
  1627. ) {
  1628. return vm._props[key]
  1629. }
  1630. // call factory function for non-Function types
  1631. // a value is Function if its prototype is function even across different execution context
  1632. return typeof def === 'function' && getType(prop.type) !== 'Function'
  1633. ? def.call(vm)
  1634. : def
  1635. }
  1636. /**
  1637. * Assert whether a prop is valid.
  1638. */
  1639. function assertProp (
  1640. prop,
  1641. name,
  1642. value,
  1643. vm,
  1644. absent
  1645. ) {
  1646. if (prop.required && absent) {
  1647. warn(
  1648. 'Missing required prop: "' + name + '"',
  1649. vm
  1650. );
  1651. return
  1652. }
  1653. if (value == null && !prop.required) {
  1654. return
  1655. }
  1656. var type = prop.type;
  1657. var valid = !type || type === true;
  1658. var expectedTypes = [];
  1659. if (type) {
  1660. if (!Array.isArray(type)) {
  1661. type = [type];
  1662. }
  1663. for (var i = 0; i < type.length && !valid; i++) {
  1664. var assertedType = assertType(value, type[i], vm);
  1665. expectedTypes.push(assertedType.expectedType || '');
  1666. valid = assertedType.valid;
  1667. }
  1668. }
  1669. var haveExpectedTypes = expectedTypes.some(function (t) { return t; });
  1670. if (!valid && haveExpectedTypes) {
  1671. warn(
  1672. getInvalidTypeMessage(name, value, expectedTypes),
  1673. vm
  1674. );
  1675. return
  1676. }
  1677. var validator = prop.validator;
  1678. if (validator) {
  1679. if (!validator(value)) {
  1680. warn(
  1681. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  1682. vm
  1683. );
  1684. }
  1685. }
  1686. }
  1687. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol|BigInt)$/;
  1688. function assertType (value, type, vm) {
  1689. var valid;
  1690. var expectedType = getType(type);
  1691. if (simpleCheckRE.test(expectedType)) {
  1692. var t = typeof value;
  1693. valid = t === expectedType.toLowerCase();
  1694. // for primitive wrapper objects
  1695. if (!valid && t === 'object') {
  1696. valid = value instanceof type;
  1697. }
  1698. } else if (expectedType === 'Object') {
  1699. valid = isPlainObject(value);
  1700. } else if (expectedType === 'Array') {
  1701. valid = Array.isArray(value);
  1702. } else {
  1703. try {
  1704. valid = value instanceof type;
  1705. } catch (e) {
  1706. warn('Invalid prop type: "' + String(type) + '" is not a constructor', vm);
  1707. valid = false;
  1708. }
  1709. }
  1710. return {
  1711. valid: valid,
  1712. expectedType: expectedType
  1713. }
  1714. }
  1715. var functionTypeCheckRE = /^\s*function (\w+)/;
  1716. /**
  1717. * Use function string name to check built-in types,
  1718. * because a simple equality check will fail when running
  1719. * across different vms / iframes.
  1720. */
  1721. function getType (fn) {
  1722. var match = fn && fn.toString().match(functionTypeCheckRE);
  1723. return match ? match[1] : ''
  1724. }
  1725. function isSameType (a, b) {
  1726. return getType(a) === getType(b)
  1727. }
  1728. function getTypeIndex (type, expectedTypes) {
  1729. if (!Array.isArray(expectedTypes)) {
  1730. return isSameType(expectedTypes, type) ? 0 : -1
  1731. }
  1732. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  1733. if (isSameType(expectedTypes[i], type)) {
  1734. return i
  1735. }
  1736. }
  1737. return -1
  1738. }
  1739. function getInvalidTypeMessage (name, value, expectedTypes) {
  1740. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  1741. " Expected " + (expectedTypes.map(capitalize).join(', '));
  1742. var expectedType = expectedTypes[0];
  1743. var receivedType = toRawType(value);
  1744. // check if we need to specify expected value
  1745. if (
  1746. expectedTypes.length === 1 &&
  1747. isExplicable(expectedType) &&
  1748. isExplicable(typeof value) &&
  1749. !isBoolean(expectedType, receivedType)
  1750. ) {
  1751. message += " with value " + (styleValue(value, expectedType));
  1752. }
  1753. message += ", got " + receivedType + " ";
  1754. // check if we need to specify received value
  1755. if (isExplicable(receivedType)) {
  1756. message += "with value " + (styleValue(value, receivedType)) + ".";
  1757. }
  1758. return message
  1759. }
  1760. function styleValue (value, type) {
  1761. if (type === 'String') {
  1762. return ("\"" + value + "\"")
  1763. } else if (type === 'Number') {
  1764. return ("" + (Number(value)))
  1765. } else {
  1766. return ("" + value)
  1767. }
  1768. }
  1769. var EXPLICABLE_TYPES = ['string', 'number', 'boolean'];
  1770. function isExplicable (value) {
  1771. return EXPLICABLE_TYPES.some(function (elem) { return value.toLowerCase() === elem; })
  1772. }
  1773. function isBoolean () {
  1774. var args = [], len = arguments.length;
  1775. while ( len-- ) args[ len ] = arguments[ len ];
  1776. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  1777. }
  1778. /* */
  1779. function handleError (err, vm, info) {
  1780. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  1781. // See: https://github.com/vuejs/vuex/issues/1505
  1782. pushTarget();
  1783. try {
  1784. if (vm) {
  1785. var cur = vm;
  1786. while ((cur = cur.$parent)) {
  1787. var hooks = cur.$options.errorCaptured;
  1788. if (hooks) {
  1789. for (var i = 0; i < hooks.length; i++) {
  1790. try {
  1791. var capture = hooks[i].call(cur, err, vm, info) === false;
  1792. if (capture) { return }
  1793. } catch (e) {
  1794. globalHandleError(e, cur, 'errorCaptured hook');
  1795. }
  1796. }
  1797. }
  1798. }
  1799. }
  1800. globalHandleError(err, vm, info);
  1801. } finally {
  1802. popTarget();
  1803. }
  1804. }
  1805. function invokeWithErrorHandling (
  1806. handler,
  1807. context,
  1808. args,
  1809. vm,
  1810. info
  1811. ) {
  1812. var res;
  1813. try {
  1814. res = args ? handler.apply(context, args) : handler.call(context);
  1815. if (res && !res._isVue && isPromise(res) && !res._handled) {
  1816. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  1817. // issue #9511
  1818. // avoid catch triggering multiple times when nested calls
  1819. res._handled = true;
  1820. }
  1821. } catch (e) {
  1822. handleError(e, vm, info);
  1823. }
  1824. return res
  1825. }
  1826. function globalHandleError (err, vm, info) {
  1827. logError(err, vm, info);
  1828. }
  1829. function logError (err, vm, info) {
  1830. {
  1831. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  1832. }
  1833. /* istanbul ignore else */
  1834. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  1835. console.error(err);
  1836. } else {
  1837. throw err
  1838. }
  1839. }
  1840. /* */
  1841. var callbacks = [];
  1842. function flushCallbacks () {
  1843. var copies = callbacks.slice(0);
  1844. callbacks.length = 0;
  1845. for (var i = 0; i < copies.length; i++) {
  1846. copies[i]();
  1847. }
  1848. }
  1849. // The nextTick behavior leverages the microtask queue, which can be accessed
  1850. // via either native Promise.then or MutationObserver.
  1851. // MutationObserver has wider support, however it is seriously bugged in
  1852. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  1853. // completely stops working after triggering a few times... so, if native
  1854. // Promise is available, we will use it:
  1855. /* istanbul ignore next, $flow-disable-line */
  1856. if (typeof Promise !== 'undefined' && isNative(Promise)) ; else if (!isIE && typeof MutationObserver !== 'undefined' && (
  1857. isNative(MutationObserver) ||
  1858. // PhantomJS and iOS 7.x
  1859. MutationObserver.toString() === '[object MutationObserverConstructor]'
  1860. )) {
  1861. // Use MutationObserver where native Promise is not available,
  1862. // e.g. PhantomJS, iOS7, Android 4.4
  1863. // (#6466 MutationObserver is unreliable in IE11)
  1864. var counter = 1;
  1865. var observer = new MutationObserver(flushCallbacks);
  1866. var textNode = document.createTextNode(String(counter));
  1867. observer.observe(textNode, {
  1868. characterData: true
  1869. });
  1870. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) ;
  1871. /* */
  1872. /* */
  1873. function genClassForVnode (vnode) {
  1874. var data = vnode.data;
  1875. var parentNode = vnode;
  1876. var childNode = vnode;
  1877. while (isDef(childNode.componentInstance)) {
  1878. childNode = childNode.componentInstance._vnode;
  1879. if (childNode && childNode.data) {
  1880. data = mergeClassData(childNode.data, data);
  1881. }
  1882. }
  1883. while (isDef(parentNode = parentNode.parent)) {
  1884. if (parentNode && parentNode.data) {
  1885. data = mergeClassData(data, parentNode.data);
  1886. }
  1887. }
  1888. return renderClass(data.staticClass, data.class)
  1889. }
  1890. function mergeClassData (child, parent) {
  1891. return {
  1892. staticClass: concat(child.staticClass, parent.staticClass),
  1893. class: isDef(child.class)
  1894. ? [child.class, parent.class]
  1895. : parent.class
  1896. }
  1897. }
  1898. function renderClass (
  1899. staticClass,
  1900. dynamicClass
  1901. ) {
  1902. if (isDef(staticClass) || isDef(dynamicClass)) {
  1903. return concat(staticClass, stringifyClass(dynamicClass))
  1904. }
  1905. /* istanbul ignore next */
  1906. return ''
  1907. }
  1908. function concat (a, b) {
  1909. return a ? b ? (a + ' ' + b) : a : (b || '')
  1910. }
  1911. function stringifyClass (value) {
  1912. if (Array.isArray(value)) {
  1913. return stringifyArray(value)
  1914. }
  1915. if (isObject(value)) {
  1916. return stringifyObject(value)
  1917. }
  1918. if (typeof value === 'string') {
  1919. return value
  1920. }
  1921. /* istanbul ignore next */
  1922. return ''
  1923. }
  1924. function stringifyArray (value) {
  1925. var res = '';
  1926. var stringified;
  1927. for (var i = 0, l = value.length; i < l; i++) {
  1928. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  1929. if (res) { res += ' '; }
  1930. res += stringified;
  1931. }
  1932. }
  1933. return res
  1934. }
  1935. function stringifyObject (value) {
  1936. var res = '';
  1937. for (var key in value) {
  1938. if (value[key]) {
  1939. if (res) { res += ' '; }
  1940. res += key;
  1941. }
  1942. }
  1943. return res
  1944. }
  1945. /* */
  1946. var isHTMLTag = makeMap(
  1947. 'html,body,base,head,link,meta,style,title,' +
  1948. 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
  1949. 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
  1950. 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
  1951. 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
  1952. 'embed,object,param,source,canvas,script,noscript,del,ins,' +
  1953. 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
  1954. 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
  1955. 'output,progress,select,textarea,' +
  1956. 'details,dialog,menu,menuitem,summary,' +
  1957. 'content,element,shadow,template,blockquote,iframe,tfoot'
  1958. );
  1959. // this map is intentionally selective, only covering SVG elements that may
  1960. // contain child elements.
  1961. var isSVG = makeMap(
  1962. 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
  1963. 'foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
  1964. 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
  1965. true
  1966. );
  1967. var isPreTag = function (tag) { return tag === 'pre'; };
  1968. var isReservedTag = function (tag) {
  1969. return isHTMLTag(tag) || isSVG(tag)
  1970. };
  1971. function getTagNamespace (tag) {
  1972. if (isSVG(tag)) {
  1973. return 'svg'
  1974. }
  1975. // basic support for MathML
  1976. // note it doesn't support other MathML elements being component roots
  1977. if (tag === 'math') {
  1978. return 'math'
  1979. }
  1980. }
  1981. var isTextInputType = makeMap('text,number,password,search,email,tel,url');
  1982. /* */
  1983. /* */
  1984. function renderClass$1 (node) {
  1985. var classList = genClassForVnode(node);
  1986. if (classList !== '') {
  1987. return (" class=\"" + (escape(classList)) + "\"")
  1988. }
  1989. }
  1990. /* */
  1991. var parseStyleText = cached(function (cssText) {
  1992. var res = {};
  1993. var listDelimiter = /;(?![^(]*\))/g;
  1994. var propertyDelimiter = /:(.+)/;
  1995. cssText.split(listDelimiter).forEach(function (item) {
  1996. if (item) {
  1997. var tmp = item.split(propertyDelimiter);
  1998. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  1999. }
  2000. });
  2001. return res
  2002. });
  2003. // merge static and dynamic style data on the same vnode
  2004. function normalizeStyleData (data) {
  2005. var style = normalizeStyleBinding(data.style);
  2006. // static style is pre-processed into an object during compilation
  2007. // and is always a fresh object, so it's safe to merge into it
  2008. return data.staticStyle
  2009. ? extend(data.staticStyle, style)
  2010. : style
  2011. }
  2012. // normalize possible array / string values into Object
  2013. function normalizeStyleBinding (bindingStyle) {
  2014. if (Array.isArray(bindingStyle)) {
  2015. return toObject(bindingStyle)
  2016. }
  2017. if (typeof bindingStyle === 'string') {
  2018. return parseStyleText(bindingStyle)
  2019. }
  2020. return bindingStyle
  2021. }
  2022. /**
  2023. * parent component style should be after child's
  2024. * so that parent component's style could override it
  2025. */
  2026. function getStyle (vnode, checkChild) {
  2027. var res = {};
  2028. var styleData;
  2029. if (checkChild) {
  2030. var childNode = vnode;
  2031. while (childNode.componentInstance) {
  2032. childNode = childNode.componentInstance._vnode;
  2033. if (
  2034. childNode && childNode.data &&
  2035. (styleData = normalizeStyleData(childNode.data))
  2036. ) {
  2037. extend(res, styleData);
  2038. }
  2039. }
  2040. }
  2041. if ((styleData = normalizeStyleData(vnode.data))) {
  2042. extend(res, styleData);
  2043. }
  2044. var parentNode = vnode;
  2045. while ((parentNode = parentNode.parent)) {
  2046. if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
  2047. extend(res, styleData);
  2048. }
  2049. }
  2050. return res
  2051. }
  2052. /* */
  2053. function genStyle (style) {
  2054. var styleText = '';
  2055. for (var key in style) {
  2056. var value = style[key];
  2057. var hyphenatedKey = hyphenate(key);
  2058. if (Array.isArray(value)) {
  2059. for (var i = 0, len = value.length; i < len; i++) {
  2060. styleText += normalizeValue(hyphenatedKey, value[i]);
  2061. }
  2062. } else {
  2063. styleText += normalizeValue(hyphenatedKey, value);
  2064. }
  2065. }
  2066. return styleText
  2067. }
  2068. function normalizeValue(key, value) {
  2069. if (
  2070. typeof value === 'string' ||
  2071. (typeof value === 'number' && noUnitNumericStyleProps[key]) ||
  2072. value === 0
  2073. ) {
  2074. return (key + ":" + value + ";")
  2075. } else {
  2076. // invalid values
  2077. return ""
  2078. }
  2079. }
  2080. function renderStyle (vnode) {
  2081. var styleText = genStyle(getStyle(vnode, false));
  2082. if (styleText !== '') {
  2083. return (" style=" + (JSON.stringify(escape(styleText))))
  2084. }
  2085. }
  2086. var modules = [
  2087. renderAttrs,
  2088. renderDOMProps,
  2089. renderClass$1,
  2090. renderStyle
  2091. ];
  2092. /* */
  2093. function show (node, dir) {
  2094. if (!dir.value) {
  2095. var style = node.data.style || (node.data.style = {});
  2096. if (Array.isArray(style)) {
  2097. style.push({ display: 'none' });
  2098. } else {
  2099. style.display = 'none';
  2100. }
  2101. }
  2102. }
  2103. /* */
  2104. // this is only applied for <select v-model> because it is the only edge case
  2105. // that must be done at runtime instead of compile time.
  2106. function model (node, dir) {
  2107. if (!node.children) { return }
  2108. var value = dir.value;
  2109. var isMultiple = node.data.attrs && node.data.attrs.multiple;
  2110. for (var i = 0, l = node.children.length; i < l; i++) {
  2111. var option = node.children[i];
  2112. if (option.tag === 'option') {
  2113. if (isMultiple) {
  2114. var selected =
  2115. Array.isArray(value) &&
  2116. (looseIndexOf(value, getValue(option)) > -1);
  2117. if (selected) {
  2118. setSelected(option);
  2119. }
  2120. } else {
  2121. if (looseEqual(value, getValue(option))) {
  2122. setSelected(option);
  2123. return
  2124. }
  2125. }
  2126. }
  2127. }
  2128. }
  2129. function getValue (option) {
  2130. var data = option.data || {};
  2131. return (
  2132. (data.attrs && data.attrs.value) ||
  2133. (data.domProps && data.domProps.value) ||
  2134. (option.children && option.children[0] && option.children[0].text)
  2135. )
  2136. }
  2137. function setSelected (option) {
  2138. var data = option.data || (option.data = {});
  2139. var attrs = data.attrs || (data.attrs = {});
  2140. attrs.selected = '';
  2141. }
  2142. var directives = {
  2143. show: show,
  2144. model: model
  2145. };
  2146. /* */
  2147. var isUnaryTag = makeMap(
  2148. 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
  2149. 'link,meta,param,source,track,wbr'
  2150. );
  2151. // Elements that you can, intentionally, leave open
  2152. // (and which close themselves)
  2153. var canBeLeftOpenTag = makeMap(
  2154. 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source'
  2155. );
  2156. // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
  2157. // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
  2158. var isNonPhrasingTag = makeMap(
  2159. 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
  2160. 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
  2161. 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
  2162. 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
  2163. 'title,tr,track'
  2164. );
  2165. /* */
  2166. var MAX_STACK_DEPTH = 800;
  2167. var noop$1 = function (_) { return _; };
  2168. var defer = typeof process !== 'undefined' && process.nextTick
  2169. ? process.nextTick
  2170. : typeof Promise !== 'undefined'
  2171. ? function (fn) { return Promise.resolve().then(fn); }
  2172. : typeof setTimeout !== 'undefined'
  2173. ? setTimeout
  2174. : noop$1;
  2175. if (defer === noop$1) {
  2176. throw new Error(
  2177. 'Your JavaScript runtime does not support any asynchronous primitives ' +
  2178. 'that are required by vue-server-renderer. Please use a polyfill for ' +
  2179. 'either Promise or setTimeout.'
  2180. )
  2181. }
  2182. function createWriteFunction (
  2183. write,
  2184. onError
  2185. ) {
  2186. var stackDepth = 0;
  2187. var cachedWrite = function (text, next) {
  2188. if (text && cachedWrite.caching) {
  2189. cachedWrite.cacheBuffer[cachedWrite.cacheBuffer.length - 1] += text;
  2190. }
  2191. var waitForNext = write(text, next);
  2192. if (waitForNext !== true) {
  2193. if (stackDepth >= MAX_STACK_DEPTH) {
  2194. defer(function () {
  2195. try { next(); } catch (e) {
  2196. onError(e);
  2197. }
  2198. });
  2199. } else {
  2200. stackDepth++;
  2201. next();
  2202. stackDepth--;
  2203. }
  2204. }
  2205. };
  2206. cachedWrite.caching = false;
  2207. cachedWrite.cacheBuffer = [];
  2208. cachedWrite.componentBuffer = [];
  2209. return cachedWrite
  2210. }
  2211. /* */
  2212. var RenderContext = function RenderContext (options) {
  2213. this.userContext = options.userContext;
  2214. this.activeInstance = options.activeInstance;
  2215. this.renderStates = [];
  2216. this.write = options.write;
  2217. this.done = options.done;
  2218. this.renderNode = options.renderNode;
  2219. this.isUnaryTag = options.isUnaryTag;
  2220. this.modules = options.modules;
  2221. this.directives = options.directives;
  2222. var cache = options.cache;
  2223. if (cache && (!cache.get || !cache.set)) {
  2224. throw new Error('renderer cache must implement at least get & set.')
  2225. }
  2226. this.cache = cache;
  2227. this.get = cache && normalizeAsync(cache, 'get');
  2228. this.has = cache && normalizeAsync(cache, 'has');
  2229. this.next = this.next.bind(this);
  2230. };
  2231. RenderContext.prototype.next = function next () {
  2232. // eslint-disable-next-line
  2233. while (true) {
  2234. var lastState = this.renderStates[this.renderStates.length - 1];
  2235. if (isUndef(lastState)) {
  2236. return this.done()
  2237. }
  2238. /* eslint-disable no-case-declarations */
  2239. switch (lastState.type) {
  2240. case 'Element':
  2241. case 'Fragment':
  2242. var children = lastState.children;
  2243. var total = lastState.total;
  2244. var rendered = lastState.rendered++;
  2245. if (rendered < total) {
  2246. return this.renderNode(children[rendered], false, this)
  2247. } else {
  2248. this.renderStates.pop();
  2249. if (lastState.type === 'Element') {
  2250. return this.write(lastState.endTag, this.next)
  2251. }
  2252. }
  2253. break
  2254. case 'Component':
  2255. this.renderStates.pop();
  2256. this.activeInstance = lastState.prevActive;
  2257. break
  2258. case 'ComponentWithCache':
  2259. this.renderStates.pop();
  2260. var buffer = lastState.buffer;
  2261. var bufferIndex = lastState.bufferIndex;
  2262. var componentBuffer = lastState.componentBuffer;
  2263. var key = lastState.key;
  2264. var result = {
  2265. html: buffer[bufferIndex],
  2266. components: componentBuffer[bufferIndex]
  2267. };
  2268. this.cache.set(key, result);
  2269. if (bufferIndex === 0) {
  2270. // this is a top-level cached component,
  2271. // exit caching mode.
  2272. this.write.caching = false;
  2273. } else {
  2274. // parent component is also being cached,
  2275. // merge self into parent's result
  2276. buffer[bufferIndex - 1] += result.html;
  2277. var prev = componentBuffer[bufferIndex - 1];
  2278. result.components.forEach(function (c) { return prev.add(c); });
  2279. }
  2280. buffer.length = bufferIndex;
  2281. componentBuffer.length = bufferIndex;
  2282. break
  2283. }
  2284. }
  2285. };
  2286. function normalizeAsync (cache, method) {
  2287. var fn = cache[method];
  2288. if (isUndef(fn)) {
  2289. return
  2290. } else if (fn.length > 1) {
  2291. return function (key, cb) { return fn.call(cache, key, cb); }
  2292. } else {
  2293. return function (key, cb) { return cb(fn.call(cache, key)); }
  2294. }
  2295. }
  2296. /* */
  2297. var validDivisionCharRE = /[\w).+\-_$\]]/;
  2298. function parseFilters (exp) {
  2299. var inSingle = false;
  2300. var inDouble = false;
  2301. var inTemplateString = false;
  2302. var inRegex = false;
  2303. var curly = 0;
  2304. var square = 0;
  2305. var paren = 0;
  2306. var lastFilterIndex = 0;
  2307. var c, prev, i, expression, filters;
  2308. for (i = 0; i < exp.length; i++) {
  2309. prev = c;
  2310. c = exp.charCodeAt(i);
  2311. if (inSingle) {
  2312. if (c === 0x27 && prev !== 0x5C) { inSingle = false; }
  2313. } else if (inDouble) {
  2314. if (c === 0x22 && prev !== 0x5C) { inDouble = false; }
  2315. } else if (inTemplateString) {
  2316. if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }
  2317. } else if (inRegex) {
  2318. if (c === 0x2f && prev !== 0x5C) { inRegex = false; }
  2319. } else if (
  2320. c === 0x7C && // pipe
  2321. exp.charCodeAt(i + 1) !== 0x7C &&
  2322. exp.charCodeAt(i - 1) !== 0x7C &&
  2323. !curly && !square && !paren
  2324. ) {
  2325. if (expression === undefined) {
  2326. // first filter, end of expression
  2327. lastFilterIndex = i + 1;
  2328. expression = exp.slice(0, i).trim();
  2329. } else {
  2330. pushFilter();
  2331. }
  2332. } else {
  2333. switch (c) {
  2334. case 0x22: inDouble = true; break // "
  2335. case 0x27: inSingle = true; break // '
  2336. case 0x60: inTemplateString = true; break // `
  2337. case 0x28: paren++; break // (
  2338. case 0x29: paren--; break // )
  2339. case 0x5B: square++; break // [
  2340. case 0x5D: square--; break // ]
  2341. case 0x7B: curly++; break // {
  2342. case 0x7D: curly--; break // }
  2343. }
  2344. if (c === 0x2f) { // /
  2345. var j = i - 1;
  2346. var p = (void 0);
  2347. // find first non-whitespace prev char
  2348. for (; j >= 0; j--) {
  2349. p = exp.charAt(j);
  2350. if (p !== ' ') { break }
  2351. }
  2352. if (!p || !validDivisionCharRE.test(p)) {
  2353. inRegex = true;
  2354. }
  2355. }
  2356. }
  2357. }
  2358. if (expression === undefined) {
  2359. expression = exp.slice(0, i).trim();
  2360. } else if (lastFilterIndex !== 0) {
  2361. pushFilter();
  2362. }
  2363. function pushFilter () {
  2364. (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
  2365. lastFilterIndex = i + 1;
  2366. }
  2367. if (filters) {
  2368. for (i = 0; i < filters.length; i++) {
  2369. expression = wrapFilter(expression, filters[i]);
  2370. }
  2371. }
  2372. return expression
  2373. }
  2374. function wrapFilter (exp, filter) {
  2375. var i = filter.indexOf('(');
  2376. if (i < 0) {
  2377. // _f: resolveFilter
  2378. return ("_f(\"" + filter + "\")(" + exp + ")")
  2379. } else {
  2380. var name = filter.slice(0, i);
  2381. var args = filter.slice(i + 1);
  2382. return ("_f(\"" + name + "\")(" + exp + (args !== ')' ? ',' + args : args))
  2383. }
  2384. }
  2385. /* */
  2386. var defaultTagRE = /\{\{((?:.|\r?\n)+?)\}\}/g;
  2387. var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
  2388. var buildRegex = cached(function (delimiters) {
  2389. var open = delimiters[0].replace(regexEscapeRE, '\\$&');
  2390. var close = delimiters[1].replace(regexEscapeRE, '\\$&');
  2391. return new RegExp(open + '((?:.|\\n)+?)' + close, 'g')
  2392. });
  2393. function parseText (
  2394. text,
  2395. delimiters
  2396. ) {
  2397. var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
  2398. if (!tagRE.test(text)) {
  2399. return
  2400. }
  2401. var tokens = [];
  2402. var rawTokens = [];
  2403. var lastIndex = tagRE.lastIndex = 0;
  2404. var match, index, tokenValue;
  2405. while ((match = tagRE.exec(text))) {
  2406. index = match.index;
  2407. // push text token
  2408. if (index > lastIndex) {
  2409. rawTokens.push(tokenValue = text.slice(lastIndex, index));
  2410. tokens.push(JSON.stringify(tokenValue));
  2411. }
  2412. // tag token
  2413. var exp = parseFilters(match[1].trim());
  2414. tokens.push(("_s(" + exp + ")"));
  2415. rawTokens.push({ '@binding': exp });
  2416. lastIndex = index + match[0].length;
  2417. }
  2418. if (lastIndex < text.length) {
  2419. rawTokens.push(tokenValue = text.slice(lastIndex));
  2420. tokens.push(JSON.stringify(tokenValue));
  2421. }
  2422. return {
  2423. expression: tokens.join('+'),
  2424. tokens: rawTokens
  2425. }
  2426. }
  2427. /* */
  2428. /* eslint-disable no-unused-vars */
  2429. function baseWarn (msg, range) {
  2430. console.error(("[Vue compiler]: " + msg));
  2431. }
  2432. /* eslint-enable no-unused-vars */
  2433. function pluckModuleFunction (
  2434. modules,
  2435. key
  2436. ) {
  2437. return modules
  2438. ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })
  2439. : []
  2440. }
  2441. function addProp (el, name, value, range, dynamic) {
  2442. (el.props || (el.props = [])).push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
  2443. el.plain = false;
  2444. }
  2445. function addAttr (el, name, value, range, dynamic) {
  2446. var attrs = dynamic
  2447. ? (el.dynamicAttrs || (el.dynamicAttrs = []))
  2448. : (el.attrs || (el.attrs = []));
  2449. attrs.push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
  2450. el.plain = false;
  2451. }
  2452. // add a raw attr (use this in preTransforms)
  2453. function addRawAttr (el, name, value, range) {
  2454. el.attrsMap[name] = value;
  2455. el.attrsList.push(rangeSetItem({ name: name, value: value }, range));
  2456. }
  2457. function addDirective (
  2458. el,
  2459. name,
  2460. rawName,
  2461. value,
  2462. arg,
  2463. isDynamicArg,
  2464. modifiers,
  2465. range
  2466. ) {
  2467. (el.directives || (el.directives = [])).push(rangeSetItem({
  2468. name: name,
  2469. rawName: rawName,
  2470. value: value,
  2471. arg: arg,
  2472. isDynamicArg: isDynamicArg,
  2473. modifiers: modifiers
  2474. }, range));
  2475. el.plain = false;
  2476. }
  2477. function prependModifierMarker (symbol, name, dynamic) {
  2478. return dynamic
  2479. ? ("_p(" + name + ",\"" + symbol + "\")")
  2480. : symbol + name // mark the event as captured
  2481. }
  2482. function addHandler (
  2483. el,
  2484. name,
  2485. value,
  2486. modifiers,
  2487. important,
  2488. warn,
  2489. range,
  2490. dynamic
  2491. ) {
  2492. modifiers = modifiers || emptyObject;
  2493. // warn prevent and passive modifier
  2494. /* istanbul ignore if */
  2495. if (
  2496. warn &&
  2497. modifiers.prevent && modifiers.passive
  2498. ) {
  2499. warn(
  2500. 'passive and prevent can\'t be used together. ' +
  2501. 'Passive handler can\'t prevent default event.',
  2502. range
  2503. );
  2504. }
  2505. // normalize click.right and click.middle since they don't actually fire
  2506. // this is technically browser-specific, but at least for now browsers are
  2507. // the only target envs that have right/middle clicks.
  2508. if (modifiers.right) {
  2509. if (dynamic) {
  2510. name = "(" + name + ")==='click'?'contextmenu':(" + name + ")";
  2511. } else if (name === 'click') {
  2512. name = 'contextmenu';
  2513. delete modifiers.right;
  2514. }
  2515. } else if (modifiers.middle) {
  2516. if (dynamic) {
  2517. name = "(" + name + ")==='click'?'mouseup':(" + name + ")";
  2518. } else if (name === 'click') {
  2519. name = 'mouseup';
  2520. }
  2521. }
  2522. // check capture modifier
  2523. if (modifiers.capture) {
  2524. delete modifiers.capture;
  2525. name = prependModifierMarker('!', name, dynamic);
  2526. }
  2527. if (modifiers.once) {
  2528. delete modifiers.once;
  2529. name = prependModifierMarker('~', name, dynamic);
  2530. }
  2531. /* istanbul ignore if */
  2532. if (modifiers.passive) {
  2533. delete modifiers.passive;
  2534. name = prependModifierMarker('&', name, dynamic);
  2535. }
  2536. var events;
  2537. if (modifiers.native) {
  2538. delete modifiers.native;
  2539. events = el.nativeEvents || (el.nativeEvents = {});
  2540. } else {
  2541. events = el.events || (el.events = {});
  2542. }
  2543. var newHandler = rangeSetItem({ value: value.trim(), dynamic: dynamic }, range);
  2544. if (modifiers !== emptyObject) {
  2545. newHandler.modifiers = modifiers;
  2546. }
  2547. var handlers = events[name];
  2548. /* istanbul ignore if */
  2549. if (Array.isArray(handlers)) {
  2550. important ? handlers.unshift(newHandler) : handlers.push(newHandler);
  2551. } else if (handlers) {
  2552. events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
  2553. } else {
  2554. events[name] = newHandler;
  2555. }
  2556. el.plain = false;
  2557. }
  2558. function getRawBindingAttr (
  2559. el,
  2560. name
  2561. ) {
  2562. return el.rawAttrsMap[':' + name] ||
  2563. el.rawAttrsMap['v-bind:' + name] ||
  2564. el.rawAttrsMap[name]
  2565. }
  2566. function getBindingAttr (
  2567. el,
  2568. name,
  2569. getStatic
  2570. ) {
  2571. var dynamicValue =
  2572. getAndRemoveAttr(el, ':' + name) ||
  2573. getAndRemoveAttr(el, 'v-bind:' + name);
  2574. if (dynamicValue != null) {
  2575. return parseFilters(dynamicValue)
  2576. } else if (getStatic !== false) {
  2577. var staticValue = getAndRemoveAttr(el, name);
  2578. if (staticValue != null) {
  2579. return JSON.stringify(staticValue)
  2580. }
  2581. }
  2582. }
  2583. // note: this only removes the attr from the Array (attrsList) so that it
  2584. // doesn't get processed by processAttrs.
  2585. // By default it does NOT remove it from the map (attrsMap) because the map is
  2586. // needed during codegen.
  2587. function getAndRemoveAttr (
  2588. el,
  2589. name,
  2590. removeFromMap
  2591. ) {
  2592. var val;
  2593. if ((val = el.attrsMap[name]) != null) {
  2594. var list = el.attrsList;
  2595. for (var i = 0, l = list.length; i < l; i++) {
  2596. if (list[i].name === name) {
  2597. list.splice(i, 1);
  2598. break
  2599. }
  2600. }
  2601. }
  2602. if (removeFromMap) {
  2603. delete el.attrsMap[name];
  2604. }
  2605. return val
  2606. }
  2607. function getAndRemoveAttrByRegex (
  2608. el,
  2609. name
  2610. ) {
  2611. var list = el.attrsList;
  2612. for (var i = 0, l = list.length; i < l; i++) {
  2613. var attr = list[i];
  2614. if (name.test(attr.name)) {
  2615. list.splice(i, 1);
  2616. return attr
  2617. }
  2618. }
  2619. }
  2620. function rangeSetItem (
  2621. item,
  2622. range
  2623. ) {
  2624. if (range) {
  2625. if (range.start != null) {
  2626. item.start = range.start;
  2627. }
  2628. if (range.end != null) {
  2629. item.end = range.end;
  2630. }
  2631. }
  2632. return item
  2633. }
  2634. /* */
  2635. function transformNode (el, options) {
  2636. var warn = options.warn || baseWarn;
  2637. var staticClass = getAndRemoveAttr(el, 'class');
  2638. if (staticClass) {
  2639. var res = parseText(staticClass, options.delimiters);
  2640. if (res) {
  2641. warn(
  2642. "class=\"" + staticClass + "\": " +
  2643. 'Interpolation inside attributes has been removed. ' +
  2644. 'Use v-bind or the colon shorthand instead. For example, ' +
  2645. 'instead of <div class="{{ val }}">, use <div :class="val">.',
  2646. el.rawAttrsMap['class']
  2647. );
  2648. }
  2649. }
  2650. if (staticClass) {
  2651. el.staticClass = JSON.stringify(staticClass);
  2652. }
  2653. var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
  2654. if (classBinding) {
  2655. el.classBinding = classBinding;
  2656. }
  2657. }
  2658. function genData (el) {
  2659. var data = '';
  2660. if (el.staticClass) {
  2661. data += "staticClass:" + (el.staticClass) + ",";
  2662. }
  2663. if (el.classBinding) {
  2664. data += "class:" + (el.classBinding) + ",";
  2665. }
  2666. return data
  2667. }
  2668. var klass = {
  2669. staticKeys: ['staticClass'],
  2670. transformNode: transformNode,
  2671. genData: genData
  2672. };
  2673. /* */
  2674. function transformNode$1 (el, options) {
  2675. var warn = options.warn || baseWarn;
  2676. var staticStyle = getAndRemoveAttr(el, 'style');
  2677. if (staticStyle) {
  2678. /* istanbul ignore if */
  2679. {
  2680. var res = parseText(staticStyle, options.delimiters);
  2681. if (res) {
  2682. warn(
  2683. "style=\"" + staticStyle + "\": " +
  2684. 'Interpolation inside attributes has been removed. ' +
  2685. 'Use v-bind or the colon shorthand instead. For example, ' +
  2686. 'instead of <div style="{{ val }}">, use <div :style="val">.',
  2687. el.rawAttrsMap['style']
  2688. );
  2689. }
  2690. }
  2691. el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
  2692. }
  2693. var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
  2694. if (styleBinding) {
  2695. el.styleBinding = styleBinding;
  2696. }
  2697. }
  2698. function genData$1 (el) {
  2699. var data = '';
  2700. if (el.staticStyle) {
  2701. data += "staticStyle:" + (el.staticStyle) + ",";
  2702. }
  2703. if (el.styleBinding) {
  2704. data += "style:(" + (el.styleBinding) + "),";
  2705. }
  2706. return data
  2707. }
  2708. var style = {
  2709. staticKeys: ['staticStyle'],
  2710. transformNode: transformNode$1,
  2711. genData: genData$1
  2712. };
  2713. var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  2714. function createCommonjsModule(fn, module) {
  2715. return module = { exports: {} }, fn(module, module.exports), module.exports;
  2716. }
  2717. var he = createCommonjsModule(function (module, exports) {
  2718. (function(root) {
  2719. // Detect free variables `exports`.
  2720. var freeExports = exports;
  2721. // Detect free variable `module`.
  2722. var freeModule = module &&
  2723. module.exports == freeExports && module;
  2724. // Detect free variable `global`, from Node.js or Browserified code,
  2725. // and use it as `root`.
  2726. var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal;
  2727. if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
  2728. root = freeGlobal;
  2729. }
  2730. /*--------------------------------------------------------------------------*/
  2731. // All astral symbols.
  2732. var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
  2733. // All ASCII symbols (not just printable ASCII) except those listed in the
  2734. // first column of the overrides table.
  2735. // https://html.spec.whatwg.org/multipage/syntax.html#table-charref-overrides
  2736. var regexAsciiWhitelist = /[\x01-\x7F]/g;
  2737. // All BMP symbols that are not ASCII newlines, printable ASCII symbols, or
  2738. // code points listed in the first column of the overrides table on
  2739. // https://html.spec.whatwg.org/multipage/syntax.html#table-charref-overrides.
  2740. var regexBmpWhitelist = /[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g;
  2741. var regexEncodeNonAscii = /<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g;
  2742. var encodeMap = {'\xAD':'shy','\u200C':'zwnj','\u200D':'zwj','\u200E':'lrm','\u2063':'ic','\u2062':'it','\u2061':'af','\u200F':'rlm','\u200B':'ZeroWidthSpace','\u2060':'NoBreak','\u0311':'DownBreve','\u20DB':'tdot','\u20DC':'DotDot','\t':'Tab','\n':'NewLine','\u2008':'puncsp','\u205F':'MediumSpace','\u2009':'thinsp','\u200A':'hairsp','\u2004':'emsp13','\u2002':'ensp','\u2005':'emsp14','\u2003':'emsp','\u2007':'numsp','\xA0':'nbsp','\u205F\u200A':'ThickSpace','\u203E':'oline','_':'lowbar','\u2010':'dash','\u2013':'ndash','\u2014':'mdash','\u2015':'horbar',',':'comma',';':'semi','\u204F':'bsemi',':':'colon','\u2A74':'Colone','!':'excl','\xA1':'iexcl','?':'quest','\xBF':'iquest','.':'period','\u2025':'nldr','\u2026':'mldr','\xB7':'middot','\'':'apos','\u2018':'lsquo','\u2019':'rsquo','\u201A':'sbquo','\u2039':'lsaquo','\u203A':'rsaquo','"':'quot','\u201C':'ldquo','\u201D':'rdquo','\u201E':'bdquo','\xAB':'laquo','\xBB':'raquo','(':'lpar',')':'rpar','[':'lsqb',']':'rsqb','{':'lcub','}':'rcub','\u2308':'lceil','\u2309':'rceil','\u230A':'lfloor','\u230B':'rfloor','\u2985':'lopar','\u2986':'ropar','\u298B':'lbrke','\u298C':'rbrke','\u298D':'lbrkslu','\u298E':'rbrksld','\u298F':'lbrksld','\u2990':'rbrkslu','\u2991':'langd','\u2992':'rangd','\u2993':'lparlt','\u2994':'rpargt','\u2995':'gtlPar','\u2996':'ltrPar','\u27E6':'lobrk','\u27E7':'robrk','\u27E8':'lang','\u27E9':'rang','\u27EA':'Lang','\u27EB':'Rang','\u27EC':'loang','\u27ED':'roang','\u2772':'lbbrk','\u2773':'rbbrk','\u2016':'Vert','\xA7':'sect','\xB6':'para','@':'commat','*':'ast','/':'sol','undefined':null,'&':'amp','#':'num','%':'percnt','\u2030':'permil','\u2031':'pertenk','\u2020':'dagger','\u2021':'Dagger','\u2022':'bull','\u2043':'hybull','\u2032':'prime','\u2033':'Prime','\u2034':'tprime','\u2057':'qprime','\u2035':'bprime','\u2041':'caret','`':'grave','\xB4':'acute','\u02DC':'tilde','^':'Hat','\xAF':'macr','\u02D8':'breve','\u02D9':'dot','\xA8':'die','\u02DA':'ring','\u02DD':'dblac','\xB8':'cedil','\u02DB':'ogon','\u02C6':'circ','\u02C7':'caron','\xB0':'deg','\xA9':'copy','\xAE':'reg','\u2117':'copysr','\u2118':'wp','\u211E':'rx','\u2127':'mho','\u2129':'iiota','\u2190':'larr','\u219A':'nlarr','\u2192':'rarr','\u219B':'nrarr','\u2191':'uarr','\u2193':'darr','\u2194':'harr','\u21AE':'nharr','\u2195':'varr','\u2196':'nwarr','\u2197':'nearr','\u2198':'searr','\u2199':'swarr','\u219D':'rarrw','\u219D\u0338':'nrarrw','\u219E':'Larr','\u219F':'Uarr','\u21A0':'Rarr','\u21A1':'Darr','\u21A2':'larrtl','\u21A3':'rarrtl','\u21A4':'mapstoleft','\u21A5':'mapstoup','\u21A6':'map','\u21A7':'mapstodown','\u21A9':'larrhk','\u21AA':'rarrhk','\u21AB':'larrlp','\u21AC':'rarrlp','\u21AD':'harrw','\u21B0':'lsh','\u21B1':'rsh','\u21B2':'ldsh','\u21B3':'rdsh','\u21B5':'crarr','\u21B6':'cularr','\u21B7':'curarr','\u21BA':'olarr','\u21BB':'orarr','\u21BC':'lharu','\u21BD':'lhard','\u21BE':'uharr','\u21BF':'uharl','\u21C0':'rharu','\u21C1':'rhard','\u21C2':'dharr','\u21C3':'dharl','\u21C4':'rlarr','\u21C5':'udarr','\u21C6':'lrarr','\u21C7':'llarr','\u21C8':'uuarr','\u21C9':'rrarr','\u21CA':'ddarr','\u21CB':'lrhar','\u21CC':'rlhar','\u21D0':'lArr','\u21CD':'nlArr','\u21D1':'uArr','\u21D2':'rArr','\u21CF':'nrArr','\u21D3':'dArr','\u21D4':'iff','\u21CE':'nhArr','\u21D5':'vArr','\u21D6':'nwArr','\u21D7':'neArr','\u21D8':'seArr','\u21D9':'swArr','\u21DA':'lAarr','\u21DB':'rAarr','\u21DD':'zigrarr','\u21E4':'larrb','\u21E5':'rarrb','\u21F5':'duarr','\u21FD':'loarr','\u21FE':'roarr','\u21FF':'hoarr','\u2200':'forall','\u2201':'comp','\u2202':'part','\u2202\u0338':'npart','\u2203':'exist','\u2204':'nexist','\u2205':'empty','\u2207':'Del','\u2208':'in','\u2209':'notin','\u220B':'ni','\u220C':'notni','\u03F6':'bepsi','\u220F':'prod','\u2210':'coprod','\u2211':'sum','+':'plus','\xB1':'pm','\xF7':'div','\xD7':'times','<':'lt','\u226E':'nlt','<\u20D2':'nvlt','=':'equals','\u2260':'ne','=\u20E5':'bne','\u2A75':'Equal','>':'gt','\u226F':'ngt','>\u20D2':'nvgt','\xAC':'not','|':'vert','\xA6':'brvbar','\u2212':'minus','\u2213':'mp','\u2214':'plusdo','\u2044':'frasl','\u2216':'setmn','\u2217':'lowast','\u2218':'compfn','\u221A':'Sqrt','\u221D':'prop','\u221E':'infin','\u221F':'angrt','\u2220':'ang','\u2220\u20D2':'nang','\u2221':'angmsd','\u2222':'angsph','\u2223':'mid','\u2224':'nmid','\u2225':'par','\u2226':'npar','\u2227':'and','\u2228':'or','\u2229':'cap','\u2229\uFE00':'caps','\u222A':'cup','\u222A\uFE00':'cups','\u222B':'int','\u222C':'Int','\u222D':'tint','\u2A0C':'qint','\u222E':'oint','\u222F':'Conint','\u2230':'Cconint','\u2231':'cwint','\u2232':'cwconint','\u2233':'awconint','\u2234':'there4','\u2235':'becaus','\u2236':'ratio','\u2237':'Colon','\u2238':'minusd','\u223A':'mDDot','\u223B':'homtht','\u223C':'sim','\u2241':'nsim','\u223C\u20D2':'nvsim','\u223D':'bsim','\u223D\u0331':'race','\u223E':'ac','\u223E\u0333':'acE','\u223F':'acd','\u2240':'wr','\u2242':'esim','\u2242\u0338':'nesim','\u2243':'sime','\u2244':'nsime','\u2245':'cong','\u2247':'ncong','\u2246':'simne','\u2248':'ap','\u2249':'nap','\u224A':'ape','\u224B':'apid','\u224B\u0338':'napid','\u224C':'bcong','\u224D':'CupCap','\u226D':'NotCupCap','\u224D\u20D2':'nvap','\u224E':'bump','\u224E\u0338':'nbump','\u224F':'bumpe','\u224F\u0338':'nbumpe','\u2250':'doteq','\u2250\u0338':'nedot','\u2251':'eDot','\u2252':'efDot','\u2253':'erDot','\u2254':'colone','\u2255':'ecolon','\u2256':'ecir','\u2257':'cire','\u2259':'wedgeq','\u225A':'veeeq','\u225C':'trie','\u225F':'equest','\u2261':'equiv','\u2262':'nequiv','\u2261\u20E5':'bnequiv','\u2264':'le','\u2270':'nle','\u2264\u20D2':'nvle','\u2265':'ge','\u2271':'nge','\u2265\u20D2':'nvge','\u2266':'lE','\u2266\u0338':'nlE','\u2267':'gE','\u2267\u0338':'ngE','\u2268\uFE00':'lvnE','\u2268':'lnE','\u2269':'gnE','\u2269\uFE00':'gvnE','\u226A':'ll','\u226A\u0338':'nLtv','\u226A\u20D2':'nLt','\u226B':'gg','\u226B\u0338':'nGtv','\u226B\u20D2':'nGt','\u226C':'twixt','\u2272':'lsim','\u2274':'nlsim','\u2273':'gsim','\u2275':'ngsim','\u2276':'lg','\u2278':'ntlg','\u2277':'gl','\u2279':'ntgl','\u227A':'pr','\u2280':'npr','\u227B':'sc','\u2281':'nsc','\u227C':'prcue','\u22E0':'nprcue','\u227D':'sccue','\u22E1':'nsccue','\u227E':'prsim','\u227F':'scsim','\u227F\u0338':'NotSucceedsTilde','\u2282':'sub','\u2284':'nsub','\u2282\u20D2':'vnsub','\u2283':'sup','\u2285':'nsup','\u2283\u20D2':'vnsup','\u2286':'sube','\u2288':'nsube','\u2287':'supe','\u2289':'nsupe','\u228A\uFE00':'vsubne','\u228A':'subne','\u228B\uFE00':'vsupne','\u228B':'supne','\u228D':'cupdot','\u228E':'uplus','\u228F':'sqsub','\u228F\u0338':'NotSquareSubset','\u2290':'sqsup','\u2290\u0338':'NotSquareSuperset','\u2291':'sqsube','\u22E2':'nsqsube','\u2292':'sqsupe','\u22E3':'nsqsupe','\u2293':'sqcap','\u2293\uFE00':'sqcaps','\u2294':'sqcup','\u2294\uFE00':'sqcups','\u2295':'oplus','\u2296':'ominus','\u2297':'otimes','\u2298':'osol','\u2299':'odot','\u229A':'ocir','\u229B':'oast','\u229D':'odash','\u229E':'plusb','\u229F':'minusb','\u22A0':'timesb','\u22A1':'sdotb','\u22A2':'vdash','\u22AC':'nvdash','\u22A3':'dashv','\u22A4':'top','\u22A5':'bot','\u22A7':'models','\u22A8':'vDash','\u22AD':'nvDash','\u22A9':'Vdash','\u22AE':'nVdash','\u22AA':'Vvdash','\u22AB':'VDash','\u22AF':'nVDash','\u22B0':'prurel','\u22B2':'vltri','\u22EA':'nltri','\u22B3':'vrtri','\u22EB':'nrtri','\u22B4':'ltrie','\u22EC':'nltrie','\u22B4\u20D2':'nvltrie','\u22B5':'rtrie','\u22ED':'nrtrie','\u22B5\u20D2':'nvrtrie','\u22B6':'origof','\u22B7':'imof','\u22B8':'mumap','\u22B9':'hercon','\u22BA':'intcal','\u22BB':'veebar','\u22BD':'barvee','\u22BE':'angrtvb','\u22BF':'lrtri','\u22C0':'Wedge','\u22C1':'Vee','\u22C2':'xcap','\u22C3':'xcup','\u22C4':'diam','\u22C5':'sdot','\u22C6':'Star','\u22C7':'divonx','\u22C8':'bowtie','\u22C9':'ltimes','\u22CA':'rtimes','\u22CB':'lthree','\u22CC':'rthree','\u22CD':'bsime','\u22CE':'cuvee','\u22CF':'cuwed','\u22D0':'Sub','\u22D1':'Sup','\u22D2':'Cap','\u22D3':'Cup','\u22D4':'fork','\u22D5':'epar','\u22D6':'ltdot','\u22D7':'gtdot','\u22D8':'Ll','\u22D8\u0338':'nLl','\u22D9':'Gg','\u22D9\u0338':'nGg','\u22DA\uFE00':'lesg','\u22DA':'leg','\u22DB':'gel','\u22DB\uFE00':'gesl','\u22DE':'cuepr','\u22DF':'cuesc','\u22E6':'lnsim','\u22E7':'gnsim','\u22E8':'prnsim','\u22E9':'scnsim','\u22EE':'vellip','\u22EF':'ctdot','\u22F0':'utdot','\u22F1':'dtdot','\u22F2':'disin','\u22F3':'isinsv','\u22F4':'isins','\u22F5':'isindot','\u22F5\u0338':'notindot','\u22F6':'notinvc','\u22F7':'notinvb','\u22F9':'isinE','\u22F9\u0338':'notinE','\u22FA':'nisd','\u22FB':'xnis','\u22FC':'nis','\u22FD':'notnivc','\u22FE':'notnivb','\u2305':'barwed','\u2306':'Barwed','\u230C':'drcrop','\u230D':'dlcrop','\u230E':'urcrop','\u230F':'ulcrop','\u2310':'bnot','\u2312':'profline','\u2313':'profsurf','\u2315':'telrec','\u2316':'target','\u231C':'ulcorn','\u231D':'urcorn','\u231E':'dlcorn','\u231F':'drcorn','\u2322':'frown','\u2323':'smile','\u232D':'cylcty','\u232E':'profalar','\u2336':'topbot','\u233D':'ovbar','\u233F':'solbar','\u237C':'angzarr','\u23B0':'lmoust','\u23B1':'rmoust','\u23B4':'tbrk','\u23B5':'bbrk','\u23B6':'bbrktbrk','\u23DC':'OverParenthesis','\u23DD':'UnderParenthesis','\u23DE':'OverBrace','\u23DF':'UnderBrace','\u23E2':'trpezium','\u23E7':'elinters','\u2423':'blank','\u2500':'boxh','\u2502':'boxv','\u250C':'boxdr','\u2510':'boxdl','\u2514':'boxur','\u2518':'boxul','\u251C':'boxvr','\u2524':'boxvl','\u252C':'boxhd','\u2534':'boxhu','\u253C':'boxvh','\u2550':'boxH','\u2551':'boxV','\u2552':'boxdR','\u2553':'boxDr','\u2554':'boxDR','\u2555':'boxdL','\u2556':'boxDl','\u2557':'boxDL','\u2558':'boxuR','\u2559':'boxUr','\u255A':'boxUR','\u255B':'boxuL','\u255C':'boxUl','\u255D':'boxUL','\u255E':'boxvR','\u255F':'boxVr','\u2560':'boxVR','\u2561':'boxvL','\u2562':'boxVl','\u2563':'boxVL','\u2564':'boxHd','\u2565':'boxhD','\u2566':'boxHD','\u2567':'boxHu','\u2568':'boxhU','\u2569':'boxHU','\u256A':'boxvH','\u256B':'boxVh','\u256C':'boxVH','\u2580':'uhblk','\u2584':'lhblk','\u2588':'block','\u2591':'blk14','\u2592':'blk12','\u2593':'blk34','\u25A1':'squ','\u25AA':'squf','\u25AB':'EmptyVerySmallSquare','\u25AD':'rect','\u25AE':'marker','\u25B1':'fltns','\u25B3':'xutri','\u25B4':'utrif','\u25B5':'utri','\u25B8':'rtrif','\u25B9':'rtri','\u25BD':'xdtri','\u25BE':'dtrif','\u25BF':'dtri','\u25C2':'ltrif','\u25C3':'ltri','\u25CA':'loz','\u25CB':'cir','\u25EC':'tridot','\u25EF':'xcirc','\u25F8':'ultri','\u25F9':'urtri','\u25FA':'lltri','\u25FB':'EmptySmallSquare','\u25FC':'FilledSmallSquare','\u2605':'starf','\u2606':'star','\u260E':'phone','\u2640':'female','\u2642':'male','\u2660':'spades','\u2663':'clubs','\u2665':'hearts','\u2666':'diams','\u266A':'sung','\u2713':'check','\u2717':'cross','\u2720':'malt','\u2736':'sext','\u2758':'VerticalSeparator','\u27C8':'bsolhsub','\u27C9':'suphsol','\u27F5':'xlarr','\u27F6':'xrarr','\u27F7':'xharr','\u27F8':'xlArr','\u27F9':'xrArr','\u27FA':'xhArr','\u27FC':'xmap','\u27FF':'dzigrarr','\u2902':'nvlArr','\u2903':'nvrArr','\u2904':'nvHarr','\u2905':'Map','\u290C':'lbarr','\u290D':'rbarr','\u290E':'lBarr','\u290F':'rBarr','\u2910':'RBarr','\u2911':'DDotrahd','\u2912':'UpArrowBar','\u2913':'DownArrowBar','\u2916':'Rarrtl','\u2919':'latail','\u291A':'ratail','\u291B':'lAtail','\u291C':'rAtail','\u291D':'larrfs','\u291E':'rarrfs','\u291F':'larrbfs','\u2920':'rarrbfs','\u2923':'nwarhk','\u2924':'nearhk','\u2925':'searhk','\u2926':'swarhk','\u2927':'nwnear','\u2928':'toea','\u2929':'tosa','\u292A':'swnwar','\u2933':'rarrc','\u2933\u0338':'nrarrc','\u2935':'cudarrr','\u2936':'ldca','\u2937':'rdca','\u2938':'cudarrl','\u2939':'larrpl','\u293C':'curarrm','\u293D':'cularrp','\u2945':'rarrpl','\u2948':'harrcir','\u2949':'Uarrocir','\u294A':'lurdshar','\u294B':'ldrushar','\u294E':'LeftRightVector','\u294F':'RightUpDownVector','\u2950':'DownLeftRightVector','\u2951':'LeftUpDownVector','\u2952':'LeftVectorBar','\u2953':'RightVectorBar','\u2954':'RightUpVectorBar','\u2955':'RightDownVectorBar','\u2956':'DownLeftVectorBar','\u2957':'DownRightVectorBar','\u2958':'LeftUpVectorBar','\u2959':'LeftDownVectorBar','\u295A':'LeftTeeVector','\u295B':'RightTeeVector','\u295C':'RightUpTeeVector','\u295D':'RightDownTeeVector','\u295E':'DownLeftTeeVector','\u295F':'DownRightTeeVector','\u2960':'LeftUpTeeVector','\u2961':'LeftDownTeeVector','\u2962':'lHar','\u2963':'uHar','\u2964':'rHar','\u2965':'dHar','\u2966':'luruhar','\u2967':'ldrdhar','\u2968':'ruluhar','\u2969':'rdldhar','\u296A':'lharul','\u296B':'llhard','\u296C':'rharul','\u296D':'lrhard','\u296E':'udhar','\u296F':'duhar','\u2970':'RoundImplies','\u2971':'erarr','\u2972':'simrarr','\u2973':'larrsim','\u2974':'rarrsim','\u2975':'rarrap','\u2976':'ltlarr','\u2978':'gtrarr','\u2979':'subrarr','\u297B':'suplarr','\u297C':'lfisht','\u297D':'rfisht','\u297E':'ufisht','\u297F':'dfisht','\u299A':'vzigzag','\u299C':'vangrt','\u299D':'angrtvbd','\u29A4':'ange','\u29A5':'range','\u29A6':'dwangle','\u29A7':'uwangle','\u29A8':'angmsdaa','\u29A9':'angmsdab','\u29AA':'angmsdac','\u29AB':'angmsdad','\u29AC':'angmsdae','\u29AD':'angmsdaf','\u29AE':'angmsdag','\u29AF':'angmsdah','\u29B0':'bemptyv','\u29B1':'demptyv','\u29B2':'cemptyv','\u29B3':'raemptyv','\u29B4':'laemptyv','\u29B5':'ohbar','\u29B6':'omid','\u29B7':'opar','\u29B9':'operp','\u29BB':'olcross','\u29BC':'odsold','\u29BE':'olcir','\u29BF':'ofcir','\u29C0':'olt','\u29C1':'ogt','\u29C2':'cirscir','\u29C3':'cirE','\u29C4':'solb','\u29C5':'bsolb','\u29C9':'boxbox','\u29CD':'trisb','\u29CE':'rtriltri','\u29CF':'LeftTriangleBar','\u29CF\u0338':'NotLeftTriangleBar','\u29D0':'RightTriangleBar','\u29D0\u0338':'NotRightTriangleBar','\u29DC':'iinfin','\u29DD':'infintie','\u29DE':'nvinfin','\u29E3':'eparsl','\u29E4':'smeparsl','\u29E5':'eqvparsl','\u29EB':'lozf','\u29F4':'RuleDelayed','\u29F6':'dsol','\u2A00':'xodot','\u2A01':'xoplus','\u2A02':'xotime','\u2A04':'xuplus','\u2A06':'xsqcup','\u2A0D':'fpartint','\u2A10':'cirfnint','\u2A11':'awint','\u2A12':'rppolint','\u2A13':'scpolint','\u2A14':'npolint','\u2A15':'pointint','\u2A16':'quatint','\u2A17':'intlarhk','\u2A22':'pluscir','\u2A23':'plusacir','\u2A24':'simplus','\u2A25':'plusdu','\u2A26':'plussim','\u2A27':'plustwo','\u2A29':'mcomma','\u2A2A':'minusdu','\u2A2D':'loplus','\u2A2E':'roplus','\u2A2F':'Cross','\u2A30':'timesd','\u2A31':'timesbar','\u2A33':'smashp','\u2A34':'lotimes','\u2A35':'rotimes','\u2A36':'otimesas','\u2A37':'Otimes','\u2A38':'odiv','\u2A39':'triplus','\u2A3A':'triminus','\u2A3B':'tritime','\u2A3C':'iprod','\u2A3F':'amalg','\u2A40':'capdot','\u2A42':'ncup','\u2A43':'ncap','\u2A44':'capand','\u2A45':'cupor','\u2A46':'cupcap','\u2A47':'capcup','\u2A48':'cupbrcap','\u2A49':'capbrcup','\u2A4A':'cupcup','\u2A4B':'capcap','\u2A4C':'ccups','\u2A4D':'ccaps','\u2A50':'ccupssm','\u2A53':'And','\u2A54':'Or','\u2A55':'andand','\u2A56':'oror','\u2A57':'orslope','\u2A58':'andslope','\u2A5A':'andv','\u2A5B':'orv','\u2A5C':'andd','\u2A5D':'ord','\u2A5F':'wedbar','\u2A66':'sdote','\u2A6A':'simdot','\u2A6D':'congdot','\u2A6D\u0338':'ncongdot','\u2A6E':'easter','\u2A6F':'apacir','\u2A70':'apE','\u2A70\u0338':'napE','\u2A71':'eplus','\u2A72':'pluse','\u2A73':'Esim','\u2A77':'eDDot','\u2A78':'equivDD','\u2A79':'ltcir','\u2A7A':'gtcir','\u2A7B':'ltquest','\u2A7C':'gtquest','\u2A7D':'les','\u2A7D\u0338':'nles','\u2A7E':'ges','\u2A7E\u0338':'nges','\u2A7F':'lesdot','\u2A80':'gesdot','\u2A81':'lesdoto','\u2A82':'gesdoto','\u2A83':'lesdotor','\u2A84':'gesdotol','\u2A85':'lap','\u2A86':'gap','\u2A87':'lne','\u2A88':'gne','\u2A89':'lnap','\u2A8A':'gnap','\u2A8B':'lEg','\u2A8C':'gEl','\u2A8D':'lsime','\u2A8E':'gsime','\u2A8F':'lsimg','\u2A90':'gsiml','\u2A91':'lgE','\u2A92':'glE','\u2A93':'lesges','\u2A94':'gesles','\u2A95':'els','\u2A96':'egs','\u2A97':'elsdot','\u2A98':'egsdot','\u2A99':'el','\u2A9A':'eg','\u2A9D':'siml','\u2A9E':'simg','\u2A9F':'simlE','\u2AA0':'simgE','\u2AA1':'LessLess','\u2AA1\u0338':'NotNestedLessLess','\u2AA2':'GreaterGreater','\u2AA2\u0338':'NotNestedGreaterGreater','\u2AA4':'glj','\u2AA5':'gla','\u2AA6':'ltcc','\u2AA7':'gtcc','\u2AA8':'lescc','\u2AA9':'gescc','\u2AAA':'smt','\u2AAB':'lat','\u2AAC':'smte','\u2AAC\uFE00':'smtes','\u2AAD':'late','\u2AAD\uFE00':'lates','\u2AAE':'bumpE','\u2AAF':'pre','\u2AAF\u0338':'npre','\u2AB0':'sce','\u2AB0\u0338':'nsce','\u2AB3':'prE','\u2AB4':'scE','\u2AB5':'prnE','\u2AB6':'scnE','\u2AB7':'prap','\u2AB8':'scap','\u2AB9':'prnap','\u2ABA':'scnap','\u2ABB':'Pr','\u2ABC':'Sc','\u2ABD':'subdot','\u2ABE':'supdot','\u2ABF':'subplus','\u2AC0':'supplus','\u2AC1':'submult','\u2AC2':'supmult','\u2AC3':'subedot','\u2AC4':'supedot','\u2AC5':'subE','\u2AC5\u0338':'nsubE','\u2AC6':'supE','\u2AC6\u0338':'nsupE','\u2AC7':'subsim','\u2AC8':'supsim','\u2ACB\uFE00':'vsubnE','\u2ACB':'subnE','\u2ACC\uFE00':'vsupnE','\u2ACC':'supnE','\u2ACF':'csub','\u2AD0':'csup','\u2AD1':'csube','\u2AD2':'csupe','\u2AD3':'subsup','\u2AD4':'supsub','\u2AD5':'subsub','\u2AD6':'supsup','\u2AD7':'suphsub','\u2AD8':'supdsub','\u2AD9':'forkv','\u2ADA':'topfork','\u2ADB':'mlcp','\u2AE4':'Dashv','\u2AE6':'Vdashl','\u2AE7':'Barv','\u2AE8':'vBar','\u2AE9':'vBarv','\u2AEB':'Vbar','\u2AEC':'Not','\u2AED':'bNot','\u2AEE':'rnmid','\u2AEF':'cirmid','\u2AF0':'midcir','\u2AF1':'topcir','\u2AF2':'nhpar','\u2AF3':'parsim','\u2AFD':'parsl','\u2AFD\u20E5':'nparsl','\u266D':'flat','\u266E':'natur','\u266F':'sharp','\xA4':'curren','\xA2':'cent','$':'dollar','\xA3':'pound','\xA5':'yen','\u20AC':'euro','\xB9':'sup1','\xBD':'half','\u2153':'frac13','\xBC':'frac14','\u2155':'frac15','\u2159':'frac16','\u215B':'frac18','\xB2':'sup2','\u2154':'frac23','\u2156':'frac25','\xB3':'sup3','\xBE':'frac34','\u2157':'frac35','\u215C':'frac38','\u2158':'frac45','\u215A':'frac56','\u215D':'frac58','\u215E':'frac78','\uD835\uDCB6':'ascr','\uD835\uDD52':'aopf','\uD835\uDD1E':'afr','\uD835\uDD38':'Aopf','\uD835\uDD04':'Afr','\uD835\uDC9C':'Ascr','\xAA':'ordf','\xE1':'aacute','\xC1':'Aacute','\xE0':'agrave','\xC0':'Agrave','\u0103':'abreve','\u0102':'Abreve','\xE2':'acirc','\xC2':'Acirc','\xE5':'aring','\xC5':'angst','\xE4':'auml','\xC4':'Auml','\xE3':'atilde','\xC3':'Atilde','\u0105':'aogon','\u0104':'Aogon','\u0101':'amacr','\u0100':'Amacr','\xE6':'aelig','\xC6':'AElig','\uD835\uDCB7':'bscr','\uD835\uDD53':'bopf','\uD835\uDD1F':'bfr','\uD835\uDD39':'Bopf','\u212C':'Bscr','\uD835\uDD05':'Bfr','\uD835\uDD20':'cfr','\uD835\uDCB8':'cscr','\uD835\uDD54':'copf','\u212D':'Cfr','\uD835\uDC9E':'Cscr','\u2102':'Copf','\u0107':'cacute','\u0106':'Cacute','\u0109':'ccirc','\u0108':'Ccirc','\u010D':'ccaron','\u010C':'Ccaron','\u010B':'cdot','\u010A':'Cdot','\xE7':'ccedil','\xC7':'Ccedil','\u2105':'incare','\uD835\uDD21':'dfr','\u2146':'dd','\uD835\uDD55':'dopf','\uD835\uDCB9':'dscr','\uD835\uDC9F':'Dscr','\uD835\uDD07':'Dfr','\u2145':'DD','\uD835\uDD3B':'Dopf','\u010F':'dcaron','\u010E':'Dcaron','\u0111':'dstrok','\u0110':'Dstrok','\xF0':'eth','\xD0':'ETH','\u2147':'ee','\u212F':'escr','\uD835\uDD22':'efr','\uD835\uDD56':'eopf','\u2130':'Escr','\uD835\uDD08':'Efr','\uD835\uDD3C':'Eopf','\xE9':'eacute','\xC9':'Eacute','\xE8':'egrave','\xC8':'Egrave','\xEA':'ecirc','\xCA':'Ecirc','\u011B':'ecaron','\u011A':'Ecaron','\xEB':'euml','\xCB':'Euml','\u0117':'edot','\u0116':'Edot','\u0119':'eogon','\u0118':'Eogon','\u0113':'emacr','\u0112':'Emacr','\uD835\uDD23':'ffr','\uD835\uDD57':'fopf','\uD835\uDCBB':'fscr','\uD835\uDD09':'Ffr','\uD835\uDD3D':'Fopf','\u2131':'Fscr','\uFB00':'fflig','\uFB03':'ffilig','\uFB04':'ffllig','\uFB01':'filig','fj':'fjlig','\uFB02':'fllig','\u0192':'fnof','\u210A':'gscr','\uD835\uDD58':'gopf','\uD835\uDD24':'gfr','\uD835\uDCA2':'Gscr','\uD835\uDD3E':'Gopf','\uD835\uDD0A':'Gfr','\u01F5':'gacute','\u011F':'gbreve','\u011E':'Gbreve','\u011D':'gcirc','\u011C':'Gcirc','\u0121':'gdot','\u0120':'Gdot','\u0122':'Gcedil','\uD835\uDD25':'hfr','\u210E':'planckh','\uD835\uDCBD':'hscr','\uD835\uDD59':'hopf','\u210B':'Hscr','\u210C':'Hfr','\u210D':'Hopf','\u0125':'hcirc','\u0124':'Hcirc','\u210F':'hbar','\u0127':'hstrok','\u0126':'Hstrok','\uD835\uDD5A':'iopf','\uD835\uDD26':'ifr','\uD835\uDCBE':'iscr','\u2148':'ii','\uD835\uDD40':'Iopf','\u2110':'Iscr','\u2111':'Im','\xED':'iacute','\xCD':'Iacute','\xEC':'igrave','\xCC':'Igrave','\xEE':'icirc','\xCE':'Icirc','\xEF':'iuml','\xCF':'Iuml','\u0129':'itilde','\u0128':'Itilde','\u0130':'Idot','\u012F':'iogon','\u012E':'Iogon','\u012B':'imacr','\u012A':'Imacr','\u0133':'ijlig','\u0132':'IJlig','\u0131':'imath','\uD835\uDCBF':'jscr','\uD835\uDD5B':'jopf','\uD835\uDD27':'jfr','\uD835\uDCA5':'Jscr','\uD835\uDD0D':'Jfr','\uD835\uDD41':'Jopf','\u0135':'jcirc','\u0134':'Jcirc','\u0237':'jmath','\uD835\uDD5C':'kopf','\uD835\uDCC0':'kscr','\uD835\uDD28':'kfr','\uD835\uDCA6':'Kscr','\uD835\uDD42':'Kopf','\uD835\uDD0E':'Kfr','\u0137':'kcedil','\u0136':'Kcedil','\uD835\uDD29':'lfr','\uD835\uDCC1':'lscr','\u2113':'ell','\uD835\uDD5D':'lopf','\u2112':'Lscr','\uD835\uDD0F':'Lfr','\uD835\uDD43':'Lopf','\u013A':'lacute','\u0139':'Lacute','\u013E':'lcaron','\u013D':'Lcaron','\u013C':'lcedil','\u013B':'Lcedil','\u0142':'lstrok','\u0141':'Lstrok','\u0140':'lmidot','\u013F':'Lmidot','\uD835\uDD2A':'mfr','\uD835\uDD5E':'mopf','\uD835\uDCC2':'mscr','\uD835\uDD10':'Mfr','\uD835\uDD44':'Mopf','\u2133':'Mscr','\uD835\uDD2B':'nfr','\uD835\uDD5F':'nopf','\uD835\uDCC3':'nscr','\u2115':'Nopf','\uD835\uDCA9':'Nscr','\uD835\uDD11':'Nfr','\u0144':'nacute','\u0143':'Nacute','\u0148':'ncaron','\u0147':'Ncaron','\xF1':'ntilde','\xD1':'Ntilde','\u0146':'ncedil','\u0145':'Ncedil','\u2116':'numero','\u014B':'eng','\u014A':'ENG','\uD835\uDD60':'oopf','\uD835\uDD2C':'ofr','\u2134':'oscr','\uD835\uDCAA':'Oscr','\uD835\uDD12':'Ofr','\uD835\uDD46':'Oopf','\xBA':'ordm','\xF3':'oacute','\xD3':'Oacute','\xF2':'ograve','\xD2':'Ograve','\xF4':'ocirc','\xD4':'Ocirc','\xF6':'ouml','\xD6':'Ouml','\u0151':'odblac','\u0150':'Odblac','\xF5':'otilde','\xD5':'Otilde','\xF8':'oslash','\xD8':'Oslash','\u014D':'omacr','\u014C':'Omacr','\u0153':'oelig','\u0152':'OElig','\uD835\uDD2D':'pfr','\uD835\uDCC5':'pscr','\uD835\uDD61':'popf','\u2119':'Popf','\uD835\uDD13':'Pfr','\uD835\uDCAB':'Pscr','\uD835\uDD62':'qopf','\uD835\uDD2E':'qfr','\uD835\uDCC6':'qscr','\uD835\uDCAC':'Qscr','\uD835\uDD14':'Qfr','\u211A':'Qopf','\u0138':'kgreen','\uD835\uDD2F':'rfr','\uD835\uDD63':'ropf','\uD835\uDCC7':'rscr','\u211B':'Rscr','\u211C':'Re','\u211D':'Ropf','\u0155':'racute','\u0154':'Racute','\u0159':'rcaron','\u0158':'Rcaron','\u0157':'rcedil','\u0156':'Rcedil','\uD835\uDD64':'sopf','\uD835\uDCC8':'sscr','\uD835\uDD30':'sfr','\uD835\uDD4A':'Sopf','\uD835\uDD16':'Sfr','\uD835\uDCAE':'Sscr','\u24C8':'oS','\u015B':'sacute','\u015A':'Sacute','\u015D':'scirc','\u015C':'Scirc','\u0161':'scaron','\u0160':'Scaron','\u015F':'scedil','\u015E':'Scedil','\xDF':'szlig','\uD835\uDD31':'tfr','\uD835\uDCC9':'tscr','\uD835\uDD65':'topf','\uD835\uDCAF':'Tscr','\uD835\uDD17':'Tfr','\uD835\uDD4B':'Topf','\u0165':'tcaron','\u0164':'Tcaron','\u0163':'tcedil','\u0162':'Tcedil','\u2122':'trade','\u0167':'tstrok','\u0166':'Tstrok','\uD835\uDCCA':'uscr','\uD835\uDD66':'uopf','\uD835\uDD32':'ufr','\uD835\uDD4C':'Uopf','\uD835\uDD18':'Ufr','\uD835\uDCB0':'Uscr','\xFA':'uacute','\xDA':'Uacute','\xF9':'ugrave','\xD9':'Ugrave','\u016D':'ubreve','\u016C':'Ubreve','\xFB':'ucirc','\xDB':'Ucirc','\u016F':'uring','\u016E':'Uring','\xFC':'uuml','\xDC':'Uuml','\u0171':'udblac','\u0170':'Udblac','\u0169':'utilde','\u0168':'Utilde','\u0173':'uogon','\u0172':'Uogon','\u016B':'umacr','\u016A':'Umacr','\uD835\uDD33':'vfr','\uD835\uDD67':'vopf','\uD835\uDCCB':'vscr','\uD835\uDD19':'Vfr','\uD835\uDD4D':'Vopf','\uD835\uDCB1':'Vscr','\uD835\uDD68':'wopf','\uD835\uDCCC':'wscr','\uD835\uDD34':'wfr','\uD835\uDCB2':'Wscr','\uD835\uDD4E':'Wopf','\uD835\uDD1A':'Wfr','\u0175':'wcirc','\u0174':'Wcirc','\uD835\uDD35':'xfr','\uD835\uDCCD':'xscr','\uD835\uDD69':'xopf','\uD835\uDD4F':'Xopf','\uD835\uDD1B':'Xfr','\uD835\uDCB3':'Xscr','\uD835\uDD36':'yfr','\uD835\uDCCE':'yscr','\uD835\uDD6A':'yopf','\uD835\uDCB4':'Yscr','\uD835\uDD1C':'Yfr','\uD835\uDD50':'Yopf','\xFD':'yacute','\xDD':'Yacute','\u0177':'ycirc','\u0176':'Ycirc','\xFF':'yuml','\u0178':'Yuml','\uD835\uDCCF':'zscr','\uD835\uDD37':'zfr','\uD835\uDD6B':'zopf','\u2128':'Zfr','\u2124':'Zopf','\uD835\uDCB5':'Zscr','\u017A':'zacute','\u0179':'Zacute','\u017E':'zcaron','\u017D':'Zcaron','\u017C':'zdot','\u017B':'Zdot','\u01B5':'imped','\xFE':'thorn','\xDE':'THORN','\u0149':'napos','\u03B1':'alpha','\u0391':'Alpha','\u03B2':'beta','\u0392':'Beta','\u03B3':'gamma','\u0393':'Gamma','\u03B4':'delta','\u0394':'Delta','\u03B5':'epsi','\u03F5':'epsiv','\u0395':'Epsilon','\u03DD':'gammad','\u03DC':'Gammad','\u03B6':'zeta','\u0396':'Zeta','\u03B7':'eta','\u0397':'Eta','\u03B8':'theta','\u03D1':'thetav','\u0398':'Theta','\u03B9':'iota','\u0399':'Iota','\u03BA':'kappa','\u03F0':'kappav','\u039A':'Kappa','\u03BB':'lambda','\u039B':'Lambda','\u03BC':'mu','\xB5':'micro','\u039C':'Mu','\u03BD':'nu','\u039D':'Nu','\u03BE':'xi','\u039E':'Xi','\u03BF':'omicron','\u039F':'Omicron','\u03C0':'pi','\u03D6':'piv','\u03A0':'Pi','\u03C1':'rho','\u03F1':'rhov','\u03A1':'Rho','\u03C3':'sigma','\u03A3':'Sigma','\u03C2':'sigmaf','\u03C4':'tau','\u03A4':'Tau','\u03C5':'upsi','\u03A5':'Upsilon','\u03D2':'Upsi','\u03C6':'phi','\u03D5':'phiv','\u03A6':'Phi','\u03C7':'chi','\u03A7':'Chi','\u03C8':'psi','\u03A8':'Psi','\u03C9':'omega','\u03A9':'ohm','\u0430':'acy','\u0410':'Acy','\u0431':'bcy','\u0411':'Bcy','\u0432':'vcy','\u0412':'Vcy','\u0433':'gcy','\u0413':'Gcy','\u0453':'gjcy','\u0403':'GJcy','\u0434':'dcy','\u0414':'Dcy','\u0452':'djcy','\u0402':'DJcy','\u0435':'iecy','\u0415':'IEcy','\u0451':'iocy','\u0401':'IOcy','\u0454':'jukcy','\u0404':'Jukcy','\u0436':'zhcy','\u0416':'ZHcy','\u0437':'zcy','\u0417':'Zcy','\u0455':'dscy','\u0405':'DScy','\u0438':'icy','\u0418':'Icy','\u0456':'iukcy','\u0406':'Iukcy','\u0457':'yicy','\u0407':'YIcy','\u0439':'jcy','\u0419':'Jcy','\u0458':'jsercy','\u0408':'Jsercy','\u043A':'kcy','\u041A':'Kcy','\u045C':'kjcy','\u040C':'KJcy','\u043B':'lcy','\u041B':'Lcy','\u0459':'ljcy','\u0409':'LJcy','\u043C':'mcy','\u041C':'Mcy','\u043D':'ncy','\u041D':'Ncy','\u045A':'njcy','\u040A':'NJcy','\u043E':'ocy','\u041E':'Ocy','\u043F':'pcy','\u041F':'Pcy','\u0440':'rcy','\u0420':'Rcy','\u0441':'scy','\u0421':'Scy','\u0442':'tcy','\u0422':'Tcy','\u045B':'tshcy','\u040B':'TSHcy','\u0443':'ucy','\u0423':'Ucy','\u045E':'ubrcy','\u040E':'Ubrcy','\u0444':'fcy','\u0424':'Fcy','\u0445':'khcy','\u0425':'KHcy','\u0446':'tscy','\u0426':'TScy','\u0447':'chcy','\u0427':'CHcy','\u045F':'dzcy','\u040F':'DZcy','\u0448':'shcy','\u0428':'SHcy','\u0449':'shchcy','\u0429':'SHCHcy','\u044A':'hardcy','\u042A':'HARDcy','\u044B':'ycy','\u042B':'Ycy','\u044C':'softcy','\u042C':'SOFTcy','\u044D':'ecy','\u042D':'Ecy','\u044E':'yucy','\u042E':'YUcy','\u044F':'yacy','\u042F':'YAcy','\u2135':'aleph','\u2136':'beth','\u2137':'gimel','\u2138':'daleth'};
  2743. var regexEscape = /["&'<>`]/g;
  2744. var escapeMap = {
  2745. '"': '&quot;',
  2746. '&': '&amp;',
  2747. '\'': '&#x27;',
  2748. '<': '&lt;',
  2749. // See https://mathiasbynens.be/notes/ambiguous-ampersands: in HTML, the
  2750. // following is not strictly necessary unless it’s part of a tag or an
  2751. // unquoted attribute value. We’re only escaping it to support those
  2752. // situations, and for XML support.
  2753. '>': '&gt;',
  2754. // In Internet Explorer ≤ 8, the backtick character can be used
  2755. // to break out of (un)quoted attribute values or HTML comments.
  2756. // See http://html5sec.org/#102, http://html5sec.org/#108, and
  2757. // http://html5sec.org/#133.
  2758. '`': '&#x60;'
  2759. };
  2760. var regexInvalidEntity = /&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/;
  2761. var regexInvalidRawCodePoint = /[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
  2762. var regexDecode = /&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g;
  2763. var decodeMap = {'aacute':'\xE1','Aacute':'\xC1','abreve':'\u0103','Abreve':'\u0102','ac':'\u223E','acd':'\u223F','acE':'\u223E\u0333','acirc':'\xE2','Acirc':'\xC2','acute':'\xB4','acy':'\u0430','Acy':'\u0410','aelig':'\xE6','AElig':'\xC6','af':'\u2061','afr':'\uD835\uDD1E','Afr':'\uD835\uDD04','agrave':'\xE0','Agrave':'\xC0','alefsym':'\u2135','aleph':'\u2135','alpha':'\u03B1','Alpha':'\u0391','amacr':'\u0101','Amacr':'\u0100','amalg':'\u2A3F','amp':'&','AMP':'&','and':'\u2227','And':'\u2A53','andand':'\u2A55','andd':'\u2A5C','andslope':'\u2A58','andv':'\u2A5A','ang':'\u2220','ange':'\u29A4','angle':'\u2220','angmsd':'\u2221','angmsdaa':'\u29A8','angmsdab':'\u29A9','angmsdac':'\u29AA','angmsdad':'\u29AB','angmsdae':'\u29AC','angmsdaf':'\u29AD','angmsdag':'\u29AE','angmsdah':'\u29AF','angrt':'\u221F','angrtvb':'\u22BE','angrtvbd':'\u299D','angsph':'\u2222','angst':'\xC5','angzarr':'\u237C','aogon':'\u0105','Aogon':'\u0104','aopf':'\uD835\uDD52','Aopf':'\uD835\uDD38','ap':'\u2248','apacir':'\u2A6F','ape':'\u224A','apE':'\u2A70','apid':'\u224B','apos':'\'','ApplyFunction':'\u2061','approx':'\u2248','approxeq':'\u224A','aring':'\xE5','Aring':'\xC5','ascr':'\uD835\uDCB6','Ascr':'\uD835\uDC9C','Assign':'\u2254','ast':'*','asymp':'\u2248','asympeq':'\u224D','atilde':'\xE3','Atilde':'\xC3','auml':'\xE4','Auml':'\xC4','awconint':'\u2233','awint':'\u2A11','backcong':'\u224C','backepsilon':'\u03F6','backprime':'\u2035','backsim':'\u223D','backsimeq':'\u22CD','Backslash':'\u2216','Barv':'\u2AE7','barvee':'\u22BD','barwed':'\u2305','Barwed':'\u2306','barwedge':'\u2305','bbrk':'\u23B5','bbrktbrk':'\u23B6','bcong':'\u224C','bcy':'\u0431','Bcy':'\u0411','bdquo':'\u201E','becaus':'\u2235','because':'\u2235','Because':'\u2235','bemptyv':'\u29B0','bepsi':'\u03F6','bernou':'\u212C','Bernoullis':'\u212C','beta':'\u03B2','Beta':'\u0392','beth':'\u2136','between':'\u226C','bfr':'\uD835\uDD1F','Bfr':'\uD835\uDD05','bigcap':'\u22C2','bigcirc':'\u25EF','bigcup':'\u22C3','bigodot':'\u2A00','bigoplus':'\u2A01','bigotimes':'\u2A02','bigsqcup':'\u2A06','bigstar':'\u2605','bigtriangledown':'\u25BD','bigtriangleup':'\u25B3','biguplus':'\u2A04','bigvee':'\u22C1','bigwedge':'\u22C0','bkarow':'\u290D','blacklozenge':'\u29EB','blacksquare':'\u25AA','blacktriangle':'\u25B4','blacktriangledown':'\u25BE','blacktriangleleft':'\u25C2','blacktriangleright':'\u25B8','blank':'\u2423','blk12':'\u2592','blk14':'\u2591','blk34':'\u2593','block':'\u2588','bne':'=\u20E5','bnequiv':'\u2261\u20E5','bnot':'\u2310','bNot':'\u2AED','bopf':'\uD835\uDD53','Bopf':'\uD835\uDD39','bot':'\u22A5','bottom':'\u22A5','bowtie':'\u22C8','boxbox':'\u29C9','boxdl':'\u2510','boxdL':'\u2555','boxDl':'\u2556','boxDL':'\u2557','boxdr':'\u250C','boxdR':'\u2552','boxDr':'\u2553','boxDR':'\u2554','boxh':'\u2500','boxH':'\u2550','boxhd':'\u252C','boxhD':'\u2565','boxHd':'\u2564','boxHD':'\u2566','boxhu':'\u2534','boxhU':'\u2568','boxHu':'\u2567','boxHU':'\u2569','boxminus':'\u229F','boxplus':'\u229E','boxtimes':'\u22A0','boxul':'\u2518','boxuL':'\u255B','boxUl':'\u255C','boxUL':'\u255D','boxur':'\u2514','boxuR':'\u2558','boxUr':'\u2559','boxUR':'\u255A','boxv':'\u2502','boxV':'\u2551','boxvh':'\u253C','boxvH':'\u256A','boxVh':'\u256B','boxVH':'\u256C','boxvl':'\u2524','boxvL':'\u2561','boxVl':'\u2562','boxVL':'\u2563','boxvr':'\u251C','boxvR':'\u255E','boxVr':'\u255F','boxVR':'\u2560','bprime':'\u2035','breve':'\u02D8','Breve':'\u02D8','brvbar':'\xA6','bscr':'\uD835\uDCB7','Bscr':'\u212C','bsemi':'\u204F','bsim':'\u223D','bsime':'\u22CD','bsol':'\\','bsolb':'\u29C5','bsolhsub':'\u27C8','bull':'\u2022','bullet':'\u2022','bump':'\u224E','bumpe':'\u224F','bumpE':'\u2AAE','bumpeq':'\u224F','Bumpeq':'\u224E','cacute':'\u0107','Cacute':'\u0106','cap':'\u2229','Cap':'\u22D2','capand':'\u2A44','capbrcup':'\u2A49','capcap':'\u2A4B','capcup':'\u2A47','capdot':'\u2A40','CapitalDifferentialD':'\u2145','caps':'\u2229\uFE00','caret':'\u2041','caron':'\u02C7','Cayleys':'\u212D','ccaps':'\u2A4D','ccaron':'\u010D','Ccaron':'\u010C','ccedil':'\xE7','Ccedil':'\xC7','ccirc':'\u0109','Ccirc':'\u0108','Cconint':'\u2230','ccups':'\u2A4C','ccupssm':'\u2A50','cdot':'\u010B','Cdot':'\u010A','cedil':'\xB8','Cedilla':'\xB8','cemptyv':'\u29B2','cent':'\xA2','centerdot':'\xB7','CenterDot':'\xB7','cfr':'\uD835\uDD20','Cfr':'\u212D','chcy':'\u0447','CHcy':'\u0427','check':'\u2713','checkmark':'\u2713','chi':'\u03C7','Chi':'\u03A7','cir':'\u25CB','circ':'\u02C6','circeq':'\u2257','circlearrowleft':'\u21BA','circlearrowright':'\u21BB','circledast':'\u229B','circledcirc':'\u229A','circleddash':'\u229D','CircleDot':'\u2299','circledR':'\xAE','circledS':'\u24C8','CircleMinus':'\u2296','CirclePlus':'\u2295','CircleTimes':'\u2297','cire':'\u2257','cirE':'\u29C3','cirfnint':'\u2A10','cirmid':'\u2AEF','cirscir':'\u29C2','ClockwiseContourIntegral':'\u2232','CloseCurlyDoubleQuote':'\u201D','CloseCurlyQuote':'\u2019','clubs':'\u2663','clubsuit':'\u2663','colon':':','Colon':'\u2237','colone':'\u2254','Colone':'\u2A74','coloneq':'\u2254','comma':',','commat':'@','comp':'\u2201','compfn':'\u2218','complement':'\u2201','complexes':'\u2102','cong':'\u2245','congdot':'\u2A6D','Congruent':'\u2261','conint':'\u222E','Conint':'\u222F','ContourIntegral':'\u222E','copf':'\uD835\uDD54','Copf':'\u2102','coprod':'\u2210','Coproduct':'\u2210','copy':'\xA9','COPY':'\xA9','copysr':'\u2117','CounterClockwiseContourIntegral':'\u2233','crarr':'\u21B5','cross':'\u2717','Cross':'\u2A2F','cscr':'\uD835\uDCB8','Cscr':'\uD835\uDC9E','csub':'\u2ACF','csube':'\u2AD1','csup':'\u2AD0','csupe':'\u2AD2','ctdot':'\u22EF','cudarrl':'\u2938','cudarrr':'\u2935','cuepr':'\u22DE','cuesc':'\u22DF','cularr':'\u21B6','cularrp':'\u293D','cup':'\u222A','Cup':'\u22D3','cupbrcap':'\u2A48','cupcap':'\u2A46','CupCap':'\u224D','cupcup':'\u2A4A','cupdot':'\u228D','cupor':'\u2A45','cups':'\u222A\uFE00','curarr':'\u21B7','curarrm':'\u293C','curlyeqprec':'\u22DE','curlyeqsucc':'\u22DF','curlyvee':'\u22CE','curlywedge':'\u22CF','curren':'\xA4','curvearrowleft':'\u21B6','curvearrowright':'\u21B7','cuvee':'\u22CE','cuwed':'\u22CF','cwconint':'\u2232','cwint':'\u2231','cylcty':'\u232D','dagger':'\u2020','Dagger':'\u2021','daleth':'\u2138','darr':'\u2193','dArr':'\u21D3','Darr':'\u21A1','dash':'\u2010','dashv':'\u22A3','Dashv':'\u2AE4','dbkarow':'\u290F','dblac':'\u02DD','dcaron':'\u010F','Dcaron':'\u010E','dcy':'\u0434','Dcy':'\u0414','dd':'\u2146','DD':'\u2145','ddagger':'\u2021','ddarr':'\u21CA','DDotrahd':'\u2911','ddotseq':'\u2A77','deg':'\xB0','Del':'\u2207','delta':'\u03B4','Delta':'\u0394','demptyv':'\u29B1','dfisht':'\u297F','dfr':'\uD835\uDD21','Dfr':'\uD835\uDD07','dHar':'\u2965','dharl':'\u21C3','dharr':'\u21C2','DiacriticalAcute':'\xB4','DiacriticalDot':'\u02D9','DiacriticalDoubleAcute':'\u02DD','DiacriticalGrave':'`','DiacriticalTilde':'\u02DC','diam':'\u22C4','diamond':'\u22C4','Diamond':'\u22C4','diamondsuit':'\u2666','diams':'\u2666','die':'\xA8','DifferentialD':'\u2146','digamma':'\u03DD','disin':'\u22F2','div':'\xF7','divide':'\xF7','divideontimes':'\u22C7','divonx':'\u22C7','djcy':'\u0452','DJcy':'\u0402','dlcorn':'\u231E','dlcrop':'\u230D','dollar':'$','dopf':'\uD835\uDD55','Dopf':'\uD835\uDD3B','dot':'\u02D9','Dot':'\xA8','DotDot':'\u20DC','doteq':'\u2250','doteqdot':'\u2251','DotEqual':'\u2250','dotminus':'\u2238','dotplus':'\u2214','dotsquare':'\u22A1','doublebarwedge':'\u2306','DoubleContourIntegral':'\u222F','DoubleDot':'\xA8','DoubleDownArrow':'\u21D3','DoubleLeftArrow':'\u21D0','DoubleLeftRightArrow':'\u21D4','DoubleLeftTee':'\u2AE4','DoubleLongLeftArrow':'\u27F8','DoubleLongLeftRightArrow':'\u27FA','DoubleLongRightArrow':'\u27F9','DoubleRightArrow':'\u21D2','DoubleRightTee':'\u22A8','DoubleUpArrow':'\u21D1','DoubleUpDownArrow':'\u21D5','DoubleVerticalBar':'\u2225','downarrow':'\u2193','Downarrow':'\u21D3','DownArrow':'\u2193','DownArrowBar':'\u2913','DownArrowUpArrow':'\u21F5','DownBreve':'\u0311','downdownarrows':'\u21CA','downharpoonleft':'\u21C3','downharpoonright':'\u21C2','DownLeftRightVector':'\u2950','DownLeftTeeVector':'\u295E','DownLeftVector':'\u21BD','DownLeftVectorBar':'\u2956','DownRightTeeVector':'\u295F','DownRightVector':'\u21C1','DownRightVectorBar':'\u2957','DownTee':'\u22A4','DownTeeArrow':'\u21A7','drbkarow':'\u2910','drcorn':'\u231F','drcrop':'\u230C','dscr':'\uD835\uDCB9','Dscr':'\uD835\uDC9F','dscy':'\u0455','DScy':'\u0405','dsol':'\u29F6','dstrok':'\u0111','Dstrok':'\u0110','dtdot':'\u22F1','dtri':'\u25BF','dtrif':'\u25BE','duarr':'\u21F5','duhar':'\u296F','dwangle':'\u29A6','dzcy':'\u045F','DZcy':'\u040F','dzigrarr':'\u27FF','eacute':'\xE9','Eacute':'\xC9','easter':'\u2A6E','ecaron':'\u011B','Ecaron':'\u011A','ecir':'\u2256','ecirc':'\xEA','Ecirc':'\xCA','ecolon':'\u2255','ecy':'\u044D','Ecy':'\u042D','eDDot':'\u2A77','edot':'\u0117','eDot':'\u2251','Edot':'\u0116','ee':'\u2147','efDot':'\u2252','efr':'\uD835\uDD22','Efr':'\uD835\uDD08','eg':'\u2A9A','egrave':'\xE8','Egrave':'\xC8','egs':'\u2A96','egsdot':'\u2A98','el':'\u2A99','Element':'\u2208','elinters':'\u23E7','ell':'\u2113','els':'\u2A95','elsdot':'\u2A97','emacr':'\u0113','Emacr':'\u0112','empty':'\u2205','emptyset':'\u2205','EmptySmallSquare':'\u25FB','emptyv':'\u2205','EmptyVerySmallSquare':'\u25AB','emsp':'\u2003','emsp13':'\u2004','emsp14':'\u2005','eng':'\u014B','ENG':'\u014A','ensp':'\u2002','eogon':'\u0119','Eogon':'\u0118','eopf':'\uD835\uDD56','Eopf':'\uD835\uDD3C','epar':'\u22D5','eparsl':'\u29E3','eplus':'\u2A71','epsi':'\u03B5','epsilon':'\u03B5','Epsilon':'\u0395','epsiv':'\u03F5','eqcirc':'\u2256','eqcolon':'\u2255','eqsim':'\u2242','eqslantgtr':'\u2A96','eqslantless':'\u2A95','Equal':'\u2A75','equals':'=','EqualTilde':'\u2242','equest':'\u225F','Equilibrium':'\u21CC','equiv':'\u2261','equivDD':'\u2A78','eqvparsl':'\u29E5','erarr':'\u2971','erDot':'\u2253','escr':'\u212F','Escr':'\u2130','esdot':'\u2250','esim':'\u2242','Esim':'\u2A73','eta':'\u03B7','Eta':'\u0397','eth':'\xF0','ETH':'\xD0','euml':'\xEB','Euml':'\xCB','euro':'\u20AC','excl':'!','exist':'\u2203','Exists':'\u2203','expectation':'\u2130','exponentiale':'\u2147','ExponentialE':'\u2147','fallingdotseq':'\u2252','fcy':'\u0444','Fcy':'\u0424','female':'\u2640','ffilig':'\uFB03','fflig':'\uFB00','ffllig':'\uFB04','ffr':'\uD835\uDD23','Ffr':'\uD835\uDD09','filig':'\uFB01','FilledSmallSquare':'\u25FC','FilledVerySmallSquare':'\u25AA','fjlig':'fj','flat':'\u266D','fllig':'\uFB02','fltns':'\u25B1','fnof':'\u0192','fopf':'\uD835\uDD57','Fopf':'\uD835\uDD3D','forall':'\u2200','ForAll':'\u2200','fork':'\u22D4','forkv':'\u2AD9','Fouriertrf':'\u2131','fpartint':'\u2A0D','frac12':'\xBD','frac13':'\u2153','frac14':'\xBC','frac15':'\u2155','frac16':'\u2159','frac18':'\u215B','frac23':'\u2154','frac25':'\u2156','frac34':'\xBE','frac35':'\u2157','frac38':'\u215C','frac45':'\u2158','frac56':'\u215A','frac58':'\u215D','frac78':'\u215E','frasl':'\u2044','frown':'\u2322','fscr':'\uD835\uDCBB','Fscr':'\u2131','gacute':'\u01F5','gamma':'\u03B3','Gamma':'\u0393','gammad':'\u03DD','Gammad':'\u03DC','gap':'\u2A86','gbreve':'\u011F','Gbreve':'\u011E','Gcedil':'\u0122','gcirc':'\u011D','Gcirc':'\u011C','gcy':'\u0433','Gcy':'\u0413','gdot':'\u0121','Gdot':'\u0120','ge':'\u2265','gE':'\u2267','gel':'\u22DB','gEl':'\u2A8C','geq':'\u2265','geqq':'\u2267','geqslant':'\u2A7E','ges':'\u2A7E','gescc':'\u2AA9','gesdot':'\u2A80','gesdoto':'\u2A82','gesdotol':'\u2A84','gesl':'\u22DB\uFE00','gesles':'\u2A94','gfr':'\uD835\uDD24','Gfr':'\uD835\uDD0A','gg':'\u226B','Gg':'\u22D9','ggg':'\u22D9','gimel':'\u2137','gjcy':'\u0453','GJcy':'\u0403','gl':'\u2277','gla':'\u2AA5','glE':'\u2A92','glj':'\u2AA4','gnap':'\u2A8A','gnapprox':'\u2A8A','gne':'\u2A88','gnE':'\u2269','gneq':'\u2A88','gneqq':'\u2269','gnsim':'\u22E7','gopf':'\uD835\uDD58','Gopf':'\uD835\uDD3E','grave':'`','GreaterEqual':'\u2265','GreaterEqualLess':'\u22DB','GreaterFullEqual':'\u2267','GreaterGreater':'\u2AA2','GreaterLess':'\u2277','GreaterSlantEqual':'\u2A7E','GreaterTilde':'\u2273','gscr':'\u210A','Gscr':'\uD835\uDCA2','gsim':'\u2273','gsime':'\u2A8E','gsiml':'\u2A90','gt':'>','Gt':'\u226B','GT':'>','gtcc':'\u2AA7','gtcir':'\u2A7A','gtdot':'\u22D7','gtlPar':'\u2995','gtquest':'\u2A7C','gtrapprox':'\u2A86','gtrarr':'\u2978','gtrdot':'\u22D7','gtreqless':'\u22DB','gtreqqless':'\u2A8C','gtrless':'\u2277','gtrsim':'\u2273','gvertneqq':'\u2269\uFE00','gvnE':'\u2269\uFE00','Hacek':'\u02C7','hairsp':'\u200A','half':'\xBD','hamilt':'\u210B','hardcy':'\u044A','HARDcy':'\u042A','harr':'\u2194','hArr':'\u21D4','harrcir':'\u2948','harrw':'\u21AD','Hat':'^','hbar':'\u210F','hcirc':'\u0125','Hcirc':'\u0124','hearts':'\u2665','heartsuit':'\u2665','hellip':'\u2026','hercon':'\u22B9','hfr':'\uD835\uDD25','Hfr':'\u210C','HilbertSpace':'\u210B','hksearow':'\u2925','hkswarow':'\u2926','hoarr':'\u21FF','homtht':'\u223B','hookleftarrow':'\u21A9','hookrightarrow':'\u21AA','hopf':'\uD835\uDD59','Hopf':'\u210D','horbar':'\u2015','HorizontalLine':'\u2500','hscr':'\uD835\uDCBD','Hscr':'\u210B','hslash':'\u210F','hstrok':'\u0127','Hstrok':'\u0126','HumpDownHump':'\u224E','HumpEqual':'\u224F','hybull':'\u2043','hyphen':'\u2010','iacute':'\xED','Iacute':'\xCD','ic':'\u2063','icirc':'\xEE','Icirc':'\xCE','icy':'\u0438','Icy':'\u0418','Idot':'\u0130','iecy':'\u0435','IEcy':'\u0415','iexcl':'\xA1','iff':'\u21D4','ifr':'\uD835\uDD26','Ifr':'\u2111','igrave':'\xEC','Igrave':'\xCC','ii':'\u2148','iiiint':'\u2A0C','iiint':'\u222D','iinfin':'\u29DC','iiota':'\u2129','ijlig':'\u0133','IJlig':'\u0132','Im':'\u2111','imacr':'\u012B','Imacr':'\u012A','image':'\u2111','ImaginaryI':'\u2148','imagline':'\u2110','imagpart':'\u2111','imath':'\u0131','imof':'\u22B7','imped':'\u01B5','Implies':'\u21D2','in':'\u2208','incare':'\u2105','infin':'\u221E','infintie':'\u29DD','inodot':'\u0131','int':'\u222B','Int':'\u222C','intcal':'\u22BA','integers':'\u2124','Integral':'\u222B','intercal':'\u22BA','Intersection':'\u22C2','intlarhk':'\u2A17','intprod':'\u2A3C','InvisibleComma':'\u2063','InvisibleTimes':'\u2062','iocy':'\u0451','IOcy':'\u0401','iogon':'\u012F','Iogon':'\u012E','iopf':'\uD835\uDD5A','Iopf':'\uD835\uDD40','iota':'\u03B9','Iota':'\u0399','iprod':'\u2A3C','iquest':'\xBF','iscr':'\uD835\uDCBE','Iscr':'\u2110','isin':'\u2208','isindot':'\u22F5','isinE':'\u22F9','isins':'\u22F4','isinsv':'\u22F3','isinv':'\u2208','it':'\u2062','itilde':'\u0129','Itilde':'\u0128','iukcy':'\u0456','Iukcy':'\u0406','iuml':'\xEF','Iuml':'\xCF','jcirc':'\u0135','Jcirc':'\u0134','jcy':'\u0439','Jcy':'\u0419','jfr':'\uD835\uDD27','Jfr':'\uD835\uDD0D','jmath':'\u0237','jopf':'\uD835\uDD5B','Jopf':'\uD835\uDD41','jscr':'\uD835\uDCBF','Jscr':'\uD835\uDCA5','jsercy':'\u0458','Jsercy':'\u0408','jukcy':'\u0454','Jukcy':'\u0404','kappa':'\u03BA','Kappa':'\u039A','kappav':'\u03F0','kcedil':'\u0137','Kcedil':'\u0136','kcy':'\u043A','Kcy':'\u041A','kfr':'\uD835\uDD28','Kfr':'\uD835\uDD0E','kgreen':'\u0138','khcy':'\u0445','KHcy':'\u0425','kjcy':'\u045C','KJcy':'\u040C','kopf':'\uD835\uDD5C','Kopf':'\uD835\uDD42','kscr':'\uD835\uDCC0','Kscr':'\uD835\uDCA6','lAarr':'\u21DA','lacute':'\u013A','Lacute':'\u0139','laemptyv':'\u29B4','lagran':'\u2112','lambda':'\u03BB','Lambda':'\u039B','lang':'\u27E8','Lang':'\u27EA','langd':'\u2991','langle':'\u27E8','lap':'\u2A85','Laplacetrf':'\u2112','laquo':'\xAB','larr':'\u2190','lArr':'\u21D0','Larr':'\u219E','larrb':'\u21E4','larrbfs':'\u291F','larrfs':'\u291D','larrhk':'\u21A9','larrlp':'\u21AB','larrpl':'\u2939','larrsim':'\u2973','larrtl':'\u21A2','lat':'\u2AAB','latail':'\u2919','lAtail':'\u291B','late':'\u2AAD','lates':'\u2AAD\uFE00','lbarr':'\u290C','lBarr':'\u290E','lbbrk':'\u2772','lbrace':'{','lbrack':'[','lbrke':'\u298B','lbrksld':'\u298F','lbrkslu':'\u298D','lcaron':'\u013E','Lcaron':'\u013D','lcedil':'\u013C','Lcedil':'\u013B','lceil':'\u2308','lcub':'{','lcy':'\u043B','Lcy':'\u041B','ldca':'\u2936','ldquo':'\u201C','ldquor':'\u201E','ldrdhar':'\u2967','ldrushar':'\u294B','ldsh':'\u21B2','le':'\u2264','lE':'\u2266','LeftAngleBracket':'\u27E8','leftarrow':'\u2190','Leftarrow':'\u21D0','LeftArrow':'\u2190','LeftArrowBar':'\u21E4','LeftArrowRightArrow':'\u21C6','leftarrowtail':'\u21A2','LeftCeiling':'\u2308','LeftDoubleBracket':'\u27E6','LeftDownTeeVector':'\u2961','LeftDownVector':'\u21C3','LeftDownVectorBar':'\u2959','LeftFloor':'\u230A','leftharpoondown':'\u21BD','leftharpoonup':'\u21BC','leftleftarrows':'\u21C7','leftrightarrow':'\u2194','Leftrightarrow':'\u21D4','LeftRightArrow':'\u2194','leftrightarrows':'\u21C6','leftrightharpoons':'\u21CB','leftrightsquigarrow':'\u21AD','LeftRightVector':'\u294E','LeftTee':'\u22A3','LeftTeeArrow':'\u21A4','LeftTeeVector':'\u295A','leftthreetimes':'\u22CB','LeftTriangle':'\u22B2','LeftTriangleBar':'\u29CF','LeftTriangleEqual':'\u22B4','LeftUpDownVector':'\u2951','LeftUpTeeVector':'\u2960','LeftUpVector':'\u21BF','LeftUpVectorBar':'\u2958','LeftVector':'\u21BC','LeftVectorBar':'\u2952','leg':'\u22DA','lEg':'\u2A8B','leq':'\u2264','leqq':'\u2266','leqslant':'\u2A7D','les':'\u2A7D','lescc':'\u2AA8','lesdot':'\u2A7F','lesdoto':'\u2A81','lesdotor':'\u2A83','lesg':'\u22DA\uFE00','lesges':'\u2A93','lessapprox':'\u2A85','lessdot':'\u22D6','lesseqgtr':'\u22DA','lesseqqgtr':'\u2A8B','LessEqualGreater':'\u22DA','LessFullEqual':'\u2266','LessGreater':'\u2276','lessgtr':'\u2276','LessLess':'\u2AA1','lesssim':'\u2272','LessSlantEqual':'\u2A7D','LessTilde':'\u2272','lfisht':'\u297C','lfloor':'\u230A','lfr':'\uD835\uDD29','Lfr':'\uD835\uDD0F','lg':'\u2276','lgE':'\u2A91','lHar':'\u2962','lhard':'\u21BD','lharu':'\u21BC','lharul':'\u296A','lhblk':'\u2584','ljcy':'\u0459','LJcy':'\u0409','ll':'\u226A','Ll':'\u22D8','llarr':'\u21C7','llcorner':'\u231E','Lleftarrow':'\u21DA','llhard':'\u296B','lltri':'\u25FA','lmidot':'\u0140','Lmidot':'\u013F','lmoust':'\u23B0','lmoustache':'\u23B0','lnap':'\u2A89','lnapprox':'\u2A89','lne':'\u2A87','lnE':'\u2268','lneq':'\u2A87','lneqq':'\u2268','lnsim':'\u22E6','loang':'\u27EC','loarr':'\u21FD','lobrk':'\u27E6','longleftarrow':'\u27F5','Longleftarrow':'\u27F8','LongLeftArrow':'\u27F5','longleftrightarrow':'\u27F7','Longleftrightarrow':'\u27FA','LongLeftRightArrow':'\u27F7','longmapsto':'\u27FC','longrightarrow':'\u27F6','Longrightarrow':'\u27F9','LongRightArrow':'\u27F6','looparrowleft':'\u21AB','looparrowright':'\u21AC','lopar':'\u2985','lopf':'\uD835\uDD5D','Lopf':'\uD835\uDD43','loplus':'\u2A2D','lotimes':'\u2A34','lowast':'\u2217','lowbar':'_','LowerLeftArrow':'\u2199','LowerRightArrow':'\u2198','loz':'\u25CA','lozenge':'\u25CA','lozf':'\u29EB','lpar':'(','lparlt':'\u2993','lrarr':'\u21C6','lrcorner':'\u231F','lrhar':'\u21CB','lrhard':'\u296D','lrm':'\u200E','lrtri':'\u22BF','lsaquo':'\u2039','lscr':'\uD835\uDCC1','Lscr':'\u2112','lsh':'\u21B0','Lsh':'\u21B0','lsim':'\u2272','lsime':'\u2A8D','lsimg':'\u2A8F','lsqb':'[','lsquo':'\u2018','lsquor':'\u201A','lstrok':'\u0142','Lstrok':'\u0141','lt':'<','Lt':'\u226A','LT':'<','ltcc':'\u2AA6','ltcir':'\u2A79','ltdot':'\u22D6','lthree':'\u22CB','ltimes':'\u22C9','ltlarr':'\u2976','ltquest':'\u2A7B','ltri':'\u25C3','ltrie':'\u22B4','ltrif':'\u25C2','ltrPar':'\u2996','lurdshar':'\u294A','luruhar':'\u2966','lvertneqq':'\u2268\uFE00','lvnE':'\u2268\uFE00','macr':'\xAF','male':'\u2642','malt':'\u2720','maltese':'\u2720','map':'\u21A6','Map':'\u2905','mapsto':'\u21A6','mapstodown':'\u21A7','mapstoleft':'\u21A4','mapstoup':'\u21A5','marker':'\u25AE','mcomma':'\u2A29','mcy':'\u043C','Mcy':'\u041C','mdash':'\u2014','mDDot':'\u223A','measuredangle':'\u2221','MediumSpace':'\u205F','Mellintrf':'\u2133','mfr':'\uD835\uDD2A','Mfr':'\uD835\uDD10','mho':'\u2127','micro':'\xB5','mid':'\u2223','midast':'*','midcir':'\u2AF0','middot':'\xB7','minus':'\u2212','minusb':'\u229F','minusd':'\u2238','minusdu':'\u2A2A','MinusPlus':'\u2213','mlcp':'\u2ADB','mldr':'\u2026','mnplus':'\u2213','models':'\u22A7','mopf':'\uD835\uDD5E','Mopf':'\uD835\uDD44','mp':'\u2213','mscr':'\uD835\uDCC2','Mscr':'\u2133','mstpos':'\u223E','mu':'\u03BC','Mu':'\u039C','multimap':'\u22B8','mumap':'\u22B8','nabla':'\u2207','nacute':'\u0144','Nacute':'\u0143','nang':'\u2220\u20D2','nap':'\u2249','napE':'\u2A70\u0338','napid':'\u224B\u0338','napos':'\u0149','napprox':'\u2249','natur':'\u266E','natural':'\u266E','naturals':'\u2115','nbsp':'\xA0','nbump':'\u224E\u0338','nbumpe':'\u224F\u0338','ncap':'\u2A43','ncaron':'\u0148','Ncaron':'\u0147','ncedil':'\u0146','Ncedil':'\u0145','ncong':'\u2247','ncongdot':'\u2A6D\u0338','ncup':'\u2A42','ncy':'\u043D','Ncy':'\u041D','ndash':'\u2013','ne':'\u2260','nearhk':'\u2924','nearr':'\u2197','neArr':'\u21D7','nearrow':'\u2197','nedot':'\u2250\u0338','NegativeMediumSpace':'\u200B','NegativeThickSpace':'\u200B','NegativeThinSpace':'\u200B','NegativeVeryThinSpace':'\u200B','nequiv':'\u2262','nesear':'\u2928','nesim':'\u2242\u0338','NestedGreaterGreater':'\u226B','NestedLessLess':'\u226A','NewLine':'\n','nexist':'\u2204','nexists':'\u2204','nfr':'\uD835\uDD2B','Nfr':'\uD835\uDD11','nge':'\u2271','ngE':'\u2267\u0338','ngeq':'\u2271','ngeqq':'\u2267\u0338','ngeqslant':'\u2A7E\u0338','nges':'\u2A7E\u0338','nGg':'\u22D9\u0338','ngsim':'\u2275','ngt':'\u226F','nGt':'\u226B\u20D2','ngtr':'\u226F','nGtv':'\u226B\u0338','nharr':'\u21AE','nhArr':'\u21CE','nhpar':'\u2AF2','ni':'\u220B','nis':'\u22FC','nisd':'\u22FA','niv':'\u220B','njcy':'\u045A','NJcy':'\u040A','nlarr':'\u219A','nlArr':'\u21CD','nldr':'\u2025','nle':'\u2270','nlE':'\u2266\u0338','nleftarrow':'\u219A','nLeftarrow':'\u21CD','nleftrightarrow':'\u21AE','nLeftrightarrow':'\u21CE','nleq':'\u2270','nleqq':'\u2266\u0338','nleqslant':'\u2A7D\u0338','nles':'\u2A7D\u0338','nless':'\u226E','nLl':'\u22D8\u0338','nlsim':'\u2274','nlt':'\u226E','nLt':'\u226A\u20D2','nltri':'\u22EA','nltrie':'\u22EC','nLtv':'\u226A\u0338','nmid':'\u2224','NoBreak':'\u2060','NonBreakingSpace':'\xA0','nopf':'\uD835\uDD5F','Nopf':'\u2115','not':'\xAC','Not':'\u2AEC','NotCongruent':'\u2262','NotCupCap':'\u226D','NotDoubleVerticalBar':'\u2226','NotElement':'\u2209','NotEqual':'\u2260','NotEqualTilde':'\u2242\u0338','NotExists':'\u2204','NotGreater':'\u226F','NotGreaterEqual':'\u2271','NotGreaterFullEqual':'\u2267\u0338','NotGreaterGreater':'\u226B\u0338','NotGreaterLess':'\u2279','NotGreaterSlantEqual':'\u2A7E\u0338','NotGreaterTilde':'\u2275','NotHumpDownHump':'\u224E\u0338','NotHumpEqual':'\u224F\u0338','notin':'\u2209','notindot':'\u22F5\u0338','notinE':'\u22F9\u0338','notinva':'\u2209','notinvb':'\u22F7','notinvc':'\u22F6','NotLeftTriangle':'\u22EA','NotLeftTriangleBar':'\u29CF\u0338','NotLeftTriangleEqual':'\u22EC','NotLess':'\u226E','NotLessEqual':'\u2270','NotLessGreater':'\u2278','NotLessLess':'\u226A\u0338','NotLessSlantEqual':'\u2A7D\u0338','NotLessTilde':'\u2274','NotNestedGreaterGreater':'\u2AA2\u0338','NotNestedLessLess':'\u2AA1\u0338','notni':'\u220C','notniva':'\u220C','notnivb':'\u22FE','notnivc':'\u22FD','NotPrecedes':'\u2280','NotPrecedesEqual':'\u2AAF\u0338','NotPrecedesSlantEqual':'\u22E0','NotReverseElement':'\u220C','NotRightTriangle':'\u22EB','NotRightTriangleBar':'\u29D0\u0338','NotRightTriangleEqual':'\u22ED','NotSquareSubset':'\u228F\u0338','NotSquareSubsetEqual':'\u22E2','NotSquareSuperset':'\u2290\u0338','NotSquareSupersetEqual':'\u22E3','NotSubset':'\u2282\u20D2','NotSubsetEqual':'\u2288','NotSucceeds':'\u2281','NotSucceedsEqual':'\u2AB0\u0338','NotSucceedsSlantEqual':'\u22E1','NotSucceedsTilde':'\u227F\u0338','NotSuperset':'\u2283\u20D2','NotSupersetEqual':'\u2289','NotTilde':'\u2241','NotTildeEqual':'\u2244','NotTildeFullEqual':'\u2247','NotTildeTilde':'\u2249','NotVerticalBar':'\u2224','npar':'\u2226','nparallel':'\u2226','nparsl':'\u2AFD\u20E5','npart':'\u2202\u0338','npolint':'\u2A14','npr':'\u2280','nprcue':'\u22E0','npre':'\u2AAF\u0338','nprec':'\u2280','npreceq':'\u2AAF\u0338','nrarr':'\u219B','nrArr':'\u21CF','nrarrc':'\u2933\u0338','nrarrw':'\u219D\u0338','nrightarrow':'\u219B','nRightarrow':'\u21CF','nrtri':'\u22EB','nrtrie':'\u22ED','nsc':'\u2281','nsccue':'\u22E1','nsce':'\u2AB0\u0338','nscr':'\uD835\uDCC3','Nscr':'\uD835\uDCA9','nshortmid':'\u2224','nshortparallel':'\u2226','nsim':'\u2241','nsime':'\u2244','nsimeq':'\u2244','nsmid':'\u2224','nspar':'\u2226','nsqsube':'\u22E2','nsqsupe':'\u22E3','nsub':'\u2284','nsube':'\u2288','nsubE':'\u2AC5\u0338','nsubset':'\u2282\u20D2','nsubseteq':'\u2288','nsubseteqq':'\u2AC5\u0338','nsucc':'\u2281','nsucceq':'\u2AB0\u0338','nsup':'\u2285','nsupe':'\u2289','nsupE':'\u2AC6\u0338','nsupset':'\u2283\u20D2','nsupseteq':'\u2289','nsupseteqq':'\u2AC6\u0338','ntgl':'\u2279','ntilde':'\xF1','Ntilde':'\xD1','ntlg':'\u2278','ntriangleleft':'\u22EA','ntrianglelefteq':'\u22EC','ntriangleright':'\u22EB','ntrianglerighteq':'\u22ED','nu':'\u03BD','Nu':'\u039D','num':'#','numero':'\u2116','numsp':'\u2007','nvap':'\u224D\u20D2','nvdash':'\u22AC','nvDash':'\u22AD','nVdash':'\u22AE','nVDash':'\u22AF','nvge':'\u2265\u20D2','nvgt':'>\u20D2','nvHarr':'\u2904','nvinfin':'\u29DE','nvlArr':'\u2902','nvle':'\u2264\u20D2','nvlt':'<\u20D2','nvltrie':'\u22B4\u20D2','nvrArr':'\u2903','nvrtrie':'\u22B5\u20D2','nvsim':'\u223C\u20D2','nwarhk':'\u2923','nwarr':'\u2196','nwArr':'\u21D6','nwarrow':'\u2196','nwnear':'\u2927','oacute':'\xF3','Oacute':'\xD3','oast':'\u229B','ocir':'\u229A','ocirc':'\xF4','Ocirc':'\xD4','ocy':'\u043E','Ocy':'\u041E','odash':'\u229D','odblac':'\u0151','Odblac':'\u0150','odiv':'\u2A38','odot':'\u2299','odsold':'\u29BC','oelig':'\u0153','OElig':'\u0152','ofcir':'\u29BF','ofr':'\uD835\uDD2C','Ofr':'\uD835\uDD12','ogon':'\u02DB','ograve':'\xF2','Ograve':'\xD2','ogt':'\u29C1','ohbar':'\u29B5','ohm':'\u03A9','oint':'\u222E','olarr':'\u21BA','olcir':'\u29BE','olcross':'\u29BB','oline':'\u203E','olt':'\u29C0','omacr':'\u014D','Omacr':'\u014C','omega':'\u03C9','Omega':'\u03A9','omicron':'\u03BF','Omicron':'\u039F','omid':'\u29B6','ominus':'\u2296','oopf':'\uD835\uDD60','Oopf':'\uD835\uDD46','opar':'\u29B7','OpenCurlyDoubleQuote':'\u201C','OpenCurlyQuote':'\u2018','operp':'\u29B9','oplus':'\u2295','or':'\u2228','Or':'\u2A54','orarr':'\u21BB','ord':'\u2A5D','order':'\u2134','orderof':'\u2134','ordf':'\xAA','ordm':'\xBA','origof':'\u22B6','oror':'\u2A56','orslope':'\u2A57','orv':'\u2A5B','oS':'\u24C8','oscr':'\u2134','Oscr':'\uD835\uDCAA','oslash':'\xF8','Oslash':'\xD8','osol':'\u2298','otilde':'\xF5','Otilde':'\xD5','otimes':'\u2297','Otimes':'\u2A37','otimesas':'\u2A36','ouml':'\xF6','Ouml':'\xD6','ovbar':'\u233D','OverBar':'\u203E','OverBrace':'\u23DE','OverBracket':'\u23B4','OverParenthesis':'\u23DC','par':'\u2225','para':'\xB6','parallel':'\u2225','parsim':'\u2AF3','parsl':'\u2AFD','part':'\u2202','PartialD':'\u2202','pcy':'\u043F','Pcy':'\u041F','percnt':'%','period':'.','permil':'\u2030','perp':'\u22A5','pertenk':'\u2031','pfr':'\uD835\uDD2D','Pfr':'\uD835\uDD13','phi':'\u03C6','Phi':'\u03A6','phiv':'\u03D5','phmmat':'\u2133','phone':'\u260E','pi':'\u03C0','Pi':'\u03A0','pitchfork':'\u22D4','piv':'\u03D6','planck':'\u210F','planckh':'\u210E','plankv':'\u210F','plus':'+','plusacir':'\u2A23','plusb':'\u229E','pluscir':'\u2A22','plusdo':'\u2214','plusdu':'\u2A25','pluse':'\u2A72','PlusMinus':'\xB1','plusmn':'\xB1','plussim':'\u2A26','plustwo':'\u2A27','pm':'\xB1','Poincareplane':'\u210C','pointint':'\u2A15','popf':'\uD835\uDD61','Popf':'\u2119','pound':'\xA3','pr':'\u227A','Pr':'\u2ABB','prap':'\u2AB7','prcue':'\u227C','pre':'\u2AAF','prE':'\u2AB3','prec':'\u227A','precapprox':'\u2AB7','preccurlyeq':'\u227C','Precedes':'\u227A','PrecedesEqual':'\u2AAF','PrecedesSlantEqual':'\u227C','PrecedesTilde':'\u227E','preceq':'\u2AAF','precnapprox':'\u2AB9','precneqq':'\u2AB5','precnsim':'\u22E8','precsim':'\u227E','prime':'\u2032','Prime':'\u2033','primes':'\u2119','prnap':'\u2AB9','prnE':'\u2AB5','prnsim':'\u22E8','prod':'\u220F','Product':'\u220F','profalar':'\u232E','profline':'\u2312','profsurf':'\u2313','prop':'\u221D','Proportion':'\u2237','Proportional':'\u221D','propto':'\u221D','prsim':'\u227E','prurel':'\u22B0','pscr':'\uD835\uDCC5','Pscr':'\uD835\uDCAB','psi':'\u03C8','Psi':'\u03A8','puncsp':'\u2008','qfr':'\uD835\uDD2E','Qfr':'\uD835\uDD14','qint':'\u2A0C','qopf':'\uD835\uDD62','Qopf':'\u211A','qprime':'\u2057','qscr':'\uD835\uDCC6','Qscr':'\uD835\uDCAC','quaternions':'\u210D','quatint':'\u2A16','quest':'?','questeq':'\u225F','quot':'"','QUOT':'"','rAarr':'\u21DB','race':'\u223D\u0331','racute':'\u0155','Racute':'\u0154','radic':'\u221A','raemptyv':'\u29B3','rang':'\u27E9','Rang':'\u27EB','rangd':'\u2992','range':'\u29A5','rangle':'\u27E9','raquo':'\xBB','rarr':'\u2192','rArr':'\u21D2','Rarr':'\u21A0','rarrap':'\u2975','rarrb':'\u21E5','rarrbfs':'\u2920','rarrc':'\u2933','rarrfs':'\u291E','rarrhk':'\u21AA','rarrlp':'\u21AC','rarrpl':'\u2945','rarrsim':'\u2974','rarrtl':'\u21A3','Rarrtl':'\u2916','rarrw':'\u219D','ratail':'\u291A','rAtail':'\u291C','ratio':'\u2236','rationals':'\u211A','rbarr':'\u290D','rBarr':'\u290F','RBarr':'\u2910','rbbrk':'\u2773','rbrace':'}','rbrack':']','rbrke':'\u298C','rbrksld':'\u298E','rbrkslu':'\u2990','rcaron':'\u0159','Rcaron':'\u0158','rcedil':'\u0157','Rcedil':'\u0156','rceil':'\u2309','rcub':'}','rcy':'\u0440','Rcy':'\u0420','rdca':'\u2937','rdldhar':'\u2969','rdquo':'\u201D','rdquor':'\u201D','rdsh':'\u21B3','Re':'\u211C','real':'\u211C','realine':'\u211B','realpart':'\u211C','reals':'\u211D','rect':'\u25AD','reg':'\xAE','REG':'\xAE','ReverseElement':'\u220B','ReverseEquilibrium':'\u21CB','ReverseUpEquilibrium':'\u296F','rfisht':'\u297D','rfloor':'\u230B','rfr':'\uD835\uDD2F','Rfr':'\u211C','rHar':'\u2964','rhard':'\u21C1','rharu':'\u21C0','rharul':'\u296C','rho':'\u03C1','Rho':'\u03A1','rhov':'\u03F1','RightAngleBracket':'\u27E9','rightarrow':'\u2192','Rightarrow':'\u21D2','RightArrow':'\u2192','RightArrowBar':'\u21E5','RightArrowLeftArrow':'\u21C4','rightarrowtail':'\u21A3','RightCeiling':'\u2309','RightDoubleBracket':'\u27E7','RightDownTeeVector':'\u295D','RightDownVector':'\u21C2','RightDownVectorBar':'\u2955','RightFloor':'\u230B','rightharpoondown':'\u21C1','rightharpoonup':'\u21C0','rightleftarrows':'\u21C4','rightleftharpoons':'\u21CC','rightrightarrows':'\u21C9','rightsquigarrow':'\u219D','RightTee':'\u22A2','RightTeeArrow':'\u21A6','RightTeeVector':'\u295B','rightthreetimes':'\u22CC','RightTriangle':'\u22B3','RightTriangleBar':'\u29D0','RightTriangleEqual':'\u22B5','RightUpDownVector':'\u294F','RightUpTeeVector':'\u295C','RightUpVector':'\u21BE','RightUpVectorBar':'\u2954','RightVector':'\u21C0','RightVectorBar':'\u2953','ring':'\u02DA','risingdotseq':'\u2253','rlarr':'\u21C4','rlhar':'\u21CC','rlm':'\u200F','rmoust':'\u23B1','rmoustache':'\u23B1','rnmid':'\u2AEE','roang':'\u27ED','roarr':'\u21FE','robrk':'\u27E7','ropar':'\u2986','ropf':'\uD835\uDD63','Ropf':'\u211D','roplus':'\u2A2E','rotimes':'\u2A35','RoundImplies':'\u2970','rpar':')','rpargt':'\u2994','rppolint':'\u2A12','rrarr':'\u21C9','Rrightarrow':'\u21DB','rsaquo':'\u203A','rscr':'\uD835\uDCC7','Rscr':'\u211B','rsh':'\u21B1','Rsh':'\u21B1','rsqb':']','rsquo':'\u2019','rsquor':'\u2019','rthree':'\u22CC','rtimes':'\u22CA','rtri':'\u25B9','rtrie':'\u22B5','rtrif':'\u25B8','rtriltri':'\u29CE','RuleDelayed':'\u29F4','ruluhar':'\u2968','rx':'\u211E','sacute':'\u015B','Sacute':'\u015A','sbquo':'\u201A','sc':'\u227B','Sc':'\u2ABC','scap':'\u2AB8','scaron':'\u0161','Scaron':'\u0160','sccue':'\u227D','sce':'\u2AB0','scE':'\u2AB4','scedil':'\u015F','Scedil':'\u015E','scirc':'\u015D','Scirc':'\u015C','scnap':'\u2ABA','scnE':'\u2AB6','scnsim':'\u22E9','scpolint':'\u2A13','scsim':'\u227F','scy':'\u0441','Scy':'\u0421','sdot':'\u22C5','sdotb':'\u22A1','sdote':'\u2A66','searhk':'\u2925','searr':'\u2198','seArr':'\u21D8','searrow':'\u2198','sect':'\xA7','semi':';','seswar':'\u2929','setminus':'\u2216','setmn':'\u2216','sext':'\u2736','sfr':'\uD835\uDD30','Sfr':'\uD835\uDD16','sfrown':'\u2322','sharp':'\u266F','shchcy':'\u0449','SHCHcy':'\u0429','shcy':'\u0448','SHcy':'\u0428','ShortDownArrow':'\u2193','ShortLeftArrow':'\u2190','shortmid':'\u2223','shortparallel':'\u2225','ShortRightArrow':'\u2192','ShortUpArrow':'\u2191','shy':'\xAD','sigma':'\u03C3','Sigma':'\u03A3','sigmaf':'\u03C2','sigmav':'\u03C2','sim':'\u223C','simdot':'\u2A6A','sime':'\u2243','simeq':'\u2243','simg':'\u2A9E','simgE':'\u2AA0','siml':'\u2A9D','simlE':'\u2A9F','simne':'\u2246','simplus':'\u2A24','simrarr':'\u2972','slarr':'\u2190','SmallCircle':'\u2218','smallsetminus':'\u2216','smashp':'\u2A33','smeparsl':'\u29E4','smid':'\u2223','smile':'\u2323','smt':'\u2AAA','smte':'\u2AAC','smtes':'\u2AAC\uFE00','softcy':'\u044C','SOFTcy':'\u042C','sol':'/','solb':'\u29C4','solbar':'\u233F','sopf':'\uD835\uDD64','Sopf':'\uD835\uDD4A','spades':'\u2660','spadesuit':'\u2660','spar':'\u2225','sqcap':'\u2293','sqcaps':'\u2293\uFE00','sqcup':'\u2294','sqcups':'\u2294\uFE00','Sqrt':'\u221A','sqsub':'\u228F','sqsube':'\u2291','sqsubset':'\u228F','sqsubseteq':'\u2291','sqsup':'\u2290','sqsupe':'\u2292','sqsupset':'\u2290','sqsupseteq':'\u2292','squ':'\u25A1','square':'\u25A1','Square':'\u25A1','SquareIntersection':'\u2293','SquareSubset':'\u228F','SquareSubsetEqual':'\u2291','SquareSuperset':'\u2290','SquareSupersetEqual':'\u2292','SquareUnion':'\u2294','squarf':'\u25AA','squf':'\u25AA','srarr':'\u2192','sscr':'\uD835\uDCC8','Sscr':'\uD835\uDCAE','ssetmn':'\u2216','ssmile':'\u2323','sstarf':'\u22C6','star':'\u2606','Star':'\u22C6','starf':'\u2605','straightepsilon':'\u03F5','straightphi':'\u03D5','strns':'\xAF','sub':'\u2282','Sub':'\u22D0','subdot':'\u2ABD','sube':'\u2286','subE':'\u2AC5','subedot':'\u2AC3','submult':'\u2AC1','subne':'\u228A','subnE':'\u2ACB','subplus':'\u2ABF','subrarr':'\u2979','subset':'\u2282','Subset':'\u22D0','subseteq':'\u2286','subseteqq':'\u2AC5','SubsetEqual':'\u2286','subsetneq':'\u228A','subsetneqq':'\u2ACB','subsim':'\u2AC7','subsub':'\u2AD5','subsup':'\u2AD3','succ':'\u227B','succapprox':'\u2AB8','succcurlyeq':'\u227D','Succeeds':'\u227B','SucceedsEqual':'\u2AB0','SucceedsSlantEqual':'\u227D','SucceedsTilde':'\u227F','succeq':'\u2AB0','succnapprox':'\u2ABA','succneqq':'\u2AB6','succnsim':'\u22E9','succsim':'\u227F','SuchThat':'\u220B','sum':'\u2211','Sum':'\u2211','sung':'\u266A','sup':'\u2283','Sup':'\u22D1','sup1':'\xB9','sup2':'\xB2','sup3':'\xB3','supdot':'\u2ABE','supdsub':'\u2AD8','supe':'\u2287','supE':'\u2AC6','supedot':'\u2AC4','Superset':'\u2283','SupersetEqual':'\u2287','suphsol':'\u27C9','suphsub':'\u2AD7','suplarr':'\u297B','supmult':'\u2AC2','supne':'\u228B','supnE':'\u2ACC','supplus':'\u2AC0','supset':'\u2283','Supset':'\u22D1','supseteq':'\u2287','supseteqq':'\u2AC6','supsetneq':'\u228B','supsetneqq':'\u2ACC','supsim':'\u2AC8','supsub':'\u2AD4','supsup':'\u2AD6','swarhk':'\u2926','swarr':'\u2199','swArr':'\u21D9','swarrow':'\u2199','swnwar':'\u292A','szlig':'\xDF','Tab':'\t','target':'\u2316','tau':'\u03C4','Tau':'\u03A4','tbrk':'\u23B4','tcaron':'\u0165','Tcaron':'\u0164','tcedil':'\u0163','Tcedil':'\u0162','tcy':'\u0442','Tcy':'\u0422','tdot':'\u20DB','telrec':'\u2315','tfr':'\uD835\uDD31','Tfr':'\uD835\uDD17','there4':'\u2234','therefore':'\u2234','Therefore':'\u2234','theta':'\u03B8','Theta':'\u0398','thetasym':'\u03D1','thetav':'\u03D1','thickapprox':'\u2248','thicksim':'\u223C','ThickSpace':'\u205F\u200A','thinsp':'\u2009','ThinSpace':'\u2009','thkap':'\u2248','thksim':'\u223C','thorn':'\xFE','THORN':'\xDE','tilde':'\u02DC','Tilde':'\u223C','TildeEqual':'\u2243','TildeFullEqual':'\u2245','TildeTilde':'\u2248','times':'\xD7','timesb':'\u22A0','timesbar':'\u2A31','timesd':'\u2A30','tint':'\u222D','toea':'\u2928','top':'\u22A4','topbot':'\u2336','topcir':'\u2AF1','topf':'\uD835\uDD65','Topf':'\uD835\uDD4B','topfork':'\u2ADA','tosa':'\u2929','tprime':'\u2034','trade':'\u2122','TRADE':'\u2122','triangle':'\u25B5','triangledown':'\u25BF','triangleleft':'\u25C3','trianglelefteq':'\u22B4','triangleq':'\u225C','triangleright':'\u25B9','trianglerighteq':'\u22B5','tridot':'\u25EC','trie':'\u225C','triminus':'\u2A3A','TripleDot':'\u20DB','triplus':'\u2A39','trisb':'\u29CD','tritime':'\u2A3B','trpezium':'\u23E2','tscr':'\uD835\uDCC9','Tscr':'\uD835\uDCAF','tscy':'\u0446','TScy':'\u0426','tshcy':'\u045B','TSHcy':'\u040B','tstrok':'\u0167','Tstrok':'\u0166','twixt':'\u226C','twoheadleftarrow':'\u219E','twoheadrightarrow':'\u21A0','uacute':'\xFA','Uacute':'\xDA','uarr':'\u2191','uArr':'\u21D1','Uarr':'\u219F','Uarrocir':'\u2949','ubrcy':'\u045E','Ubrcy':'\u040E','ubreve':'\u016D','Ubreve':'\u016C','ucirc':'\xFB','Ucirc':'\xDB','ucy':'\u0443','Ucy':'\u0423','udarr':'\u21C5','udblac':'\u0171','Udblac':'\u0170','udhar':'\u296E','ufisht':'\u297E','ufr':'\uD835\uDD32','Ufr':'\uD835\uDD18','ugrave':'\xF9','Ugrave':'\xD9','uHar':'\u2963','uharl':'\u21BF','uharr':'\u21BE','uhblk':'\u2580','ulcorn':'\u231C','ulcorner':'\u231C','ulcrop':'\u230F','ultri':'\u25F8','umacr':'\u016B','Umacr':'\u016A','uml':'\xA8','UnderBar':'_','UnderBrace':'\u23DF','UnderBracket':'\u23B5','UnderParenthesis':'\u23DD','Union':'\u22C3','UnionPlus':'\u228E','uogon':'\u0173','Uogon':'\u0172','uopf':'\uD835\uDD66','Uopf':'\uD835\uDD4C','uparrow':'\u2191','Uparrow':'\u21D1','UpArrow':'\u2191','UpArrowBar':'\u2912','UpArrowDownArrow':'\u21C5','updownarrow':'\u2195','Updownarrow':'\u21D5','UpDownArrow':'\u2195','UpEquilibrium':'\u296E','upharpoonleft':'\u21BF','upharpoonright':'\u21BE','uplus':'\u228E','UpperLeftArrow':'\u2196','UpperRightArrow':'\u2197','upsi':'\u03C5','Upsi':'\u03D2','upsih':'\u03D2','upsilon':'\u03C5','Upsilon':'\u03A5','UpTee':'\u22A5','UpTeeArrow':'\u21A5','upuparrows':'\u21C8','urcorn':'\u231D','urcorner':'\u231D','urcrop':'\u230E','uring':'\u016F','Uring':'\u016E','urtri':'\u25F9','uscr':'\uD835\uDCCA','Uscr':'\uD835\uDCB0','utdot':'\u22F0','utilde':'\u0169','Utilde':'\u0168','utri':'\u25B5','utrif':'\u25B4','uuarr':'\u21C8','uuml':'\xFC','Uuml':'\xDC','uwangle':'\u29A7','vangrt':'\u299C','varepsilon':'\u03F5','varkappa':'\u03F0','varnothing':'\u2205','varphi':'\u03D5','varpi':'\u03D6','varpropto':'\u221D','varr':'\u2195','vArr':'\u21D5','varrho':'\u03F1','varsigma':'\u03C2','varsubsetneq':'\u228A\uFE00','varsubsetneqq':'\u2ACB\uFE00','varsupsetneq':'\u228B\uFE00','varsupsetneqq':'\u2ACC\uFE00','vartheta':'\u03D1','vartriangleleft':'\u22B2','vartriangleright':'\u22B3','vBar':'\u2AE8','Vbar':'\u2AEB','vBarv':'\u2AE9','vcy':'\u0432','Vcy':'\u0412','vdash':'\u22A2','vDash':'\u22A8','Vdash':'\u22A9','VDash':'\u22AB','Vdashl':'\u2AE6','vee':'\u2228','Vee':'\u22C1','veebar':'\u22BB','veeeq':'\u225A','vellip':'\u22EE','verbar':'|','Verbar':'\u2016','vert':'|','Vert':'\u2016','VerticalBar':'\u2223','VerticalLine':'|','VerticalSeparator':'\u2758','VerticalTilde':'\u2240','VeryThinSpace':'\u200A','vfr':'\uD835\uDD33','Vfr':'\uD835\uDD19','vltri':'\u22B2','vnsub':'\u2282\u20D2','vnsup':'\u2283\u20D2','vopf':'\uD835\uDD67','Vopf':'\uD835\uDD4D','vprop':'\u221D','vrtri':'\u22B3','vscr':'\uD835\uDCCB','Vscr':'\uD835\uDCB1','vsubne':'\u228A\uFE00','vsubnE':'\u2ACB\uFE00','vsupne':'\u228B\uFE00','vsupnE':'\u2ACC\uFE00','Vvdash':'\u22AA','vzigzag':'\u299A','wcirc':'\u0175','Wcirc':'\u0174','wedbar':'\u2A5F','wedge':'\u2227','Wedge':'\u22C0','wedgeq':'\u2259','weierp':'\u2118','wfr':'\uD835\uDD34','Wfr':'\uD835\uDD1A','wopf':'\uD835\uDD68','Wopf':'\uD835\uDD4E','wp':'\u2118','wr':'\u2240','wreath':'\u2240','wscr':'\uD835\uDCCC','Wscr':'\uD835\uDCB2','xcap':'\u22C2','xcirc':'\u25EF','xcup':'\u22C3','xdtri':'\u25BD','xfr':'\uD835\uDD35','Xfr':'\uD835\uDD1B','xharr':'\u27F7','xhArr':'\u27FA','xi':'\u03BE','Xi':'\u039E','xlarr':'\u27F5','xlArr':'\u27F8','xmap':'\u27FC','xnis':'\u22FB','xodot':'\u2A00','xopf':'\uD835\uDD69','Xopf':'\uD835\uDD4F','xoplus':'\u2A01','xotime':'\u2A02','xrarr':'\u27F6','xrArr':'\u27F9','xscr':'\uD835\uDCCD','Xscr':'\uD835\uDCB3','xsqcup':'\u2A06','xuplus':'\u2A04','xutri':'\u25B3','xvee':'\u22C1','xwedge':'\u22C0','yacute':'\xFD','Yacute':'\xDD','yacy':'\u044F','YAcy':'\u042F','ycirc':'\u0177','Ycirc':'\u0176','ycy':'\u044B','Ycy':'\u042B','yen':'\xA5','yfr':'\uD835\uDD36','Yfr':'\uD835\uDD1C','yicy':'\u0457','YIcy':'\u0407','yopf':'\uD835\uDD6A','Yopf':'\uD835\uDD50','yscr':'\uD835\uDCCE','Yscr':'\uD835\uDCB4','yucy':'\u044E','YUcy':'\u042E','yuml':'\xFF','Yuml':'\u0178','zacute':'\u017A','Zacute':'\u0179','zcaron':'\u017E','Zcaron':'\u017D','zcy':'\u0437','Zcy':'\u0417','zdot':'\u017C','Zdot':'\u017B','zeetrf':'\u2128','ZeroWidthSpace':'\u200B','zeta':'\u03B6','Zeta':'\u0396','zfr':'\uD835\uDD37','Zfr':'\u2128','zhcy':'\u0436','ZHcy':'\u0416','zigrarr':'\u21DD','zopf':'\uD835\uDD6B','Zopf':'\u2124','zscr':'\uD835\uDCCF','Zscr':'\uD835\uDCB5','zwj':'\u200D','zwnj':'\u200C'};
  2764. var decodeMapLegacy = {'aacute':'\xE1','Aacute':'\xC1','acirc':'\xE2','Acirc':'\xC2','acute':'\xB4','aelig':'\xE6','AElig':'\xC6','agrave':'\xE0','Agrave':'\xC0','amp':'&','AMP':'&','aring':'\xE5','Aring':'\xC5','atilde':'\xE3','Atilde':'\xC3','auml':'\xE4','Auml':'\xC4','brvbar':'\xA6','ccedil':'\xE7','Ccedil':'\xC7','cedil':'\xB8','cent':'\xA2','copy':'\xA9','COPY':'\xA9','curren':'\xA4','deg':'\xB0','divide':'\xF7','eacute':'\xE9','Eacute':'\xC9','ecirc':'\xEA','Ecirc':'\xCA','egrave':'\xE8','Egrave':'\xC8','eth':'\xF0','ETH':'\xD0','euml':'\xEB','Euml':'\xCB','frac12':'\xBD','frac14':'\xBC','frac34':'\xBE','gt':'>','GT':'>','iacute':'\xED','Iacute':'\xCD','icirc':'\xEE','Icirc':'\xCE','iexcl':'\xA1','igrave':'\xEC','Igrave':'\xCC','iquest':'\xBF','iuml':'\xEF','Iuml':'\xCF','laquo':'\xAB','lt':'<','LT':'<','macr':'\xAF','micro':'\xB5','middot':'\xB7','nbsp':'\xA0','not':'\xAC','ntilde':'\xF1','Ntilde':'\xD1','oacute':'\xF3','Oacute':'\xD3','ocirc':'\xF4','Ocirc':'\xD4','ograve':'\xF2','Ograve':'\xD2','ordf':'\xAA','ordm':'\xBA','oslash':'\xF8','Oslash':'\xD8','otilde':'\xF5','Otilde':'\xD5','ouml':'\xF6','Ouml':'\xD6','para':'\xB6','plusmn':'\xB1','pound':'\xA3','quot':'"','QUOT':'"','raquo':'\xBB','reg':'\xAE','REG':'\xAE','sect':'\xA7','shy':'\xAD','sup1':'\xB9','sup2':'\xB2','sup3':'\xB3','szlig':'\xDF','thorn':'\xFE','THORN':'\xDE','times':'\xD7','uacute':'\xFA','Uacute':'\xDA','ucirc':'\xFB','Ucirc':'\xDB','ugrave':'\xF9','Ugrave':'\xD9','uml':'\xA8','uuml':'\xFC','Uuml':'\xDC','yacute':'\xFD','Yacute':'\xDD','yen':'\xA5','yuml':'\xFF'};
  2765. var decodeMapNumeric = {'0':'\uFFFD','128':'\u20AC','130':'\u201A','131':'\u0192','132':'\u201E','133':'\u2026','134':'\u2020','135':'\u2021','136':'\u02C6','137':'\u2030','138':'\u0160','139':'\u2039','140':'\u0152','142':'\u017D','145':'\u2018','146':'\u2019','147':'\u201C','148':'\u201D','149':'\u2022','150':'\u2013','151':'\u2014','152':'\u02DC','153':'\u2122','154':'\u0161','155':'\u203A','156':'\u0153','158':'\u017E','159':'\u0178'};
  2766. var invalidReferenceCodePoints = [1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65000,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111];
  2767. /*--------------------------------------------------------------------------*/
  2768. var stringFromCharCode = String.fromCharCode;
  2769. var object = {};
  2770. var hasOwnProperty = object.hasOwnProperty;
  2771. var has = function(object, propertyName) {
  2772. return hasOwnProperty.call(object, propertyName);
  2773. };
  2774. var contains = function(array, value) {
  2775. var index = -1;
  2776. var length = array.length;
  2777. while (++index < length) {
  2778. if (array[index] == value) {
  2779. return true;
  2780. }
  2781. }
  2782. return false;
  2783. };
  2784. var merge = function(options, defaults) {
  2785. if (!options) {
  2786. return defaults;
  2787. }
  2788. var result = {};
  2789. var key;
  2790. for (key in defaults) {
  2791. // A `hasOwnProperty` check is not needed here, since only recognized
  2792. // option names are used anyway. Any others are ignored.
  2793. result[key] = has(options, key) ? options[key] : defaults[key];
  2794. }
  2795. return result;
  2796. };
  2797. // Modified version of `ucs2encode`; see https://mths.be/punycode.
  2798. var codePointToSymbol = function(codePoint, strict) {
  2799. var output = '';
  2800. if ((codePoint >= 0xD800 && codePoint <= 0xDFFF) || codePoint > 0x10FFFF) {
  2801. // See issue #4:
  2802. // “Otherwise, if the number is in the range 0xD800 to 0xDFFF or is
  2803. // greater than 0x10FFFF, then this is a parse error. Return a U+FFFD
  2804. // REPLACEMENT CHARACTER.”
  2805. if (strict) {
  2806. parseError('character reference outside the permissible Unicode range');
  2807. }
  2808. return '\uFFFD';
  2809. }
  2810. if (has(decodeMapNumeric, codePoint)) {
  2811. if (strict) {
  2812. parseError('disallowed character reference');
  2813. }
  2814. return decodeMapNumeric[codePoint];
  2815. }
  2816. if (strict && contains(invalidReferenceCodePoints, codePoint)) {
  2817. parseError('disallowed character reference');
  2818. }
  2819. if (codePoint > 0xFFFF) {
  2820. codePoint -= 0x10000;
  2821. output += stringFromCharCode(codePoint >>> 10 & 0x3FF | 0xD800);
  2822. codePoint = 0xDC00 | codePoint & 0x3FF;
  2823. }
  2824. output += stringFromCharCode(codePoint);
  2825. return output;
  2826. };
  2827. var hexEscape = function(codePoint) {
  2828. return '&#x' + codePoint.toString(16).toUpperCase() + ';';
  2829. };
  2830. var decEscape = function(codePoint) {
  2831. return '&#' + codePoint + ';';
  2832. };
  2833. var parseError = function(message) {
  2834. throw Error('Parse error: ' + message);
  2835. };
  2836. /*--------------------------------------------------------------------------*/
  2837. var encode = function(string, options) {
  2838. options = merge(options, encode.options);
  2839. var strict = options.strict;
  2840. if (strict && regexInvalidRawCodePoint.test(string)) {
  2841. parseError('forbidden code point');
  2842. }
  2843. var encodeEverything = options.encodeEverything;
  2844. var useNamedReferences = options.useNamedReferences;
  2845. var allowUnsafeSymbols = options.allowUnsafeSymbols;
  2846. var escapeCodePoint = options.decimal ? decEscape : hexEscape;
  2847. var escapeBmpSymbol = function(symbol) {
  2848. return escapeCodePoint(symbol.charCodeAt(0));
  2849. };
  2850. if (encodeEverything) {
  2851. // Encode ASCII symbols.
  2852. string = string.replace(regexAsciiWhitelist, function(symbol) {
  2853. // Use named references if requested & possible.
  2854. if (useNamedReferences && has(encodeMap, symbol)) {
  2855. return '&' + encodeMap[symbol] + ';';
  2856. }
  2857. return escapeBmpSymbol(symbol);
  2858. });
  2859. // Shorten a few escapes that represent two symbols, of which at least one
  2860. // is within the ASCII range.
  2861. if (useNamedReferences) {
  2862. string = string
  2863. .replace(/&gt;\u20D2/g, '&nvgt;')
  2864. .replace(/&lt;\u20D2/g, '&nvlt;')
  2865. .replace(/&#x66;&#x6A;/g, '&fjlig;');
  2866. }
  2867. // Encode non-ASCII symbols.
  2868. if (useNamedReferences) {
  2869. // Encode non-ASCII symbols that can be replaced with a named reference.
  2870. string = string.replace(regexEncodeNonAscii, function(string) {
  2871. // Note: there is no need to check `has(encodeMap, string)` here.
  2872. return '&' + encodeMap[string] + ';';
  2873. });
  2874. }
  2875. // Note: any remaining non-ASCII symbols are handled outside of the `if`.
  2876. } else if (useNamedReferences) {
  2877. // Apply named character references.
  2878. // Encode `<>"'&` using named character references.
  2879. if (!allowUnsafeSymbols) {
  2880. string = string.replace(regexEscape, function(string) {
  2881. return '&' + encodeMap[string] + ';'; // no need to check `has()` here
  2882. });
  2883. }
  2884. // Shorten escapes that represent two symbols, of which at least one is
  2885. // `<>"'&`.
  2886. string = string
  2887. .replace(/&gt;\u20D2/g, '&nvgt;')
  2888. .replace(/&lt;\u20D2/g, '&nvlt;');
  2889. // Encode non-ASCII symbols that can be replaced with a named reference.
  2890. string = string.replace(regexEncodeNonAscii, function(string) {
  2891. // Note: there is no need to check `has(encodeMap, string)` here.
  2892. return '&' + encodeMap[string] + ';';
  2893. });
  2894. } else if (!allowUnsafeSymbols) {
  2895. // Encode `<>"'&` using hexadecimal escapes, now that they’re not handled
  2896. // using named character references.
  2897. string = string.replace(regexEscape, escapeBmpSymbol);
  2898. }
  2899. return string
  2900. // Encode astral symbols.
  2901. .replace(regexAstralSymbols, function($0) {
  2902. // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
  2903. var high = $0.charCodeAt(0);
  2904. var low = $0.charCodeAt(1);
  2905. var codePoint = (high - 0xD800) * 0x400 + low - 0xDC00 + 0x10000;
  2906. return escapeCodePoint(codePoint);
  2907. })
  2908. // Encode any remaining BMP symbols that are not printable ASCII symbols
  2909. // using a hexadecimal escape.
  2910. .replace(regexBmpWhitelist, escapeBmpSymbol);
  2911. };
  2912. // Expose default options (so they can be overridden globally).
  2913. encode.options = {
  2914. 'allowUnsafeSymbols': false,
  2915. 'encodeEverything': false,
  2916. 'strict': false,
  2917. 'useNamedReferences': false,
  2918. 'decimal' : false
  2919. };
  2920. var decode = function(html, options) {
  2921. options = merge(options, decode.options);
  2922. var strict = options.strict;
  2923. if (strict && regexInvalidEntity.test(html)) {
  2924. parseError('malformed character reference');
  2925. }
  2926. return html.replace(regexDecode, function($0, $1, $2, $3, $4, $5, $6, $7, $8) {
  2927. var codePoint;
  2928. var semicolon;
  2929. var decDigits;
  2930. var hexDigits;
  2931. var reference;
  2932. var next;
  2933. if ($1) {
  2934. reference = $1;
  2935. // Note: there is no need to check `has(decodeMap, reference)`.
  2936. return decodeMap[reference];
  2937. }
  2938. if ($2) {
  2939. // Decode named character references without trailing `;`, e.g. `&amp`.
  2940. // This is only a parse error if it gets converted to `&`, or if it is
  2941. // followed by `=` in an attribute context.
  2942. reference = $2;
  2943. next = $3;
  2944. if (next && options.isAttributeValue) {
  2945. if (strict && next == '=') {
  2946. parseError('`&` did not start a character reference');
  2947. }
  2948. return $0;
  2949. } else {
  2950. if (strict) {
  2951. parseError(
  2952. 'named character reference was not terminated by a semicolon'
  2953. );
  2954. }
  2955. // Note: there is no need to check `has(decodeMapLegacy, reference)`.
  2956. return decodeMapLegacy[reference] + (next || '');
  2957. }
  2958. }
  2959. if ($4) {
  2960. // Decode decimal escapes, e.g. `&#119558;`.
  2961. decDigits = $4;
  2962. semicolon = $5;
  2963. if (strict && !semicolon) {
  2964. parseError('character reference was not terminated by a semicolon');
  2965. }
  2966. codePoint = parseInt(decDigits, 10);
  2967. return codePointToSymbol(codePoint, strict);
  2968. }
  2969. if ($6) {
  2970. // Decode hexadecimal escapes, e.g. `&#x1D306;`.
  2971. hexDigits = $6;
  2972. semicolon = $7;
  2973. if (strict && !semicolon) {
  2974. parseError('character reference was not terminated by a semicolon');
  2975. }
  2976. codePoint = parseInt(hexDigits, 16);
  2977. return codePointToSymbol(codePoint, strict);
  2978. }
  2979. // If we’re still here, `if ($7)` is implied; it’s an ambiguous
  2980. // ampersand for sure. https://mths.be/notes/ambiguous-ampersands
  2981. if (strict) {
  2982. parseError(
  2983. 'named character reference was not terminated by a semicolon'
  2984. );
  2985. }
  2986. return $0;
  2987. });
  2988. };
  2989. // Expose default options (so they can be overridden globally).
  2990. decode.options = {
  2991. 'isAttributeValue': false,
  2992. 'strict': false
  2993. };
  2994. var escape = function(string) {
  2995. return string.replace(regexEscape, function($0) {
  2996. // Note: there is no need to check `has(escapeMap, $0)` here.
  2997. return escapeMap[$0];
  2998. });
  2999. };
  3000. /*--------------------------------------------------------------------------*/
  3001. var he = {
  3002. 'version': '1.2.0',
  3003. 'encode': encode,
  3004. 'decode': decode,
  3005. 'escape': escape,
  3006. 'unescape': decode
  3007. };
  3008. // Some AMD build optimizers, like r.js, check for specific condition patterns
  3009. // like the following:
  3010. if (freeExports && !freeExports.nodeType) {
  3011. if (freeModule) { // in Node.js, io.js, or RingoJS v0.8.0+
  3012. freeModule.exports = he;
  3013. } else { // in Narwhal or RingoJS v0.7.0-
  3014. for (var key in he) {
  3015. has(he, key) && (freeExports[key] = he[key]);
  3016. }
  3017. }
  3018. } else { // in Rhino or a web browser
  3019. root.he = he;
  3020. }
  3021. }(commonjsGlobal));
  3022. });
  3023. /**
  3024. * Not type-checking this file because it's mostly vendor code.
  3025. */
  3026. // Regular Expressions for parsing tags and attributes
  3027. var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
  3028. var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
  3029. var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z" + (unicodeRegExp.source) + "]*";
  3030. var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")";
  3031. var startTagOpen = new RegExp(("^<" + qnameCapture));
  3032. var startTagClose = /^\s*(\/?)>/;
  3033. var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
  3034. var doctype = /^<!DOCTYPE [^>]+>/i;
  3035. // #7298: escape - to avoid being passed as HTML comment when inlined in page
  3036. var comment = /^<!\--/;
  3037. var conditionalComment = /^<!\[/;
  3038. // Special Elements (can contain anything)
  3039. var isPlainTextElement = makeMap('script,style,textarea', true);
  3040. var reCache = {};
  3041. var decodingMap = {
  3042. '&lt;': '<',
  3043. '&gt;': '>',
  3044. '&quot;': '"',
  3045. '&amp;': '&',
  3046. '&#10;': '\n',
  3047. '&#9;': '\t',
  3048. '&#39;': "'"
  3049. };
  3050. var encodedAttr = /&(?:lt|gt|quot|amp|#39);/g;
  3051. var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g;
  3052. // #5992
  3053. var isIgnoreNewlineTag = makeMap('pre,textarea', true);
  3054. var shouldIgnoreFirstNewline = function (tag, html) { return tag && isIgnoreNewlineTag(tag) && html[0] === '\n'; };
  3055. function decodeAttr (value, shouldDecodeNewlines) {
  3056. var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;
  3057. return value.replace(re, function (match) { return decodingMap[match]; })
  3058. }
  3059. function parseHTML (html, options) {
  3060. var stack = [];
  3061. var expectHTML = options.expectHTML;
  3062. var isUnaryTag$$1 = options.isUnaryTag || no;
  3063. var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no;
  3064. var index = 0;
  3065. var last, lastTag;
  3066. while (html) {
  3067. last = html;
  3068. // Make sure we're not in a plaintext content element like script/style
  3069. if (!lastTag || !isPlainTextElement(lastTag)) {
  3070. var textEnd = html.indexOf('<');
  3071. if (textEnd === 0) {
  3072. // Comment:
  3073. if (comment.test(html)) {
  3074. var commentEnd = html.indexOf('-->');
  3075. if (commentEnd >= 0) {
  3076. if (options.shouldKeepComment) {
  3077. options.comment(html.substring(4, commentEnd), index, index + commentEnd + 3);
  3078. }
  3079. advance(commentEnd + 3);
  3080. continue
  3081. }
  3082. }
  3083. // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
  3084. if (conditionalComment.test(html)) {
  3085. var conditionalEnd = html.indexOf(']>');
  3086. if (conditionalEnd >= 0) {
  3087. advance(conditionalEnd + 2);
  3088. continue
  3089. }
  3090. }
  3091. // Doctype:
  3092. var doctypeMatch = html.match(doctype);
  3093. if (doctypeMatch) {
  3094. advance(doctypeMatch[0].length);
  3095. continue
  3096. }
  3097. // End tag:
  3098. var endTagMatch = html.match(endTag);
  3099. if (endTagMatch) {
  3100. var curIndex = index;
  3101. advance(endTagMatch[0].length);
  3102. parseEndTag(endTagMatch[1], curIndex, index);
  3103. continue
  3104. }
  3105. // Start tag:
  3106. var startTagMatch = parseStartTag();
  3107. if (startTagMatch) {
  3108. handleStartTag(startTagMatch);
  3109. if (shouldIgnoreFirstNewline(startTagMatch.tagName, html)) {
  3110. advance(1);
  3111. }
  3112. continue
  3113. }
  3114. }
  3115. var text = (void 0), rest = (void 0), next = (void 0);
  3116. if (textEnd >= 0) {
  3117. rest = html.slice(textEnd);
  3118. while (
  3119. !endTag.test(rest) &&
  3120. !startTagOpen.test(rest) &&
  3121. !comment.test(rest) &&
  3122. !conditionalComment.test(rest)
  3123. ) {
  3124. // < in plain text, be forgiving and treat it as text
  3125. next = rest.indexOf('<', 1);
  3126. if (next < 0) { break }
  3127. textEnd += next;
  3128. rest = html.slice(textEnd);
  3129. }
  3130. text = html.substring(0, textEnd);
  3131. }
  3132. if (textEnd < 0) {
  3133. text = html;
  3134. }
  3135. if (text) {
  3136. advance(text.length);
  3137. }
  3138. if (options.chars && text) {
  3139. options.chars(text, index - text.length, index);
  3140. }
  3141. } else {
  3142. var endTagLength = 0;
  3143. var stackedTag = lastTag.toLowerCase();
  3144. var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));
  3145. var rest$1 = html.replace(reStackedTag, function (all, text, endTag) {
  3146. endTagLength = endTag.length;
  3147. if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {
  3148. text = text
  3149. .replace(/<!\--([\s\S]*?)-->/g, '$1') // #7298
  3150. .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
  3151. }
  3152. if (shouldIgnoreFirstNewline(stackedTag, text)) {
  3153. text = text.slice(1);
  3154. }
  3155. if (options.chars) {
  3156. options.chars(text);
  3157. }
  3158. return ''
  3159. });
  3160. index += html.length - rest$1.length;
  3161. html = rest$1;
  3162. parseEndTag(stackedTag, index - endTagLength, index);
  3163. }
  3164. if (html === last) {
  3165. options.chars && options.chars(html);
  3166. if (!stack.length && options.warn) {
  3167. options.warn(("Mal-formatted tag at end of template: \"" + html + "\""), { start: index + html.length });
  3168. }
  3169. break
  3170. }
  3171. }
  3172. // Clean up any remaining tags
  3173. parseEndTag();
  3174. function advance (n) {
  3175. index += n;
  3176. html = html.substring(n);
  3177. }
  3178. function parseStartTag () {
  3179. var start = html.match(startTagOpen);
  3180. if (start) {
  3181. var match = {
  3182. tagName: start[1],
  3183. attrs: [],
  3184. start: index
  3185. };
  3186. advance(start[0].length);
  3187. var end, attr;
  3188. while (!(end = html.match(startTagClose)) && (attr = html.match(dynamicArgAttribute) || html.match(attribute))) {
  3189. attr.start = index;
  3190. advance(attr[0].length);
  3191. attr.end = index;
  3192. match.attrs.push(attr);
  3193. }
  3194. if (end) {
  3195. match.unarySlash = end[1];
  3196. advance(end[0].length);
  3197. match.end = index;
  3198. return match
  3199. }
  3200. }
  3201. }
  3202. function handleStartTag (match) {
  3203. var tagName = match.tagName;
  3204. var unarySlash = match.unarySlash;
  3205. if (expectHTML) {
  3206. if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
  3207. parseEndTag(lastTag);
  3208. }
  3209. if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) {
  3210. parseEndTag(tagName);
  3211. }
  3212. }
  3213. var unary = isUnaryTag$$1(tagName) || !!unarySlash;
  3214. var l = match.attrs.length;
  3215. var attrs = new Array(l);
  3216. for (var i = 0; i < l; i++) {
  3217. var args = match.attrs[i];
  3218. var value = args[3] || args[4] || args[5] || '';
  3219. var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href'
  3220. ? options.shouldDecodeNewlinesForHref
  3221. : options.shouldDecodeNewlines;
  3222. attrs[i] = {
  3223. name: args[1],
  3224. value: decodeAttr(value, shouldDecodeNewlines)
  3225. };
  3226. if (options.outputSourceRange) {
  3227. attrs[i].start = args.start + args[0].match(/^\s*/).length;
  3228. attrs[i].end = args.end;
  3229. }
  3230. }
  3231. if (!unary) {
  3232. stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs, start: match.start, end: match.end });
  3233. lastTag = tagName;
  3234. }
  3235. if (options.start) {
  3236. options.start(tagName, attrs, unary, match.start, match.end);
  3237. }
  3238. }
  3239. function parseEndTag (tagName, start, end) {
  3240. var pos, lowerCasedTagName;
  3241. if (start == null) { start = index; }
  3242. if (end == null) { end = index; }
  3243. // Find the closest opened tag of the same type
  3244. if (tagName) {
  3245. lowerCasedTagName = tagName.toLowerCase();
  3246. for (pos = stack.length - 1; pos >= 0; pos--) {
  3247. if (stack[pos].lowerCasedTag === lowerCasedTagName) {
  3248. break
  3249. }
  3250. }
  3251. } else {
  3252. // If no tag name is provided, clean shop
  3253. pos = 0;
  3254. }
  3255. if (pos >= 0) {
  3256. // Close all the open elements, up the stack
  3257. for (var i = stack.length - 1; i >= pos; i--) {
  3258. if (i > pos || !tagName &&
  3259. options.warn
  3260. ) {
  3261. options.warn(
  3262. ("tag <" + (stack[i].tag) + "> has no matching end tag."),
  3263. { start: stack[i].start, end: stack[i].end }
  3264. );
  3265. }
  3266. if (options.end) {
  3267. options.end(stack[i].tag, start, end);
  3268. }
  3269. }
  3270. // Remove the open elements from the stack
  3271. stack.length = pos;
  3272. lastTag = pos && stack[pos - 1].tag;
  3273. } else if (lowerCasedTagName === 'br') {
  3274. if (options.start) {
  3275. options.start(tagName, [], true, start, end);
  3276. }
  3277. } else if (lowerCasedTagName === 'p') {
  3278. if (options.start) {
  3279. options.start(tagName, [], false, start, end);
  3280. }
  3281. if (options.end) {
  3282. options.end(tagName, start, end);
  3283. }
  3284. }
  3285. }
  3286. }
  3287. /* */
  3288. /**
  3289. * Cross-platform code generation for component v-model
  3290. */
  3291. function genComponentModel (
  3292. el,
  3293. value,
  3294. modifiers
  3295. ) {
  3296. var ref = modifiers || {};
  3297. var number = ref.number;
  3298. var trim = ref.trim;
  3299. var baseValueExpression = '$$v';
  3300. var valueExpression = baseValueExpression;
  3301. if (trim) {
  3302. valueExpression =
  3303. "(typeof " + baseValueExpression + " === 'string'" +
  3304. "? " + baseValueExpression + ".trim()" +
  3305. ": " + baseValueExpression + ")";
  3306. }
  3307. if (number) {
  3308. valueExpression = "_n(" + valueExpression + ")";
  3309. }
  3310. var assignment = genAssignmentCode(value, valueExpression);
  3311. el.model = {
  3312. value: ("(" + value + ")"),
  3313. expression: JSON.stringify(value),
  3314. callback: ("function (" + baseValueExpression + ") {" + assignment + "}")
  3315. };
  3316. }
  3317. /**
  3318. * Cross-platform codegen helper for generating v-model value assignment code.
  3319. */
  3320. function genAssignmentCode (
  3321. value,
  3322. assignment
  3323. ) {
  3324. var res = parseModel(value);
  3325. if (res.key === null) {
  3326. return (value + "=" + assignment)
  3327. } else {
  3328. return ("$set(" + (res.exp) + ", " + (res.key) + ", " + assignment + ")")
  3329. }
  3330. }
  3331. /**
  3332. * Parse a v-model expression into a base path and a final key segment.
  3333. * Handles both dot-path and possible square brackets.
  3334. *
  3335. * Possible cases:
  3336. *
  3337. * - test
  3338. * - test[key]
  3339. * - test[test1[key]]
  3340. * - test["a"][key]
  3341. * - xxx.test[a[a].test1[key]]
  3342. * - test.xxx.a["asa"][test1[key]]
  3343. *
  3344. */
  3345. var len, str, chr, index, expressionPos, expressionEndPos;
  3346. function parseModel (val) {
  3347. // Fix https://github.com/vuejs/vue/pull/7730
  3348. // allow v-model="obj.val " (trailing whitespace)
  3349. val = val.trim();
  3350. len = val.length;
  3351. if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
  3352. index = val.lastIndexOf('.');
  3353. if (index > -1) {
  3354. return {
  3355. exp: val.slice(0, index),
  3356. key: '"' + val.slice(index + 1) + '"'
  3357. }
  3358. } else {
  3359. return {
  3360. exp: val,
  3361. key: null
  3362. }
  3363. }
  3364. }
  3365. str = val;
  3366. index = expressionPos = expressionEndPos = 0;
  3367. while (!eof()) {
  3368. chr = next();
  3369. /* istanbul ignore if */
  3370. if (isStringStart(chr)) {
  3371. parseString(chr);
  3372. } else if (chr === 0x5B) {
  3373. parseBracket(chr);
  3374. }
  3375. }
  3376. return {
  3377. exp: val.slice(0, expressionPos),
  3378. key: val.slice(expressionPos + 1, expressionEndPos)
  3379. }
  3380. }
  3381. function next () {
  3382. return str.charCodeAt(++index)
  3383. }
  3384. function eof () {
  3385. return index >= len
  3386. }
  3387. function isStringStart (chr) {
  3388. return chr === 0x22 || chr === 0x27
  3389. }
  3390. function parseBracket (chr) {
  3391. var inBracket = 1;
  3392. expressionPos = index;
  3393. while (!eof()) {
  3394. chr = next();
  3395. if (isStringStart(chr)) {
  3396. parseString(chr);
  3397. continue
  3398. }
  3399. if (chr === 0x5B) { inBracket++; }
  3400. if (chr === 0x5D) { inBracket--; }
  3401. if (inBracket === 0) {
  3402. expressionEndPos = index;
  3403. break
  3404. }
  3405. }
  3406. }
  3407. function parseString (chr) {
  3408. var stringQuote = chr;
  3409. while (!eof()) {
  3410. chr = next();
  3411. if (chr === stringQuote) {
  3412. break
  3413. }
  3414. }
  3415. }
  3416. /* */
  3417. var onRE = /^@|^v-on:/;
  3418. var dirRE = /^v-|^@|^:|^#/;
  3419. var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
  3420. var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
  3421. var stripParensRE = /^\(|\)$/g;
  3422. var dynamicArgRE = /^\[.*\]$/;
  3423. var argRE = /:(.*)$/;
  3424. var bindRE = /^:|^\.|^v-bind:/;
  3425. var modifierRE = /\.[^.\]]+(?=[^\]]*$)/g;
  3426. var slotRE = /^v-slot(:|$)|^#/;
  3427. var lineBreakRE = /[\r\n]/;
  3428. var whitespaceRE = /[ \f\t\r\n]+/g;
  3429. var invalidAttributeRE = /[\s"'<>\/=]/;
  3430. var decodeHTMLCached = cached(he.decode);
  3431. var emptySlotScopeToken = "_empty_";
  3432. // configurable state
  3433. var warn$1;
  3434. var delimiters;
  3435. var transforms;
  3436. var preTransforms;
  3437. var postTransforms;
  3438. var platformIsPreTag;
  3439. var platformMustUseProp;
  3440. var platformGetTagNamespace;
  3441. var maybeComponent;
  3442. function createASTElement (
  3443. tag,
  3444. attrs,
  3445. parent
  3446. ) {
  3447. return {
  3448. type: 1,
  3449. tag: tag,
  3450. attrsList: attrs,
  3451. attrsMap: makeAttrsMap(attrs),
  3452. rawAttrsMap: {},
  3453. parent: parent,
  3454. children: []
  3455. }
  3456. }
  3457. /**
  3458. * Convert HTML string to AST.
  3459. */
  3460. function parse (
  3461. template,
  3462. options
  3463. ) {
  3464. warn$1 = options.warn || baseWarn;
  3465. platformIsPreTag = options.isPreTag || no;
  3466. platformMustUseProp = options.mustUseProp || no;
  3467. platformGetTagNamespace = options.getTagNamespace || no;
  3468. var isReservedTag = options.isReservedTag || no;
  3469. maybeComponent = function (el) { return !!(
  3470. el.component ||
  3471. el.attrsMap[':is'] ||
  3472. el.attrsMap['v-bind:is'] ||
  3473. !(el.attrsMap.is ? isReservedTag(el.attrsMap.is) : isReservedTag(el.tag))
  3474. ); };
  3475. transforms = pluckModuleFunction(options.modules, 'transformNode');
  3476. preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
  3477. postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
  3478. delimiters = options.delimiters;
  3479. var stack = [];
  3480. var preserveWhitespace = options.preserveWhitespace !== false;
  3481. var whitespaceOption = options.whitespace;
  3482. var root;
  3483. var currentParent;
  3484. var inVPre = false;
  3485. var inPre = false;
  3486. var warned = false;
  3487. function warnOnce (msg, range) {
  3488. if (!warned) {
  3489. warned = true;
  3490. warn$1(msg, range);
  3491. }
  3492. }
  3493. function closeElement (element) {
  3494. trimEndingWhitespace(element);
  3495. if (!inVPre && !element.processed) {
  3496. element = processElement(element, options);
  3497. }
  3498. // tree management
  3499. if (!stack.length && element !== root) {
  3500. // allow root elements with v-if, v-else-if and v-else
  3501. if (root.if && (element.elseif || element.else)) {
  3502. {
  3503. checkRootConstraints(element);
  3504. }
  3505. addIfCondition(root, {
  3506. exp: element.elseif,
  3507. block: element
  3508. });
  3509. } else {
  3510. warnOnce(
  3511. "Component template should contain exactly one root element. " +
  3512. "If you are using v-if on multiple elements, " +
  3513. "use v-else-if to chain them instead.",
  3514. { start: element.start }
  3515. );
  3516. }
  3517. }
  3518. if (currentParent && !element.forbidden) {
  3519. if (element.elseif || element.else) {
  3520. processIfConditions(element, currentParent);
  3521. } else {
  3522. if (element.slotScope) {
  3523. // scoped slot
  3524. // keep it in the children list so that v-else(-if) conditions can
  3525. // find it as the prev node.
  3526. var name = element.slotTarget || '"default"'
  3527. ;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
  3528. }
  3529. currentParent.children.push(element);
  3530. element.parent = currentParent;
  3531. }
  3532. }
  3533. // final children cleanup
  3534. // filter out scoped slots
  3535. element.children = element.children.filter(function (c) { return !(c).slotScope; });
  3536. // remove trailing whitespace node again
  3537. trimEndingWhitespace(element);
  3538. // check pre state
  3539. if (element.pre) {
  3540. inVPre = false;
  3541. }
  3542. if (platformIsPreTag(element.tag)) {
  3543. inPre = false;
  3544. }
  3545. // apply post-transforms
  3546. for (var i = 0; i < postTransforms.length; i++) {
  3547. postTransforms[i](element, options);
  3548. }
  3549. }
  3550. function trimEndingWhitespace (el) {
  3551. // remove trailing whitespace node
  3552. if (!inPre) {
  3553. var lastNode;
  3554. while (
  3555. (lastNode = el.children[el.children.length - 1]) &&
  3556. lastNode.type === 3 &&
  3557. lastNode.text === ' '
  3558. ) {
  3559. el.children.pop();
  3560. }
  3561. }
  3562. }
  3563. function checkRootConstraints (el) {
  3564. if (el.tag === 'slot' || el.tag === 'template') {
  3565. warnOnce(
  3566. "Cannot use <" + (el.tag) + "> as component root element because it may " +
  3567. 'contain multiple nodes.',
  3568. { start: el.start }
  3569. );
  3570. }
  3571. if (el.attrsMap.hasOwnProperty('v-for')) {
  3572. warnOnce(
  3573. 'Cannot use v-for on stateful component root element because ' +
  3574. 'it renders multiple elements.',
  3575. el.rawAttrsMap['v-for']
  3576. );
  3577. }
  3578. }
  3579. parseHTML(template, {
  3580. warn: warn$1,
  3581. expectHTML: options.expectHTML,
  3582. isUnaryTag: options.isUnaryTag,
  3583. canBeLeftOpenTag: options.canBeLeftOpenTag,
  3584. shouldDecodeNewlines: options.shouldDecodeNewlines,
  3585. shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref,
  3586. shouldKeepComment: options.comments,
  3587. outputSourceRange: options.outputSourceRange,
  3588. start: function start (tag, attrs, unary, start$1, end) {
  3589. // check namespace.
  3590. // inherit parent ns if there is one
  3591. var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
  3592. // handle IE svg bug
  3593. /* istanbul ignore if */
  3594. if (isIE && ns === 'svg') {
  3595. attrs = guardIESVGBug(attrs);
  3596. }
  3597. var element = createASTElement(tag, attrs, currentParent);
  3598. if (ns) {
  3599. element.ns = ns;
  3600. }
  3601. {
  3602. if (options.outputSourceRange) {
  3603. element.start = start$1;
  3604. element.end = end;
  3605. element.rawAttrsMap = element.attrsList.reduce(function (cumulated, attr) {
  3606. cumulated[attr.name] = attr;
  3607. return cumulated
  3608. }, {});
  3609. }
  3610. attrs.forEach(function (attr) {
  3611. if (invalidAttributeRE.test(attr.name)) {
  3612. warn$1(
  3613. "Invalid dynamic argument expression: attribute names cannot contain " +
  3614. "spaces, quotes, <, >, / or =.",
  3615. {
  3616. start: attr.start + attr.name.indexOf("["),
  3617. end: attr.start + attr.name.length
  3618. }
  3619. );
  3620. }
  3621. });
  3622. }
  3623. if (isForbiddenTag(element) && !isServerRendering()) {
  3624. element.forbidden = true;
  3625. warn$1(
  3626. 'Templates should only be responsible for mapping the state to the ' +
  3627. 'UI. Avoid placing tags with side-effects in your templates, such as ' +
  3628. "<" + tag + ">" + ', as they will not be parsed.',
  3629. { start: element.start }
  3630. );
  3631. }
  3632. // apply pre-transforms
  3633. for (var i = 0; i < preTransforms.length; i++) {
  3634. element = preTransforms[i](element, options) || element;
  3635. }
  3636. if (!inVPre) {
  3637. processPre(element);
  3638. if (element.pre) {
  3639. inVPre = true;
  3640. }
  3641. }
  3642. if (platformIsPreTag(element.tag)) {
  3643. inPre = true;
  3644. }
  3645. if (inVPre) {
  3646. processRawAttrs(element);
  3647. } else if (!element.processed) {
  3648. // structural directives
  3649. processFor(element);
  3650. processIf(element);
  3651. processOnce(element);
  3652. }
  3653. if (!root) {
  3654. root = element;
  3655. {
  3656. checkRootConstraints(root);
  3657. }
  3658. }
  3659. if (!unary) {
  3660. currentParent = element;
  3661. stack.push(element);
  3662. } else {
  3663. closeElement(element);
  3664. }
  3665. },
  3666. end: function end (tag, start, end$1) {
  3667. var element = stack[stack.length - 1];
  3668. // pop stack
  3669. stack.length -= 1;
  3670. currentParent = stack[stack.length - 1];
  3671. if (options.outputSourceRange) {
  3672. element.end = end$1;
  3673. }
  3674. closeElement(element);
  3675. },
  3676. chars: function chars (text, start, end) {
  3677. if (!currentParent) {
  3678. {
  3679. if (text === template) {
  3680. warnOnce(
  3681. 'Component template requires a root element, rather than just text.',
  3682. { start: start }
  3683. );
  3684. } else if ((text = text.trim())) {
  3685. warnOnce(
  3686. ("text \"" + text + "\" outside root element will be ignored."),
  3687. { start: start }
  3688. );
  3689. }
  3690. }
  3691. return
  3692. }
  3693. // IE textarea placeholder bug
  3694. /* istanbul ignore if */
  3695. if (isIE &&
  3696. currentParent.tag === 'textarea' &&
  3697. currentParent.attrsMap.placeholder === text
  3698. ) {
  3699. return
  3700. }
  3701. var children = currentParent.children;
  3702. if (inPre || text.trim()) {
  3703. text = isTextTag(currentParent) ? text : decodeHTMLCached(text);
  3704. } else if (!children.length) {
  3705. // remove the whitespace-only node right after an opening tag
  3706. text = '';
  3707. } else if (whitespaceOption) {
  3708. if (whitespaceOption === 'condense') {
  3709. // in condense mode, remove the whitespace node if it contains
  3710. // line break, otherwise condense to a single space
  3711. text = lineBreakRE.test(text) ? '' : ' ';
  3712. } else {
  3713. text = ' ';
  3714. }
  3715. } else {
  3716. text = preserveWhitespace ? ' ' : '';
  3717. }
  3718. if (text) {
  3719. if (!inPre && whitespaceOption === 'condense') {
  3720. // condense consecutive whitespaces into single space
  3721. text = text.replace(whitespaceRE, ' ');
  3722. }
  3723. var res;
  3724. var child;
  3725. if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) {
  3726. child = {
  3727. type: 2,
  3728. expression: res.expression,
  3729. tokens: res.tokens,
  3730. text: text
  3731. };
  3732. } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') {
  3733. child = {
  3734. type: 3,
  3735. text: text
  3736. };
  3737. }
  3738. if (child) {
  3739. if (options.outputSourceRange) {
  3740. child.start = start;
  3741. child.end = end;
  3742. }
  3743. children.push(child);
  3744. }
  3745. }
  3746. },
  3747. comment: function comment (text, start, end) {
  3748. // adding anything as a sibling to the root node is forbidden
  3749. // comments should still be allowed, but ignored
  3750. if (currentParent) {
  3751. var child = {
  3752. type: 3,
  3753. text: text,
  3754. isComment: true
  3755. };
  3756. if (options.outputSourceRange) {
  3757. child.start = start;
  3758. child.end = end;
  3759. }
  3760. currentParent.children.push(child);
  3761. }
  3762. }
  3763. });
  3764. return root
  3765. }
  3766. function processPre (el) {
  3767. if (getAndRemoveAttr(el, 'v-pre') != null) {
  3768. el.pre = true;
  3769. }
  3770. }
  3771. function processRawAttrs (el) {
  3772. var list = el.attrsList;
  3773. var len = list.length;
  3774. if (len) {
  3775. var attrs = el.attrs = new Array(len);
  3776. for (var i = 0; i < len; i++) {
  3777. attrs[i] = {
  3778. name: list[i].name,
  3779. value: JSON.stringify(list[i].value)
  3780. };
  3781. if (list[i].start != null) {
  3782. attrs[i].start = list[i].start;
  3783. attrs[i].end = list[i].end;
  3784. }
  3785. }
  3786. } else if (!el.pre) {
  3787. // non root node in pre blocks with no attributes
  3788. el.plain = true;
  3789. }
  3790. }
  3791. function processElement (
  3792. element,
  3793. options
  3794. ) {
  3795. processKey(element);
  3796. // determine whether this is a plain element after
  3797. // removing structural attributes
  3798. element.plain = (
  3799. !element.key &&
  3800. !element.scopedSlots &&
  3801. !element.attrsList.length
  3802. );
  3803. processRef(element);
  3804. processSlotContent(element);
  3805. processSlotOutlet(element);
  3806. processComponent(element);
  3807. for (var i = 0; i < transforms.length; i++) {
  3808. element = transforms[i](element, options) || element;
  3809. }
  3810. processAttrs(element);
  3811. return element
  3812. }
  3813. function processKey (el) {
  3814. var exp = getBindingAttr(el, 'key');
  3815. if (exp) {
  3816. {
  3817. if (el.tag === 'template') {
  3818. warn$1(
  3819. "<template> cannot be keyed. Place the key on real elements instead.",
  3820. getRawBindingAttr(el, 'key')
  3821. );
  3822. }
  3823. if (el.for) {
  3824. var iterator = el.iterator2 || el.iterator1;
  3825. var parent = el.parent;
  3826. if (iterator && iterator === exp && parent && parent.tag === 'transition-group') {
  3827. warn$1(
  3828. "Do not use v-for index as key on <transition-group> children, " +
  3829. "this is the same as not using keys.",
  3830. getRawBindingAttr(el, 'key'),
  3831. true /* tip */
  3832. );
  3833. }
  3834. }
  3835. }
  3836. el.key = exp;
  3837. }
  3838. }
  3839. function processRef (el) {
  3840. var ref = getBindingAttr(el, 'ref');
  3841. if (ref) {
  3842. el.ref = ref;
  3843. el.refInFor = checkInFor(el);
  3844. }
  3845. }
  3846. function processFor (el) {
  3847. var exp;
  3848. if ((exp = getAndRemoveAttr(el, 'v-for'))) {
  3849. var res = parseFor(exp);
  3850. if (res) {
  3851. extend(el, res);
  3852. } else {
  3853. warn$1(
  3854. ("Invalid v-for expression: " + exp),
  3855. el.rawAttrsMap['v-for']
  3856. );
  3857. }
  3858. }
  3859. }
  3860. function parseFor (exp) {
  3861. var inMatch = exp.match(forAliasRE);
  3862. if (!inMatch) { return }
  3863. var res = {};
  3864. res.for = inMatch[2].trim();
  3865. var alias = inMatch[1].trim().replace(stripParensRE, '');
  3866. var iteratorMatch = alias.match(forIteratorRE);
  3867. if (iteratorMatch) {
  3868. res.alias = alias.replace(forIteratorRE, '').trim();
  3869. res.iterator1 = iteratorMatch[1].trim();
  3870. if (iteratorMatch[2]) {
  3871. res.iterator2 = iteratorMatch[2].trim();
  3872. }
  3873. } else {
  3874. res.alias = alias;
  3875. }
  3876. return res
  3877. }
  3878. function processIf (el) {
  3879. var exp = getAndRemoveAttr(el, 'v-if');
  3880. if (exp) {
  3881. el.if = exp;
  3882. addIfCondition(el, {
  3883. exp: exp,
  3884. block: el
  3885. });
  3886. } else {
  3887. if (getAndRemoveAttr(el, 'v-else') != null) {
  3888. el.else = true;
  3889. }
  3890. var elseif = getAndRemoveAttr(el, 'v-else-if');
  3891. if (elseif) {
  3892. el.elseif = elseif;
  3893. }
  3894. }
  3895. }
  3896. function processIfConditions (el, parent) {
  3897. var prev = findPrevElement(parent.children);
  3898. if (prev && prev.if) {
  3899. addIfCondition(prev, {
  3900. exp: el.elseif,
  3901. block: el
  3902. });
  3903. } else {
  3904. warn$1(
  3905. "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " +
  3906. "used on element <" + (el.tag) + "> without corresponding v-if.",
  3907. el.rawAttrsMap[el.elseif ? 'v-else-if' : 'v-else']
  3908. );
  3909. }
  3910. }
  3911. function findPrevElement (children) {
  3912. var i = children.length;
  3913. while (i--) {
  3914. if (children[i].type === 1) {
  3915. return children[i]
  3916. } else {
  3917. if (children[i].text !== ' ') {
  3918. warn$1(
  3919. "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " +
  3920. "will be ignored.",
  3921. children[i]
  3922. );
  3923. }
  3924. children.pop();
  3925. }
  3926. }
  3927. }
  3928. function addIfCondition (el, condition) {
  3929. if (!el.ifConditions) {
  3930. el.ifConditions = [];
  3931. }
  3932. el.ifConditions.push(condition);
  3933. }
  3934. function processOnce (el) {
  3935. var once$$1 = getAndRemoveAttr(el, 'v-once');
  3936. if (once$$1 != null) {
  3937. el.once = true;
  3938. }
  3939. }
  3940. // handle content being passed to a component as slot,
  3941. // e.g. <template slot="xxx">, <div slot-scope="xxx">
  3942. function processSlotContent (el) {
  3943. var slotScope;
  3944. if (el.tag === 'template') {
  3945. slotScope = getAndRemoveAttr(el, 'scope');
  3946. /* istanbul ignore if */
  3947. if (slotScope) {
  3948. warn$1(
  3949. "the \"scope\" attribute for scoped slots have been deprecated and " +
  3950. "replaced by \"slot-scope\" since 2.5. The new \"slot-scope\" attribute " +
  3951. "can also be used on plain elements in addition to <template> to " +
  3952. "denote scoped slots.",
  3953. el.rawAttrsMap['scope'],
  3954. true
  3955. );
  3956. }
  3957. el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
  3958. } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
  3959. /* istanbul ignore if */
  3960. if (el.attrsMap['v-for']) {
  3961. warn$1(
  3962. "Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " +
  3963. "(v-for takes higher priority). Use a wrapper <template> for the " +
  3964. "scoped slot to make it clearer.",
  3965. el.rawAttrsMap['slot-scope'],
  3966. true
  3967. );
  3968. }
  3969. el.slotScope = slotScope;
  3970. }
  3971. // slot="xxx"
  3972. var slotTarget = getBindingAttr(el, 'slot');
  3973. if (slotTarget) {
  3974. el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
  3975. el.slotTargetDynamic = !!(el.attrsMap[':slot'] || el.attrsMap['v-bind:slot']);
  3976. // preserve slot as an attribute for native shadow DOM compat
  3977. // only for non-scoped slots.
  3978. if (el.tag !== 'template' && !el.slotScope) {
  3979. addAttr(el, 'slot', slotTarget, getRawBindingAttr(el, 'slot'));
  3980. }
  3981. }
  3982. // 2.6 v-slot syntax
  3983. {
  3984. if (el.tag === 'template') {
  3985. // v-slot on <template>
  3986. var slotBinding = getAndRemoveAttrByRegex(el, slotRE);
  3987. if (slotBinding) {
  3988. {
  3989. if (el.slotTarget || el.slotScope) {
  3990. warn$1(
  3991. "Unexpected mixed usage of different slot syntaxes.",
  3992. el
  3993. );
  3994. }
  3995. if (el.parent && !maybeComponent(el.parent)) {
  3996. warn$1(
  3997. "<template v-slot> can only appear at the root level inside " +
  3998. "the receiving component",
  3999. el
  4000. );
  4001. }
  4002. }
  4003. var ref = getSlotName(slotBinding);
  4004. var name = ref.name;
  4005. var dynamic = ref.dynamic;
  4006. el.slotTarget = name;
  4007. el.slotTargetDynamic = dynamic;
  4008. el.slotScope = slotBinding.value || emptySlotScopeToken; // force it into a scoped slot for perf
  4009. }
  4010. } else {
  4011. // v-slot on component, denotes default slot
  4012. var slotBinding$1 = getAndRemoveAttrByRegex(el, slotRE);
  4013. if (slotBinding$1) {
  4014. {
  4015. if (!maybeComponent(el)) {
  4016. warn$1(
  4017. "v-slot can only be used on components or <template>.",
  4018. slotBinding$1
  4019. );
  4020. }
  4021. if (el.slotScope || el.slotTarget) {
  4022. warn$1(
  4023. "Unexpected mixed usage of different slot syntaxes.",
  4024. el
  4025. );
  4026. }
  4027. if (el.scopedSlots) {
  4028. warn$1(
  4029. "To avoid scope ambiguity, the default slot should also use " +
  4030. "<template> syntax when there are other named slots.",
  4031. slotBinding$1
  4032. );
  4033. }
  4034. }
  4035. // add the component's children to its default slot
  4036. var slots = el.scopedSlots || (el.scopedSlots = {});
  4037. var ref$1 = getSlotName(slotBinding$1);
  4038. var name$1 = ref$1.name;
  4039. var dynamic$1 = ref$1.dynamic;
  4040. var slotContainer = slots[name$1] = createASTElement('template', [], el);
  4041. slotContainer.slotTarget = name$1;
  4042. slotContainer.slotTargetDynamic = dynamic$1;
  4043. slotContainer.children = el.children.filter(function (c) {
  4044. if (!c.slotScope) {
  4045. c.parent = slotContainer;
  4046. return true
  4047. }
  4048. });
  4049. slotContainer.slotScope = slotBinding$1.value || emptySlotScopeToken;
  4050. // remove children as they are returned from scopedSlots now
  4051. el.children = [];
  4052. // mark el non-plain so data gets generated
  4053. el.plain = false;
  4054. }
  4055. }
  4056. }
  4057. }
  4058. function getSlotName (binding) {
  4059. var name = binding.name.replace(slotRE, '');
  4060. if (!name) {
  4061. if (binding.name[0] !== '#') {
  4062. name = 'default';
  4063. } else {
  4064. warn$1(
  4065. "v-slot shorthand syntax requires a slot name.",
  4066. binding
  4067. );
  4068. }
  4069. }
  4070. return dynamicArgRE.test(name)
  4071. // dynamic [name]
  4072. ? { name: name.slice(1, -1), dynamic: true }
  4073. // static name
  4074. : { name: ("\"" + name + "\""), dynamic: false }
  4075. }
  4076. // handle <slot/> outlets
  4077. function processSlotOutlet (el) {
  4078. if (el.tag === 'slot') {
  4079. el.slotName = getBindingAttr(el, 'name');
  4080. if (el.key) {
  4081. warn$1(
  4082. "`key` does not work on <slot> because slots are abstract outlets " +
  4083. "and can possibly expand into multiple elements. " +
  4084. "Use the key on a wrapping element instead.",
  4085. getRawBindingAttr(el, 'key')
  4086. );
  4087. }
  4088. }
  4089. }
  4090. function processComponent (el) {
  4091. var binding;
  4092. if ((binding = getBindingAttr(el, 'is'))) {
  4093. el.component = binding;
  4094. }
  4095. if (getAndRemoveAttr(el, 'inline-template') != null) {
  4096. el.inlineTemplate = true;
  4097. }
  4098. }
  4099. function processAttrs (el) {
  4100. var list = el.attrsList;
  4101. var i, l, name, rawName, value, modifiers, syncGen, isDynamic;
  4102. for (i = 0, l = list.length; i < l; i++) {
  4103. name = rawName = list[i].name;
  4104. value = list[i].value;
  4105. if (dirRE.test(name)) {
  4106. // mark element as dynamic
  4107. el.hasBindings = true;
  4108. // modifiers
  4109. modifiers = parseModifiers(name.replace(dirRE, ''));
  4110. // support .foo shorthand syntax for the .prop modifier
  4111. if (modifiers) {
  4112. name = name.replace(modifierRE, '');
  4113. }
  4114. if (bindRE.test(name)) { // v-bind
  4115. name = name.replace(bindRE, '');
  4116. value = parseFilters(value);
  4117. isDynamic = dynamicArgRE.test(name);
  4118. if (isDynamic) {
  4119. name = name.slice(1, -1);
  4120. }
  4121. if (
  4122. value.trim().length === 0
  4123. ) {
  4124. warn$1(
  4125. ("The value for a v-bind expression cannot be empty. Found in \"v-bind:" + name + "\"")
  4126. );
  4127. }
  4128. if (modifiers) {
  4129. if (modifiers.prop && !isDynamic) {
  4130. name = camelize(name);
  4131. if (name === 'innerHtml') { name = 'innerHTML'; }
  4132. }
  4133. if (modifiers.camel && !isDynamic) {
  4134. name = camelize(name);
  4135. }
  4136. if (modifiers.sync) {
  4137. syncGen = genAssignmentCode(value, "$event");
  4138. if (!isDynamic) {
  4139. addHandler(
  4140. el,
  4141. ("update:" + (camelize(name))),
  4142. syncGen,
  4143. null,
  4144. false,
  4145. warn$1,
  4146. list[i]
  4147. );
  4148. if (hyphenate(name) !== camelize(name)) {
  4149. addHandler(
  4150. el,
  4151. ("update:" + (hyphenate(name))),
  4152. syncGen,
  4153. null,
  4154. false,
  4155. warn$1,
  4156. list[i]
  4157. );
  4158. }
  4159. } else {
  4160. // handler w/ dynamic event name
  4161. addHandler(
  4162. el,
  4163. ("\"update:\"+(" + name + ")"),
  4164. syncGen,
  4165. null,
  4166. false,
  4167. warn$1,
  4168. list[i],
  4169. true // dynamic
  4170. );
  4171. }
  4172. }
  4173. }
  4174. if ((modifiers && modifiers.prop) || (
  4175. !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name)
  4176. )) {
  4177. addProp(el, name, value, list[i], isDynamic);
  4178. } else {
  4179. addAttr(el, name, value, list[i], isDynamic);
  4180. }
  4181. } else if (onRE.test(name)) { // v-on
  4182. name = name.replace(onRE, '');
  4183. isDynamic = dynamicArgRE.test(name);
  4184. if (isDynamic) {
  4185. name = name.slice(1, -1);
  4186. }
  4187. addHandler(el, name, value, modifiers, false, warn$1, list[i], isDynamic);
  4188. } else { // normal directives
  4189. name = name.replace(dirRE, '');
  4190. // parse arg
  4191. var argMatch = name.match(argRE);
  4192. var arg = argMatch && argMatch[1];
  4193. isDynamic = false;
  4194. if (arg) {
  4195. name = name.slice(0, -(arg.length + 1));
  4196. if (dynamicArgRE.test(arg)) {
  4197. arg = arg.slice(1, -1);
  4198. isDynamic = true;
  4199. }
  4200. }
  4201. addDirective(el, name, rawName, value, arg, isDynamic, modifiers, list[i]);
  4202. if (name === 'model') {
  4203. checkForAliasModel(el, value);
  4204. }
  4205. }
  4206. } else {
  4207. // literal attribute
  4208. {
  4209. var res = parseText(value, delimiters);
  4210. if (res) {
  4211. warn$1(
  4212. name + "=\"" + value + "\": " +
  4213. 'Interpolation inside attributes has been removed. ' +
  4214. 'Use v-bind or the colon shorthand instead. For example, ' +
  4215. 'instead of <div id="{{ val }}">, use <div :id="val">.',
  4216. list[i]
  4217. );
  4218. }
  4219. }
  4220. addAttr(el, name, JSON.stringify(value), list[i]);
  4221. // #6887 firefox doesn't update muted state if set via attribute
  4222. // even immediately after element creation
  4223. if (!el.component &&
  4224. name === 'muted' &&
  4225. platformMustUseProp(el.tag, el.attrsMap.type, name)) {
  4226. addProp(el, name, 'true', list[i]);
  4227. }
  4228. }
  4229. }
  4230. }
  4231. function checkInFor (el) {
  4232. var parent = el;
  4233. while (parent) {
  4234. if (parent.for !== undefined) {
  4235. return true
  4236. }
  4237. parent = parent.parent;
  4238. }
  4239. return false
  4240. }
  4241. function parseModifiers (name) {
  4242. var match = name.match(modifierRE);
  4243. if (match) {
  4244. var ret = {};
  4245. match.forEach(function (m) { ret[m.slice(1)] = true; });
  4246. return ret
  4247. }
  4248. }
  4249. function makeAttrsMap (attrs) {
  4250. var map = {};
  4251. for (var i = 0, l = attrs.length; i < l; i++) {
  4252. if (
  4253. map[attrs[i].name] && !isIE && !isEdge
  4254. ) {
  4255. warn$1('duplicate attribute: ' + attrs[i].name, attrs[i]);
  4256. }
  4257. map[attrs[i].name] = attrs[i].value;
  4258. }
  4259. return map
  4260. }
  4261. // for script (e.g. type="x/template") or style, do not decode content
  4262. function isTextTag (el) {
  4263. return el.tag === 'script' || el.tag === 'style'
  4264. }
  4265. function isForbiddenTag (el) {
  4266. return (
  4267. el.tag === 'style' ||
  4268. (el.tag === 'script' && (
  4269. !el.attrsMap.type ||
  4270. el.attrsMap.type === 'text/javascript'
  4271. ))
  4272. )
  4273. }
  4274. var ieNSBug = /^xmlns:NS\d+/;
  4275. var ieNSPrefix = /^NS\d+:/;
  4276. /* istanbul ignore next */
  4277. function guardIESVGBug (attrs) {
  4278. var res = [];
  4279. for (var i = 0; i < attrs.length; i++) {
  4280. var attr = attrs[i];
  4281. if (!ieNSBug.test(attr.name)) {
  4282. attr.name = attr.name.replace(ieNSPrefix, '');
  4283. res.push(attr);
  4284. }
  4285. }
  4286. return res
  4287. }
  4288. function checkForAliasModel (el, value) {
  4289. var _el = el;
  4290. while (_el) {
  4291. if (_el.for && _el.alias === value) {
  4292. warn$1(
  4293. "<" + (el.tag) + " v-model=\"" + value + "\">: " +
  4294. "You are binding v-model directly to a v-for iteration alias. " +
  4295. "This will not be able to modify the v-for source array because " +
  4296. "writing to the alias is like modifying a function local variable. " +
  4297. "Consider using an array of objects and use v-model on an object property instead.",
  4298. el.rawAttrsMap['v-model']
  4299. );
  4300. }
  4301. _el = _el.parent;
  4302. }
  4303. }
  4304. /* */
  4305. function preTransformNode (el, options) {
  4306. if (el.tag === 'input') {
  4307. var map = el.attrsMap;
  4308. if (!map['v-model']) {
  4309. return
  4310. }
  4311. var typeBinding;
  4312. if (map[':type'] || map['v-bind:type']) {
  4313. typeBinding = getBindingAttr(el, 'type');
  4314. }
  4315. if (!map.type && !typeBinding && map['v-bind']) {
  4316. typeBinding = "(" + (map['v-bind']) + ").type";
  4317. }
  4318. if (typeBinding) {
  4319. var ifCondition = getAndRemoveAttr(el, 'v-if', true);
  4320. var ifConditionExtra = ifCondition ? ("&&(" + ifCondition + ")") : "";
  4321. var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;
  4322. var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);
  4323. // 1. checkbox
  4324. var branch0 = cloneASTElement(el);
  4325. // process for on the main node
  4326. processFor(branch0);
  4327. addRawAttr(branch0, 'type', 'checkbox');
  4328. processElement(branch0, options);
  4329. branch0.processed = true; // prevent it from double-processed
  4330. branch0.if = "(" + typeBinding + ")==='checkbox'" + ifConditionExtra;
  4331. addIfCondition(branch0, {
  4332. exp: branch0.if,
  4333. block: branch0
  4334. });
  4335. // 2. add radio else-if condition
  4336. var branch1 = cloneASTElement(el);
  4337. getAndRemoveAttr(branch1, 'v-for', true);
  4338. addRawAttr(branch1, 'type', 'radio');
  4339. processElement(branch1, options);
  4340. addIfCondition(branch0, {
  4341. exp: "(" + typeBinding + ")==='radio'" + ifConditionExtra,
  4342. block: branch1
  4343. });
  4344. // 3. other
  4345. var branch2 = cloneASTElement(el);
  4346. getAndRemoveAttr(branch2, 'v-for', true);
  4347. addRawAttr(branch2, ':type', typeBinding);
  4348. processElement(branch2, options);
  4349. addIfCondition(branch0, {
  4350. exp: ifCondition,
  4351. block: branch2
  4352. });
  4353. if (hasElse) {
  4354. branch0.else = true;
  4355. } else if (elseIfCondition) {
  4356. branch0.elseif = elseIfCondition;
  4357. }
  4358. return branch0
  4359. }
  4360. }
  4361. }
  4362. function cloneASTElement (el) {
  4363. return createASTElement(el.tag, el.attrsList.slice(), el.parent)
  4364. }
  4365. var model$1 = {
  4366. preTransformNode: preTransformNode
  4367. };
  4368. var modules$1 = [
  4369. klass,
  4370. style,
  4371. model$1
  4372. ];
  4373. /* */
  4374. var warn$2;
  4375. // in some cases, the event used has to be determined at runtime
  4376. // so we used some reserved tokens during compile.
  4377. var RANGE_TOKEN = '__r';
  4378. function model$2 (
  4379. el,
  4380. dir,
  4381. _warn
  4382. ) {
  4383. warn$2 = _warn;
  4384. var value = dir.value;
  4385. var modifiers = dir.modifiers;
  4386. var tag = el.tag;
  4387. var type = el.attrsMap.type;
  4388. {
  4389. // inputs with type="file" are read only and setting the input's
  4390. // value will throw an error.
  4391. if (tag === 'input' && type === 'file') {
  4392. warn$2(
  4393. "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" +
  4394. "File inputs are read only. Use a v-on:change listener instead.",
  4395. el.rawAttrsMap['v-model']
  4396. );
  4397. }
  4398. }
  4399. if (el.component) {
  4400. genComponentModel(el, value, modifiers);
  4401. // component v-model doesn't need extra runtime
  4402. return false
  4403. } else if (tag === 'select') {
  4404. genSelect(el, value, modifiers);
  4405. } else if (tag === 'input' && type === 'checkbox') {
  4406. genCheckboxModel(el, value, modifiers);
  4407. } else if (tag === 'input' && type === 'radio') {
  4408. genRadioModel(el, value, modifiers);
  4409. } else if (tag === 'input' || tag === 'textarea') {
  4410. genDefaultModel(el, value, modifiers);
  4411. } else {
  4412. genComponentModel(el, value, modifiers);
  4413. // component v-model doesn't need extra runtime
  4414. return false
  4415. }
  4416. // ensure runtime directive metadata
  4417. return true
  4418. }
  4419. function genCheckboxModel (
  4420. el,
  4421. value,
  4422. modifiers
  4423. ) {
  4424. var number = modifiers && modifiers.number;
  4425. var valueBinding = getBindingAttr(el, 'value') || 'null';
  4426. var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
  4427. var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
  4428. addProp(el, 'checked',
  4429. "Array.isArray(" + value + ")" +
  4430. "?_i(" + value + "," + valueBinding + ")>-1" + (
  4431. trueValueBinding === 'true'
  4432. ? (":(" + value + ")")
  4433. : (":_q(" + value + "," + trueValueBinding + ")")
  4434. )
  4435. );
  4436. addHandler(el, 'change',
  4437. "var $$a=" + value + "," +
  4438. '$$el=$event.target,' +
  4439. "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" +
  4440. 'if(Array.isArray($$a)){' +
  4441. "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," +
  4442. '$$i=_i($$a,$$v);' +
  4443. "if($$el.checked){$$i<0&&(" + (genAssignmentCode(value, '$$a.concat([$$v])')) + ")}" +
  4444. "else{$$i>-1&&(" + (genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))')) + ")}" +
  4445. "}else{" + (genAssignmentCode(value, '$$c')) + "}",
  4446. null, true
  4447. );
  4448. }
  4449. function genRadioModel (
  4450. el,
  4451. value,
  4452. modifiers
  4453. ) {
  4454. var number = modifiers && modifiers.number;
  4455. var valueBinding = getBindingAttr(el, 'value') || 'null';
  4456. valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding;
  4457. addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")"));
  4458. addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true);
  4459. }
  4460. function genSelect (
  4461. el,
  4462. value,
  4463. modifiers
  4464. ) {
  4465. var number = modifiers && modifiers.number;
  4466. var selectedVal = "Array.prototype.filter" +
  4467. ".call($event.target.options,function(o){return o.selected})" +
  4468. ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" +
  4469. "return " + (number ? '_n(val)' : 'val') + "})";
  4470. var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]';
  4471. var code = "var $$selectedVal = " + selectedVal + ";";
  4472. code = code + " " + (genAssignmentCode(value, assignment));
  4473. addHandler(el, 'change', code, null, true);
  4474. }
  4475. function genDefaultModel (
  4476. el,
  4477. value,
  4478. modifiers
  4479. ) {
  4480. var type = el.attrsMap.type;
  4481. // warn if v-bind:value conflicts with v-model
  4482. // except for inputs with v-bind:type
  4483. {
  4484. var value$1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value'];
  4485. var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
  4486. if (value$1 && !typeBinding) {
  4487. var binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value';
  4488. warn$2(
  4489. binding + "=\"" + value$1 + "\" conflicts with v-model on the same element " +
  4490. 'because the latter already expands to a value binding internally',
  4491. el.rawAttrsMap[binding]
  4492. );
  4493. }
  4494. }
  4495. var ref = modifiers || {};
  4496. var lazy = ref.lazy;
  4497. var number = ref.number;
  4498. var trim = ref.trim;
  4499. var needCompositionGuard = !lazy && type !== 'range';
  4500. var event = lazy
  4501. ? 'change'
  4502. : type === 'range'
  4503. ? RANGE_TOKEN
  4504. : 'input';
  4505. var valueExpression = '$event.target.value';
  4506. if (trim) {
  4507. valueExpression = "$event.target.value.trim()";
  4508. }
  4509. if (number) {
  4510. valueExpression = "_n(" + valueExpression + ")";
  4511. }
  4512. var code = genAssignmentCode(value, valueExpression);
  4513. if (needCompositionGuard) {
  4514. code = "if($event.target.composing)return;" + code;
  4515. }
  4516. addProp(el, 'value', ("(" + value + ")"));
  4517. addHandler(el, event, code, null, true);
  4518. if (trim || number) {
  4519. addHandler(el, 'blur', '$forceUpdate()');
  4520. }
  4521. }
  4522. /* */
  4523. function text (el, dir) {
  4524. if (dir.value) {
  4525. addProp(el, 'textContent', ("_s(" + (dir.value) + ")"), dir);
  4526. }
  4527. }
  4528. /* */
  4529. function html (el, dir) {
  4530. if (dir.value) {
  4531. addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"), dir);
  4532. }
  4533. }
  4534. var directives$1 = {
  4535. model: model$2,
  4536. text: text,
  4537. html: html
  4538. };
  4539. /* */
  4540. var baseOptions = {
  4541. expectHTML: true,
  4542. modules: modules$1,
  4543. directives: directives$1,
  4544. isPreTag: isPreTag,
  4545. isUnaryTag: isUnaryTag,
  4546. mustUseProp: mustUseProp,
  4547. canBeLeftOpenTag: canBeLeftOpenTag,
  4548. isReservedTag: isReservedTag,
  4549. getTagNamespace: getTagNamespace,
  4550. staticKeys: genStaticKeys(modules$1)
  4551. };
  4552. /* */
  4553. var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
  4554. var fnInvokeRE = /\([^)]*?\);*$/;
  4555. var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
  4556. // KeyboardEvent.keyCode aliases
  4557. var keyCodes = {
  4558. esc: 27,
  4559. tab: 9,
  4560. enter: 13,
  4561. space: 32,
  4562. up: 38,
  4563. left: 37,
  4564. right: 39,
  4565. down: 40,
  4566. 'delete': [8, 46]
  4567. };
  4568. // KeyboardEvent.key aliases
  4569. var keyNames = {
  4570. // #7880: IE11 and Edge use `Esc` for Escape key name.
  4571. esc: ['Esc', 'Escape'],
  4572. tab: 'Tab',
  4573. enter: 'Enter',
  4574. // #9112: IE11 uses `Spacebar` for Space key name.
  4575. space: [' ', 'Spacebar'],
  4576. // #7806: IE11 uses key names without `Arrow` prefix for arrow keys.
  4577. up: ['Up', 'ArrowUp'],
  4578. left: ['Left', 'ArrowLeft'],
  4579. right: ['Right', 'ArrowRight'],
  4580. down: ['Down', 'ArrowDown'],
  4581. // #9112: IE11 uses `Del` for Delete key name.
  4582. 'delete': ['Backspace', 'Delete', 'Del']
  4583. };
  4584. // #4868: modifiers that prevent the execution of the listener
  4585. // need to explicitly return null so that we can determine whether to remove
  4586. // the listener for .once
  4587. var genGuard = function (condition) { return ("if(" + condition + ")return null;"); };
  4588. var modifierCode = {
  4589. stop: '$event.stopPropagation();',
  4590. prevent: '$event.preventDefault();',
  4591. self: genGuard("$event.target !== $event.currentTarget"),
  4592. ctrl: genGuard("!$event.ctrlKey"),
  4593. shift: genGuard("!$event.shiftKey"),
  4594. alt: genGuard("!$event.altKey"),
  4595. meta: genGuard("!$event.metaKey"),
  4596. left: genGuard("'button' in $event && $event.button !== 0"),
  4597. middle: genGuard("'button' in $event && $event.button !== 1"),
  4598. right: genGuard("'button' in $event && $event.button !== 2")
  4599. };
  4600. function genHandlers (
  4601. events,
  4602. isNative
  4603. ) {
  4604. var prefix = isNative ? 'nativeOn:' : 'on:';
  4605. var staticHandlers = "";
  4606. var dynamicHandlers = "";
  4607. for (var name in events) {
  4608. var handlerCode = genHandler(events[name]);
  4609. if (events[name] && events[name].dynamic) {
  4610. dynamicHandlers += name + "," + handlerCode + ",";
  4611. } else {
  4612. staticHandlers += "\"" + name + "\":" + handlerCode + ",";
  4613. }
  4614. }
  4615. staticHandlers = "{" + (staticHandlers.slice(0, -1)) + "}";
  4616. if (dynamicHandlers) {
  4617. return prefix + "_d(" + staticHandlers + ",[" + (dynamicHandlers.slice(0, -1)) + "])"
  4618. } else {
  4619. return prefix + staticHandlers
  4620. }
  4621. }
  4622. function genHandler (handler) {
  4623. if (!handler) {
  4624. return 'function(){}'
  4625. }
  4626. if (Array.isArray(handler)) {
  4627. return ("[" + (handler.map(function (handler) { return genHandler(handler); }).join(',')) + "]")
  4628. }
  4629. var isMethodPath = simplePathRE.test(handler.value);
  4630. var isFunctionExpression = fnExpRE.test(handler.value);
  4631. var isFunctionInvocation = simplePathRE.test(handler.value.replace(fnInvokeRE, ''));
  4632. if (!handler.modifiers) {
  4633. if (isMethodPath || isFunctionExpression) {
  4634. return handler.value
  4635. }
  4636. return ("function($event){" + (isFunctionInvocation ? ("return " + (handler.value)) : handler.value) + "}") // inline statement
  4637. } else {
  4638. var code = '';
  4639. var genModifierCode = '';
  4640. var keys = [];
  4641. for (var key in handler.modifiers) {
  4642. if (modifierCode[key]) {
  4643. genModifierCode += modifierCode[key];
  4644. // left/right
  4645. if (keyCodes[key]) {
  4646. keys.push(key);
  4647. }
  4648. } else if (key === 'exact') {
  4649. var modifiers = (handler.modifiers);
  4650. genModifierCode += genGuard(
  4651. ['ctrl', 'shift', 'alt', 'meta']
  4652. .filter(function (keyModifier) { return !modifiers[keyModifier]; })
  4653. .map(function (keyModifier) { return ("$event." + keyModifier + "Key"); })
  4654. .join('||')
  4655. );
  4656. } else {
  4657. keys.push(key);
  4658. }
  4659. }
  4660. if (keys.length) {
  4661. code += genKeyFilter(keys);
  4662. }
  4663. // Make sure modifiers like prevent and stop get executed after key filtering
  4664. if (genModifierCode) {
  4665. code += genModifierCode;
  4666. }
  4667. var handlerCode = isMethodPath
  4668. ? ("return " + (handler.value) + ".apply(null, arguments)")
  4669. : isFunctionExpression
  4670. ? ("return (" + (handler.value) + ").apply(null, arguments)")
  4671. : isFunctionInvocation
  4672. ? ("return " + (handler.value))
  4673. : handler.value;
  4674. return ("function($event){" + code + handlerCode + "}")
  4675. }
  4676. }
  4677. function genKeyFilter (keys) {
  4678. return (
  4679. // make sure the key filters only apply to KeyboardEvents
  4680. // #9441: can't use 'keyCode' in $event because Chrome autofill fires fake
  4681. // key events that do not have keyCode property...
  4682. "if(!$event.type.indexOf('key')&&" +
  4683. (keys.map(genFilterCode).join('&&')) + ")return null;"
  4684. )
  4685. }
  4686. function genFilterCode (key) {
  4687. var keyVal = parseInt(key, 10);
  4688. if (keyVal) {
  4689. return ("$event.keyCode!==" + keyVal)
  4690. }
  4691. var keyCode = keyCodes[key];
  4692. var keyName = keyNames[key];
  4693. return (
  4694. "_k($event.keyCode," +
  4695. (JSON.stringify(key)) + "," +
  4696. (JSON.stringify(keyCode)) + "," +
  4697. "$event.key," +
  4698. "" + (JSON.stringify(keyName)) +
  4699. ")"
  4700. )
  4701. }
  4702. /* */
  4703. function on (el, dir) {
  4704. if (dir.modifiers) {
  4705. warn("v-on without argument does not support modifiers.");
  4706. }
  4707. el.wrapListeners = function (code) { return ("_g(" + code + "," + (dir.value) + ")"); };
  4708. }
  4709. /* */
  4710. function bind$1 (el, dir) {
  4711. el.wrapData = function (code) {
  4712. return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + "," + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + ")")
  4713. };
  4714. }
  4715. /* */
  4716. var baseDirectives = {
  4717. on: on,
  4718. bind: bind$1,
  4719. cloak: noop
  4720. };
  4721. /* */
  4722. var CodegenState = function CodegenState (options) {
  4723. this.options = options;
  4724. this.warn = options.warn || baseWarn;
  4725. this.transforms = pluckModuleFunction(options.modules, 'transformCode');
  4726. this.dataGenFns = pluckModuleFunction(options.modules, 'genData');
  4727. this.directives = extend(extend({}, baseDirectives), options.directives);
  4728. var isReservedTag = options.isReservedTag || no;
  4729. this.maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };
  4730. this.onceId = 0;
  4731. this.staticRenderFns = [];
  4732. this.pre = false;
  4733. };
  4734. function generate (
  4735. ast,
  4736. options
  4737. ) {
  4738. var state = new CodegenState(options);
  4739. // fix #11483, Root level <script> tags should not be rendered.
  4740. var code = ast ? (ast.tag === 'script' ? 'null' : genElement(ast, state)) : '_c("div")';
  4741. return {
  4742. render: ("with(this){return " + code + "}"),
  4743. staticRenderFns: state.staticRenderFns
  4744. }
  4745. }
  4746. function genElement (el, state) {
  4747. if (el.parent) {
  4748. el.pre = el.pre || el.parent.pre;
  4749. }
  4750. if (el.staticRoot && !el.staticProcessed) {
  4751. return genStatic(el, state)
  4752. } else if (el.once && !el.onceProcessed) {
  4753. return genOnce(el, state)
  4754. } else if (el.for && !el.forProcessed) {
  4755. return genFor(el, state)
  4756. } else if (el.if && !el.ifProcessed) {
  4757. return genIf(el, state)
  4758. } else if (el.tag === 'template' && !el.slotTarget && !state.pre) {
  4759. return genChildren(el, state) || 'void 0'
  4760. } else if (el.tag === 'slot') {
  4761. return genSlot(el, state)
  4762. } else {
  4763. // component or element
  4764. var code;
  4765. if (el.component) {
  4766. code = genComponent(el.component, el, state);
  4767. } else {
  4768. var data;
  4769. if (!el.plain || (el.pre && state.maybeComponent(el))) {
  4770. data = genData$2(el, state);
  4771. }
  4772. var children = el.inlineTemplate ? null : genChildren(el, state, true);
  4773. code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")";
  4774. }
  4775. // module transforms
  4776. for (var i = 0; i < state.transforms.length; i++) {
  4777. code = state.transforms[i](el, code);
  4778. }
  4779. return code
  4780. }
  4781. }
  4782. // hoist static sub-trees out
  4783. function genStatic (el, state) {
  4784. el.staticProcessed = true;
  4785. // Some elements (templates) need to behave differently inside of a v-pre
  4786. // node. All pre nodes are static roots, so we can use this as a location to
  4787. // wrap a state change and reset it upon exiting the pre node.
  4788. var originalPreState = state.pre;
  4789. if (el.pre) {
  4790. state.pre = el.pre;
  4791. }
  4792. state.staticRenderFns.push(("with(this){return " + (genElement(el, state)) + "}"));
  4793. state.pre = originalPreState;
  4794. return ("_m(" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")")
  4795. }
  4796. // v-once
  4797. function genOnce (el, state) {
  4798. el.onceProcessed = true;
  4799. if (el.if && !el.ifProcessed) {
  4800. return genIf(el, state)
  4801. } else if (el.staticInFor) {
  4802. var key = '';
  4803. var parent = el.parent;
  4804. while (parent) {
  4805. if (parent.for) {
  4806. key = parent.key;
  4807. break
  4808. }
  4809. parent = parent.parent;
  4810. }
  4811. if (!key) {
  4812. state.warn(
  4813. "v-once can only be used inside v-for that is keyed. ",
  4814. el.rawAttrsMap['v-once']
  4815. );
  4816. return genElement(el, state)
  4817. }
  4818. return ("_o(" + (genElement(el, state)) + "," + (state.onceId++) + "," + key + ")")
  4819. } else {
  4820. return genStatic(el, state)
  4821. }
  4822. }
  4823. function genIf (
  4824. el,
  4825. state,
  4826. altGen,
  4827. altEmpty
  4828. ) {
  4829. el.ifProcessed = true; // avoid recursion
  4830. return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty)
  4831. }
  4832. function genIfConditions (
  4833. conditions,
  4834. state,
  4835. altGen,
  4836. altEmpty
  4837. ) {
  4838. if (!conditions.length) {
  4839. return altEmpty || '_e()'
  4840. }
  4841. var condition = conditions.shift();
  4842. if (condition.exp) {
  4843. return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions, state, altGen, altEmpty)))
  4844. } else {
  4845. return ("" + (genTernaryExp(condition.block)))
  4846. }
  4847. // v-if with v-once should generate code like (a)?_m(0):_m(1)
  4848. function genTernaryExp (el) {
  4849. return altGen
  4850. ? altGen(el, state)
  4851. : el.once
  4852. ? genOnce(el, state)
  4853. : genElement(el, state)
  4854. }
  4855. }
  4856. function genFor (
  4857. el,
  4858. state,
  4859. altGen,
  4860. altHelper
  4861. ) {
  4862. var exp = el.for;
  4863. var alias = el.alias;
  4864. var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
  4865. var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
  4866. if (state.maybeComponent(el) &&
  4867. el.tag !== 'slot' &&
  4868. el.tag !== 'template' &&
  4869. !el.key
  4870. ) {
  4871. state.warn(
  4872. "<" + (el.tag) + " v-for=\"" + alias + " in " + exp + "\">: component lists rendered with " +
  4873. "v-for should have explicit keys. " +
  4874. "See https://vuejs.org/guide/list.html#key for more info.",
  4875. el.rawAttrsMap['v-for'],
  4876. true /* tip */
  4877. );
  4878. }
  4879. el.forProcessed = true; // avoid recursion
  4880. return (altHelper || '_l') + "((" + exp + ")," +
  4881. "function(" + alias + iterator1 + iterator2 + "){" +
  4882. "return " + ((altGen || genElement)(el, state)) +
  4883. '})'
  4884. }
  4885. function genData$2 (el, state) {
  4886. var data = '{';
  4887. // directives first.
  4888. // directives may mutate the el's other properties before they are generated.
  4889. var dirs = genDirectives(el, state);
  4890. if (dirs) { data += dirs + ','; }
  4891. // key
  4892. if (el.key) {
  4893. data += "key:" + (el.key) + ",";
  4894. }
  4895. // ref
  4896. if (el.ref) {
  4897. data += "ref:" + (el.ref) + ",";
  4898. }
  4899. if (el.refInFor) {
  4900. data += "refInFor:true,";
  4901. }
  4902. // pre
  4903. if (el.pre) {
  4904. data += "pre:true,";
  4905. }
  4906. // record original tag name for components using "is" attribute
  4907. if (el.component) {
  4908. data += "tag:\"" + (el.tag) + "\",";
  4909. }
  4910. // module data generation functions
  4911. for (var i = 0; i < state.dataGenFns.length; i++) {
  4912. data += state.dataGenFns[i](el);
  4913. }
  4914. // attributes
  4915. if (el.attrs) {
  4916. data += "attrs:" + (genProps(el.attrs)) + ",";
  4917. }
  4918. // DOM props
  4919. if (el.props) {
  4920. data += "domProps:" + (genProps(el.props)) + ",";
  4921. }
  4922. // event handlers
  4923. if (el.events) {
  4924. data += (genHandlers(el.events, false)) + ",";
  4925. }
  4926. if (el.nativeEvents) {
  4927. data += (genHandlers(el.nativeEvents, true)) + ",";
  4928. }
  4929. // slot target
  4930. // only for non-scoped slots
  4931. if (el.slotTarget && !el.slotScope) {
  4932. data += "slot:" + (el.slotTarget) + ",";
  4933. }
  4934. // scoped slots
  4935. if (el.scopedSlots) {
  4936. data += (genScopedSlots(el, el.scopedSlots, state)) + ",";
  4937. }
  4938. // component v-model
  4939. if (el.model) {
  4940. data += "model:{value:" + (el.model.value) + ",callback:" + (el.model.callback) + ",expression:" + (el.model.expression) + "},";
  4941. }
  4942. // inline-template
  4943. if (el.inlineTemplate) {
  4944. var inlineTemplate = genInlineTemplate(el, state);
  4945. if (inlineTemplate) {
  4946. data += inlineTemplate + ",";
  4947. }
  4948. }
  4949. data = data.replace(/,$/, '') + '}';
  4950. // v-bind dynamic argument wrap
  4951. // v-bind with dynamic arguments must be applied using the same v-bind object
  4952. // merge helper so that class/style/mustUseProp attrs are handled correctly.
  4953. if (el.dynamicAttrs) {
  4954. data = "_b(" + data + ",\"" + (el.tag) + "\"," + (genProps(el.dynamicAttrs)) + ")";
  4955. }
  4956. // v-bind data wrap
  4957. if (el.wrapData) {
  4958. data = el.wrapData(data);
  4959. }
  4960. // v-on data wrap
  4961. if (el.wrapListeners) {
  4962. data = el.wrapListeners(data);
  4963. }
  4964. return data
  4965. }
  4966. function genDirectives (el, state) {
  4967. var dirs = el.directives;
  4968. if (!dirs) { return }
  4969. var res = 'directives:[';
  4970. var hasRuntime = false;
  4971. var i, l, dir, needRuntime;
  4972. for (i = 0, l = dirs.length; i < l; i++) {
  4973. dir = dirs[i];
  4974. needRuntime = true;
  4975. var gen = state.directives[dir.name];
  4976. if (gen) {
  4977. // compile-time directive that manipulates AST.
  4978. // returns true if it also needs a runtime counterpart.
  4979. needRuntime = !!gen(el, dir, state.warn);
  4980. }
  4981. if (needRuntime) {
  4982. hasRuntime = true;
  4983. res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:" + (dir.isDynamicArg ? dir.arg : ("\"" + (dir.arg) + "\""))) : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},";
  4984. }
  4985. }
  4986. if (hasRuntime) {
  4987. return res.slice(0, -1) + ']'
  4988. }
  4989. }
  4990. function genInlineTemplate (el, state) {
  4991. var ast = el.children[0];
  4992. if (el.children.length !== 1 || ast.type !== 1) {
  4993. state.warn(
  4994. 'Inline-template components must have exactly one child element.',
  4995. { start: el.start }
  4996. );
  4997. }
  4998. if (ast && ast.type === 1) {
  4999. var inlineRenderFns = generate(ast, state.options);
  5000. return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}")
  5001. }
  5002. }
  5003. function genScopedSlots (
  5004. el,
  5005. slots,
  5006. state
  5007. ) {
  5008. // by default scoped slots are considered "stable", this allows child
  5009. // components with only scoped slots to skip forced updates from parent.
  5010. // but in some cases we have to bail-out of this optimization
  5011. // for example if the slot contains dynamic names, has v-if or v-for on them...
  5012. var needsForceUpdate = el.for || Object.keys(slots).some(function (key) {
  5013. var slot = slots[key];
  5014. return (
  5015. slot.slotTargetDynamic ||
  5016. slot.if ||
  5017. slot.for ||
  5018. containsSlotChild(slot) // is passing down slot from parent which may be dynamic
  5019. )
  5020. });
  5021. // #9534: if a component with scoped slots is inside a conditional branch,
  5022. // it's possible for the same component to be reused but with different
  5023. // compiled slot content. To avoid that, we generate a unique key based on
  5024. // the generated code of all the slot contents.
  5025. var needsKey = !!el.if;
  5026. // OR when it is inside another scoped slot or v-for (the reactivity may be
  5027. // disconnected due to the intermediate scope variable)
  5028. // #9438, #9506
  5029. // TODO: this can be further optimized by properly analyzing in-scope bindings
  5030. // and skip force updating ones that do not actually use scope variables.
  5031. if (!needsForceUpdate) {
  5032. var parent = el.parent;
  5033. while (parent) {
  5034. if (
  5035. (parent.slotScope && parent.slotScope !== emptySlotScopeToken) ||
  5036. parent.for
  5037. ) {
  5038. needsForceUpdate = true;
  5039. break
  5040. }
  5041. if (parent.if) {
  5042. needsKey = true;
  5043. }
  5044. parent = parent.parent;
  5045. }
  5046. }
  5047. var generatedSlots = Object.keys(slots)
  5048. .map(function (key) { return genScopedSlot(slots[key], state); })
  5049. .join(',');
  5050. return ("scopedSlots:_u([" + generatedSlots + "]" + (needsForceUpdate ? ",null,true" : "") + (!needsForceUpdate && needsKey ? (",null,false," + (hash(generatedSlots))) : "") + ")")
  5051. }
  5052. function hash(str) {
  5053. var hash = 5381;
  5054. var i = str.length;
  5055. while(i) {
  5056. hash = (hash * 33) ^ str.charCodeAt(--i);
  5057. }
  5058. return hash >>> 0
  5059. }
  5060. function containsSlotChild (el) {
  5061. if (el.type === 1) {
  5062. if (el.tag === 'slot') {
  5063. return true
  5064. }
  5065. return el.children.some(containsSlotChild)
  5066. }
  5067. return false
  5068. }
  5069. function genScopedSlot (
  5070. el,
  5071. state
  5072. ) {
  5073. var isLegacySyntax = el.attrsMap['slot-scope'];
  5074. if (el.if && !el.ifProcessed && !isLegacySyntax) {
  5075. return genIf(el, state, genScopedSlot, "null")
  5076. }
  5077. if (el.for && !el.forProcessed) {
  5078. return genFor(el, state, genScopedSlot)
  5079. }
  5080. var slotScope = el.slotScope === emptySlotScopeToken
  5081. ? ""
  5082. : String(el.slotScope);
  5083. var fn = "function(" + slotScope + "){" +
  5084. "return " + (el.tag === 'template'
  5085. ? el.if && isLegacySyntax
  5086. ? ("(" + (el.if) + ")?" + (genChildren(el, state) || 'undefined') + ":undefined")
  5087. : genChildren(el, state) || 'undefined'
  5088. : genElement(el, state)) + "}";
  5089. // reverse proxy v-slot without scope on this.$slots
  5090. var reverseProxy = slotScope ? "" : ",proxy:true";
  5091. return ("{key:" + (el.slotTarget || "\"default\"") + ",fn:" + fn + reverseProxy + "}")
  5092. }
  5093. function genChildren (
  5094. el,
  5095. state,
  5096. checkSkip,
  5097. altGenElement,
  5098. altGenNode
  5099. ) {
  5100. var children = el.children;
  5101. if (children.length) {
  5102. var el$1 = children[0];
  5103. // optimize single v-for
  5104. if (children.length === 1 &&
  5105. el$1.for &&
  5106. el$1.tag !== 'template' &&
  5107. el$1.tag !== 'slot'
  5108. ) {
  5109. var normalizationType = checkSkip
  5110. ? state.maybeComponent(el$1) ? ",1" : ",0"
  5111. : "";
  5112. return ("" + ((altGenElement || genElement)(el$1, state)) + normalizationType)
  5113. }
  5114. var normalizationType$1 = checkSkip
  5115. ? getNormalizationType(children, state.maybeComponent)
  5116. : 0;
  5117. var gen = altGenNode || genNode;
  5118. return ("[" + (children.map(function (c) { return gen(c, state); }).join(',')) + "]" + (normalizationType$1 ? ("," + normalizationType$1) : ''))
  5119. }
  5120. }
  5121. // determine the normalization needed for the children array.
  5122. // 0: no normalization needed
  5123. // 1: simple normalization needed (possible 1-level deep nested array)
  5124. // 2: full normalization needed
  5125. function getNormalizationType (
  5126. children,
  5127. maybeComponent
  5128. ) {
  5129. var res = 0;
  5130. for (var i = 0; i < children.length; i++) {
  5131. var el = children[i];
  5132. if (el.type !== 1) {
  5133. continue
  5134. }
  5135. if (needsNormalization(el) ||
  5136. (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
  5137. res = 2;
  5138. break
  5139. }
  5140. if (maybeComponent(el) ||
  5141. (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
  5142. res = 1;
  5143. }
  5144. }
  5145. return res
  5146. }
  5147. function needsNormalization (el) {
  5148. return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'
  5149. }
  5150. function genNode (node, state) {
  5151. if (node.type === 1) {
  5152. return genElement(node, state)
  5153. } else if (node.type === 3 && node.isComment) {
  5154. return genComment(node)
  5155. } else {
  5156. return genText(node)
  5157. }
  5158. }
  5159. function genText (text) {
  5160. return ("_v(" + (text.type === 2
  5161. ? text.expression // no need for () because already wrapped in _s()
  5162. : transformSpecialNewlines(JSON.stringify(text.text))) + ")")
  5163. }
  5164. function genComment (comment) {
  5165. return ("_e(" + (JSON.stringify(comment.text)) + ")")
  5166. }
  5167. function genSlot (el, state) {
  5168. var slotName = el.slotName || '"default"';
  5169. var children = genChildren(el, state);
  5170. var res = "_t(" + slotName + (children ? (",function(){return " + children + "}") : '');
  5171. var attrs = el.attrs || el.dynamicAttrs
  5172. ? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { return ({
  5173. // slot props are camelized
  5174. name: camelize(attr.name),
  5175. value: attr.value,
  5176. dynamic: attr.dynamic
  5177. }); }))
  5178. : null;
  5179. var bind$$1 = el.attrsMap['v-bind'];
  5180. if ((attrs || bind$$1) && !children) {
  5181. res += ",null";
  5182. }
  5183. if (attrs) {
  5184. res += "," + attrs;
  5185. }
  5186. if (bind$$1) {
  5187. res += (attrs ? '' : ',null') + "," + bind$$1;
  5188. }
  5189. return res + ')'
  5190. }
  5191. // componentName is el.component, take it as argument to shun flow's pessimistic refinement
  5192. function genComponent (
  5193. componentName,
  5194. el,
  5195. state
  5196. ) {
  5197. var children = el.inlineTemplate ? null : genChildren(el, state, true);
  5198. return ("_c(" + componentName + "," + (genData$2(el, state)) + (children ? ("," + children) : '') + ")")
  5199. }
  5200. function genProps (props) {
  5201. var staticProps = "";
  5202. var dynamicProps = "";
  5203. for (var i = 0; i < props.length; i++) {
  5204. var prop = props[i];
  5205. var value = transformSpecialNewlines(prop.value);
  5206. if (prop.dynamic) {
  5207. dynamicProps += (prop.name) + "," + value + ",";
  5208. } else {
  5209. staticProps += "\"" + (prop.name) + "\":" + value + ",";
  5210. }
  5211. }
  5212. staticProps = "{" + (staticProps.slice(0, -1)) + "}";
  5213. if (dynamicProps) {
  5214. return ("_d(" + staticProps + ",[" + (dynamicProps.slice(0, -1)) + "])")
  5215. } else {
  5216. return staticProps
  5217. }
  5218. }
  5219. // #3895, #4268
  5220. function transformSpecialNewlines (text) {
  5221. return text
  5222. .replace(/\u2028/g, '\\u2028')
  5223. .replace(/\u2029/g, '\\u2029')
  5224. }
  5225. /* */
  5226. var plainStringRE = /^"(?:[^"\\]|\\.)*"$|^'(?:[^'\\]|\\.)*'$/;
  5227. // let the model AST transform translate v-model into appropriate
  5228. // props bindings
  5229. function applyModelTransform (el, state) {
  5230. if (el.directives) {
  5231. for (var i = 0; i < el.directives.length; i++) {
  5232. var dir = el.directives[i];
  5233. if (dir.name === 'model') {
  5234. state.directives.model(el, dir, state.warn);
  5235. // remove value for textarea as its converted to text
  5236. if (el.tag === 'textarea' && el.props) {
  5237. el.props = el.props.filter(function (p) { return p.name !== 'value'; });
  5238. }
  5239. break
  5240. }
  5241. }
  5242. }
  5243. }
  5244. function genAttrSegments (
  5245. attrs
  5246. ) {
  5247. return attrs.map(function (ref) {
  5248. var name = ref.name;
  5249. var value = ref.value;
  5250. return genAttrSegment(name, value);
  5251. })
  5252. }
  5253. function genDOMPropSegments (
  5254. props,
  5255. attrs
  5256. ) {
  5257. var segments = [];
  5258. props.forEach(function (ref) {
  5259. var name = ref.name;
  5260. var value = ref.value;
  5261. name = propsToAttrMap[name] || name.toLowerCase();
  5262. if (isRenderableAttr(name) &&
  5263. !(attrs && attrs.some(function (a) { return a.name === name; }))
  5264. ) {
  5265. segments.push(genAttrSegment(name, value));
  5266. }
  5267. });
  5268. return segments
  5269. }
  5270. function genAttrSegment (name, value) {
  5271. if (plainStringRE.test(value)) {
  5272. // force double quote
  5273. value = value.replace(/^'|'$/g, '"');
  5274. // force enumerated attr to "true"
  5275. if (isEnumeratedAttr(name) && value !== "\"false\"") {
  5276. value = "\"true\"";
  5277. }
  5278. return {
  5279. type: RAW,
  5280. value: isBooleanAttr(name)
  5281. ? (" " + name + "=\"" + name + "\"")
  5282. : value === '""'
  5283. ? (" " + name)
  5284. : (" " + name + "=\"" + (JSON.parse(value)) + "\"")
  5285. }
  5286. } else {
  5287. return {
  5288. type: EXPRESSION,
  5289. value: ("_ssrAttr(" + (JSON.stringify(name)) + "," + value + ")")
  5290. }
  5291. }
  5292. }
  5293. function genClassSegments (
  5294. staticClass,
  5295. classBinding
  5296. ) {
  5297. if (staticClass && !classBinding) {
  5298. return [{ type: RAW, value: (" class=\"" + (JSON.parse(staticClass)) + "\"") }]
  5299. } else {
  5300. return [{
  5301. type: EXPRESSION,
  5302. value: ("_ssrClass(" + (staticClass || 'null') + "," + (classBinding || 'null') + ")")
  5303. }]
  5304. }
  5305. }
  5306. function genStyleSegments (
  5307. staticStyle,
  5308. parsedStaticStyle,
  5309. styleBinding,
  5310. vShowExpression
  5311. ) {
  5312. if (staticStyle && !styleBinding && !vShowExpression) {
  5313. return [{ type: RAW, value: (" style=" + (JSON.stringify(staticStyle))) }]
  5314. } else {
  5315. return [{
  5316. type: EXPRESSION,
  5317. value: ("_ssrStyle(" + (parsedStaticStyle || 'null') + "," + (styleBinding || 'null') + ", " + (vShowExpression
  5318. ? ("{ display: (" + vShowExpression + ") ? '' : 'none' }")
  5319. : 'null') + ")")
  5320. }]
  5321. }
  5322. }
  5323. /* */
  5324. // optimizability constants
  5325. var optimizability = {
  5326. FALSE: 0, // whole sub tree un-optimizable
  5327. FULL: 1, // whole sub tree optimizable
  5328. SELF: 2, // self optimizable but has some un-optimizable children
  5329. CHILDREN: 3, // self un-optimizable but have fully optimizable children
  5330. PARTIAL: 4 // self un-optimizable with some un-optimizable children
  5331. };
  5332. var isPlatformReservedTag;
  5333. function optimize (root, options) {
  5334. if (!root) { return }
  5335. isPlatformReservedTag = options.isReservedTag || no;
  5336. walk(root, true);
  5337. }
  5338. function walk (node, isRoot) {
  5339. if (isUnOptimizableTree(node)) {
  5340. node.ssrOptimizability = optimizability.FALSE;
  5341. return
  5342. }
  5343. // root node or nodes with custom directives should always be a VNode
  5344. var selfUnoptimizable = isRoot || hasCustomDirective(node);
  5345. var check = function (child) {
  5346. if (child.ssrOptimizability !== optimizability.FULL) {
  5347. node.ssrOptimizability = selfUnoptimizable
  5348. ? optimizability.PARTIAL
  5349. : optimizability.SELF;
  5350. }
  5351. };
  5352. if (selfUnoptimizable) {
  5353. node.ssrOptimizability = optimizability.CHILDREN;
  5354. }
  5355. if (node.type === 1) {
  5356. for (var i = 0, l = node.children.length; i < l; i++) {
  5357. var child = node.children[i];
  5358. walk(child);
  5359. check(child);
  5360. }
  5361. if (node.ifConditions) {
  5362. for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
  5363. var block = node.ifConditions[i$1].block;
  5364. walk(block, isRoot);
  5365. check(block);
  5366. }
  5367. }
  5368. if (node.ssrOptimizability == null ||
  5369. (!isRoot && (node.attrsMap['v-html'] || node.attrsMap['v-text']))
  5370. ) {
  5371. node.ssrOptimizability = optimizability.FULL;
  5372. } else {
  5373. node.children = optimizeSiblings(node);
  5374. }
  5375. } else {
  5376. node.ssrOptimizability = optimizability.FULL;
  5377. }
  5378. }
  5379. function optimizeSiblings (el) {
  5380. var children = el.children;
  5381. var optimizedChildren = [];
  5382. var currentOptimizableGroup = [];
  5383. var pushGroup = function () {
  5384. if (currentOptimizableGroup.length) {
  5385. optimizedChildren.push({
  5386. type: 1,
  5387. parent: el,
  5388. tag: 'template',
  5389. attrsList: [],
  5390. attrsMap: {},
  5391. rawAttrsMap: {},
  5392. children: currentOptimizableGroup,
  5393. ssrOptimizability: optimizability.FULL
  5394. });
  5395. }
  5396. currentOptimizableGroup = [];
  5397. };
  5398. for (var i = 0; i < children.length; i++) {
  5399. var c = children[i];
  5400. if (c.ssrOptimizability === optimizability.FULL) {
  5401. currentOptimizableGroup.push(c);
  5402. } else {
  5403. // wrap fully-optimizable adjacent siblings inside a template tag
  5404. // so that they can be optimized into a single ssrNode by codegen
  5405. pushGroup();
  5406. optimizedChildren.push(c);
  5407. }
  5408. }
  5409. pushGroup();
  5410. return optimizedChildren
  5411. }
  5412. function isUnOptimizableTree (node) {
  5413. if (node.type === 2 || node.type === 3) { // text or expression
  5414. return false
  5415. }
  5416. return (
  5417. isBuiltInTag(node.tag) || // built-in (slot, component)
  5418. !isPlatformReservedTag(node.tag) || // custom component
  5419. !!node.component || // "is" component
  5420. isSelectWithModel(node) // <select v-model> requires runtime inspection
  5421. )
  5422. }
  5423. var isBuiltInDir = makeMap('text,html,show,on,bind,model,pre,cloak,once');
  5424. function hasCustomDirective (node) {
  5425. return (
  5426. node.type === 1 &&
  5427. node.directives &&
  5428. node.directives.some(function (d) { return !isBuiltInDir(d.name); })
  5429. )
  5430. }
  5431. // <select v-model> cannot be optimized because it requires a runtime check
  5432. // to determine proper selected option
  5433. function isSelectWithModel (node) {
  5434. return (
  5435. node.type === 1 &&
  5436. node.tag === 'select' &&
  5437. node.directives != null &&
  5438. node.directives.some(function (d) { return d.name === 'model'; })
  5439. )
  5440. }
  5441. /* */
  5442. // segment types
  5443. var RAW = 0;
  5444. var INTERPOLATION = 1;
  5445. var EXPRESSION = 2;
  5446. function generate$1 (
  5447. ast,
  5448. options
  5449. ) {
  5450. var state = new CodegenState(options);
  5451. var code = ast ? genSSRElement(ast, state) : '_c("div")';
  5452. return {
  5453. render: ("with(this){return " + code + "}"),
  5454. staticRenderFns: state.staticRenderFns
  5455. }
  5456. }
  5457. function genSSRElement (el, state) {
  5458. if (el.for && !el.forProcessed) {
  5459. return genFor(el, state, genSSRElement)
  5460. } else if (el.if && !el.ifProcessed) {
  5461. return genIf(el, state, genSSRElement)
  5462. } else if (el.tag === 'template' && !el.slotTarget) {
  5463. return el.ssrOptimizability === optimizability.FULL
  5464. ? genChildrenAsStringNode(el, state)
  5465. : genSSRChildren(el, state) || 'void 0'
  5466. }
  5467. switch (el.ssrOptimizability) {
  5468. case optimizability.FULL:
  5469. // stringify whole tree
  5470. return genStringElement(el, state)
  5471. case optimizability.SELF:
  5472. // stringify self and check children
  5473. return genStringElementWithChildren(el, state)
  5474. case optimizability.CHILDREN:
  5475. // generate self as VNode and stringify children
  5476. return genNormalElement(el, state, true)
  5477. case optimizability.PARTIAL:
  5478. // generate self as VNode and check children
  5479. return genNormalElement(el, state, false)
  5480. default:
  5481. // bail whole tree
  5482. return genElement(el, state)
  5483. }
  5484. }
  5485. function genNormalElement (el, state, stringifyChildren) {
  5486. var data = el.plain ? undefined : genData$2(el, state);
  5487. var children = stringifyChildren
  5488. ? ("[" + (genChildrenAsStringNode(el, state)) + "]")
  5489. : genSSRChildren(el, state, true);
  5490. return ("_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")")
  5491. }
  5492. function genSSRChildren (el, state, checkSkip) {
  5493. return genChildren(el, state, checkSkip, genSSRElement, genSSRNode)
  5494. }
  5495. function genSSRNode (el, state) {
  5496. return el.type === 1
  5497. ? genSSRElement(el, state)
  5498. : genText(el)
  5499. }
  5500. function genChildrenAsStringNode (el, state) {
  5501. return el.children.length
  5502. ? ("_ssrNode(" + (flattenSegments(childrenToSegments(el, state))) + ")")
  5503. : ''
  5504. }
  5505. function genStringElement (el, state) {
  5506. return ("_ssrNode(" + (elementToString(el, state)) + ")")
  5507. }
  5508. function genStringElementWithChildren (el, state) {
  5509. var children = genSSRChildren(el, state, true);
  5510. return ("_ssrNode(" + (flattenSegments(elementToOpenTagSegments(el, state))) + ",\"</" + (el.tag) + ">\"" + (children ? ("," + children) : '') + ")")
  5511. }
  5512. function elementToString (el, state) {
  5513. return ("(" + (flattenSegments(elementToSegments(el, state))) + ")")
  5514. }
  5515. function elementToSegments (el, state) {
  5516. // v-for / v-if
  5517. if (el.for && !el.forProcessed) {
  5518. el.forProcessed = true;
  5519. return [{
  5520. type: EXPRESSION,
  5521. value: genFor(el, state, elementToString, '_ssrList')
  5522. }]
  5523. } else if (el.if && !el.ifProcessed) {
  5524. el.ifProcessed = true;
  5525. return [{
  5526. type: EXPRESSION,
  5527. value: genIf(el, state, elementToString, '"<!---->"')
  5528. }]
  5529. } else if (el.tag === 'template') {
  5530. return childrenToSegments(el, state)
  5531. }
  5532. var openSegments = elementToOpenTagSegments(el, state);
  5533. var childrenSegments = childrenToSegments(el, state);
  5534. var ref = state.options;
  5535. var isUnaryTag = ref.isUnaryTag;
  5536. var close = (isUnaryTag && isUnaryTag(el.tag))
  5537. ? []
  5538. : [{ type: RAW, value: ("</" + (el.tag) + ">") }];
  5539. return openSegments.concat(childrenSegments, close)
  5540. }
  5541. function elementToOpenTagSegments (el, state) {
  5542. applyModelTransform(el, state);
  5543. var binding;
  5544. var segments = [{ type: RAW, value: ("<" + (el.tag)) }];
  5545. // attrs
  5546. if (el.attrs) {
  5547. segments.push.apply(segments, genAttrSegments(el.attrs));
  5548. }
  5549. // domProps
  5550. if (el.props) {
  5551. segments.push.apply(segments, genDOMPropSegments(el.props, el.attrs));
  5552. }
  5553. // v-bind="object"
  5554. if ((binding = el.attrsMap['v-bind'])) {
  5555. segments.push({ type: EXPRESSION, value: ("_ssrAttrs(" + binding + ")") });
  5556. }
  5557. // v-bind.prop="object"
  5558. if ((binding = el.attrsMap['v-bind.prop'])) {
  5559. segments.push({ type: EXPRESSION, value: ("_ssrDOMProps(" + binding + ")") });
  5560. }
  5561. // class
  5562. if (el.staticClass || el.classBinding) {
  5563. segments.push.apply(
  5564. segments,
  5565. genClassSegments(el.staticClass, el.classBinding)
  5566. );
  5567. }
  5568. // style & v-show
  5569. if (el.staticStyle || el.styleBinding || el.attrsMap['v-show']) {
  5570. segments.push.apply(
  5571. segments,
  5572. genStyleSegments(
  5573. el.attrsMap.style,
  5574. el.staticStyle,
  5575. el.styleBinding,
  5576. el.attrsMap['v-show']
  5577. )
  5578. );
  5579. }
  5580. // _scopedId
  5581. if (state.options.scopeId) {
  5582. segments.push({ type: RAW, value: (" " + (state.options.scopeId)) });
  5583. }
  5584. segments.push({ type: RAW, value: ">" });
  5585. return segments
  5586. }
  5587. function childrenToSegments (el, state) {
  5588. var binding;
  5589. if ((binding = el.attrsMap['v-html'])) {
  5590. return [{ type: EXPRESSION, value: ("_s(" + binding + ")") }]
  5591. }
  5592. if ((binding = el.attrsMap['v-text'])) {
  5593. return [{ type: INTERPOLATION, value: ("_s(" + binding + ")") }]
  5594. }
  5595. if (el.tag === 'textarea' && (binding = el.attrsMap['v-model'])) {
  5596. return [{ type: INTERPOLATION, value: ("_s(" + binding + ")") }]
  5597. }
  5598. return el.children
  5599. ? nodesToSegments(el.children, state)
  5600. : []
  5601. }
  5602. function nodesToSegments (
  5603. children,
  5604. state
  5605. ) {
  5606. var segments = [];
  5607. for (var i = 0; i < children.length; i++) {
  5608. var c = children[i];
  5609. if (c.type === 1) {
  5610. segments.push.apply(segments, elementToSegments(c, state));
  5611. } else if (c.type === 2) {
  5612. segments.push({ type: INTERPOLATION, value: c.expression });
  5613. } else if (c.type === 3) {
  5614. var text = escape(c.text);
  5615. if (c.isComment) {
  5616. text = '<!--' + text + '-->';
  5617. }
  5618. segments.push({ type: RAW, value: text });
  5619. }
  5620. }
  5621. return segments
  5622. }
  5623. function flattenSegments (segments) {
  5624. var mergedSegments = [];
  5625. var textBuffer = '';
  5626. var pushBuffer = function () {
  5627. if (textBuffer) {
  5628. mergedSegments.push(JSON.stringify(textBuffer));
  5629. textBuffer = '';
  5630. }
  5631. };
  5632. for (var i = 0; i < segments.length; i++) {
  5633. var s = segments[i];
  5634. if (s.type === RAW) {
  5635. textBuffer += s.value;
  5636. } else if (s.type === INTERPOLATION) {
  5637. pushBuffer();
  5638. mergedSegments.push(("_ssrEscape(" + (s.value) + ")"));
  5639. } else if (s.type === EXPRESSION) {
  5640. pushBuffer();
  5641. mergedSegments.push(("(" + (s.value) + ")"));
  5642. }
  5643. }
  5644. pushBuffer();
  5645. return mergedSegments.join('+')
  5646. }
  5647. /* */
  5648. // these keywords should not appear inside expressions, but operators like
  5649. // typeof, instanceof and in are allowed
  5650. var prohibitedKeywordRE = new RegExp('\\b' + (
  5651. 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
  5652. 'super,throw,while,yield,delete,export,import,return,switch,default,' +
  5653. 'extends,finally,continue,debugger,function,arguments'
  5654. ).split(',').join('\\b|\\b') + '\\b');
  5655. // these unary operators should not be used as property/method names
  5656. var unaryOperatorsRE = new RegExp('\\b' + (
  5657. 'delete,typeof,void'
  5658. ).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
  5659. // strip strings in expressions
  5660. var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
  5661. // detect problematic expressions in a template
  5662. function detectErrors (ast, warn) {
  5663. if (ast) {
  5664. checkNode(ast, warn);
  5665. }
  5666. }
  5667. function checkNode (node, warn) {
  5668. if (node.type === 1) {
  5669. for (var name in node.attrsMap) {
  5670. if (dirRE.test(name)) {
  5671. var value = node.attrsMap[name];
  5672. if (value) {
  5673. var range = node.rawAttrsMap[name];
  5674. if (name === 'v-for') {
  5675. checkFor(node, ("v-for=\"" + value + "\""), warn, range);
  5676. } else if (name === 'v-slot' || name[0] === '#') {
  5677. checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range);
  5678. } else if (onRE.test(name)) {
  5679. checkEvent(value, (name + "=\"" + value + "\""), warn, range);
  5680. } else {
  5681. checkExpression(value, (name + "=\"" + value + "\""), warn, range);
  5682. }
  5683. }
  5684. }
  5685. }
  5686. if (node.children) {
  5687. for (var i = 0; i < node.children.length; i++) {
  5688. checkNode(node.children[i], warn);
  5689. }
  5690. }
  5691. } else if (node.type === 2) {
  5692. checkExpression(node.expression, node.text, warn, node);
  5693. }
  5694. }
  5695. function checkEvent (exp, text, warn, range) {
  5696. var stripped = exp.replace(stripStringRE, '');
  5697. var keywordMatch = stripped.match(unaryOperatorsRE);
  5698. if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
  5699. warn(
  5700. "avoid using JavaScript unary operator as property name: " +
  5701. "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()),
  5702. range
  5703. );
  5704. }
  5705. checkExpression(exp, text, warn, range);
  5706. }
  5707. function checkFor (node, text, warn, range) {
  5708. checkExpression(node.for || '', text, warn, range);
  5709. checkIdentifier(node.alias, 'v-for alias', text, warn, range);
  5710. checkIdentifier(node.iterator1, 'v-for iterator', text, warn, range);
  5711. checkIdentifier(node.iterator2, 'v-for iterator', text, warn, range);
  5712. }
  5713. function checkIdentifier (
  5714. ident,
  5715. type,
  5716. text,
  5717. warn,
  5718. range
  5719. ) {
  5720. if (typeof ident === 'string') {
  5721. try {
  5722. new Function(("var " + ident + "=_"));
  5723. } catch (e) {
  5724. warn(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())), range);
  5725. }
  5726. }
  5727. }
  5728. function checkExpression (exp, text, warn, range) {
  5729. try {
  5730. new Function(("return " + exp));
  5731. } catch (e) {
  5732. var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
  5733. if (keywordMatch) {
  5734. warn(
  5735. "avoid using JavaScript keyword as property name: " +
  5736. "\"" + (keywordMatch[0]) + "\"\n Raw expression: " + (text.trim()),
  5737. range
  5738. );
  5739. } else {
  5740. warn(
  5741. "invalid expression: " + (e.message) + " in\n\n" +
  5742. " " + exp + "\n\n" +
  5743. " Raw expression: " + (text.trim()) + "\n",
  5744. range
  5745. );
  5746. }
  5747. }
  5748. }
  5749. function checkFunctionParameterExpression (exp, text, warn, range) {
  5750. try {
  5751. new Function(exp, '');
  5752. } catch (e) {
  5753. warn(
  5754. "invalid function parameter expression: " + (e.message) + " in\n\n" +
  5755. " " + exp + "\n\n" +
  5756. " Raw expression: " + (text.trim()) + "\n",
  5757. range
  5758. );
  5759. }
  5760. }
  5761. /* */
  5762. var range = 2;
  5763. function generateCodeFrame (
  5764. source,
  5765. start,
  5766. end
  5767. ) {
  5768. if ( start === void 0 ) start = 0;
  5769. if ( end === void 0 ) end = source.length;
  5770. var lines = source.split(/\r?\n/);
  5771. var count = 0;
  5772. var res = [];
  5773. for (var i = 0; i < lines.length; i++) {
  5774. count += lines[i].length + 1;
  5775. if (count >= start) {
  5776. for (var j = i - range; j <= i + range || end > count; j++) {
  5777. if (j < 0 || j >= lines.length) { continue }
  5778. res.push(("" + (j + 1) + (repeat$1(" ", 3 - String(j + 1).length)) + "| " + (lines[j])));
  5779. var lineLength = lines[j].length;
  5780. if (j === i) {
  5781. // push underline
  5782. var pad = start - (count - lineLength) + 1;
  5783. var length = end > count ? lineLength - pad : end - start;
  5784. res.push(" | " + repeat$1(" ", pad) + repeat$1("^", length));
  5785. } else if (j > i) {
  5786. if (end > count) {
  5787. var length$1 = Math.min(end - count, lineLength);
  5788. res.push(" | " + repeat$1("^", length$1));
  5789. }
  5790. count += lineLength + 1;
  5791. }
  5792. }
  5793. break
  5794. }
  5795. }
  5796. return res.join('\n')
  5797. }
  5798. function repeat$1 (str, n) {
  5799. var result = '';
  5800. if (n > 0) {
  5801. while (true) { // eslint-disable-line
  5802. if (n & 1) { result += str; }
  5803. n >>>= 1;
  5804. if (n <= 0) { break }
  5805. str += str;
  5806. }
  5807. }
  5808. return result
  5809. }
  5810. /* */
  5811. function createFunction (code, errors) {
  5812. try {
  5813. return new Function(code)
  5814. } catch (err) {
  5815. errors.push({ err: err, code: code });
  5816. return noop
  5817. }
  5818. }
  5819. function createCompileToFunctionFn (compile) {
  5820. var cache = Object.create(null);
  5821. return function compileToFunctions (
  5822. template,
  5823. options,
  5824. vm
  5825. ) {
  5826. options = extend({}, options);
  5827. var warn$$1 = options.warn || warn;
  5828. delete options.warn;
  5829. /* istanbul ignore if */
  5830. {
  5831. // detect possible CSP restriction
  5832. try {
  5833. new Function('return 1');
  5834. } catch (e) {
  5835. if (e.toString().match(/unsafe-eval|CSP/)) {
  5836. warn$$1(
  5837. 'It seems you are using the standalone build of Vue.js in an ' +
  5838. 'environment with Content Security Policy that prohibits unsafe-eval. ' +
  5839. 'The template compiler cannot work in this environment. Consider ' +
  5840. 'relaxing the policy to allow unsafe-eval or pre-compiling your ' +
  5841. 'templates into render functions.'
  5842. );
  5843. }
  5844. }
  5845. }
  5846. // check cache
  5847. var key = options.delimiters
  5848. ? String(options.delimiters) + template
  5849. : template;
  5850. if (cache[key]) {
  5851. return cache[key]
  5852. }
  5853. // compile
  5854. var compiled = compile(template, options);
  5855. // check compilation errors/tips
  5856. {
  5857. if (compiled.errors && compiled.errors.length) {
  5858. if (options.outputSourceRange) {
  5859. compiled.errors.forEach(function (e) {
  5860. warn$$1(
  5861. "Error compiling template:\n\n" + (e.msg) + "\n\n" +
  5862. generateCodeFrame(template, e.start, e.end),
  5863. vm
  5864. );
  5865. });
  5866. } else {
  5867. warn$$1(
  5868. "Error compiling template:\n\n" + template + "\n\n" +
  5869. compiled.errors.map(function (e) { return ("- " + e); }).join('\n') + '\n',
  5870. vm
  5871. );
  5872. }
  5873. }
  5874. if (compiled.tips && compiled.tips.length) {
  5875. if (options.outputSourceRange) {
  5876. compiled.tips.forEach(function (e) { return tip(e.msg, vm); });
  5877. } else {
  5878. compiled.tips.forEach(function (msg) { return tip(msg, vm); });
  5879. }
  5880. }
  5881. }
  5882. // turn code into functions
  5883. var res = {};
  5884. var fnGenErrors = [];
  5885. res.render = createFunction(compiled.render, fnGenErrors);
  5886. res.staticRenderFns = compiled.staticRenderFns.map(function (code) {
  5887. return createFunction(code, fnGenErrors)
  5888. });
  5889. // check function generation errors.
  5890. // this should only happen if there is a bug in the compiler itself.
  5891. // mostly for codegen development use
  5892. /* istanbul ignore if */
  5893. {
  5894. if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {
  5895. warn$$1(
  5896. "Failed to generate render function:\n\n" +
  5897. fnGenErrors.map(function (ref) {
  5898. var err = ref.err;
  5899. var code = ref.code;
  5900. return ((err.toString()) + " in\n\n" + code + "\n");
  5901. }).join('\n'),
  5902. vm
  5903. );
  5904. }
  5905. }
  5906. return (cache[key] = res)
  5907. }
  5908. }
  5909. /* */
  5910. function createCompilerCreator (baseCompile) {
  5911. return function createCompiler (baseOptions) {
  5912. function compile (
  5913. template,
  5914. options
  5915. ) {
  5916. var finalOptions = Object.create(baseOptions);
  5917. var errors = [];
  5918. var tips = [];
  5919. var warn = function (msg, range, tip) {
  5920. (tip ? tips : errors).push(msg);
  5921. };
  5922. if (options) {
  5923. if (options.outputSourceRange) {
  5924. // $flow-disable-line
  5925. var leadingSpaceLength = template.match(/^\s*/)[0].length;
  5926. warn = function (msg, range, tip) {
  5927. var data = { msg: msg };
  5928. if (range) {
  5929. if (range.start != null) {
  5930. data.start = range.start + leadingSpaceLength;
  5931. }
  5932. if (range.end != null) {
  5933. data.end = range.end + leadingSpaceLength;
  5934. }
  5935. }
  5936. (tip ? tips : errors).push(data);
  5937. };
  5938. }
  5939. // merge custom modules
  5940. if (options.modules) {
  5941. finalOptions.modules =
  5942. (baseOptions.modules || []).concat(options.modules);
  5943. }
  5944. // merge custom directives
  5945. if (options.directives) {
  5946. finalOptions.directives = extend(
  5947. Object.create(baseOptions.directives || null),
  5948. options.directives
  5949. );
  5950. }
  5951. // copy other options
  5952. for (var key in options) {
  5953. if (key !== 'modules' && key !== 'directives') {
  5954. finalOptions[key] = options[key];
  5955. }
  5956. }
  5957. }
  5958. finalOptions.warn = warn;
  5959. var compiled = baseCompile(template.trim(), finalOptions);
  5960. {
  5961. detectErrors(compiled.ast, warn);
  5962. }
  5963. compiled.errors = errors;
  5964. compiled.tips = tips;
  5965. return compiled
  5966. }
  5967. return {
  5968. compile: compile,
  5969. compileToFunctions: createCompileToFunctionFn(compile)
  5970. }
  5971. }
  5972. }
  5973. /* */
  5974. var createCompiler = createCompilerCreator(function baseCompile (
  5975. template,
  5976. options
  5977. ) {
  5978. var ast = parse(template.trim(), options);
  5979. optimize(ast, options);
  5980. var code = generate$1(ast, options);
  5981. return {
  5982. ast: ast,
  5983. render: code.render,
  5984. staticRenderFns: code.staticRenderFns
  5985. }
  5986. });
  5987. /* */
  5988. var ref = createCompiler(baseOptions);
  5989. var compile = ref.compile;
  5990. var compileToFunctions = ref.compileToFunctions;
  5991. /* */
  5992. // The template compiler attempts to minimize the need for normalization by
  5993. // statically analyzing the template at compile time.
  5994. //
  5995. // For plain HTML markup, normalization can be completely skipped because the
  5996. // generated render function is guaranteed to return Array<VNode>. There are
  5997. // two cases where extra normalization is needed:
  5998. // 1. When the children contains components - because a functional component
  5999. // may return an Array instead of a single root. In this case, just a simple
  6000. // normalization is needed - if any child is an Array, we flatten the whole
  6001. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  6002. // because functional components already normalize their own children.
  6003. function simpleNormalizeChildren (children) {
  6004. for (var i = 0; i < children.length; i++) {
  6005. if (Array.isArray(children[i])) {
  6006. return Array.prototype.concat.apply([], children)
  6007. }
  6008. }
  6009. return children
  6010. }
  6011. // 2. When the children contains constructs that always generated nested Arrays,
  6012. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  6013. // with hand-written render functions / JSX. In such cases a full normalization
  6014. // is needed to cater to all possible types of children values.
  6015. function normalizeChildren (children) {
  6016. return isPrimitive(children)
  6017. ? [createTextVNode(children)]
  6018. : Array.isArray(children)
  6019. ? normalizeArrayChildren(children)
  6020. : undefined
  6021. }
  6022. function isTextNode (node) {
  6023. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  6024. }
  6025. function normalizeArrayChildren (children, nestedIndex) {
  6026. var res = [];
  6027. var i, c, lastIndex, last;
  6028. for (i = 0; i < children.length; i++) {
  6029. c = children[i];
  6030. if (isUndef(c) || typeof c === 'boolean') { continue }
  6031. lastIndex = res.length - 1;
  6032. last = res[lastIndex];
  6033. // nested
  6034. if (Array.isArray(c)) {
  6035. if (c.length > 0) {
  6036. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  6037. // merge adjacent text nodes
  6038. if (isTextNode(c[0]) && isTextNode(last)) {
  6039. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  6040. c.shift();
  6041. }
  6042. res.push.apply(res, c);
  6043. }
  6044. } else if (isPrimitive(c)) {
  6045. if (isTextNode(last)) {
  6046. // merge adjacent text nodes
  6047. // this is necessary for SSR hydration because text nodes are
  6048. // essentially merged when rendered to HTML strings
  6049. res[lastIndex] = createTextVNode(last.text + c);
  6050. } else if (c !== '') {
  6051. // convert primitive to vnode
  6052. res.push(createTextVNode(c));
  6053. }
  6054. } else {
  6055. if (isTextNode(c) && isTextNode(last)) {
  6056. // merge adjacent text nodes
  6057. res[lastIndex] = createTextVNode(last.text + c.text);
  6058. } else {
  6059. // default key for nested array children (likely generated by v-for)
  6060. if (isTrue(children._isVList) &&
  6061. isDef(c.tag) &&
  6062. isUndef(c.key) &&
  6063. isDef(nestedIndex)) {
  6064. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  6065. }
  6066. res.push(c);
  6067. }
  6068. }
  6069. }
  6070. return res
  6071. }
  6072. /* */
  6073. var ssrHelpers = {
  6074. _ssrEscape: escape,
  6075. _ssrNode: renderStringNode,
  6076. _ssrList: renderStringList,
  6077. _ssrAttr: renderAttr,
  6078. _ssrAttrs: renderAttrs$1,
  6079. _ssrDOMProps: renderDOMProps$1,
  6080. _ssrClass: renderSSRClass,
  6081. _ssrStyle: renderSSRStyle
  6082. };
  6083. function installSSRHelpers (vm) {
  6084. if (vm._ssrNode) {
  6085. return
  6086. }
  6087. var Vue = vm.constructor;
  6088. while (Vue.super) {
  6089. Vue = Vue.super;
  6090. }
  6091. extend(Vue.prototype, ssrHelpers);
  6092. if (Vue.FunctionalRenderContext) {
  6093. extend(Vue.FunctionalRenderContext.prototype, ssrHelpers);
  6094. }
  6095. }
  6096. var StringNode = function StringNode (
  6097. open,
  6098. close,
  6099. children,
  6100. normalizationType
  6101. ) {
  6102. this.isString = true;
  6103. this.open = open;
  6104. this.close = close;
  6105. if (children) {
  6106. this.children = normalizationType === 1
  6107. ? simpleNormalizeChildren(children)
  6108. : normalizationType === 2
  6109. ? normalizeChildren(children)
  6110. : children;
  6111. } else {
  6112. this.children = void 0;
  6113. }
  6114. };
  6115. function renderStringNode (
  6116. open,
  6117. close,
  6118. children,
  6119. normalizationType
  6120. ) {
  6121. return new StringNode(open, close, children, normalizationType)
  6122. }
  6123. function renderStringList (
  6124. val,
  6125. render
  6126. ) {
  6127. var ret = '';
  6128. var i, l, keys, key;
  6129. if (Array.isArray(val) || typeof val === 'string') {
  6130. for (i = 0, l = val.length; i < l; i++) {
  6131. ret += render(val[i], i);
  6132. }
  6133. } else if (typeof val === 'number') {
  6134. for (i = 0; i < val; i++) {
  6135. ret += render(i + 1, i);
  6136. }
  6137. } else if (isObject(val)) {
  6138. keys = Object.keys(val);
  6139. for (i = 0, l = keys.length; i < l; i++) {
  6140. key = keys[i];
  6141. ret += render(val[key], key, i);
  6142. }
  6143. }
  6144. return ret
  6145. }
  6146. function renderAttrs$1 (obj) {
  6147. var res = '';
  6148. for (var key in obj) {
  6149. if (isSSRUnsafeAttr(key)) {
  6150. continue
  6151. }
  6152. res += renderAttr(key, obj[key]);
  6153. }
  6154. return res
  6155. }
  6156. function renderDOMProps$1 (obj) {
  6157. var res = '';
  6158. for (var key in obj) {
  6159. var attr = propsToAttrMap[key] || key.toLowerCase();
  6160. if (isRenderableAttr(attr)) {
  6161. res += renderAttr(attr, obj[key]);
  6162. }
  6163. }
  6164. return res
  6165. }
  6166. function renderSSRClass (
  6167. staticClass,
  6168. dynamic
  6169. ) {
  6170. var res = renderClass(staticClass, dynamic);
  6171. return res === '' ? res : (" class=\"" + (escape(res)) + "\"")
  6172. }
  6173. function renderSSRStyle (
  6174. staticStyle,
  6175. dynamic,
  6176. extra
  6177. ) {
  6178. var style = {};
  6179. if (staticStyle) { extend(style, staticStyle); }
  6180. if (dynamic) { extend(style, normalizeStyleBinding(dynamic)); }
  6181. if (extra) { extend(style, extra); }
  6182. var res = genStyle(style);
  6183. return res === '' ? res : (" style=" + (JSON.stringify(escape(res))))
  6184. }
  6185. /* not type checking this file because flow doesn't play well with Proxy */
  6186. {
  6187. var allowedGlobals = makeMap(
  6188. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  6189. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  6190. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,' +
  6191. 'require' // for Webpack/Browserify
  6192. );
  6193. var hasProxy =
  6194. typeof Proxy !== 'undefined' && isNative(Proxy);
  6195. if (hasProxy) {
  6196. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  6197. config.keyCodes = new Proxy(config.keyCodes, {
  6198. set: function set (target, key, value) {
  6199. if (isBuiltInModifier(key)) {
  6200. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  6201. return false
  6202. } else {
  6203. target[key] = value;
  6204. return true
  6205. }
  6206. }
  6207. });
  6208. }
  6209. }
  6210. /* */
  6211. var seenObjects = new _Set();
  6212. /**
  6213. * Recursively traverse an object to evoke all converted
  6214. * getters, so that every nested property inside the object
  6215. * is collected as a "deep" dependency.
  6216. */
  6217. function traverse (val) {
  6218. _traverse(val, seenObjects);
  6219. seenObjects.clear();
  6220. }
  6221. function _traverse (val, seen) {
  6222. var i, keys;
  6223. var isA = Array.isArray(val);
  6224. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  6225. return
  6226. }
  6227. if (val.__ob__) {
  6228. var depId = val.__ob__.dep.id;
  6229. if (seen.has(depId)) {
  6230. return
  6231. }
  6232. seen.add(depId);
  6233. }
  6234. if (isA) {
  6235. i = val.length;
  6236. while (i--) { _traverse(val[i], seen); }
  6237. } else {
  6238. keys = Object.keys(val);
  6239. i = keys.length;
  6240. while (i--) { _traverse(val[keys[i]], seen); }
  6241. }
  6242. }
  6243. {
  6244. var perf = inBrowser && window.performance;
  6245. /* istanbul ignore if */
  6246. if (
  6247. perf &&
  6248. perf.mark &&
  6249. perf.measure &&
  6250. perf.clearMarks &&
  6251. perf.clearMeasures
  6252. ) ;
  6253. }
  6254. /* */
  6255. var normalizeEvent = cached(function (name) {
  6256. var passive = name.charAt(0) === '&';
  6257. name = passive ? name.slice(1) : name;
  6258. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  6259. name = once$$1 ? name.slice(1) : name;
  6260. var capture = name.charAt(0) === '!';
  6261. name = capture ? name.slice(1) : name;
  6262. return {
  6263. name: name,
  6264. once: once$$1,
  6265. capture: capture,
  6266. passive: passive
  6267. }
  6268. });
  6269. function createFnInvoker (fns, vm) {
  6270. function invoker () {
  6271. var arguments$1 = arguments;
  6272. var fns = invoker.fns;
  6273. if (Array.isArray(fns)) {
  6274. var cloned = fns.slice();
  6275. for (var i = 0; i < cloned.length; i++) {
  6276. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  6277. }
  6278. } else {
  6279. // return handler return value for single handlers
  6280. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  6281. }
  6282. }
  6283. invoker.fns = fns;
  6284. return invoker
  6285. }
  6286. function updateListeners (
  6287. on,
  6288. oldOn,
  6289. add,
  6290. remove$$1,
  6291. createOnceHandler,
  6292. vm
  6293. ) {
  6294. var name, def$$1, cur, old, event;
  6295. for (name in on) {
  6296. def$$1 = cur = on[name];
  6297. old = oldOn[name];
  6298. event = normalizeEvent(name);
  6299. if (isUndef(cur)) {
  6300. warn(
  6301. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  6302. vm
  6303. );
  6304. } else if (isUndef(old)) {
  6305. if (isUndef(cur.fns)) {
  6306. cur = on[name] = createFnInvoker(cur, vm);
  6307. }
  6308. if (isTrue(event.once)) {
  6309. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  6310. }
  6311. add(event.name, cur, event.capture, event.passive, event.params);
  6312. } else if (cur !== old) {
  6313. old.fns = cur;
  6314. on[name] = old;
  6315. }
  6316. }
  6317. for (name in oldOn) {
  6318. if (isUndef(on[name])) {
  6319. event = normalizeEvent(name);
  6320. remove$$1(event.name, oldOn[name], event.capture);
  6321. }
  6322. }
  6323. }
  6324. /* */
  6325. /* */
  6326. function extractPropsFromVNodeData (
  6327. data,
  6328. Ctor,
  6329. tag
  6330. ) {
  6331. // we are only extracting raw values here.
  6332. // validation and default values are handled in the child
  6333. // component itself.
  6334. var propOptions = Ctor.options.props;
  6335. if (isUndef(propOptions)) {
  6336. return
  6337. }
  6338. var res = {};
  6339. var attrs = data.attrs;
  6340. var props = data.props;
  6341. if (isDef(attrs) || isDef(props)) {
  6342. for (var key in propOptions) {
  6343. var altKey = hyphenate(key);
  6344. {
  6345. var keyInLowerCase = key.toLowerCase();
  6346. if (
  6347. key !== keyInLowerCase &&
  6348. attrs && hasOwn(attrs, keyInLowerCase)
  6349. ) {
  6350. tip(
  6351. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  6352. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  6353. " \"" + key + "\". " +
  6354. "Note that HTML attributes are case-insensitive and camelCased " +
  6355. "props need to use their kebab-case equivalents when using in-DOM " +
  6356. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  6357. );
  6358. }
  6359. }
  6360. checkProp(res, props, key, altKey, true) ||
  6361. checkProp(res, attrs, key, altKey, false);
  6362. }
  6363. }
  6364. return res
  6365. }
  6366. function checkProp (
  6367. res,
  6368. hash,
  6369. key,
  6370. altKey,
  6371. preserve
  6372. ) {
  6373. if (isDef(hash)) {
  6374. if (hasOwn(hash, key)) {
  6375. res[key] = hash[key];
  6376. if (!preserve) {
  6377. delete hash[key];
  6378. }
  6379. return true
  6380. } else if (hasOwn(hash, altKey)) {
  6381. res[key] = hash[altKey];
  6382. if (!preserve) {
  6383. delete hash[altKey];
  6384. }
  6385. return true
  6386. }
  6387. }
  6388. return false
  6389. }
  6390. /* */
  6391. var SIMPLE_NORMALIZE = 1;
  6392. var ALWAYS_NORMALIZE = 2;
  6393. // wrapper function for providing a more flexible interface
  6394. // without getting yelled at by flow
  6395. function createElement (
  6396. context,
  6397. tag,
  6398. data,
  6399. children,
  6400. normalizationType,
  6401. alwaysNormalize
  6402. ) {
  6403. if (Array.isArray(data) || isPrimitive(data)) {
  6404. normalizationType = children;
  6405. children = data;
  6406. data = undefined;
  6407. }
  6408. if (isTrue(alwaysNormalize)) {
  6409. normalizationType = ALWAYS_NORMALIZE;
  6410. }
  6411. return _createElement(context, tag, data, children, normalizationType)
  6412. }
  6413. function _createElement (
  6414. context,
  6415. tag,
  6416. data,
  6417. children,
  6418. normalizationType
  6419. ) {
  6420. if (isDef(data) && isDef((data).__ob__)) {
  6421. warn(
  6422. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6423. 'Always create fresh vnode data objects in each render!',
  6424. context
  6425. );
  6426. return createEmptyVNode()
  6427. }
  6428. // object syntax in v-bind
  6429. if (isDef(data) && isDef(data.is)) {
  6430. tag = data.is;
  6431. }
  6432. if (!tag) {
  6433. // in case of component :is set to falsy value
  6434. return createEmptyVNode()
  6435. }
  6436. // warn against non-primitive key
  6437. if (isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6438. ) {
  6439. {
  6440. warn(
  6441. 'Avoid using non-primitive value as key, ' +
  6442. 'use string/number value instead.',
  6443. context
  6444. );
  6445. }
  6446. }
  6447. // support single function children as default scoped slot
  6448. if (Array.isArray(children) &&
  6449. typeof children[0] === 'function'
  6450. ) {
  6451. data = data || {};
  6452. data.scopedSlots = { default: children[0] };
  6453. children.length = 0;
  6454. }
  6455. if (normalizationType === ALWAYS_NORMALIZE) {
  6456. children = normalizeChildren(children);
  6457. } else if (normalizationType === SIMPLE_NORMALIZE) {
  6458. children = simpleNormalizeChildren(children);
  6459. }
  6460. var vnode, ns;
  6461. if (typeof tag === 'string') {
  6462. var Ctor;
  6463. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  6464. if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  6465. // component
  6466. vnode = createComponent(Ctor, data, context, children, tag);
  6467. } else {
  6468. // unknown or unlisted namespaced elements
  6469. // check at runtime because it may get assigned a namespace when its
  6470. // parent normalizes children
  6471. vnode = new VNode(
  6472. tag, data, children,
  6473. undefined, undefined, context
  6474. );
  6475. }
  6476. } else {
  6477. // direct component options / constructor
  6478. vnode = createComponent(tag, data, context, children);
  6479. }
  6480. if (Array.isArray(vnode)) {
  6481. return vnode
  6482. } else if (isDef(vnode)) {
  6483. if (isDef(ns)) { applyNS(vnode, ns); }
  6484. if (isDef(data)) { registerDeepBindings(data); }
  6485. return vnode
  6486. } else {
  6487. return createEmptyVNode()
  6488. }
  6489. }
  6490. function applyNS (vnode, ns, force) {
  6491. vnode.ns = ns;
  6492. if (vnode.tag === 'foreignObject') {
  6493. // use default namespace inside foreignObject
  6494. ns = undefined;
  6495. force = true;
  6496. }
  6497. if (isDef(vnode.children)) {
  6498. for (var i = 0, l = vnode.children.length; i < l; i++) {
  6499. var child = vnode.children[i];
  6500. if (isDef(child.tag) && (
  6501. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  6502. applyNS(child, ns, force);
  6503. }
  6504. }
  6505. }
  6506. }
  6507. // ref #5318
  6508. // necessary to ensure parent re-render when deep bindings like :style and
  6509. // :class are used on slot nodes
  6510. function registerDeepBindings (data) {
  6511. if (isObject(data.style)) {
  6512. traverse(data.style);
  6513. }
  6514. if (isObject(data.class)) {
  6515. traverse(data.class);
  6516. }
  6517. }
  6518. /* */
  6519. /**
  6520. * Runtime helper for rendering v-for lists.
  6521. */
  6522. function renderList (
  6523. val,
  6524. render
  6525. ) {
  6526. var ret, i, l, keys, key;
  6527. if (Array.isArray(val) || typeof val === 'string') {
  6528. ret = new Array(val.length);
  6529. for (i = 0, l = val.length; i < l; i++) {
  6530. ret[i] = render(val[i], i);
  6531. }
  6532. } else if (typeof val === 'number') {
  6533. ret = new Array(val);
  6534. for (i = 0; i < val; i++) {
  6535. ret[i] = render(i + 1, i);
  6536. }
  6537. } else if (isObject(val)) {
  6538. if (hasSymbol && val[Symbol.iterator]) {
  6539. ret = [];
  6540. var iterator = val[Symbol.iterator]();
  6541. var result = iterator.next();
  6542. while (!result.done) {
  6543. ret.push(render(result.value, ret.length));
  6544. result = iterator.next();
  6545. }
  6546. } else {
  6547. keys = Object.keys(val);
  6548. ret = new Array(keys.length);
  6549. for (i = 0, l = keys.length; i < l; i++) {
  6550. key = keys[i];
  6551. ret[i] = render(val[key], key, i);
  6552. }
  6553. }
  6554. }
  6555. if (!isDef(ret)) {
  6556. ret = [];
  6557. }
  6558. (ret)._isVList = true;
  6559. return ret
  6560. }
  6561. /* */
  6562. /**
  6563. * Runtime helper for rendering <slot>
  6564. */
  6565. function renderSlot (
  6566. name,
  6567. fallbackRender,
  6568. props,
  6569. bindObject
  6570. ) {
  6571. var scopedSlotFn = this.$scopedSlots[name];
  6572. var nodes;
  6573. if (scopedSlotFn) {
  6574. // scoped slot
  6575. props = props || {};
  6576. if (bindObject) {
  6577. if (!isObject(bindObject)) {
  6578. warn('slot v-bind without argument expects an Object', this);
  6579. }
  6580. props = extend(extend({}, bindObject), props);
  6581. }
  6582. nodes =
  6583. scopedSlotFn(props) ||
  6584. (typeof fallbackRender === 'function' ? fallbackRender() : fallbackRender);
  6585. } else {
  6586. nodes =
  6587. this.$slots[name] ||
  6588. (typeof fallbackRender === 'function' ? fallbackRender() : fallbackRender);
  6589. }
  6590. var target = props && props.slot;
  6591. if (target) {
  6592. return this.$createElement('template', { slot: target }, nodes)
  6593. } else {
  6594. return nodes
  6595. }
  6596. }
  6597. /* */
  6598. /**
  6599. * Runtime helper for resolving filters
  6600. */
  6601. function resolveFilter (id) {
  6602. return resolveAsset(this.$options, 'filters', id, true) || identity
  6603. }
  6604. /* */
  6605. function isKeyNotMatch (expect, actual) {
  6606. if (Array.isArray(expect)) {
  6607. return expect.indexOf(actual) === -1
  6608. } else {
  6609. return expect !== actual
  6610. }
  6611. }
  6612. /**
  6613. * Runtime helper for checking keyCodes from config.
  6614. * exposed as Vue.prototype._k
  6615. * passing in eventKeyName as last argument separately for backwards compat
  6616. */
  6617. function checkKeyCodes (
  6618. eventKeyCode,
  6619. key,
  6620. builtInKeyCode,
  6621. eventKeyName,
  6622. builtInKeyName
  6623. ) {
  6624. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  6625. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  6626. return isKeyNotMatch(builtInKeyName, eventKeyName)
  6627. } else if (mappedKeyCode) {
  6628. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  6629. } else if (eventKeyName) {
  6630. return hyphenate(eventKeyName) !== key
  6631. }
  6632. return eventKeyCode === undefined
  6633. }
  6634. /* */
  6635. /**
  6636. * Runtime helper for merging v-bind="object" into a VNode's data.
  6637. */
  6638. function bindObjectProps (
  6639. data,
  6640. tag,
  6641. value,
  6642. asProp,
  6643. isSync
  6644. ) {
  6645. if (value) {
  6646. if (!isObject(value)) {
  6647. warn(
  6648. 'v-bind without argument expects an Object or Array value',
  6649. this
  6650. );
  6651. } else {
  6652. if (Array.isArray(value)) {
  6653. value = toObject(value);
  6654. }
  6655. var hash;
  6656. var loop = function ( key ) {
  6657. if (
  6658. key === 'class' ||
  6659. key === 'style' ||
  6660. isReservedAttribute(key)
  6661. ) {
  6662. hash = data;
  6663. } else {
  6664. var type = data.attrs && data.attrs.type;
  6665. hash = asProp || config.mustUseProp(tag, type, key)
  6666. ? data.domProps || (data.domProps = {})
  6667. : data.attrs || (data.attrs = {});
  6668. }
  6669. var camelizedKey = camelize(key);
  6670. var hyphenatedKey = hyphenate(key);
  6671. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  6672. hash[key] = value[key];
  6673. if (isSync) {
  6674. var on = data.on || (data.on = {});
  6675. on[("update:" + key)] = function ($event) {
  6676. value[key] = $event;
  6677. };
  6678. }
  6679. }
  6680. };
  6681. for (var key in value) loop( key );
  6682. }
  6683. }
  6684. return data
  6685. }
  6686. /* */
  6687. /**
  6688. * Runtime helper for rendering static trees.
  6689. */
  6690. function renderStatic (
  6691. index,
  6692. isInFor
  6693. ) {
  6694. var cached = this._staticTrees || (this._staticTrees = []);
  6695. var tree = cached[index];
  6696. // if has already-rendered static tree and not inside v-for,
  6697. // we can reuse the same tree.
  6698. if (tree && !isInFor) {
  6699. return tree
  6700. }
  6701. // otherwise, render a fresh tree.
  6702. tree = cached[index] = this.$options.staticRenderFns[index].call(
  6703. this._renderProxy,
  6704. null,
  6705. this // for render fns generated for functional component templates
  6706. );
  6707. markStatic(tree, ("__static__" + index), false);
  6708. return tree
  6709. }
  6710. /**
  6711. * Runtime helper for v-once.
  6712. * Effectively it means marking the node as static with a unique key.
  6713. */
  6714. function markOnce (
  6715. tree,
  6716. index,
  6717. key
  6718. ) {
  6719. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  6720. return tree
  6721. }
  6722. function markStatic (
  6723. tree,
  6724. key,
  6725. isOnce
  6726. ) {
  6727. if (Array.isArray(tree)) {
  6728. for (var i = 0; i < tree.length; i++) {
  6729. if (tree[i] && typeof tree[i] !== 'string') {
  6730. markStaticNode(tree[i], (key + "_" + i), isOnce);
  6731. }
  6732. }
  6733. } else {
  6734. markStaticNode(tree, key, isOnce);
  6735. }
  6736. }
  6737. function markStaticNode (node, key, isOnce) {
  6738. node.isStatic = true;
  6739. node.key = key;
  6740. node.isOnce = isOnce;
  6741. }
  6742. /* */
  6743. function bindObjectListeners (data, value) {
  6744. if (value) {
  6745. if (!isPlainObject(value)) {
  6746. warn(
  6747. 'v-on without argument expects an Object value',
  6748. this
  6749. );
  6750. } else {
  6751. var on = data.on = data.on ? extend({}, data.on) : {};
  6752. for (var key in value) {
  6753. var existing = on[key];
  6754. var ours = value[key];
  6755. on[key] = existing ? [].concat(existing, ours) : ours;
  6756. }
  6757. }
  6758. }
  6759. return data
  6760. }
  6761. /* */
  6762. function resolveScopedSlots (
  6763. fns, // see flow/vnode
  6764. res,
  6765. // the following are added in 2.6
  6766. hasDynamicKeys,
  6767. contentHashKey
  6768. ) {
  6769. res = res || { $stable: !hasDynamicKeys };
  6770. for (var i = 0; i < fns.length; i++) {
  6771. var slot = fns[i];
  6772. if (Array.isArray(slot)) {
  6773. resolveScopedSlots(slot, res, hasDynamicKeys);
  6774. } else if (slot) {
  6775. // marker for reverse proxying v-slot without scope on this.$slots
  6776. if (slot.proxy) {
  6777. slot.fn.proxy = true;
  6778. }
  6779. res[slot.key] = slot.fn;
  6780. }
  6781. }
  6782. if (contentHashKey) {
  6783. (res).$key = contentHashKey;
  6784. }
  6785. return res
  6786. }
  6787. /* */
  6788. function bindDynamicKeys (baseObj, values) {
  6789. for (var i = 0; i < values.length; i += 2) {
  6790. var key = values[i];
  6791. if (typeof key === 'string' && key) {
  6792. baseObj[values[i]] = values[i + 1];
  6793. } else if (key !== '' && key !== null) {
  6794. // null is a special value for explicitly removing a binding
  6795. warn(
  6796. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  6797. this
  6798. );
  6799. }
  6800. }
  6801. return baseObj
  6802. }
  6803. // helper to dynamically append modifier runtime markers to event names.
  6804. // ensure only append when value is already string, otherwise it will be cast
  6805. // to string and cause the type check to miss.
  6806. function prependModifier (value, symbol) {
  6807. return typeof value === 'string' ? symbol + value : value
  6808. }
  6809. /* */
  6810. function installRenderHelpers (target) {
  6811. target._o = markOnce;
  6812. target._n = toNumber;
  6813. target._s = toString;
  6814. target._l = renderList;
  6815. target._t = renderSlot;
  6816. target._q = looseEqual;
  6817. target._i = looseIndexOf;
  6818. target._m = renderStatic;
  6819. target._f = resolveFilter;
  6820. target._k = checkKeyCodes;
  6821. target._b = bindObjectProps;
  6822. target._v = createTextVNode;
  6823. target._e = createEmptyVNode;
  6824. target._u = resolveScopedSlots;
  6825. target._g = bindObjectListeners;
  6826. target._d = bindDynamicKeys;
  6827. target._p = prependModifier;
  6828. }
  6829. /* */
  6830. /**
  6831. * Runtime helper for resolving raw children VNodes into a slot object.
  6832. */
  6833. function resolveSlots (
  6834. children,
  6835. context
  6836. ) {
  6837. if (!children || !children.length) {
  6838. return {}
  6839. }
  6840. var slots = {};
  6841. for (var i = 0, l = children.length; i < l; i++) {
  6842. var child = children[i];
  6843. var data = child.data;
  6844. // remove slot attribute if the node is resolved as a Vue slot node
  6845. if (data && data.attrs && data.attrs.slot) {
  6846. delete data.attrs.slot;
  6847. }
  6848. // named slots should only be respected if the vnode was rendered in the
  6849. // same context.
  6850. if ((child.context === context || child.fnContext === context) &&
  6851. data && data.slot != null
  6852. ) {
  6853. var name = data.slot;
  6854. var slot = (slots[name] || (slots[name] = []));
  6855. if (child.tag === 'template') {
  6856. slot.push.apply(slot, child.children || []);
  6857. } else {
  6858. slot.push(child);
  6859. }
  6860. } else {
  6861. (slots.default || (slots.default = [])).push(child);
  6862. }
  6863. }
  6864. // ignore slots that contains only whitespace
  6865. for (var name$1 in slots) {
  6866. if (slots[name$1].every(isWhitespace)) {
  6867. delete slots[name$1];
  6868. }
  6869. }
  6870. return slots
  6871. }
  6872. function isWhitespace (node) {
  6873. return (node.isComment && !node.asyncFactory) || node.text === ' '
  6874. }
  6875. /* */
  6876. function isAsyncPlaceholder (node) {
  6877. return node.isComment && node.asyncFactory
  6878. }
  6879. /* */
  6880. function normalizeScopedSlots (
  6881. slots,
  6882. normalSlots,
  6883. prevSlots
  6884. ) {
  6885. var res;
  6886. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  6887. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  6888. var key = slots && slots.$key;
  6889. if (!slots) {
  6890. res = {};
  6891. } else if (slots._normalized) {
  6892. // fast path 1: child component re-render only, parent did not change
  6893. return slots._normalized
  6894. } else if (
  6895. isStable &&
  6896. prevSlots &&
  6897. prevSlots !== emptyObject &&
  6898. key === prevSlots.$key &&
  6899. !hasNormalSlots &&
  6900. !prevSlots.$hasNormal
  6901. ) {
  6902. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  6903. // only need to normalize once
  6904. return prevSlots
  6905. } else {
  6906. res = {};
  6907. for (var key$1 in slots) {
  6908. if (slots[key$1] && key$1[0] !== '$') {
  6909. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  6910. }
  6911. }
  6912. }
  6913. // expose normal slots on scopedSlots
  6914. for (var key$2 in normalSlots) {
  6915. if (!(key$2 in res)) {
  6916. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  6917. }
  6918. }
  6919. // avoriaz seems to mock a non-extensible $scopedSlots object
  6920. // and when that is passed down this would cause an error
  6921. if (slots && Object.isExtensible(slots)) {
  6922. (slots)._normalized = res;
  6923. }
  6924. def(res, '$stable', isStable);
  6925. def(res, '$key', key);
  6926. def(res, '$hasNormal', hasNormalSlots);
  6927. return res
  6928. }
  6929. function normalizeScopedSlot(normalSlots, key, fn) {
  6930. var normalized = function () {
  6931. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  6932. res = res && typeof res === 'object' && !Array.isArray(res)
  6933. ? [res] // single vnode
  6934. : normalizeChildren(res);
  6935. var vnode = res && res[0];
  6936. return res && (
  6937. !vnode ||
  6938. (res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
  6939. ) ? undefined
  6940. : res
  6941. };
  6942. // this is a slot using the new v-slot syntax without scope. although it is
  6943. // compiled as a scoped slot, render fn users would expect it to be present
  6944. // on this.$slots because the usage is semantically a normal slot.
  6945. if (fn.proxy) {
  6946. Object.defineProperty(normalSlots, key, {
  6947. get: normalized,
  6948. enumerable: true,
  6949. configurable: true
  6950. });
  6951. }
  6952. return normalized
  6953. }
  6954. function proxyNormalSlot(slots, key) {
  6955. return function () { return slots[key]; }
  6956. }
  6957. /* */
  6958. var currentRenderingInstance = null;
  6959. /* */
  6960. function ensureCtor (comp, base) {
  6961. if (
  6962. comp.__esModule ||
  6963. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  6964. ) {
  6965. comp = comp.default;
  6966. }
  6967. return isObject(comp)
  6968. ? base.extend(comp)
  6969. : comp
  6970. }
  6971. function createAsyncPlaceholder (
  6972. factory,
  6973. data,
  6974. context,
  6975. children,
  6976. tag
  6977. ) {
  6978. var node = createEmptyVNode();
  6979. node.asyncFactory = factory;
  6980. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  6981. return node
  6982. }
  6983. function resolveAsyncComponent (
  6984. factory,
  6985. baseCtor
  6986. ) {
  6987. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  6988. return factory.errorComp
  6989. }
  6990. if (isDef(factory.resolved)) {
  6991. return factory.resolved
  6992. }
  6993. var owner = currentRenderingInstance;
  6994. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  6995. // already pending
  6996. factory.owners.push(owner);
  6997. }
  6998. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  6999. return factory.loadingComp
  7000. }
  7001. if (owner && !isDef(factory.owners)) {
  7002. var owners = factory.owners = [owner];
  7003. var sync = true;
  7004. var timerLoading = null;
  7005. var timerTimeout = null
  7006. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  7007. var forceRender = function (renderCompleted) {
  7008. for (var i = 0, l = owners.length; i < l; i++) {
  7009. (owners[i]).$forceUpdate();
  7010. }
  7011. if (renderCompleted) {
  7012. owners.length = 0;
  7013. if (timerLoading !== null) {
  7014. clearTimeout(timerLoading);
  7015. timerLoading = null;
  7016. }
  7017. if (timerTimeout !== null) {
  7018. clearTimeout(timerTimeout);
  7019. timerTimeout = null;
  7020. }
  7021. }
  7022. };
  7023. var resolve = once(function (res) {
  7024. // cache resolved
  7025. factory.resolved = ensureCtor(res, baseCtor);
  7026. // invoke callbacks only if this is not a synchronous resolve
  7027. // (async resolves are shimmed as synchronous during SSR)
  7028. if (!sync) {
  7029. forceRender(true);
  7030. } else {
  7031. owners.length = 0;
  7032. }
  7033. });
  7034. var reject = once(function (reason) {
  7035. warn(
  7036. "Failed to resolve async component: " + (String(factory)) +
  7037. (reason ? ("\nReason: " + reason) : '')
  7038. );
  7039. if (isDef(factory.errorComp)) {
  7040. factory.error = true;
  7041. forceRender(true);
  7042. }
  7043. });
  7044. var res = factory(resolve, reject);
  7045. if (isObject(res)) {
  7046. if (isPromise(res)) {
  7047. // () => Promise
  7048. if (isUndef(factory.resolved)) {
  7049. res.then(resolve, reject);
  7050. }
  7051. } else if (isPromise(res.component)) {
  7052. res.component.then(resolve, reject);
  7053. if (isDef(res.error)) {
  7054. factory.errorComp = ensureCtor(res.error, baseCtor);
  7055. }
  7056. if (isDef(res.loading)) {
  7057. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  7058. if (res.delay === 0) {
  7059. factory.loading = true;
  7060. } else {
  7061. timerLoading = setTimeout(function () {
  7062. timerLoading = null;
  7063. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  7064. factory.loading = true;
  7065. forceRender(false);
  7066. }
  7067. }, res.delay || 200);
  7068. }
  7069. }
  7070. if (isDef(res.timeout)) {
  7071. timerTimeout = setTimeout(function () {
  7072. timerTimeout = null;
  7073. if (isUndef(factory.resolved)) {
  7074. reject(
  7075. "timeout (" + (res.timeout) + "ms)"
  7076. );
  7077. }
  7078. }, res.timeout);
  7079. }
  7080. }
  7081. }
  7082. sync = false;
  7083. // return in case resolved synchronously
  7084. return factory.loading
  7085. ? factory.loadingComp
  7086. : factory.resolved
  7087. }
  7088. }
  7089. /* */
  7090. /* */
  7091. /* */
  7092. var target;
  7093. function add (event, fn) {
  7094. target.$on(event, fn);
  7095. }
  7096. function remove$1 (event, fn) {
  7097. target.$off(event, fn);
  7098. }
  7099. function createOnceHandler (event, fn) {
  7100. var _target = target;
  7101. return function onceHandler () {
  7102. var res = fn.apply(null, arguments);
  7103. if (res !== null) {
  7104. _target.$off(event, onceHandler);
  7105. }
  7106. }
  7107. }
  7108. function updateComponentListeners (
  7109. vm,
  7110. listeners,
  7111. oldListeners
  7112. ) {
  7113. target = vm;
  7114. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  7115. target = undefined;
  7116. }
  7117. /* */
  7118. var activeInstance = null;
  7119. function updateChildComponent (
  7120. vm,
  7121. propsData,
  7122. listeners,
  7123. parentVnode,
  7124. renderChildren
  7125. ) {
  7126. // determine whether component has slot children
  7127. // we need to do this before overwriting $options._renderChildren.
  7128. // check if there are dynamic scopedSlots (hand-written or compiled but with
  7129. // dynamic slot names). Static scoped slots compiled from template has the
  7130. // "$stable" marker.
  7131. var newScopedSlots = parentVnode.data.scopedSlots;
  7132. var oldScopedSlots = vm.$scopedSlots;
  7133. var hasDynamicScopedSlot = !!(
  7134. (newScopedSlots && !newScopedSlots.$stable) ||
  7135. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  7136. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key) ||
  7137. (!newScopedSlots && vm.$scopedSlots.$key)
  7138. );
  7139. // Any static slot children from the parent may have changed during parent's
  7140. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  7141. // update is necessary to ensure correctness.
  7142. var needsForceUpdate = !!(
  7143. renderChildren || // has new static slots
  7144. vm.$options._renderChildren || // has old static slots
  7145. hasDynamicScopedSlot
  7146. );
  7147. vm.$options._parentVnode = parentVnode;
  7148. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  7149. if (vm._vnode) { // update child tree's parent
  7150. vm._vnode.parent = parentVnode;
  7151. }
  7152. vm.$options._renderChildren = renderChildren;
  7153. // update $attrs and $listeners hash
  7154. // these are also reactive so they may trigger child update if the child
  7155. // used them during render
  7156. vm.$attrs = parentVnode.data.attrs || emptyObject;
  7157. vm.$listeners = listeners || emptyObject;
  7158. // update props
  7159. if (propsData && vm.$options.props) {
  7160. toggleObserving(false);
  7161. var props = vm._props;
  7162. var propKeys = vm.$options._propKeys || [];
  7163. for (var i = 0; i < propKeys.length; i++) {
  7164. var key = propKeys[i];
  7165. var propOptions = vm.$options.props; // wtf flow?
  7166. props[key] = validateProp(key, propOptions, propsData, vm);
  7167. }
  7168. toggleObserving(true);
  7169. // keep a copy of raw propsData
  7170. vm.$options.propsData = propsData;
  7171. }
  7172. // update listeners
  7173. listeners = listeners || emptyObject;
  7174. var oldListeners = vm.$options._parentListeners;
  7175. vm.$options._parentListeners = listeners;
  7176. updateComponentListeners(vm, listeners, oldListeners);
  7177. // resolve slots + force update if has children
  7178. if (needsForceUpdate) {
  7179. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7180. vm.$forceUpdate();
  7181. }
  7182. }
  7183. function isInInactiveTree (vm) {
  7184. while (vm && (vm = vm.$parent)) {
  7185. if (vm._inactive) { return true }
  7186. }
  7187. return false
  7188. }
  7189. function activateChildComponent (vm, direct) {
  7190. if (direct) {
  7191. vm._directInactive = false;
  7192. if (isInInactiveTree(vm)) {
  7193. return
  7194. }
  7195. } else if (vm._directInactive) {
  7196. return
  7197. }
  7198. if (vm._inactive || vm._inactive === null) {
  7199. vm._inactive = false;
  7200. for (var i = 0; i < vm.$children.length; i++) {
  7201. activateChildComponent(vm.$children[i]);
  7202. }
  7203. callHook(vm, 'activated');
  7204. }
  7205. }
  7206. function deactivateChildComponent (vm, direct) {
  7207. if (direct) {
  7208. vm._directInactive = true;
  7209. if (isInInactiveTree(vm)) {
  7210. return
  7211. }
  7212. }
  7213. if (!vm._inactive) {
  7214. vm._inactive = true;
  7215. for (var i = 0; i < vm.$children.length; i++) {
  7216. deactivateChildComponent(vm.$children[i]);
  7217. }
  7218. callHook(vm, 'deactivated');
  7219. }
  7220. }
  7221. function callHook (vm, hook) {
  7222. // #7573 disable dep collection when invoking lifecycle hooks
  7223. pushTarget();
  7224. var handlers = vm.$options[hook];
  7225. var info = hook + " hook";
  7226. if (handlers) {
  7227. for (var i = 0, j = handlers.length; i < j; i++) {
  7228. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7229. }
  7230. }
  7231. if (vm._hasHookEvent) {
  7232. vm.$emit('hook:' + hook);
  7233. }
  7234. popTarget();
  7235. }
  7236. /* */
  7237. // Async edge case fix requires storing an event listener's attach timestamp.
  7238. var getNow = Date.now;
  7239. // Determine what event timestamp the browser is using. Annoyingly, the
  7240. // timestamp can either be hi-res (relative to page load) or low-res
  7241. // (relative to UNIX epoch), so in order to compare time we have to use the
  7242. // same timestamp type when saving the flush timestamp.
  7243. // All IE versions use low-res event timestamps, and have problematic clock
  7244. // implementations (#9632)
  7245. if (inBrowser && !isIE) {
  7246. var performance = window.performance;
  7247. if (
  7248. performance &&
  7249. typeof performance.now === 'function' &&
  7250. getNow() > document.createEvent('Event').timeStamp
  7251. ) {
  7252. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7253. // smaller than it, it means the event is using a hi-res timestamp,
  7254. // and we need to use the hi-res version for event listener timestamps as
  7255. // well.
  7256. getNow = function () { return performance.now(); };
  7257. }
  7258. }
  7259. /**
  7260. * Queue a kept-alive component that was activated during patch.
  7261. * The queue will be processed after the entire tree has been patched.
  7262. */
  7263. function queueActivatedComponent (vm) {
  7264. // setting _inactive to false here so that a render function can
  7265. // rely on checking whether it's in an inactive tree (e.g. router-view)
  7266. vm._inactive = false;
  7267. }
  7268. /* */
  7269. /* */
  7270. /* */
  7271. function resolveInject (inject, vm) {
  7272. if (inject) {
  7273. // inject is :any because flow is not smart enough to figure out cached
  7274. var result = Object.create(null);
  7275. var keys = hasSymbol
  7276. ? Reflect.ownKeys(inject)
  7277. : Object.keys(inject);
  7278. for (var i = 0; i < keys.length; i++) {
  7279. var key = keys[i];
  7280. // #6574 in case the inject object is observed...
  7281. if (key === '__ob__') { continue }
  7282. var provideKey = inject[key].from;
  7283. var source = vm;
  7284. while (source) {
  7285. if (source._provided && hasOwn(source._provided, provideKey)) {
  7286. result[key] = source._provided[provideKey];
  7287. break
  7288. }
  7289. source = source.$parent;
  7290. }
  7291. if (!source) {
  7292. if ('default' in inject[key]) {
  7293. var provideDefault = inject[key].default;
  7294. result[key] = typeof provideDefault === 'function'
  7295. ? provideDefault.call(vm)
  7296. : provideDefault;
  7297. } else {
  7298. warn(("Injection \"" + key + "\" not found"), vm);
  7299. }
  7300. }
  7301. }
  7302. return result
  7303. }
  7304. }
  7305. /* */
  7306. function resolveConstructorOptions (Ctor) {
  7307. var options = Ctor.options;
  7308. if (Ctor.super) {
  7309. var superOptions = resolveConstructorOptions(Ctor.super);
  7310. var cachedSuperOptions = Ctor.superOptions;
  7311. if (superOptions !== cachedSuperOptions) {
  7312. // super option changed,
  7313. // need to resolve new options.
  7314. Ctor.superOptions = superOptions;
  7315. // check if there are any late-modified/attached options (#4976)
  7316. var modifiedOptions = resolveModifiedOptions(Ctor);
  7317. // update base extend options
  7318. if (modifiedOptions) {
  7319. extend(Ctor.extendOptions, modifiedOptions);
  7320. }
  7321. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  7322. if (options.name) {
  7323. options.components[options.name] = Ctor;
  7324. }
  7325. }
  7326. }
  7327. return options
  7328. }
  7329. function resolveModifiedOptions (Ctor) {
  7330. var modified;
  7331. var latest = Ctor.options;
  7332. var sealed = Ctor.sealedOptions;
  7333. for (var key in latest) {
  7334. if (latest[key] !== sealed[key]) {
  7335. if (!modified) { modified = {}; }
  7336. modified[key] = latest[key];
  7337. }
  7338. }
  7339. return modified
  7340. }
  7341. /* */
  7342. function FunctionalRenderContext (
  7343. data,
  7344. props,
  7345. children,
  7346. parent,
  7347. Ctor
  7348. ) {
  7349. var this$1 = this;
  7350. var options = Ctor.options;
  7351. // ensure the createElement function in functional components
  7352. // gets a unique context - this is necessary for correct named slot check
  7353. var contextVm;
  7354. if (hasOwn(parent, '_uid')) {
  7355. contextVm = Object.create(parent);
  7356. // $flow-disable-line
  7357. contextVm._original = parent;
  7358. } else {
  7359. // the context vm passed in is a functional context as well.
  7360. // in this case we want to make sure we are able to get a hold to the
  7361. // real context instance.
  7362. contextVm = parent;
  7363. // $flow-disable-line
  7364. parent = parent._original;
  7365. }
  7366. var isCompiled = isTrue(options._compiled);
  7367. var needNormalization = !isCompiled;
  7368. this.data = data;
  7369. this.props = props;
  7370. this.children = children;
  7371. this.parent = parent;
  7372. this.listeners = data.on || emptyObject;
  7373. this.injections = resolveInject(options.inject, parent);
  7374. this.slots = function () {
  7375. if (!this$1.$slots) {
  7376. normalizeScopedSlots(
  7377. data.scopedSlots,
  7378. this$1.$slots = resolveSlots(children, parent)
  7379. );
  7380. }
  7381. return this$1.$slots
  7382. };
  7383. Object.defineProperty(this, 'scopedSlots', ({
  7384. enumerable: true,
  7385. get: function get () {
  7386. return normalizeScopedSlots(data.scopedSlots, this.slots())
  7387. }
  7388. }));
  7389. // support for compiled functional template
  7390. if (isCompiled) {
  7391. // exposing $options for renderStatic()
  7392. this.$options = options;
  7393. // pre-resolve slots for renderSlot()
  7394. this.$slots = this.slots();
  7395. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  7396. }
  7397. if (options._scopeId) {
  7398. this._c = function (a, b, c, d) {
  7399. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  7400. if (vnode && !Array.isArray(vnode)) {
  7401. vnode.fnScopeId = options._scopeId;
  7402. vnode.fnContext = parent;
  7403. }
  7404. return vnode
  7405. };
  7406. } else {
  7407. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  7408. }
  7409. }
  7410. installRenderHelpers(FunctionalRenderContext.prototype);
  7411. function createFunctionalComponent (
  7412. Ctor,
  7413. propsData,
  7414. data,
  7415. contextVm,
  7416. children
  7417. ) {
  7418. var options = Ctor.options;
  7419. var props = {};
  7420. var propOptions = options.props;
  7421. if (isDef(propOptions)) {
  7422. for (var key in propOptions) {
  7423. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  7424. }
  7425. } else {
  7426. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  7427. if (isDef(data.props)) { mergeProps(props, data.props); }
  7428. }
  7429. var renderContext = new FunctionalRenderContext(
  7430. data,
  7431. props,
  7432. children,
  7433. contextVm,
  7434. Ctor
  7435. );
  7436. var vnode = options.render.call(null, renderContext._c, renderContext);
  7437. if (vnode instanceof VNode) {
  7438. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  7439. } else if (Array.isArray(vnode)) {
  7440. var vnodes = normalizeChildren(vnode) || [];
  7441. var res = new Array(vnodes.length);
  7442. for (var i = 0; i < vnodes.length; i++) {
  7443. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  7444. }
  7445. return res
  7446. }
  7447. }
  7448. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  7449. // #7817 clone node before setting fnContext, otherwise if the node is reused
  7450. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  7451. // that should not be matched to match.
  7452. var clone = cloneVNode(vnode);
  7453. clone.fnContext = contextVm;
  7454. clone.fnOptions = options;
  7455. {
  7456. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  7457. }
  7458. if (data.slot) {
  7459. (clone.data || (clone.data = {})).slot = data.slot;
  7460. }
  7461. return clone
  7462. }
  7463. function mergeProps (to, from) {
  7464. for (var key in from) {
  7465. to[camelize(key)] = from[key];
  7466. }
  7467. }
  7468. /* */
  7469. /* */
  7470. /* */
  7471. /* */
  7472. // inline hooks to be invoked on component VNodes during patch
  7473. var componentVNodeHooks = {
  7474. init: function init (vnode, hydrating) {
  7475. if (
  7476. vnode.componentInstance &&
  7477. !vnode.componentInstance._isDestroyed &&
  7478. vnode.data.keepAlive
  7479. ) {
  7480. // kept-alive components, treat as a patch
  7481. var mountedNode = vnode; // work around flow
  7482. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  7483. } else {
  7484. var child = vnode.componentInstance = createComponentInstanceForVnode(
  7485. vnode,
  7486. activeInstance
  7487. );
  7488. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  7489. }
  7490. },
  7491. prepatch: function prepatch (oldVnode, vnode) {
  7492. var options = vnode.componentOptions;
  7493. var child = vnode.componentInstance = oldVnode.componentInstance;
  7494. updateChildComponent(
  7495. child,
  7496. options.propsData, // updated props
  7497. options.listeners, // updated listeners
  7498. vnode, // new parent vnode
  7499. options.children // new children
  7500. );
  7501. },
  7502. insert: function insert (vnode) {
  7503. var context = vnode.context;
  7504. var componentInstance = vnode.componentInstance;
  7505. if (!componentInstance._isMounted) {
  7506. componentInstance._isMounted = true;
  7507. callHook(componentInstance, 'mounted');
  7508. }
  7509. if (vnode.data.keepAlive) {
  7510. if (context._isMounted) {
  7511. // vue-router#1212
  7512. // During updates, a kept-alive component's child components may
  7513. // change, so directly walking the tree here may call activated hooks
  7514. // on incorrect children. Instead we push them into a queue which will
  7515. // be processed after the whole patch process ended.
  7516. queueActivatedComponent(componentInstance);
  7517. } else {
  7518. activateChildComponent(componentInstance, true /* direct */);
  7519. }
  7520. }
  7521. },
  7522. destroy: function destroy (vnode) {
  7523. var componentInstance = vnode.componentInstance;
  7524. if (!componentInstance._isDestroyed) {
  7525. if (!vnode.data.keepAlive) {
  7526. componentInstance.$destroy();
  7527. } else {
  7528. deactivateChildComponent(componentInstance, true /* direct */);
  7529. }
  7530. }
  7531. }
  7532. };
  7533. var hooksToMerge = Object.keys(componentVNodeHooks);
  7534. function createComponent (
  7535. Ctor,
  7536. data,
  7537. context,
  7538. children,
  7539. tag
  7540. ) {
  7541. if (isUndef(Ctor)) {
  7542. return
  7543. }
  7544. var baseCtor = context.$options._base;
  7545. // plain options object: turn it into a constructor
  7546. if (isObject(Ctor)) {
  7547. Ctor = baseCtor.extend(Ctor);
  7548. }
  7549. // if at this stage it's not a constructor or an async component factory,
  7550. // reject.
  7551. if (typeof Ctor !== 'function') {
  7552. {
  7553. warn(("Invalid Component definition: " + (String(Ctor))), context);
  7554. }
  7555. return
  7556. }
  7557. // async component
  7558. var asyncFactory;
  7559. if (isUndef(Ctor.cid)) {
  7560. asyncFactory = Ctor;
  7561. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  7562. if (Ctor === undefined) {
  7563. // return a placeholder node for async component, which is rendered
  7564. // as a comment node but preserves all the raw information for the node.
  7565. // the information will be used for async server-rendering and hydration.
  7566. return createAsyncPlaceholder(
  7567. asyncFactory,
  7568. data,
  7569. context,
  7570. children,
  7571. tag
  7572. )
  7573. }
  7574. }
  7575. data = data || {};
  7576. // resolve constructor options in case global mixins are applied after
  7577. // component constructor creation
  7578. resolveConstructorOptions(Ctor);
  7579. // transform component v-model data into props & events
  7580. if (isDef(data.model)) {
  7581. transformModel(Ctor.options, data);
  7582. }
  7583. // extract props
  7584. var propsData = extractPropsFromVNodeData(data, Ctor, tag);
  7585. // functional component
  7586. if (isTrue(Ctor.options.functional)) {
  7587. return createFunctionalComponent(Ctor, propsData, data, context, children)
  7588. }
  7589. // extract listeners, since these needs to be treated as
  7590. // child component listeners instead of DOM listeners
  7591. var listeners = data.on;
  7592. // replace with listeners with .native modifier
  7593. // so it gets processed during parent component patch.
  7594. data.on = data.nativeOn;
  7595. if (isTrue(Ctor.options.abstract)) {
  7596. // abstract components do not keep anything
  7597. // other than props & listeners & slot
  7598. // work around flow
  7599. var slot = data.slot;
  7600. data = {};
  7601. if (slot) {
  7602. data.slot = slot;
  7603. }
  7604. }
  7605. // install component management hooks onto the placeholder node
  7606. installComponentHooks(data);
  7607. // return a placeholder vnode
  7608. var name = Ctor.options.name || tag;
  7609. var vnode = new VNode(
  7610. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  7611. data, undefined, undefined, undefined, context,
  7612. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  7613. asyncFactory
  7614. );
  7615. return vnode
  7616. }
  7617. function createComponentInstanceForVnode (
  7618. // we know it's MountedComponentVNode but flow doesn't
  7619. vnode,
  7620. // activeInstance in lifecycle state
  7621. parent
  7622. ) {
  7623. var options = {
  7624. _isComponent: true,
  7625. _parentVnode: vnode,
  7626. parent: parent
  7627. };
  7628. // check inline-template render functions
  7629. var inlineTemplate = vnode.data.inlineTemplate;
  7630. if (isDef(inlineTemplate)) {
  7631. options.render = inlineTemplate.render;
  7632. options.staticRenderFns = inlineTemplate.staticRenderFns;
  7633. }
  7634. return new vnode.componentOptions.Ctor(options)
  7635. }
  7636. function installComponentHooks (data) {
  7637. var hooks = data.hook || (data.hook = {});
  7638. for (var i = 0; i < hooksToMerge.length; i++) {
  7639. var key = hooksToMerge[i];
  7640. var existing = hooks[key];
  7641. var toMerge = componentVNodeHooks[key];
  7642. if (existing !== toMerge && !(existing && existing._merged)) {
  7643. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  7644. }
  7645. }
  7646. }
  7647. function mergeHook$1 (f1, f2) {
  7648. var merged = function (a, b) {
  7649. // flow complains about extra args which is why we use any
  7650. f1(a, b);
  7651. f2(a, b);
  7652. };
  7653. merged._merged = true;
  7654. return merged
  7655. }
  7656. // transform component v-model info (value and callback) into
  7657. // prop and event handler respectively.
  7658. function transformModel (options, data) {
  7659. var prop = (options.model && options.model.prop) || 'value';
  7660. var event = (options.model && options.model.event) || 'input'
  7661. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  7662. var on = data.on || (data.on = {});
  7663. var existing = on[event];
  7664. var callback = data.model.callback;
  7665. if (isDef(existing)) {
  7666. if (
  7667. Array.isArray(existing)
  7668. ? existing.indexOf(callback) === -1
  7669. : existing !== callback
  7670. ) {
  7671. on[event] = [callback].concat(existing);
  7672. }
  7673. } else {
  7674. on[event] = callback;
  7675. }
  7676. }
  7677. /* */
  7678. var warned = Object.create(null);
  7679. var warnOnce = function (msg) {
  7680. if (!warned[msg]) {
  7681. warned[msg] = true;
  7682. // eslint-disable-next-line no-console
  7683. console.warn(("\n\u001b[31m" + msg + "\u001b[39m\n"));
  7684. }
  7685. };
  7686. var onCompilationError = function (err, vm) {
  7687. var trace = vm ? generateComponentTrace(vm) : '';
  7688. throw new Error(("\n\u001b[31m" + err + trace + "\u001b[39m\n"))
  7689. };
  7690. var normalizeRender = function (vm) {
  7691. var ref = vm.$options;
  7692. var render = ref.render;
  7693. var template = ref.template;
  7694. var _scopeId = ref._scopeId;
  7695. if (isUndef(render)) {
  7696. if (template) {
  7697. var compiled = compileToFunctions(template, {
  7698. scopeId: _scopeId,
  7699. warn: onCompilationError
  7700. }, vm);
  7701. vm.$options.render = compiled.render;
  7702. vm.$options.staticRenderFns = compiled.staticRenderFns;
  7703. } else {
  7704. throw new Error(
  7705. ("render function or template not defined in component: " + (vm.$options.name || vm.$options._componentTag || 'anonymous'))
  7706. )
  7707. }
  7708. }
  7709. };
  7710. function waitForServerPrefetch (vm, resolve, reject) {
  7711. var handlers = vm.$options.serverPrefetch;
  7712. if (isDef(handlers)) {
  7713. if (!Array.isArray(handlers)) { handlers = [handlers]; }
  7714. try {
  7715. var promises = [];
  7716. for (var i = 0, j = handlers.length; i < j; i++) {
  7717. var result = handlers[i].call(vm, vm);
  7718. if (result && typeof result.then === 'function') {
  7719. promises.push(result);
  7720. }
  7721. }
  7722. Promise.all(promises).then(resolve).catch(reject);
  7723. return
  7724. } catch (e) {
  7725. reject(e);
  7726. }
  7727. }
  7728. resolve();
  7729. }
  7730. function renderNode (node, isRoot, context) {
  7731. if (node.isString) {
  7732. renderStringNode$1(node, context);
  7733. } else if (isDef(node.componentOptions)) {
  7734. renderComponent(node, isRoot, context);
  7735. } else if (isDef(node.tag)) {
  7736. renderElement(node, isRoot, context);
  7737. } else if (isTrue(node.isComment)) {
  7738. if (isDef(node.asyncFactory)) {
  7739. // async component
  7740. renderAsyncComponent(node, isRoot, context);
  7741. } else {
  7742. context.write(("<!--" + (node.text) + "-->"), context.next);
  7743. }
  7744. } else {
  7745. context.write(
  7746. node.raw ? node.text : escape(String(node.text)),
  7747. context.next
  7748. );
  7749. }
  7750. }
  7751. function registerComponentForCache (options, write) {
  7752. // exposed by vue-loader, need to call this if cache hit because
  7753. // component lifecycle hooks will not be called.
  7754. var register = options._ssrRegister;
  7755. if (write.caching && isDef(register)) {
  7756. write.componentBuffer[write.componentBuffer.length - 1].add(register);
  7757. }
  7758. return register
  7759. }
  7760. function renderComponent (node, isRoot, context) {
  7761. var write = context.write;
  7762. var next = context.next;
  7763. var userContext = context.userContext;
  7764. // check cache hit
  7765. var Ctor = node.componentOptions.Ctor;
  7766. var getKey = Ctor.options.serverCacheKey;
  7767. var name = Ctor.options.name;
  7768. var cache = context.cache;
  7769. var registerComponent = registerComponentForCache(Ctor.options, write);
  7770. if (isDef(getKey) && isDef(cache) && isDef(name)) {
  7771. var rawKey = getKey(node.componentOptions.propsData);
  7772. if (rawKey === false) {
  7773. renderComponentInner(node, isRoot, context);
  7774. return
  7775. }
  7776. var key = name + '::' + rawKey;
  7777. var has = context.has;
  7778. var get = context.get;
  7779. if (isDef(has)) {
  7780. has(key, function (hit) {
  7781. if (hit === true && isDef(get)) {
  7782. get(key, function (res) {
  7783. if (isDef(registerComponent)) {
  7784. registerComponent(userContext);
  7785. }
  7786. res.components.forEach(function (register) { return register(userContext); });
  7787. write(res.html, next);
  7788. });
  7789. } else {
  7790. renderComponentWithCache(node, isRoot, key, context);
  7791. }
  7792. });
  7793. } else if (isDef(get)) {
  7794. get(key, function (res) {
  7795. if (isDef(res)) {
  7796. if (isDef(registerComponent)) {
  7797. registerComponent(userContext);
  7798. }
  7799. res.components.forEach(function (register) { return register(userContext); });
  7800. write(res.html, next);
  7801. } else {
  7802. renderComponentWithCache(node, isRoot, key, context);
  7803. }
  7804. });
  7805. }
  7806. } else {
  7807. if (isDef(getKey) && isUndef(cache)) {
  7808. warnOnce(
  7809. "[vue-server-renderer] Component " + (Ctor.options.name || '(anonymous)') + " implemented serverCacheKey, " +
  7810. 'but no cache was provided to the renderer.'
  7811. );
  7812. }
  7813. if (isDef(getKey) && isUndef(name)) {
  7814. warnOnce(
  7815. "[vue-server-renderer] Components that implement \"serverCacheKey\" " +
  7816. "must also define a unique \"name\" option."
  7817. );
  7818. }
  7819. renderComponentInner(node, isRoot, context);
  7820. }
  7821. }
  7822. function renderComponentWithCache (node, isRoot, key, context) {
  7823. var write = context.write;
  7824. write.caching = true;
  7825. var buffer = write.cacheBuffer;
  7826. var bufferIndex = buffer.push('') - 1;
  7827. var componentBuffer = write.componentBuffer;
  7828. componentBuffer.push(new Set());
  7829. context.renderStates.push({
  7830. type: 'ComponentWithCache',
  7831. key: key,
  7832. buffer: buffer,
  7833. bufferIndex: bufferIndex,
  7834. componentBuffer: componentBuffer
  7835. });
  7836. renderComponentInner(node, isRoot, context);
  7837. }
  7838. function renderComponentInner (node, isRoot, context) {
  7839. var prevActive = context.activeInstance;
  7840. // expose userContext on vnode
  7841. node.ssrContext = context.userContext;
  7842. var child = context.activeInstance = createComponentInstanceForVnode(
  7843. node,
  7844. context.activeInstance
  7845. );
  7846. normalizeRender(child);
  7847. var resolve = function () {
  7848. var childNode = child._render();
  7849. childNode.parent = node;
  7850. context.renderStates.push({
  7851. type: 'Component',
  7852. prevActive: prevActive
  7853. });
  7854. renderNode(childNode, isRoot, context);
  7855. };
  7856. var reject = context.done;
  7857. waitForServerPrefetch(child, resolve, reject);
  7858. }
  7859. function renderAsyncComponent (node, isRoot, context) {
  7860. var factory = node.asyncFactory;
  7861. var resolve = function (comp) {
  7862. if (comp.__esModule && comp.default) {
  7863. comp = comp.default;
  7864. }
  7865. var ref = node.asyncMeta;
  7866. var data = ref.data;
  7867. var children = ref.children;
  7868. var tag = ref.tag;
  7869. var nodeContext = node.asyncMeta.context;
  7870. var resolvedNode = createComponent(
  7871. comp,
  7872. data,
  7873. nodeContext,
  7874. children,
  7875. tag
  7876. );
  7877. if (resolvedNode) {
  7878. if (resolvedNode.componentOptions) {
  7879. // normal component
  7880. renderComponent(resolvedNode, isRoot, context);
  7881. } else if (!Array.isArray(resolvedNode)) {
  7882. // single return node from functional component
  7883. renderNode(resolvedNode, isRoot, context);
  7884. } else {
  7885. // multiple return nodes from functional component
  7886. context.renderStates.push({
  7887. type: 'Fragment',
  7888. children: resolvedNode,
  7889. rendered: 0,
  7890. total: resolvedNode.length
  7891. });
  7892. context.next();
  7893. }
  7894. } else {
  7895. // invalid component, but this does not throw on the client
  7896. // so render empty comment node
  7897. context.write("<!---->", context.next);
  7898. }
  7899. };
  7900. if (factory.resolved) {
  7901. resolve(factory.resolved);
  7902. return
  7903. }
  7904. var reject = context.done;
  7905. var res;
  7906. try {
  7907. res = factory(resolve, reject);
  7908. } catch (e) {
  7909. reject(e);
  7910. }
  7911. if (res) {
  7912. if (typeof res.then === 'function') {
  7913. res.then(resolve, reject).catch(reject);
  7914. } else {
  7915. // new syntax in 2.3
  7916. var comp = res.component;
  7917. if (comp && typeof comp.then === 'function') {
  7918. comp.then(resolve, reject).catch(reject);
  7919. }
  7920. }
  7921. }
  7922. }
  7923. function renderStringNode$1 (el, context) {
  7924. var write = context.write;
  7925. var next = context.next;
  7926. if (isUndef(el.children) || el.children.length === 0) {
  7927. write(el.open + (el.close || ''), next);
  7928. } else {
  7929. var children = el.children;
  7930. context.renderStates.push({
  7931. type: 'Element',
  7932. children: children,
  7933. rendered: 0,
  7934. total: children.length,
  7935. endTag: el.close
  7936. });
  7937. write(el.open, next);
  7938. }
  7939. }
  7940. function renderElement (el, isRoot, context) {
  7941. var write = context.write;
  7942. var next = context.next;
  7943. if (isTrue(isRoot)) {
  7944. if (!el.data) { el.data = {}; }
  7945. if (!el.data.attrs) { el.data.attrs = {}; }
  7946. el.data.attrs[SSR_ATTR] = 'true';
  7947. }
  7948. if (el.fnOptions) {
  7949. registerComponentForCache(el.fnOptions, write);
  7950. }
  7951. var startTag = renderStartingTag(el, context);
  7952. var endTag = "</" + (el.tag) + ">";
  7953. if (context.isUnaryTag(el.tag)) {
  7954. write(startTag, next);
  7955. } else if (isUndef(el.children) || el.children.length === 0) {
  7956. write(startTag + endTag, next);
  7957. } else {
  7958. var children = el.children;
  7959. context.renderStates.push({
  7960. type: 'Element',
  7961. children: children,
  7962. rendered: 0,
  7963. total: children.length,
  7964. endTag: endTag
  7965. });
  7966. write(startTag, next);
  7967. }
  7968. }
  7969. function hasAncestorData (node) {
  7970. var parentNode = node.parent;
  7971. return isDef(parentNode) && (isDef(parentNode.data) || hasAncestorData(parentNode))
  7972. }
  7973. function getVShowDirectiveInfo (node) {
  7974. var dir;
  7975. var tmp;
  7976. while (isDef(node)) {
  7977. if (node.data && node.data.directives) {
  7978. tmp = node.data.directives.find(function (dir) { return dir.name === 'show'; });
  7979. if (tmp) {
  7980. dir = tmp;
  7981. }
  7982. }
  7983. node = node.parent;
  7984. }
  7985. return dir
  7986. }
  7987. function renderStartingTag (node, context) {
  7988. var markup = "<" + (node.tag);
  7989. var directives = context.directives;
  7990. var modules = context.modules;
  7991. // construct synthetic data for module processing
  7992. // because modules like style also produce code by parent VNode data
  7993. if (isUndef(node.data) && hasAncestorData(node)) {
  7994. node.data = {};
  7995. }
  7996. if (isDef(node.data)) {
  7997. // check directives
  7998. var dirs = node.data.directives;
  7999. if (dirs) {
  8000. for (var i = 0; i < dirs.length; i++) {
  8001. var name = dirs[i].name;
  8002. if (name !== 'show') {
  8003. var dirRenderer = resolveAsset(context, 'directives', name);
  8004. if (dirRenderer) {
  8005. // directives mutate the node's data
  8006. // which then gets rendered by modules
  8007. dirRenderer(node, dirs[i]);
  8008. }
  8009. }
  8010. }
  8011. }
  8012. // v-show directive needs to be merged from parent to child
  8013. var vshowDirectiveInfo = getVShowDirectiveInfo(node);
  8014. if (vshowDirectiveInfo) {
  8015. directives.show(node, vshowDirectiveInfo);
  8016. }
  8017. // apply other modules
  8018. for (var i$1 = 0; i$1 < modules.length; i$1++) {
  8019. var res = modules[i$1](node);
  8020. if (res) {
  8021. markup += res;
  8022. }
  8023. }
  8024. }
  8025. // attach scoped CSS ID
  8026. var scopeId;
  8027. var activeInstance = context.activeInstance;
  8028. if (isDef(activeInstance) &&
  8029. activeInstance !== node.context &&
  8030. isDef(scopeId = activeInstance.$options._scopeId)
  8031. ) {
  8032. markup += " " + ((scopeId));
  8033. }
  8034. if (isDef(node.fnScopeId)) {
  8035. markup += " " + (node.fnScopeId);
  8036. } else {
  8037. while (isDef(node)) {
  8038. if (isDef(scopeId = node.context.$options._scopeId)) {
  8039. markup += " " + scopeId;
  8040. }
  8041. node = node.parent;
  8042. }
  8043. }
  8044. return markup + '>'
  8045. }
  8046. function createRenderFunction (
  8047. modules,
  8048. directives,
  8049. isUnaryTag,
  8050. cache
  8051. ) {
  8052. return function render (
  8053. component,
  8054. write,
  8055. userContext,
  8056. done
  8057. ) {
  8058. warned = Object.create(null);
  8059. var context = new RenderContext({
  8060. activeInstance: component,
  8061. userContext: userContext,
  8062. write: write, done: done, renderNode: renderNode,
  8063. isUnaryTag: isUnaryTag, modules: modules, directives: directives,
  8064. cache: cache
  8065. });
  8066. installSSRHelpers(component);
  8067. normalizeRender(component);
  8068. var resolve = function () {
  8069. renderNode(component._render(), true, context);
  8070. };
  8071. waitForServerPrefetch(component, resolve, done);
  8072. }
  8073. }
  8074. /* */
  8075. function createBasicRenderer (ref) {
  8076. if ( ref === void 0 ) ref = {};
  8077. var modules = ref.modules; if ( modules === void 0 ) modules = [];
  8078. var directives = ref.directives; if ( directives === void 0 ) directives = {};
  8079. var isUnaryTag = ref.isUnaryTag; if ( isUnaryTag === void 0 ) isUnaryTag = (function () { return false; });
  8080. var cache = ref.cache;
  8081. var render = createRenderFunction(modules, directives, isUnaryTag, cache);
  8082. return function renderToString (
  8083. component,
  8084. context,
  8085. done
  8086. ) {
  8087. if (typeof context === 'function') {
  8088. done = context;
  8089. context = {};
  8090. }
  8091. var result = '';
  8092. var write = createWriteFunction(function (text) {
  8093. result += text;
  8094. return false
  8095. }, done);
  8096. try {
  8097. render(component, write, context, function () {
  8098. done(null, result);
  8099. });
  8100. } catch (e) {
  8101. done(e);
  8102. }
  8103. }
  8104. }
  8105. /* */
  8106. var entryServerBasicRenderer = createBasicRenderer({
  8107. modules: modules,
  8108. directives: directives,
  8109. isUnaryTag: isUnaryTag,
  8110. canBeLeftOpenTag: canBeLeftOpenTag
  8111. });
  8112. return entryServerBasicRenderer;
  8113. }));