vue.js 249 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684
  1. /*!
  2. * Vue.js v2.3.3
  3. * (c) 2014-2017 Evan You
  4. * Released under the MIT License.
  5. */
  6. (function (global, factory) {
  7. typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  8. typeof define === 'function' && define.amd ? define(factory) :
  9. (global.Vue = factory());
  10. }(this, (function () { 'use strict';
  11. /* */
  12. // these helpers produces better vm code in JS engines due to their
  13. // explicitness and function inlining
  14. function isUndef (v) {
  15. return v === undefined || v === null
  16. }
  17. function isDef (v) {
  18. return v !== undefined && v !== null
  19. }
  20. function isTrue (v) {
  21. return v === true
  22. }
  23. function isFalse (v) {
  24. return v === false
  25. }
  26. /**
  27. * Check if value is primitive
  28. */
  29. function isPrimitive (value) {
  30. return typeof value === 'string' || typeof value === 'number'
  31. }
  32. /**
  33. * Quick object check - this is primarily used to tell
  34. * Objects from primitive values when we know the value
  35. * is a JSON-compliant type.
  36. */
  37. function isObject (obj) {
  38. return obj !== null && typeof obj === 'object'
  39. }
  40. var _toString = Object.prototype.toString;
  41. /**
  42. * Strict object type check. Only returns true
  43. * for plain JavaScript objects.
  44. */
  45. function isPlainObject (obj) {
  46. return _toString.call(obj) === '[object Object]'
  47. }
  48. function isRegExp (v) {
  49. return _toString.call(v) === '[object RegExp]'
  50. }
  51. /**
  52. * Convert a value to a string that is actually rendered.
  53. */
  54. function toString (val) {
  55. return val == null
  56. ? ''
  57. : typeof val === 'object'
  58. ? JSON.stringify(val, null, 2)
  59. : String(val)
  60. }
  61. /**
  62. * Convert a input value to a number for persistence.
  63. * If the conversion fails, return original string.
  64. */
  65. function toNumber (val) {
  66. var n = parseFloat(val);
  67. return isNaN(n) ? val : n
  68. }
  69. /**
  70. * Make a map and return a function for checking if a key
  71. * is in that map.
  72. */
  73. function makeMap (
  74. str,
  75. expectsLowerCase
  76. ) {
  77. var map = Object.create(null);
  78. var list = str.split(',');
  79. for (var i = 0; i < list.length; i++) {
  80. map[list[i]] = true;
  81. }
  82. return expectsLowerCase
  83. ? function (val) { return map[val.toLowerCase()]; }
  84. : function (val) { return map[val]; }
  85. }
  86. /**
  87. * Check if a tag is a built-in tag.
  88. */
  89. var isBuiltInTag = makeMap('slot,component', true);
  90. /**
  91. * Remove an item from an array
  92. */
  93. function remove (arr, item) {
  94. if (arr.length) {
  95. var index = arr.indexOf(item);
  96. if (index > -1) {
  97. return arr.splice(index, 1)
  98. }
  99. }
  100. }
  101. /**
  102. * Check whether the object has the property.
  103. */
  104. var hasOwnProperty = Object.prototype.hasOwnProperty;
  105. function hasOwn (obj, key) {
  106. return hasOwnProperty.call(obj, key)
  107. }
  108. /**
  109. * Create a cached version of a pure function.
  110. */
  111. function cached (fn) {
  112. var cache = Object.create(null);
  113. return (function cachedFn (str) {
  114. var hit = cache[str];
  115. return hit || (cache[str] = fn(str))
  116. })
  117. }
  118. /**
  119. * Camelize a hyphen-delimited string.
  120. */
  121. var camelizeRE = /-(\w)/g;
  122. var camelize = cached(function (str) {
  123. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  124. });
  125. /**
  126. * Capitalize a string.
  127. */
  128. var capitalize = cached(function (str) {
  129. return str.charAt(0).toUpperCase() + str.slice(1)
  130. });
  131. /**
  132. * Hyphenate a camelCase string.
  133. */
  134. var hyphenateRE = /([^-])([A-Z])/g;
  135. var hyphenate = cached(function (str) {
  136. return str
  137. .replace(hyphenateRE, '$1-$2')
  138. .replace(hyphenateRE, '$1-$2')
  139. .toLowerCase()
  140. });
  141. /**
  142. * Simple bind, faster than native
  143. */
  144. function bind (fn, ctx) {
  145. function boundFn (a) {
  146. var l = arguments.length;
  147. return l
  148. ? l > 1
  149. ? fn.apply(ctx, arguments)
  150. : fn.call(ctx, a)
  151. : fn.call(ctx)
  152. }
  153. // record original fn length
  154. boundFn._length = fn.length;
  155. return boundFn
  156. }
  157. /**
  158. * Convert an Array-like object to a real Array.
  159. */
  160. function toArray (list, start) {
  161. start = start || 0;
  162. var i = list.length - start;
  163. var ret = new Array(i);
  164. while (i--) {
  165. ret[i] = list[i + start];
  166. }
  167. return ret
  168. }
  169. /**
  170. * Mix properties into target object.
  171. */
  172. function extend (to, _from) {
  173. for (var key in _from) {
  174. to[key] = _from[key];
  175. }
  176. return to
  177. }
  178. /**
  179. * Merge an Array of Objects into a single Object.
  180. */
  181. function toObject (arr) {
  182. var res = {};
  183. for (var i = 0; i < arr.length; i++) {
  184. if (arr[i]) {
  185. extend(res, arr[i]);
  186. }
  187. }
  188. return res
  189. }
  190. /**
  191. * Perform no operation.
  192. */
  193. function noop () {}
  194. /**
  195. * Always return false.
  196. */
  197. var no = function () { return false; };
  198. /**
  199. * Return same value
  200. */
  201. var identity = function (_) { return _; };
  202. /**
  203. * Generate a static keys string from compiler modules.
  204. */
  205. function genStaticKeys (modules) {
  206. return modules.reduce(function (keys, m) {
  207. return keys.concat(m.staticKeys || [])
  208. }, []).join(',')
  209. }
  210. /**
  211. * Check if two values are loosely equal - that is,
  212. * if they are plain objects, do they have the same shape?
  213. */
  214. function looseEqual (a, b) {
  215. var isObjectA = isObject(a);
  216. var isObjectB = isObject(b);
  217. if (isObjectA && isObjectB) {
  218. try {
  219. return JSON.stringify(a) === JSON.stringify(b)
  220. } catch (e) {
  221. // possible circular reference
  222. return a === b
  223. }
  224. } else if (!isObjectA && !isObjectB) {
  225. return String(a) === String(b)
  226. } else {
  227. return false
  228. }
  229. }
  230. function looseIndexOf (arr, val) {
  231. for (var i = 0; i < arr.length; i++) {
  232. if (looseEqual(arr[i], val)) { return i }
  233. }
  234. return -1
  235. }
  236. /**
  237. * Ensure a function is called only once.
  238. */
  239. function once (fn) {
  240. var called = false;
  241. return function () {
  242. if (!called) {
  243. called = true;
  244. fn.apply(this, arguments);
  245. }
  246. }
  247. }
  248. var SSR_ATTR = 'data-server-rendered';
  249. var ASSET_TYPES = [
  250. 'component',
  251. 'directive',
  252. 'filter'
  253. ];
  254. var LIFECYCLE_HOOKS = [
  255. 'beforeCreate',
  256. 'created',
  257. 'beforeMount',
  258. 'mounted',
  259. 'beforeUpdate',
  260. 'updated',
  261. 'beforeDestroy',
  262. 'destroyed',
  263. 'activated',
  264. 'deactivated'
  265. ];
  266. /* */
  267. var config = ({
  268. /**
  269. * Option merge strategies (used in core/util/options)
  270. */
  271. optionMergeStrategies: Object.create(null),
  272. /**
  273. * Whether to suppress warnings.
  274. */
  275. silent: false,
  276. /**
  277. * Show production mode tip message on boot?
  278. */
  279. productionTip: "development" !== 'production',
  280. /**
  281. * Whether to enable devtools
  282. */
  283. devtools: "development" !== 'production',
  284. /**
  285. * Whether to record perf
  286. */
  287. performance: false,
  288. /**
  289. * Error handler for watcher errors
  290. */
  291. errorHandler: null,
  292. /**
  293. * Ignore certain custom elements
  294. */
  295. ignoredElements: [],
  296. /**
  297. * Custom user key aliases for v-on
  298. */
  299. keyCodes: Object.create(null),
  300. /**
  301. * Check if a tag is reserved so that it cannot be registered as a
  302. * component. This is platform-dependent and may be overwritten.
  303. */
  304. isReservedTag: no,
  305. /**
  306. * Check if an attribute is reserved so that it cannot be used as a component
  307. * prop. This is platform-dependent and may be overwritten.
  308. */
  309. isReservedAttr: no,
  310. /**
  311. * Check if a tag is an unknown element.
  312. * Platform-dependent.
  313. */
  314. isUnknownElement: no,
  315. /**
  316. * Get the namespace of an element
  317. */
  318. getTagNamespace: noop,
  319. /**
  320. * Parse the real tag name for the specific platform.
  321. */
  322. parsePlatformTagName: identity,
  323. /**
  324. * Check if an attribute must be bound using property, e.g. value
  325. * Platform-dependent.
  326. */
  327. mustUseProp: no,
  328. /**
  329. * Exposed for legacy reasons
  330. */
  331. _lifecycleHooks: LIFECYCLE_HOOKS
  332. });
  333. /* */
  334. var emptyObject = Object.freeze({});
  335. /**
  336. * Check if a string starts with $ or _
  337. */
  338. function isReserved (str) {
  339. var c = (str + '').charCodeAt(0);
  340. return c === 0x24 || c === 0x5F
  341. }
  342. /**
  343. * Define a property.
  344. */
  345. function def (obj, key, val, enumerable) {
  346. Object.defineProperty(obj, key, {
  347. value: val,
  348. enumerable: !!enumerable,
  349. writable: true,
  350. configurable: true
  351. });
  352. }
  353. /**
  354. * Parse simple path.
  355. */
  356. var bailRE = /[^\w.$]/;
  357. function parsePath (path) {
  358. if (bailRE.test(path)) {
  359. return
  360. }
  361. var segments = path.split('.');
  362. return function (obj) {
  363. for (var i = 0; i < segments.length; i++) {
  364. if (!obj) { return }
  365. obj = obj[segments[i]];
  366. }
  367. return obj
  368. }
  369. }
  370. /* */
  371. var warn = noop;
  372. var tip = noop;
  373. var formatComponentName = (null); // work around flow check
  374. {
  375. var hasConsole = typeof console !== 'undefined';
  376. var classifyRE = /(?:^|[-_])(\w)/g;
  377. var classify = function (str) { return str
  378. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  379. .replace(/[-_]/g, ''); };
  380. warn = function (msg, vm) {
  381. if (hasConsole && (!config.silent)) {
  382. console.error("[Vue warn]: " + msg + (
  383. vm ? generateComponentTrace(vm) : ''
  384. ));
  385. }
  386. };
  387. tip = function (msg, vm) {
  388. if (hasConsole && (!config.silent)) {
  389. console.warn("[Vue tip]: " + msg + (
  390. vm ? generateComponentTrace(vm) : ''
  391. ));
  392. }
  393. };
  394. formatComponentName = function (vm, includeFile) {
  395. if (vm.$root === vm) {
  396. return '<Root>'
  397. }
  398. var name = typeof vm === 'string'
  399. ? vm
  400. : typeof vm === 'function' && vm.options
  401. ? vm.options.name
  402. : vm._isVue
  403. ? vm.$options.name || vm.$options._componentTag
  404. : vm.name;
  405. var file = vm._isVue && vm.$options.__file;
  406. if (!name && file) {
  407. var match = file.match(/([^/\\]+)\.vue$/);
  408. name = match && match[1];
  409. }
  410. return (
  411. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  412. (file && includeFile !== false ? (" at " + file) : '')
  413. )
  414. };
  415. var repeat = function (str, n) {
  416. var res = '';
  417. while (n) {
  418. if (n % 2 === 1) { res += str; }
  419. if (n > 1) { str += str; }
  420. n >>= 1;
  421. }
  422. return res
  423. };
  424. var generateComponentTrace = function (vm) {
  425. if (vm._isVue && vm.$parent) {
  426. var tree = [];
  427. var currentRecursiveSequence = 0;
  428. while (vm) {
  429. if (tree.length > 0) {
  430. var last = tree[tree.length - 1];
  431. if (last.constructor === vm.constructor) {
  432. currentRecursiveSequence++;
  433. vm = vm.$parent;
  434. continue
  435. } else if (currentRecursiveSequence > 0) {
  436. tree[tree.length - 1] = [last, currentRecursiveSequence];
  437. currentRecursiveSequence = 0;
  438. }
  439. }
  440. tree.push(vm);
  441. vm = vm.$parent;
  442. }
  443. return '\n\nfound in\n\n' + tree
  444. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  445. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  446. : formatComponentName(vm))); })
  447. .join('\n')
  448. } else {
  449. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  450. }
  451. };
  452. }
  453. /* */
  454. function handleError (err, vm, info) {
  455. if (config.errorHandler) {
  456. config.errorHandler.call(null, err, vm, info);
  457. } else {
  458. {
  459. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  460. }
  461. /* istanbul ignore else */
  462. if (inBrowser && typeof console !== 'undefined') {
  463. console.error(err);
  464. } else {
  465. throw err
  466. }
  467. }
  468. }
  469. /* */
  470. /* globals MutationObserver */
  471. // can we use __proto__?
  472. var hasProto = '__proto__' in {};
  473. // Browser environment sniffing
  474. var inBrowser = typeof window !== 'undefined';
  475. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  476. var isIE = UA && /msie|trident/.test(UA);
  477. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  478. var isEdge = UA && UA.indexOf('edge/') > 0;
  479. var isAndroid = UA && UA.indexOf('android') > 0;
  480. var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
  481. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  482. var supportsPassive = false;
  483. if (inBrowser) {
  484. try {
  485. var opts = {};
  486. Object.defineProperty(opts, 'passive', ({
  487. get: function get () {
  488. /* istanbul ignore next */
  489. supportsPassive = true;
  490. }
  491. } )); // https://github.com/facebook/flow/issues/285
  492. window.addEventListener('test-passive', null, opts);
  493. } catch (e) {}
  494. }
  495. // this needs to be lazy-evaled because vue may be required before
  496. // vue-server-renderer can set VUE_ENV
  497. var _isServer;
  498. var isServerRendering = function () {
  499. if (_isServer === undefined) {
  500. /* istanbul ignore if */
  501. if (!inBrowser && typeof global !== 'undefined') {
  502. // detect presence of vue-server-renderer and avoid
  503. // Webpack shimming the process
  504. _isServer = global['process'].env.VUE_ENV === 'server';
  505. } else {
  506. _isServer = false;
  507. }
  508. }
  509. return _isServer
  510. };
  511. // detect devtools
  512. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  513. /* istanbul ignore next */
  514. function isNative (Ctor) {
  515. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  516. }
  517. var hasSymbol =
  518. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  519. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  520. /**
  521. * Defer a task to execute it asynchronously.
  522. */
  523. var nextTick = (function () {
  524. var callbacks = [];
  525. var pending = false;
  526. var timerFunc;
  527. function nextTickHandler () {
  528. pending = false;
  529. var copies = callbacks.slice(0);
  530. callbacks.length = 0;
  531. for (var i = 0; i < copies.length; i++) {
  532. copies[i]();
  533. }
  534. }
  535. // the nextTick behavior leverages the microtask queue, which can be accessed
  536. // via either native Promise.then or MutationObserver.
  537. // MutationObserver has wider support, however it is seriously bugged in
  538. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  539. // completely stops working after triggering a few times... so, if native
  540. // Promise is available, we will use it:
  541. /* istanbul ignore if */
  542. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  543. var p = Promise.resolve();
  544. var logError = function (err) { console.error(err); };
  545. timerFunc = function () {
  546. p.then(nextTickHandler).catch(logError);
  547. // in problematic UIWebViews, Promise.then doesn't completely break, but
  548. // it can get stuck in a weird state where callbacks are pushed into the
  549. // microtask queue but the queue isn't being flushed, until the browser
  550. // needs to do some other work, e.g. handle a timer. Therefore we can
  551. // "force" the microtask queue to be flushed by adding an empty timer.
  552. if (isIOS) { setTimeout(noop); }
  553. };
  554. } else if (typeof MutationObserver !== 'undefined' && (
  555. isNative(MutationObserver) ||
  556. // PhantomJS and iOS 7.x
  557. MutationObserver.toString() === '[object MutationObserverConstructor]'
  558. )) {
  559. // use MutationObserver where native Promise is not available,
  560. // e.g. PhantomJS IE11, iOS7, Android 4.4
  561. var counter = 1;
  562. var observer = new MutationObserver(nextTickHandler);
  563. var textNode = document.createTextNode(String(counter));
  564. observer.observe(textNode, {
  565. characterData: true
  566. });
  567. timerFunc = function () {
  568. counter = (counter + 1) % 2;
  569. textNode.data = String(counter);
  570. };
  571. } else {
  572. // fallback to setTimeout
  573. /* istanbul ignore next */
  574. timerFunc = function () {
  575. setTimeout(nextTickHandler, 0);
  576. };
  577. }
  578. return function queueNextTick (cb, ctx) {
  579. var _resolve;
  580. callbacks.push(function () {
  581. if (cb) {
  582. try {
  583. cb.call(ctx);
  584. } catch (e) {
  585. handleError(e, ctx, 'nextTick');
  586. }
  587. } else if (_resolve) {
  588. _resolve(ctx);
  589. }
  590. });
  591. if (!pending) {
  592. pending = true;
  593. timerFunc();
  594. }
  595. if (!cb && typeof Promise !== 'undefined') {
  596. return new Promise(function (resolve, reject) {
  597. _resolve = resolve;
  598. })
  599. }
  600. }
  601. })();
  602. var _Set;
  603. /* istanbul ignore if */
  604. if (typeof Set !== 'undefined' && isNative(Set)) {
  605. // use native Set when available.
  606. _Set = Set;
  607. } else {
  608. // a non-standard Set polyfill that only works with primitive keys.
  609. _Set = (function () {
  610. function Set () {
  611. this.set = Object.create(null);
  612. }
  613. Set.prototype.has = function has (key) {
  614. return this.set[key] === true
  615. };
  616. Set.prototype.add = function add (key) {
  617. this.set[key] = true;
  618. };
  619. Set.prototype.clear = function clear () {
  620. this.set = Object.create(null);
  621. };
  622. return Set;
  623. }());
  624. }
  625. /* */
  626. var uid = 0;
  627. /**
  628. * A dep is an observable that can have multiple
  629. * directives subscribing to it.
  630. */
  631. var Dep = function Dep () {
  632. this.id = uid++;
  633. this.subs = [];
  634. };
  635. Dep.prototype.addSub = function addSub (sub) {
  636. this.subs.push(sub);
  637. };
  638. Dep.prototype.removeSub = function removeSub (sub) {
  639. remove(this.subs, sub);
  640. };
  641. Dep.prototype.depend = function depend () {
  642. if (Dep.target) {
  643. Dep.target.addDep(this);
  644. }
  645. };
  646. Dep.prototype.notify = function notify () {
  647. // stabilize the subscriber list first
  648. var subs = this.subs.slice();
  649. for (var i = 0, l = subs.length; i < l; i++) {
  650. subs[i].update();
  651. }
  652. };
  653. // the current target watcher being evaluated.
  654. // this is globally unique because there could be only one
  655. // watcher being evaluated at any time.
  656. Dep.target = null;
  657. var targetStack = [];
  658. function pushTarget (_target) {
  659. if (Dep.target) { targetStack.push(Dep.target); }
  660. Dep.target = _target;
  661. }
  662. function popTarget () {
  663. Dep.target = targetStack.pop();
  664. }
  665. /*
  666. * not type checking this file because flow doesn't play well with
  667. * dynamically accessing methods on Array prototype
  668. */
  669. var arrayProto = Array.prototype;
  670. var arrayMethods = Object.create(arrayProto);[
  671. 'push',
  672. 'pop',
  673. 'shift',
  674. 'unshift',
  675. 'splice',
  676. 'sort',
  677. 'reverse'
  678. ]
  679. .forEach(function (method) {
  680. // cache original method
  681. var original = arrayProto[method];
  682. def(arrayMethods, method, function mutator () {
  683. var arguments$1 = arguments;
  684. // avoid leaking arguments:
  685. // http://jsperf.com/closure-with-arguments
  686. var i = arguments.length;
  687. var args = new Array(i);
  688. while (i--) {
  689. args[i] = arguments$1[i];
  690. }
  691. var result = original.apply(this, args);
  692. var ob = this.__ob__;
  693. var inserted;
  694. switch (method) {
  695. case 'push':
  696. inserted = args;
  697. break
  698. case 'unshift':
  699. inserted = args;
  700. break
  701. case 'splice':
  702. inserted = args.slice(2);
  703. break
  704. }
  705. if (inserted) { ob.observeArray(inserted); }
  706. // notify change
  707. ob.dep.notify();
  708. return result
  709. });
  710. });
  711. /* */
  712. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  713. /**
  714. * By default, when a reactive property is set, the new value is
  715. * also converted to become reactive. However when passing down props,
  716. * we don't want to force conversion because the value may be a nested value
  717. * under a frozen data structure. Converting it would defeat the optimization.
  718. */
  719. var observerState = {
  720. shouldConvert: true,
  721. isSettingProps: false
  722. };
  723. /**
  724. * Observer class that are attached to each observed
  725. * object. Once attached, the observer converts target
  726. * object's property keys into getter/setters that
  727. * collect dependencies and dispatches updates.
  728. */
  729. var Observer = function Observer (value) {
  730. this.value = value;
  731. this.dep = new Dep();
  732. this.vmCount = 0;
  733. def(value, '__ob__', this);
  734. if (Array.isArray(value)) {
  735. var augment = hasProto
  736. ? protoAugment
  737. : copyAugment;
  738. augment(value, arrayMethods, arrayKeys);
  739. this.observeArray(value);
  740. } else {
  741. this.walk(value);
  742. }
  743. };
  744. /**
  745. * Walk through each property and convert them into
  746. * getter/setters. This method should only be called when
  747. * value type is Object.
  748. */
  749. Observer.prototype.walk = function walk (obj) {
  750. var keys = Object.keys(obj);
  751. for (var i = 0; i < keys.length; i++) {
  752. defineReactive$$1(obj, keys[i], obj[keys[i]]);
  753. }
  754. };
  755. /**
  756. * Observe a list of Array items.
  757. */
  758. Observer.prototype.observeArray = function observeArray (items) {
  759. for (var i = 0, l = items.length; i < l; i++) {
  760. observe(items[i]);
  761. }
  762. };
  763. // helpers
  764. /**
  765. * Augment an target Object or Array by intercepting
  766. * the prototype chain using __proto__
  767. */
  768. function protoAugment (target, src) {
  769. /* eslint-disable no-proto */
  770. target.__proto__ = src;
  771. /* eslint-enable no-proto */
  772. }
  773. /**
  774. * Augment an target Object or Array by defining
  775. * hidden properties.
  776. */
  777. /* istanbul ignore next */
  778. function copyAugment (target, src, keys) {
  779. for (var i = 0, l = keys.length; i < l; i++) {
  780. var key = keys[i];
  781. def(target, key, src[key]);
  782. }
  783. }
  784. /**
  785. * Attempt to create an observer instance for a value,
  786. * returns the new observer if successfully observed,
  787. * or the existing observer if the value already has one.
  788. */
  789. function observe (value, asRootData) {
  790. if (!isObject(value)) {
  791. return
  792. }
  793. var ob;
  794. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  795. ob = value.__ob__;
  796. } else if (
  797. observerState.shouldConvert &&
  798. !isServerRendering() &&
  799. (Array.isArray(value) || isPlainObject(value)) &&
  800. Object.isExtensible(value) &&
  801. !value._isVue
  802. ) {
  803. ob = new Observer(value);
  804. }
  805. if (asRootData && ob) {
  806. ob.vmCount++;
  807. }
  808. return ob
  809. }
  810. /**
  811. * Define a reactive property on an Object.
  812. */
  813. function defineReactive$$1 (
  814. obj,
  815. key,
  816. val,
  817. customSetter
  818. ) {
  819. var dep = new Dep();
  820. var property = Object.getOwnPropertyDescriptor(obj, key);
  821. if (property && property.configurable === false) {
  822. return
  823. }
  824. // cater for pre-defined getter/setters
  825. var getter = property && property.get;
  826. var setter = property && property.set;
  827. var childOb = observe(val);
  828. Object.defineProperty(obj, key, {
  829. enumerable: true,
  830. configurable: true,
  831. get: function reactiveGetter () {
  832. var value = getter ? getter.call(obj) : val;
  833. if (Dep.target) {
  834. dep.depend();
  835. if (childOb) {
  836. childOb.dep.depend();
  837. }
  838. if (Array.isArray(value)) {
  839. dependArray(value);
  840. }
  841. }
  842. return value
  843. },
  844. set: function reactiveSetter (newVal) {
  845. var value = getter ? getter.call(obj) : val;
  846. /* eslint-disable no-self-compare */
  847. if (newVal === value || (newVal !== newVal && value !== value)) {
  848. return
  849. }
  850. /* eslint-enable no-self-compare */
  851. if ("development" !== 'production' && customSetter) {
  852. customSetter();
  853. }
  854. if (setter) {
  855. setter.call(obj, newVal);
  856. } else {
  857. val = newVal;
  858. }
  859. childOb = observe(newVal);
  860. dep.notify();
  861. }
  862. });
  863. }
  864. /**
  865. * Set a property on an object. Adds the new property and
  866. * triggers change notification if the property doesn't
  867. * already exist.
  868. */
  869. function set (target, key, val) {
  870. if (Array.isArray(target) && typeof key === 'number') {
  871. target.length = Math.max(target.length, key);
  872. target.splice(key, 1, val);
  873. return val
  874. }
  875. if (hasOwn(target, key)) {
  876. target[key] = val;
  877. return val
  878. }
  879. var ob = (target ).__ob__;
  880. if (target._isVue || (ob && ob.vmCount)) {
  881. "development" !== 'production' && warn(
  882. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  883. 'at runtime - declare it upfront in the data option.'
  884. );
  885. return val
  886. }
  887. if (!ob) {
  888. target[key] = val;
  889. return val
  890. }
  891. defineReactive$$1(ob.value, key, val);
  892. ob.dep.notify();
  893. return val
  894. }
  895. /**
  896. * Delete a property and trigger change if necessary.
  897. */
  898. function del (target, key) {
  899. if (Array.isArray(target) && typeof key === 'number') {
  900. target.splice(key, 1);
  901. return
  902. }
  903. var ob = (target ).__ob__;
  904. if (target._isVue || (ob && ob.vmCount)) {
  905. "development" !== 'production' && warn(
  906. 'Avoid deleting properties on a Vue instance or its root $data ' +
  907. '- just set it to null.'
  908. );
  909. return
  910. }
  911. if (!hasOwn(target, key)) {
  912. return
  913. }
  914. delete target[key];
  915. if (!ob) {
  916. return
  917. }
  918. ob.dep.notify();
  919. }
  920. /**
  921. * Collect dependencies on array elements when the array is touched, since
  922. * we cannot intercept array element access like property getters.
  923. */
  924. function dependArray (value) {
  925. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  926. e = value[i];
  927. e && e.__ob__ && e.__ob__.dep.depend();
  928. if (Array.isArray(e)) {
  929. dependArray(e);
  930. }
  931. }
  932. }
  933. /* */
  934. /**
  935. * Option overwriting strategies are functions that handle
  936. * how to merge a parent option value and a child option
  937. * value into the final value.
  938. */
  939. var strats = config.optionMergeStrategies;
  940. /**
  941. * Options with restrictions
  942. */
  943. {
  944. strats.el = strats.propsData = function (parent, child, vm, key) {
  945. if (!vm) {
  946. warn(
  947. "option \"" + key + "\" can only be used during instance " +
  948. 'creation with the `new` keyword.'
  949. );
  950. }
  951. return defaultStrat(parent, child)
  952. };
  953. }
  954. /**
  955. * Helper that recursively merges two data objects together.
  956. */
  957. function mergeData (to, from) {
  958. if (!from) { return to }
  959. var key, toVal, fromVal;
  960. var keys = Object.keys(from);
  961. for (var i = 0; i < keys.length; i++) {
  962. key = keys[i];
  963. toVal = to[key];
  964. fromVal = from[key];
  965. if (!hasOwn(to, key)) {
  966. set(to, key, fromVal);
  967. } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {
  968. mergeData(toVal, fromVal);
  969. }
  970. }
  971. return to
  972. }
  973. /**
  974. * Data
  975. */
  976. strats.data = function (
  977. parentVal,
  978. childVal,
  979. vm
  980. ) {
  981. if (!vm) {
  982. // in a Vue.extend merge, both should be functions
  983. if (!childVal) {
  984. return parentVal
  985. }
  986. if (typeof childVal !== 'function') {
  987. "development" !== 'production' && warn(
  988. 'The "data" option should be a function ' +
  989. 'that returns a per-instance value in component ' +
  990. 'definitions.',
  991. vm
  992. );
  993. return parentVal
  994. }
  995. if (!parentVal) {
  996. return childVal
  997. }
  998. // when parentVal & childVal are both present,
  999. // we need to return a function that returns the
  1000. // merged result of both functions... no need to
  1001. // check if parentVal is a function here because
  1002. // it has to be a function to pass previous merges.
  1003. return function mergedDataFn () {
  1004. return mergeData(
  1005. childVal.call(this),
  1006. parentVal.call(this)
  1007. )
  1008. }
  1009. } else if (parentVal || childVal) {
  1010. return function mergedInstanceDataFn () {
  1011. // instance merge
  1012. var instanceData = typeof childVal === 'function'
  1013. ? childVal.call(vm)
  1014. : childVal;
  1015. var defaultData = typeof parentVal === 'function'
  1016. ? parentVal.call(vm)
  1017. : undefined;
  1018. if (instanceData) {
  1019. return mergeData(instanceData, defaultData)
  1020. } else {
  1021. return defaultData
  1022. }
  1023. }
  1024. }
  1025. };
  1026. /**
  1027. * Hooks and props are merged as arrays.
  1028. */
  1029. function mergeHook (
  1030. parentVal,
  1031. childVal
  1032. ) {
  1033. return childVal
  1034. ? parentVal
  1035. ? parentVal.concat(childVal)
  1036. : Array.isArray(childVal)
  1037. ? childVal
  1038. : [childVal]
  1039. : parentVal
  1040. }
  1041. LIFECYCLE_HOOKS.forEach(function (hook) {
  1042. strats[hook] = mergeHook;
  1043. });
  1044. /**
  1045. * Assets
  1046. *
  1047. * When a vm is present (instance creation), we need to do
  1048. * a three-way merge between constructor options, instance
  1049. * options and parent options.
  1050. */
  1051. function mergeAssets (parentVal, childVal) {
  1052. var res = Object.create(parentVal || null);
  1053. return childVal
  1054. ? extend(res, childVal)
  1055. : res
  1056. }
  1057. ASSET_TYPES.forEach(function (type) {
  1058. strats[type + 's'] = mergeAssets;
  1059. });
  1060. /**
  1061. * Watchers.
  1062. *
  1063. * Watchers hashes should not overwrite one
  1064. * another, so we merge them as arrays.
  1065. */
  1066. strats.watch = function (parentVal, childVal) {
  1067. /* istanbul ignore if */
  1068. if (!childVal) { return Object.create(parentVal || null) }
  1069. if (!parentVal) { return childVal }
  1070. var ret = {};
  1071. extend(ret, parentVal);
  1072. for (var key in childVal) {
  1073. var parent = ret[key];
  1074. var child = childVal[key];
  1075. if (parent && !Array.isArray(parent)) {
  1076. parent = [parent];
  1077. }
  1078. ret[key] = parent
  1079. ? parent.concat(child)
  1080. : [child];
  1081. }
  1082. return ret
  1083. };
  1084. /**
  1085. * Other object hashes.
  1086. */
  1087. strats.props =
  1088. strats.methods =
  1089. strats.computed = function (parentVal, childVal) {
  1090. if (!childVal) { return Object.create(parentVal || null) }
  1091. if (!parentVal) { return childVal }
  1092. var ret = Object.create(null);
  1093. extend(ret, parentVal);
  1094. extend(ret, childVal);
  1095. return ret
  1096. };
  1097. /**
  1098. * Default strategy.
  1099. */
  1100. var defaultStrat = function (parentVal, childVal) {
  1101. return childVal === undefined
  1102. ? parentVal
  1103. : childVal
  1104. };
  1105. /**
  1106. * Validate component names
  1107. */
  1108. function checkComponents (options) {
  1109. for (var key in options.components) {
  1110. var lower = key.toLowerCase();
  1111. if (isBuiltInTag(lower) || config.isReservedTag(lower)) {
  1112. warn(
  1113. 'Do not use built-in or reserved HTML elements as component ' +
  1114. 'id: ' + key
  1115. );
  1116. }
  1117. }
  1118. }
  1119. /**
  1120. * Ensure all props option syntax are normalized into the
  1121. * Object-based format.
  1122. */
  1123. function normalizeProps (options) {
  1124. var props = options.props;
  1125. if (!props) { return }
  1126. var res = {};
  1127. var i, val, name;
  1128. if (Array.isArray(props)) {
  1129. i = props.length;
  1130. while (i--) {
  1131. val = props[i];
  1132. if (typeof val === 'string') {
  1133. name = camelize(val);
  1134. res[name] = { type: null };
  1135. } else {
  1136. warn('props must be strings when using array syntax.');
  1137. }
  1138. }
  1139. } else if (isPlainObject(props)) {
  1140. for (var key in props) {
  1141. val = props[key];
  1142. name = camelize(key);
  1143. res[name] = isPlainObject(val)
  1144. ? val
  1145. : { type: val };
  1146. }
  1147. }
  1148. options.props = res;
  1149. }
  1150. /**
  1151. * Normalize raw function directives into object format.
  1152. */
  1153. function normalizeDirectives (options) {
  1154. var dirs = options.directives;
  1155. if (dirs) {
  1156. for (var key in dirs) {
  1157. var def = dirs[key];
  1158. if (typeof def === 'function') {
  1159. dirs[key] = { bind: def, update: def };
  1160. }
  1161. }
  1162. }
  1163. }
  1164. /**
  1165. * Merge two option objects into a new one.
  1166. * Core utility used in both instantiation and inheritance.
  1167. */
  1168. function mergeOptions (
  1169. parent,
  1170. child,
  1171. vm
  1172. ) {
  1173. {
  1174. checkComponents(child);
  1175. }
  1176. if (typeof child === 'function') {
  1177. child = child.options;
  1178. }
  1179. normalizeProps(child);
  1180. normalizeDirectives(child);
  1181. var extendsFrom = child.extends;
  1182. if (extendsFrom) {
  1183. parent = mergeOptions(parent, extendsFrom, vm);
  1184. }
  1185. if (child.mixins) {
  1186. for (var i = 0, l = child.mixins.length; i < l; i++) {
  1187. parent = mergeOptions(parent, child.mixins[i], vm);
  1188. }
  1189. }
  1190. var options = {};
  1191. var key;
  1192. for (key in parent) {
  1193. mergeField(key);
  1194. }
  1195. for (key in child) {
  1196. if (!hasOwn(parent, key)) {
  1197. mergeField(key);
  1198. }
  1199. }
  1200. function mergeField (key) {
  1201. var strat = strats[key] || defaultStrat;
  1202. options[key] = strat(parent[key], child[key], vm, key);
  1203. }
  1204. return options
  1205. }
  1206. /**
  1207. * Resolve an asset.
  1208. * This function is used because child instances need access
  1209. * to assets defined in its ancestor chain.
  1210. */
  1211. function resolveAsset (
  1212. options,
  1213. type,
  1214. id,
  1215. warnMissing
  1216. ) {
  1217. /* istanbul ignore if */
  1218. if (typeof id !== 'string') {
  1219. return
  1220. }
  1221. var assets = options[type];
  1222. // check local registration variations first
  1223. if (hasOwn(assets, id)) { return assets[id] }
  1224. var camelizedId = camelize(id);
  1225. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  1226. var PascalCaseId = capitalize(camelizedId);
  1227. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  1228. // fallback to prototype chain
  1229. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  1230. if ("development" !== 'production' && warnMissing && !res) {
  1231. warn(
  1232. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  1233. options
  1234. );
  1235. }
  1236. return res
  1237. }
  1238. /* */
  1239. function validateProp (
  1240. key,
  1241. propOptions,
  1242. propsData,
  1243. vm
  1244. ) {
  1245. var prop = propOptions[key];
  1246. var absent = !hasOwn(propsData, key);
  1247. var value = propsData[key];
  1248. // handle boolean props
  1249. if (isType(Boolean, prop.type)) {
  1250. if (absent && !hasOwn(prop, 'default')) {
  1251. value = false;
  1252. } else if (!isType(String, prop.type) && (value === '' || value === hyphenate(key))) {
  1253. value = true;
  1254. }
  1255. }
  1256. // check default value
  1257. if (value === undefined) {
  1258. value = getPropDefaultValue(vm, prop, key);
  1259. // since the default value is a fresh copy,
  1260. // make sure to observe it.
  1261. var prevShouldConvert = observerState.shouldConvert;
  1262. observerState.shouldConvert = true;
  1263. observe(value);
  1264. observerState.shouldConvert = prevShouldConvert;
  1265. }
  1266. {
  1267. assertProp(prop, key, value, vm, absent);
  1268. }
  1269. return value
  1270. }
  1271. /**
  1272. * Get the default value of a prop.
  1273. */
  1274. function getPropDefaultValue (vm, prop, key) {
  1275. // no default, return undefined
  1276. if (!hasOwn(prop, 'default')) {
  1277. return undefined
  1278. }
  1279. var def = prop.default;
  1280. // warn against non-factory defaults for Object & Array
  1281. if ("development" !== 'production' && isObject(def)) {
  1282. warn(
  1283. 'Invalid default value for prop "' + key + '": ' +
  1284. 'Props with type Object/Array must use a factory function ' +
  1285. 'to return the default value.',
  1286. vm
  1287. );
  1288. }
  1289. // the raw prop value was also undefined from previous render,
  1290. // return previous default value to avoid unnecessary watcher trigger
  1291. if (vm && vm.$options.propsData &&
  1292. vm.$options.propsData[key] === undefined &&
  1293. vm._props[key] !== undefined
  1294. ) {
  1295. return vm._props[key]
  1296. }
  1297. // call factory function for non-Function types
  1298. // a value is Function if its prototype is function even across different execution context
  1299. return typeof def === 'function' && getType(prop.type) !== 'Function'
  1300. ? def.call(vm)
  1301. : def
  1302. }
  1303. /**
  1304. * Assert whether a prop is valid.
  1305. */
  1306. function assertProp (
  1307. prop,
  1308. name,
  1309. value,
  1310. vm,
  1311. absent
  1312. ) {
  1313. if (prop.required && absent) {
  1314. warn(
  1315. 'Missing required prop: "' + name + '"',
  1316. vm
  1317. );
  1318. return
  1319. }
  1320. if (value == null && !prop.required) {
  1321. return
  1322. }
  1323. var type = prop.type;
  1324. var valid = !type || type === true;
  1325. var expectedTypes = [];
  1326. if (type) {
  1327. if (!Array.isArray(type)) {
  1328. type = [type];
  1329. }
  1330. for (var i = 0; i < type.length && !valid; i++) {
  1331. var assertedType = assertType(value, type[i]);
  1332. expectedTypes.push(assertedType.expectedType || '');
  1333. valid = assertedType.valid;
  1334. }
  1335. }
  1336. if (!valid) {
  1337. warn(
  1338. 'Invalid prop: type check failed for prop "' + name + '".' +
  1339. ' Expected ' + expectedTypes.map(capitalize).join(', ') +
  1340. ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',
  1341. vm
  1342. );
  1343. return
  1344. }
  1345. var validator = prop.validator;
  1346. if (validator) {
  1347. if (!validator(value)) {
  1348. warn(
  1349. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  1350. vm
  1351. );
  1352. }
  1353. }
  1354. }
  1355. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  1356. function assertType (value, type) {
  1357. var valid;
  1358. var expectedType = getType(type);
  1359. if (simpleCheckRE.test(expectedType)) {
  1360. valid = typeof value === expectedType.toLowerCase();
  1361. } else if (expectedType === 'Object') {
  1362. valid = isPlainObject(value);
  1363. } else if (expectedType === 'Array') {
  1364. valid = Array.isArray(value);
  1365. } else {
  1366. valid = value instanceof type;
  1367. }
  1368. return {
  1369. valid: valid,
  1370. expectedType: expectedType
  1371. }
  1372. }
  1373. /**
  1374. * Use function string name to check built-in types,
  1375. * because a simple equality check will fail when running
  1376. * across different vms / iframes.
  1377. */
  1378. function getType (fn) {
  1379. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  1380. return match ? match[1] : ''
  1381. }
  1382. function isType (type, fn) {
  1383. if (!Array.isArray(fn)) {
  1384. return getType(fn) === getType(type)
  1385. }
  1386. for (var i = 0, len = fn.length; i < len; i++) {
  1387. if (getType(fn[i]) === getType(type)) {
  1388. return true
  1389. }
  1390. }
  1391. /* istanbul ignore next */
  1392. return false
  1393. }
  1394. /* */
  1395. var mark;
  1396. var measure;
  1397. {
  1398. var perf = inBrowser && window.performance;
  1399. /* istanbul ignore if */
  1400. if (
  1401. perf &&
  1402. perf.mark &&
  1403. perf.measure &&
  1404. perf.clearMarks &&
  1405. perf.clearMeasures
  1406. ) {
  1407. mark = function (tag) { return perf.mark(tag); };
  1408. measure = function (name, startTag, endTag) {
  1409. perf.measure(name, startTag, endTag);
  1410. perf.clearMarks(startTag);
  1411. perf.clearMarks(endTag);
  1412. perf.clearMeasures(name);
  1413. };
  1414. }
  1415. }
  1416. /* not type checking this file because flow doesn't play well with Proxy */
  1417. var initProxy;
  1418. {
  1419. var allowedGlobals = makeMap(
  1420. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  1421. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  1422. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  1423. 'require' // for Webpack/Browserify
  1424. );
  1425. var warnNonPresent = function (target, key) {
  1426. warn(
  1427. "Property or method \"" + key + "\" is not defined on the instance but " +
  1428. "referenced during render. Make sure to declare reactive data " +
  1429. "properties in the data option.",
  1430. target
  1431. );
  1432. };
  1433. var hasProxy =
  1434. typeof Proxy !== 'undefined' &&
  1435. Proxy.toString().match(/native code/);
  1436. if (hasProxy) {
  1437. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta');
  1438. config.keyCodes = new Proxy(config.keyCodes, {
  1439. set: function set (target, key, value) {
  1440. if (isBuiltInModifier(key)) {
  1441. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  1442. return false
  1443. } else {
  1444. target[key] = value;
  1445. return true
  1446. }
  1447. }
  1448. });
  1449. }
  1450. var hasHandler = {
  1451. has: function has (target, key) {
  1452. var has = key in target;
  1453. var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';
  1454. if (!has && !isAllowed) {
  1455. warnNonPresent(target, key);
  1456. }
  1457. return has || !isAllowed
  1458. }
  1459. };
  1460. var getHandler = {
  1461. get: function get (target, key) {
  1462. if (typeof key === 'string' && !(key in target)) {
  1463. warnNonPresent(target, key);
  1464. }
  1465. return target[key]
  1466. }
  1467. };
  1468. initProxy = function initProxy (vm) {
  1469. if (hasProxy) {
  1470. // determine which proxy handler to use
  1471. var options = vm.$options;
  1472. var handlers = options.render && options.render._withStripped
  1473. ? getHandler
  1474. : hasHandler;
  1475. vm._renderProxy = new Proxy(vm, handlers);
  1476. } else {
  1477. vm._renderProxy = vm;
  1478. }
  1479. };
  1480. }
  1481. /* */
  1482. var VNode = function VNode (
  1483. tag,
  1484. data,
  1485. children,
  1486. text,
  1487. elm,
  1488. context,
  1489. componentOptions
  1490. ) {
  1491. this.tag = tag;
  1492. this.data = data;
  1493. this.children = children;
  1494. this.text = text;
  1495. this.elm = elm;
  1496. this.ns = undefined;
  1497. this.context = context;
  1498. this.functionalContext = undefined;
  1499. this.key = data && data.key;
  1500. this.componentOptions = componentOptions;
  1501. this.componentInstance = undefined;
  1502. this.parent = undefined;
  1503. this.raw = false;
  1504. this.isStatic = false;
  1505. this.isRootInsert = true;
  1506. this.isComment = false;
  1507. this.isCloned = false;
  1508. this.isOnce = false;
  1509. };
  1510. var prototypeAccessors = { child: {} };
  1511. // DEPRECATED: alias for componentInstance for backwards compat.
  1512. /* istanbul ignore next */
  1513. prototypeAccessors.child.get = function () {
  1514. return this.componentInstance
  1515. };
  1516. Object.defineProperties( VNode.prototype, prototypeAccessors );
  1517. var createEmptyVNode = function () {
  1518. var node = new VNode();
  1519. node.text = '';
  1520. node.isComment = true;
  1521. return node
  1522. };
  1523. function createTextVNode (val) {
  1524. return new VNode(undefined, undefined, undefined, String(val))
  1525. }
  1526. // optimized shallow clone
  1527. // used for static nodes and slot nodes because they may be reused across
  1528. // multiple renders, cloning them avoids errors when DOM manipulations rely
  1529. // on their elm reference.
  1530. function cloneVNode (vnode) {
  1531. var cloned = new VNode(
  1532. vnode.tag,
  1533. vnode.data,
  1534. vnode.children,
  1535. vnode.text,
  1536. vnode.elm,
  1537. vnode.context,
  1538. vnode.componentOptions
  1539. );
  1540. cloned.ns = vnode.ns;
  1541. cloned.isStatic = vnode.isStatic;
  1542. cloned.key = vnode.key;
  1543. cloned.isComment = vnode.isComment;
  1544. cloned.isCloned = true;
  1545. return cloned
  1546. }
  1547. function cloneVNodes (vnodes) {
  1548. var len = vnodes.length;
  1549. var res = new Array(len);
  1550. for (var i = 0; i < len; i++) {
  1551. res[i] = cloneVNode(vnodes[i]);
  1552. }
  1553. return res
  1554. }
  1555. /* */
  1556. var normalizeEvent = cached(function (name) {
  1557. var passive = name.charAt(0) === '&';
  1558. name = passive ? name.slice(1) : name;
  1559. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  1560. name = once$$1 ? name.slice(1) : name;
  1561. var capture = name.charAt(0) === '!';
  1562. name = capture ? name.slice(1) : name;
  1563. return {
  1564. name: name,
  1565. once: once$$1,
  1566. capture: capture,
  1567. passive: passive
  1568. }
  1569. });
  1570. function createFnInvoker (fns) {
  1571. function invoker () {
  1572. var arguments$1 = arguments;
  1573. var fns = invoker.fns;
  1574. if (Array.isArray(fns)) {
  1575. for (var i = 0; i < fns.length; i++) {
  1576. fns[i].apply(null, arguments$1);
  1577. }
  1578. } else {
  1579. // return handler return value for single handlers
  1580. return fns.apply(null, arguments)
  1581. }
  1582. }
  1583. invoker.fns = fns;
  1584. return invoker
  1585. }
  1586. function updateListeners (
  1587. on,
  1588. oldOn,
  1589. add,
  1590. remove$$1,
  1591. vm
  1592. ) {
  1593. var name, cur, old, event;
  1594. for (name in on) {
  1595. cur = on[name];
  1596. old = oldOn[name];
  1597. event = normalizeEvent(name);
  1598. if (isUndef(cur)) {
  1599. "development" !== 'production' && warn(
  1600. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  1601. vm
  1602. );
  1603. } else if (isUndef(old)) {
  1604. if (isUndef(cur.fns)) {
  1605. cur = on[name] = createFnInvoker(cur);
  1606. }
  1607. add(event.name, cur, event.once, event.capture, event.passive);
  1608. } else if (cur !== old) {
  1609. old.fns = cur;
  1610. on[name] = old;
  1611. }
  1612. }
  1613. for (name in oldOn) {
  1614. if (isUndef(on[name])) {
  1615. event = normalizeEvent(name);
  1616. remove$$1(event.name, oldOn[name], event.capture);
  1617. }
  1618. }
  1619. }
  1620. /* */
  1621. function mergeVNodeHook (def, hookKey, hook) {
  1622. var invoker;
  1623. var oldHook = def[hookKey];
  1624. function wrappedHook () {
  1625. hook.apply(this, arguments);
  1626. // important: remove merged hook to ensure it's called only once
  1627. // and prevent memory leak
  1628. remove(invoker.fns, wrappedHook);
  1629. }
  1630. if (isUndef(oldHook)) {
  1631. // no existing hook
  1632. invoker = createFnInvoker([wrappedHook]);
  1633. } else {
  1634. /* istanbul ignore if */
  1635. if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
  1636. // already a merged invoker
  1637. invoker = oldHook;
  1638. invoker.fns.push(wrappedHook);
  1639. } else {
  1640. // existing plain hook
  1641. invoker = createFnInvoker([oldHook, wrappedHook]);
  1642. }
  1643. }
  1644. invoker.merged = true;
  1645. def[hookKey] = invoker;
  1646. }
  1647. /* */
  1648. function extractPropsFromVNodeData (
  1649. data,
  1650. Ctor,
  1651. tag
  1652. ) {
  1653. // we are only extracting raw values here.
  1654. // validation and default values are handled in the child
  1655. // component itself.
  1656. var propOptions = Ctor.options.props;
  1657. if (isUndef(propOptions)) {
  1658. return
  1659. }
  1660. var res = {};
  1661. var attrs = data.attrs;
  1662. var props = data.props;
  1663. if (isDef(attrs) || isDef(props)) {
  1664. for (var key in propOptions) {
  1665. var altKey = hyphenate(key);
  1666. {
  1667. var keyInLowerCase = key.toLowerCase();
  1668. if (
  1669. key !== keyInLowerCase &&
  1670. attrs && hasOwn(attrs, keyInLowerCase)
  1671. ) {
  1672. tip(
  1673. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  1674. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  1675. " \"" + key + "\". " +
  1676. "Note that HTML attributes are case-insensitive and camelCased " +
  1677. "props need to use their kebab-case equivalents when using in-DOM " +
  1678. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  1679. );
  1680. }
  1681. }
  1682. checkProp(res, props, key, altKey, true) ||
  1683. checkProp(res, attrs, key, altKey, false);
  1684. }
  1685. }
  1686. return res
  1687. }
  1688. function checkProp (
  1689. res,
  1690. hash,
  1691. key,
  1692. altKey,
  1693. preserve
  1694. ) {
  1695. if (isDef(hash)) {
  1696. if (hasOwn(hash, key)) {
  1697. res[key] = hash[key];
  1698. if (!preserve) {
  1699. delete hash[key];
  1700. }
  1701. return true
  1702. } else if (hasOwn(hash, altKey)) {
  1703. res[key] = hash[altKey];
  1704. if (!preserve) {
  1705. delete hash[altKey];
  1706. }
  1707. return true
  1708. }
  1709. }
  1710. return false
  1711. }
  1712. /* */
  1713. // The template compiler attempts to minimize the need for normalization by
  1714. // statically analyzing the template at compile time.
  1715. //
  1716. // For plain HTML markup, normalization can be completely skipped because the
  1717. // generated render function is guaranteed to return Array<VNode>. There are
  1718. // two cases where extra normalization is needed:
  1719. // 1. When the children contains components - because a functional component
  1720. // may return an Array instead of a single root. In this case, just a simple
  1721. // normalization is needed - if any child is an Array, we flatten the whole
  1722. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  1723. // because functional components already normalize their own children.
  1724. function simpleNormalizeChildren (children) {
  1725. for (var i = 0; i < children.length; i++) {
  1726. if (Array.isArray(children[i])) {
  1727. return Array.prototype.concat.apply([], children)
  1728. }
  1729. }
  1730. return children
  1731. }
  1732. // 2. When the children contains constructs that always generated nested Arrays,
  1733. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  1734. // with hand-written render functions / JSX. In such cases a full normalization
  1735. // is needed to cater to all possible types of children values.
  1736. function normalizeChildren (children) {
  1737. return isPrimitive(children)
  1738. ? [createTextVNode(children)]
  1739. : Array.isArray(children)
  1740. ? normalizeArrayChildren(children)
  1741. : undefined
  1742. }
  1743. function isTextNode (node) {
  1744. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  1745. }
  1746. function normalizeArrayChildren (children, nestedIndex) {
  1747. var res = [];
  1748. var i, c, last;
  1749. for (i = 0; i < children.length; i++) {
  1750. c = children[i];
  1751. if (isUndef(c) || typeof c === 'boolean') { continue }
  1752. last = res[res.length - 1];
  1753. // nested
  1754. if (Array.isArray(c)) {
  1755. res.push.apply(res, normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i)));
  1756. } else if (isPrimitive(c)) {
  1757. if (isTextNode(last)) {
  1758. // merge adjacent text nodes
  1759. // this is necessary for SSR hydration because text nodes are
  1760. // essentially merged when rendered to HTML strings
  1761. (last).text += String(c);
  1762. } else if (c !== '') {
  1763. // convert primitive to vnode
  1764. res.push(createTextVNode(c));
  1765. }
  1766. } else {
  1767. if (isTextNode(c) && isTextNode(last)) {
  1768. // merge adjacent text nodes
  1769. res[res.length - 1] = createTextVNode(last.text + c.text);
  1770. } else {
  1771. // default key for nested array children (likely generated by v-for)
  1772. if (isTrue(children._isVList) &&
  1773. isDef(c.tag) &&
  1774. isUndef(c.key) &&
  1775. isDef(nestedIndex)) {
  1776. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  1777. }
  1778. res.push(c);
  1779. }
  1780. }
  1781. }
  1782. return res
  1783. }
  1784. /* */
  1785. function ensureCtor (comp, base) {
  1786. return isObject(comp)
  1787. ? base.extend(comp)
  1788. : comp
  1789. }
  1790. function resolveAsyncComponent (
  1791. factory,
  1792. baseCtor,
  1793. context
  1794. ) {
  1795. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  1796. return factory.errorComp
  1797. }
  1798. if (isDef(factory.resolved)) {
  1799. return factory.resolved
  1800. }
  1801. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  1802. return factory.loadingComp
  1803. }
  1804. if (isDef(factory.contexts)) {
  1805. // already pending
  1806. factory.contexts.push(context);
  1807. } else {
  1808. var contexts = factory.contexts = [context];
  1809. var sync = true;
  1810. var forceRender = function () {
  1811. for (var i = 0, l = contexts.length; i < l; i++) {
  1812. contexts[i].$forceUpdate();
  1813. }
  1814. };
  1815. var resolve = once(function (res) {
  1816. // cache resolved
  1817. factory.resolved = ensureCtor(res, baseCtor);
  1818. // invoke callbacks only if this is not a synchronous resolve
  1819. // (async resolves are shimmed as synchronous during SSR)
  1820. if (!sync) {
  1821. forceRender();
  1822. }
  1823. });
  1824. var reject = once(function (reason) {
  1825. "development" !== 'production' && warn(
  1826. "Failed to resolve async component: " + (String(factory)) +
  1827. (reason ? ("\nReason: " + reason) : '')
  1828. );
  1829. if (isDef(factory.errorComp)) {
  1830. factory.error = true;
  1831. forceRender();
  1832. }
  1833. });
  1834. var res = factory(resolve, reject);
  1835. if (isObject(res)) {
  1836. if (typeof res.then === 'function') {
  1837. // () => Promise
  1838. if (isUndef(factory.resolved)) {
  1839. res.then(resolve, reject);
  1840. }
  1841. } else if (isDef(res.component) && typeof res.component.then === 'function') {
  1842. res.component.then(resolve, reject);
  1843. if (isDef(res.error)) {
  1844. factory.errorComp = ensureCtor(res.error, baseCtor);
  1845. }
  1846. if (isDef(res.loading)) {
  1847. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  1848. if (res.delay === 0) {
  1849. factory.loading = true;
  1850. } else {
  1851. setTimeout(function () {
  1852. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  1853. factory.loading = true;
  1854. forceRender();
  1855. }
  1856. }, res.delay || 200);
  1857. }
  1858. }
  1859. if (isDef(res.timeout)) {
  1860. setTimeout(function () {
  1861. if (isUndef(factory.resolved)) {
  1862. reject(
  1863. "timeout (" + (res.timeout) + "ms)"
  1864. );
  1865. }
  1866. }, res.timeout);
  1867. }
  1868. }
  1869. }
  1870. sync = false;
  1871. // return in case resolved synchronously
  1872. return factory.loading
  1873. ? factory.loadingComp
  1874. : factory.resolved
  1875. }
  1876. }
  1877. /* */
  1878. function getFirstComponentChild (children) {
  1879. if (Array.isArray(children)) {
  1880. for (var i = 0; i < children.length; i++) {
  1881. var c = children[i];
  1882. if (isDef(c) && isDef(c.componentOptions)) {
  1883. return c
  1884. }
  1885. }
  1886. }
  1887. }
  1888. /* */
  1889. /* */
  1890. function initEvents (vm) {
  1891. vm._events = Object.create(null);
  1892. vm._hasHookEvent = false;
  1893. // init parent attached events
  1894. var listeners = vm.$options._parentListeners;
  1895. if (listeners) {
  1896. updateComponentListeners(vm, listeners);
  1897. }
  1898. }
  1899. var target;
  1900. function add (event, fn, once$$1) {
  1901. if (once$$1) {
  1902. target.$once(event, fn);
  1903. } else {
  1904. target.$on(event, fn);
  1905. }
  1906. }
  1907. function remove$1 (event, fn) {
  1908. target.$off(event, fn);
  1909. }
  1910. function updateComponentListeners (
  1911. vm,
  1912. listeners,
  1913. oldListeners
  1914. ) {
  1915. target = vm;
  1916. updateListeners(listeners, oldListeners || {}, add, remove$1, vm);
  1917. }
  1918. function eventsMixin (Vue) {
  1919. var hookRE = /^hook:/;
  1920. Vue.prototype.$on = function (event, fn) {
  1921. var this$1 = this;
  1922. var vm = this;
  1923. if (Array.isArray(event)) {
  1924. for (var i = 0, l = event.length; i < l; i++) {
  1925. this$1.$on(event[i], fn);
  1926. }
  1927. } else {
  1928. (vm._events[event] || (vm._events[event] = [])).push(fn);
  1929. // optimize hook:event cost by using a boolean flag marked at registration
  1930. // instead of a hash lookup
  1931. if (hookRE.test(event)) {
  1932. vm._hasHookEvent = true;
  1933. }
  1934. }
  1935. return vm
  1936. };
  1937. Vue.prototype.$once = function (event, fn) {
  1938. var vm = this;
  1939. function on () {
  1940. vm.$off(event, on);
  1941. fn.apply(vm, arguments);
  1942. }
  1943. on.fn = fn;
  1944. vm.$on(event, on);
  1945. return vm
  1946. };
  1947. Vue.prototype.$off = function (event, fn) {
  1948. var this$1 = this;
  1949. var vm = this;
  1950. // all
  1951. if (!arguments.length) {
  1952. vm._events = Object.create(null);
  1953. return vm
  1954. }
  1955. // array of events
  1956. if (Array.isArray(event)) {
  1957. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  1958. this$1.$off(event[i$1], fn);
  1959. }
  1960. return vm
  1961. }
  1962. // specific event
  1963. var cbs = vm._events[event];
  1964. if (!cbs) {
  1965. return vm
  1966. }
  1967. if (arguments.length === 1) {
  1968. vm._events[event] = null;
  1969. return vm
  1970. }
  1971. // specific handler
  1972. var cb;
  1973. var i = cbs.length;
  1974. while (i--) {
  1975. cb = cbs[i];
  1976. if (cb === fn || cb.fn === fn) {
  1977. cbs.splice(i, 1);
  1978. break
  1979. }
  1980. }
  1981. return vm
  1982. };
  1983. Vue.prototype.$emit = function (event) {
  1984. var vm = this;
  1985. {
  1986. var lowerCaseEvent = event.toLowerCase();
  1987. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  1988. tip(
  1989. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  1990. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  1991. "Note that HTML attributes are case-insensitive and you cannot use " +
  1992. "v-on to listen to camelCase events when using in-DOM templates. " +
  1993. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  1994. );
  1995. }
  1996. }
  1997. var cbs = vm._events[event];
  1998. if (cbs) {
  1999. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  2000. var args = toArray(arguments, 1);
  2001. for (var i = 0, l = cbs.length; i < l; i++) {
  2002. cbs[i].apply(vm, args);
  2003. }
  2004. }
  2005. return vm
  2006. };
  2007. }
  2008. /* */
  2009. /**
  2010. * Runtime helper for resolving raw children VNodes into a slot object.
  2011. */
  2012. function resolveSlots (
  2013. children,
  2014. context
  2015. ) {
  2016. var slots = {};
  2017. if (!children) {
  2018. return slots
  2019. }
  2020. var defaultSlot = [];
  2021. for (var i = 0, l = children.length; i < l; i++) {
  2022. var child = children[i];
  2023. // named slots should only be respected if the vnode was rendered in the
  2024. // same context.
  2025. if ((child.context === context || child.functionalContext === context) &&
  2026. child.data && child.data.slot != null
  2027. ) {
  2028. var name = child.data.slot;
  2029. var slot = (slots[name] || (slots[name] = []));
  2030. if (child.tag === 'template') {
  2031. slot.push.apply(slot, child.children);
  2032. } else {
  2033. slot.push(child);
  2034. }
  2035. } else {
  2036. defaultSlot.push(child);
  2037. }
  2038. }
  2039. // ignore whitespace
  2040. if (!defaultSlot.every(isWhitespace)) {
  2041. slots.default = defaultSlot;
  2042. }
  2043. return slots
  2044. }
  2045. function isWhitespace (node) {
  2046. return node.isComment || node.text === ' '
  2047. }
  2048. function resolveScopedSlots (
  2049. fns, // see flow/vnode
  2050. res
  2051. ) {
  2052. res = res || {};
  2053. for (var i = 0; i < fns.length; i++) {
  2054. if (Array.isArray(fns[i])) {
  2055. resolveScopedSlots(fns[i], res);
  2056. } else {
  2057. res[fns[i].key] = fns[i].fn;
  2058. }
  2059. }
  2060. return res
  2061. }
  2062. /* */
  2063. var activeInstance = null;
  2064. function initLifecycle (vm) {
  2065. var options = vm.$options;
  2066. // locate first non-abstract parent
  2067. var parent = options.parent;
  2068. if (parent && !options.abstract) {
  2069. while (parent.$options.abstract && parent.$parent) {
  2070. parent = parent.$parent;
  2071. }
  2072. parent.$children.push(vm);
  2073. }
  2074. vm.$parent = parent;
  2075. vm.$root = parent ? parent.$root : vm;
  2076. vm.$children = [];
  2077. vm.$refs = {};
  2078. vm._watcher = null;
  2079. vm._inactive = null;
  2080. vm._directInactive = false;
  2081. vm._isMounted = false;
  2082. vm._isDestroyed = false;
  2083. vm._isBeingDestroyed = false;
  2084. }
  2085. function lifecycleMixin (Vue) {
  2086. Vue.prototype._update = function (vnode, hydrating) {
  2087. var vm = this;
  2088. if (vm._isMounted) {
  2089. callHook(vm, 'beforeUpdate');
  2090. }
  2091. var prevEl = vm.$el;
  2092. var prevVnode = vm._vnode;
  2093. var prevActiveInstance = activeInstance;
  2094. activeInstance = vm;
  2095. vm._vnode = vnode;
  2096. // Vue.prototype.__patch__ is injected in entry points
  2097. // based on the rendering backend used.
  2098. if (!prevVnode) {
  2099. // initial render
  2100. vm.$el = vm.__patch__(
  2101. vm.$el, vnode, hydrating, false /* removeOnly */,
  2102. vm.$options._parentElm,
  2103. vm.$options._refElm
  2104. );
  2105. } else {
  2106. // updates
  2107. vm.$el = vm.__patch__(prevVnode, vnode);
  2108. }
  2109. activeInstance = prevActiveInstance;
  2110. // update __vue__ reference
  2111. if (prevEl) {
  2112. prevEl.__vue__ = null;
  2113. }
  2114. if (vm.$el) {
  2115. vm.$el.__vue__ = vm;
  2116. }
  2117. // if parent is an HOC, update its $el as well
  2118. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  2119. vm.$parent.$el = vm.$el;
  2120. }
  2121. // updated hook is called by the scheduler to ensure that children are
  2122. // updated in a parent's updated hook.
  2123. };
  2124. Vue.prototype.$forceUpdate = function () {
  2125. var vm = this;
  2126. if (vm._watcher) {
  2127. vm._watcher.update();
  2128. }
  2129. };
  2130. Vue.prototype.$destroy = function () {
  2131. var vm = this;
  2132. if (vm._isBeingDestroyed) {
  2133. return
  2134. }
  2135. callHook(vm, 'beforeDestroy');
  2136. vm._isBeingDestroyed = true;
  2137. // remove self from parent
  2138. var parent = vm.$parent;
  2139. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  2140. remove(parent.$children, vm);
  2141. }
  2142. // teardown watchers
  2143. if (vm._watcher) {
  2144. vm._watcher.teardown();
  2145. }
  2146. var i = vm._watchers.length;
  2147. while (i--) {
  2148. vm._watchers[i].teardown();
  2149. }
  2150. // remove reference from data ob
  2151. // frozen object may not have observer.
  2152. if (vm._data.__ob__) {
  2153. vm._data.__ob__.vmCount--;
  2154. }
  2155. // call the last hook...
  2156. vm._isDestroyed = true;
  2157. // invoke destroy hooks on current rendered tree
  2158. vm.__patch__(vm._vnode, null);
  2159. // fire destroyed hook
  2160. callHook(vm, 'destroyed');
  2161. // turn off all instance listeners.
  2162. vm.$off();
  2163. // remove __vue__ reference
  2164. if (vm.$el) {
  2165. vm.$el.__vue__ = null;
  2166. }
  2167. // remove reference to DOM nodes (prevents leak)
  2168. vm.$options._parentElm = vm.$options._refElm = null;
  2169. };
  2170. }
  2171. function mountComponent (
  2172. vm,
  2173. el,
  2174. hydrating
  2175. ) {
  2176. vm.$el = el;
  2177. if (!vm.$options.render) {
  2178. vm.$options.render = createEmptyVNode;
  2179. {
  2180. /* istanbul ignore if */
  2181. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  2182. vm.$options.el || el) {
  2183. warn(
  2184. 'You are using the runtime-only build of Vue where the template ' +
  2185. 'compiler is not available. Either pre-compile the templates into ' +
  2186. 'render functions, or use the compiler-included build.',
  2187. vm
  2188. );
  2189. } else {
  2190. warn(
  2191. 'Failed to mount component: template or render function not defined.',
  2192. vm
  2193. );
  2194. }
  2195. }
  2196. }
  2197. callHook(vm, 'beforeMount');
  2198. var updateComponent;
  2199. /* istanbul ignore if */
  2200. if ("development" !== 'production' && config.performance && mark) {
  2201. updateComponent = function () {
  2202. var name = vm._name;
  2203. var id = vm._uid;
  2204. var startTag = "vue-perf-start:" + id;
  2205. var endTag = "vue-perf-end:" + id;
  2206. mark(startTag);
  2207. var vnode = vm._render();
  2208. mark(endTag);
  2209. measure((name + " render"), startTag, endTag);
  2210. mark(startTag);
  2211. vm._update(vnode, hydrating);
  2212. mark(endTag);
  2213. measure((name + " patch"), startTag, endTag);
  2214. };
  2215. } else {
  2216. updateComponent = function () {
  2217. vm._update(vm._render(), hydrating);
  2218. };
  2219. }
  2220. vm._watcher = new Watcher(vm, updateComponent, noop);
  2221. hydrating = false;
  2222. // manually mounted instance, call mounted on self
  2223. // mounted is called for render-created child components in its inserted hook
  2224. if (vm.$vnode == null) {
  2225. vm._isMounted = true;
  2226. callHook(vm, 'mounted');
  2227. }
  2228. return vm
  2229. }
  2230. function updateChildComponent (
  2231. vm,
  2232. propsData,
  2233. listeners,
  2234. parentVnode,
  2235. renderChildren
  2236. ) {
  2237. // determine whether component has slot children
  2238. // we need to do this before overwriting $options._renderChildren
  2239. var hasChildren = !!(
  2240. renderChildren || // has new static slots
  2241. vm.$options._renderChildren || // has old static slots
  2242. parentVnode.data.scopedSlots || // has new scoped slots
  2243. vm.$scopedSlots !== emptyObject // has old scoped slots
  2244. );
  2245. vm.$options._parentVnode = parentVnode;
  2246. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  2247. if (vm._vnode) { // update child tree's parent
  2248. vm._vnode.parent = parentVnode;
  2249. }
  2250. vm.$options._renderChildren = renderChildren;
  2251. // update props
  2252. if (propsData && vm.$options.props) {
  2253. observerState.shouldConvert = false;
  2254. {
  2255. observerState.isSettingProps = true;
  2256. }
  2257. var props = vm._props;
  2258. var propKeys = vm.$options._propKeys || [];
  2259. for (var i = 0; i < propKeys.length; i++) {
  2260. var key = propKeys[i];
  2261. props[key] = validateProp(key, vm.$options.props, propsData, vm);
  2262. }
  2263. observerState.shouldConvert = true;
  2264. {
  2265. observerState.isSettingProps = false;
  2266. }
  2267. // keep a copy of raw propsData
  2268. vm.$options.propsData = propsData;
  2269. }
  2270. // update listeners
  2271. if (listeners) {
  2272. var oldListeners = vm.$options._parentListeners;
  2273. vm.$options._parentListeners = listeners;
  2274. updateComponentListeners(vm, listeners, oldListeners);
  2275. }
  2276. // resolve slots + force update if has children
  2277. if (hasChildren) {
  2278. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  2279. vm.$forceUpdate();
  2280. }
  2281. }
  2282. function isInInactiveTree (vm) {
  2283. while (vm && (vm = vm.$parent)) {
  2284. if (vm._inactive) { return true }
  2285. }
  2286. return false
  2287. }
  2288. function activateChildComponent (vm, direct) {
  2289. if (direct) {
  2290. vm._directInactive = false;
  2291. if (isInInactiveTree(vm)) {
  2292. return
  2293. }
  2294. } else if (vm._directInactive) {
  2295. return
  2296. }
  2297. if (vm._inactive || vm._inactive === null) {
  2298. vm._inactive = false;
  2299. for (var i = 0; i < vm.$children.length; i++) {
  2300. activateChildComponent(vm.$children[i]);
  2301. }
  2302. callHook(vm, 'activated');
  2303. }
  2304. }
  2305. function deactivateChildComponent (vm, direct) {
  2306. if (direct) {
  2307. vm._directInactive = true;
  2308. if (isInInactiveTree(vm)) {
  2309. return
  2310. }
  2311. }
  2312. if (!vm._inactive) {
  2313. vm._inactive = true;
  2314. for (var i = 0; i < vm.$children.length; i++) {
  2315. deactivateChildComponent(vm.$children[i]);
  2316. }
  2317. callHook(vm, 'deactivated');
  2318. }
  2319. }
  2320. function callHook (vm, hook) {
  2321. var handlers = vm.$options[hook];
  2322. if (handlers) {
  2323. for (var i = 0, j = handlers.length; i < j; i++) {
  2324. try {
  2325. handlers[i].call(vm);
  2326. } catch (e) {
  2327. handleError(e, vm, (hook + " hook"));
  2328. }
  2329. }
  2330. }
  2331. if (vm._hasHookEvent) {
  2332. vm.$emit('hook:' + hook);
  2333. }
  2334. }
  2335. /* */
  2336. var MAX_UPDATE_COUNT = 100;
  2337. var queue = [];
  2338. var activatedChildren = [];
  2339. var has = {};
  2340. var circular = {};
  2341. var waiting = false;
  2342. var flushing = false;
  2343. var index = 0;
  2344. /**
  2345. * Reset the scheduler's state.
  2346. */
  2347. function resetSchedulerState () {
  2348. index = queue.length = activatedChildren.length = 0;
  2349. has = {};
  2350. {
  2351. circular = {};
  2352. }
  2353. waiting = flushing = false;
  2354. }
  2355. /**
  2356. * Flush both queues and run the watchers.
  2357. */
  2358. function flushSchedulerQueue () {
  2359. flushing = true;
  2360. var watcher, id;
  2361. // Sort queue before flush.
  2362. // This ensures that:
  2363. // 1. Components are updated from parent to child. (because parent is always
  2364. // created before the child)
  2365. // 2. A component's user watchers are run before its render watcher (because
  2366. // user watchers are created before the render watcher)
  2367. // 3. If a component is destroyed during a parent component's watcher run,
  2368. // its watchers can be skipped.
  2369. queue.sort(function (a, b) { return a.id - b.id; });
  2370. // do not cache length because more watchers might be pushed
  2371. // as we run existing watchers
  2372. for (index = 0; index < queue.length; index++) {
  2373. watcher = queue[index];
  2374. id = watcher.id;
  2375. has[id] = null;
  2376. watcher.run();
  2377. // in dev build, check and stop circular updates.
  2378. if ("development" !== 'production' && has[id] != null) {
  2379. circular[id] = (circular[id] || 0) + 1;
  2380. if (circular[id] > MAX_UPDATE_COUNT) {
  2381. warn(
  2382. 'You may have an infinite update loop ' + (
  2383. watcher.user
  2384. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  2385. : "in a component render function."
  2386. ),
  2387. watcher.vm
  2388. );
  2389. break
  2390. }
  2391. }
  2392. }
  2393. // keep copies of post queues before resetting state
  2394. var activatedQueue = activatedChildren.slice();
  2395. var updatedQueue = queue.slice();
  2396. resetSchedulerState();
  2397. // call component updated and activated hooks
  2398. callActivatedHooks(activatedQueue);
  2399. callUpdateHooks(updatedQueue);
  2400. // devtool hook
  2401. /* istanbul ignore if */
  2402. if (devtools && config.devtools) {
  2403. devtools.emit('flush');
  2404. }
  2405. }
  2406. function callUpdateHooks (queue) {
  2407. var i = queue.length;
  2408. while (i--) {
  2409. var watcher = queue[i];
  2410. var vm = watcher.vm;
  2411. if (vm._watcher === watcher && vm._isMounted) {
  2412. callHook(vm, 'updated');
  2413. }
  2414. }
  2415. }
  2416. /**
  2417. * Queue a kept-alive component that was activated during patch.
  2418. * The queue will be processed after the entire tree has been patched.
  2419. */
  2420. function queueActivatedComponent (vm) {
  2421. // settings _inactive to false here so that a render function can
  2422. // rely on checking whether it's in an inactive tree (e.g. router-view)
  2423. vm._inactive = false;
  2424. activatedChildren.push(vm);
  2425. }
  2426. function callActivatedHooks (queue) {
  2427. for (var i = 0; i < queue.length; i++) {
  2428. queue[i]._inactive = true;
  2429. activateChildComponent(queue[i], true /* true */);
  2430. }
  2431. }
  2432. /**
  2433. * Push a watcher into the watcher queue.
  2434. * Jobs with duplicate IDs will be skipped unless it's
  2435. * pushed when the queue is being flushed.
  2436. */
  2437. function queueWatcher (watcher) {
  2438. var id = watcher.id;
  2439. if (has[id] == null) {
  2440. has[id] = true;
  2441. if (!flushing) {
  2442. queue.push(watcher);
  2443. } else {
  2444. // if already flushing, splice the watcher based on its id
  2445. // if already past its id, it will be run next immediately.
  2446. var i = queue.length - 1;
  2447. while (i > index && queue[i].id > watcher.id) {
  2448. i--;
  2449. }
  2450. queue.splice(i + 1, 0, watcher);
  2451. }
  2452. // queue the flush
  2453. if (!waiting) {
  2454. waiting = true;
  2455. nextTick(flushSchedulerQueue);
  2456. }
  2457. }
  2458. }
  2459. /* */
  2460. var uid$2 = 0;
  2461. /**
  2462. * A watcher parses an expression, collects dependencies,
  2463. * and fires callback when the expression value changes.
  2464. * This is used for both the $watch() api and directives.
  2465. */
  2466. var Watcher = function Watcher (
  2467. vm,
  2468. expOrFn,
  2469. cb,
  2470. options
  2471. ) {
  2472. this.vm = vm;
  2473. vm._watchers.push(this);
  2474. // options
  2475. if (options) {
  2476. this.deep = !!options.deep;
  2477. this.user = !!options.user;
  2478. this.lazy = !!options.lazy;
  2479. this.sync = !!options.sync;
  2480. } else {
  2481. this.deep = this.user = this.lazy = this.sync = false;
  2482. }
  2483. this.cb = cb;
  2484. this.id = ++uid$2; // uid for batching
  2485. this.active = true;
  2486. this.dirty = this.lazy; // for lazy watchers
  2487. this.deps = [];
  2488. this.newDeps = [];
  2489. this.depIds = new _Set();
  2490. this.newDepIds = new _Set();
  2491. this.expression = expOrFn.toString();
  2492. // parse expression for getter
  2493. if (typeof expOrFn === 'function') {
  2494. this.getter = expOrFn;
  2495. } else {
  2496. this.getter = parsePath(expOrFn);
  2497. if (!this.getter) {
  2498. this.getter = function () {};
  2499. "development" !== 'production' && warn(
  2500. "Failed watching path: \"" + expOrFn + "\" " +
  2501. 'Watcher only accepts simple dot-delimited paths. ' +
  2502. 'For full control, use a function instead.',
  2503. vm
  2504. );
  2505. }
  2506. }
  2507. this.value = this.lazy
  2508. ? undefined
  2509. : this.get();
  2510. };
  2511. /**
  2512. * Evaluate the getter, and re-collect dependencies.
  2513. */
  2514. Watcher.prototype.get = function get () {
  2515. pushTarget(this);
  2516. var value;
  2517. var vm = this.vm;
  2518. if (this.user) {
  2519. try {
  2520. value = this.getter.call(vm, vm);
  2521. } catch (e) {
  2522. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  2523. }
  2524. } else {
  2525. value = this.getter.call(vm, vm);
  2526. }
  2527. // "touch" every property so they are all tracked as
  2528. // dependencies for deep watching
  2529. if (this.deep) {
  2530. traverse(value);
  2531. }
  2532. popTarget();
  2533. this.cleanupDeps();
  2534. return value
  2535. };
  2536. /**
  2537. * Add a dependency to this directive.
  2538. */
  2539. Watcher.prototype.addDep = function addDep (dep) {
  2540. var id = dep.id;
  2541. if (!this.newDepIds.has(id)) {
  2542. this.newDepIds.add(id);
  2543. this.newDeps.push(dep);
  2544. if (!this.depIds.has(id)) {
  2545. dep.addSub(this);
  2546. }
  2547. }
  2548. };
  2549. /**
  2550. * Clean up for dependency collection.
  2551. */
  2552. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  2553. var this$1 = this;
  2554. var i = this.deps.length;
  2555. while (i--) {
  2556. var dep = this$1.deps[i];
  2557. if (!this$1.newDepIds.has(dep.id)) {
  2558. dep.removeSub(this$1);
  2559. }
  2560. }
  2561. var tmp = this.depIds;
  2562. this.depIds = this.newDepIds;
  2563. this.newDepIds = tmp;
  2564. this.newDepIds.clear();
  2565. tmp = this.deps;
  2566. this.deps = this.newDeps;
  2567. this.newDeps = tmp;
  2568. this.newDeps.length = 0;
  2569. };
  2570. /**
  2571. * Subscriber interface.
  2572. * Will be called when a dependency changes.
  2573. */
  2574. Watcher.prototype.update = function update () {
  2575. /* istanbul ignore else */
  2576. if (this.lazy) {
  2577. this.dirty = true;
  2578. } else if (this.sync) {
  2579. this.run();
  2580. } else {
  2581. queueWatcher(this);
  2582. }
  2583. };
  2584. /**
  2585. * Scheduler job interface.
  2586. * Will be called by the scheduler.
  2587. */
  2588. Watcher.prototype.run = function run () {
  2589. if (this.active) {
  2590. var value = this.get();
  2591. if (
  2592. value !== this.value ||
  2593. // Deep watchers and watchers on Object/Arrays should fire even
  2594. // when the value is the same, because the value may
  2595. // have mutated.
  2596. isObject(value) ||
  2597. this.deep
  2598. ) {
  2599. // set new value
  2600. var oldValue = this.value;
  2601. this.value = value;
  2602. if (this.user) {
  2603. try {
  2604. this.cb.call(this.vm, value, oldValue);
  2605. } catch (e) {
  2606. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  2607. }
  2608. } else {
  2609. this.cb.call(this.vm, value, oldValue);
  2610. }
  2611. }
  2612. }
  2613. };
  2614. /**
  2615. * Evaluate the value of the watcher.
  2616. * This only gets called for lazy watchers.
  2617. */
  2618. Watcher.prototype.evaluate = function evaluate () {
  2619. this.value = this.get();
  2620. this.dirty = false;
  2621. };
  2622. /**
  2623. * Depend on all deps collected by this watcher.
  2624. */
  2625. Watcher.prototype.depend = function depend () {
  2626. var this$1 = this;
  2627. var i = this.deps.length;
  2628. while (i--) {
  2629. this$1.deps[i].depend();
  2630. }
  2631. };
  2632. /**
  2633. * Remove self from all dependencies' subscriber list.
  2634. */
  2635. Watcher.prototype.teardown = function teardown () {
  2636. var this$1 = this;
  2637. if (this.active) {
  2638. // remove self from vm's watcher list
  2639. // this is a somewhat expensive operation so we skip it
  2640. // if the vm is being destroyed.
  2641. if (!this.vm._isBeingDestroyed) {
  2642. remove(this.vm._watchers, this);
  2643. }
  2644. var i = this.deps.length;
  2645. while (i--) {
  2646. this$1.deps[i].removeSub(this$1);
  2647. }
  2648. this.active = false;
  2649. }
  2650. };
  2651. /**
  2652. * Recursively traverse an object to evoke all converted
  2653. * getters, so that every nested property inside the object
  2654. * is collected as a "deep" dependency.
  2655. */
  2656. var seenObjects = new _Set();
  2657. function traverse (val) {
  2658. seenObjects.clear();
  2659. _traverse(val, seenObjects);
  2660. }
  2661. function _traverse (val, seen) {
  2662. var i, keys;
  2663. var isA = Array.isArray(val);
  2664. if ((!isA && !isObject(val)) || !Object.isExtensible(val)) {
  2665. return
  2666. }
  2667. if (val.__ob__) {
  2668. var depId = val.__ob__.dep.id;
  2669. if (seen.has(depId)) {
  2670. return
  2671. }
  2672. seen.add(depId);
  2673. }
  2674. if (isA) {
  2675. i = val.length;
  2676. while (i--) { _traverse(val[i], seen); }
  2677. } else {
  2678. keys = Object.keys(val);
  2679. i = keys.length;
  2680. while (i--) { _traverse(val[keys[i]], seen); }
  2681. }
  2682. }
  2683. /* */
  2684. var sharedPropertyDefinition = {
  2685. enumerable: true,
  2686. configurable: true,
  2687. get: noop,
  2688. set: noop
  2689. };
  2690. function proxy (target, sourceKey, key) {
  2691. sharedPropertyDefinition.get = function proxyGetter () {
  2692. return this[sourceKey][key]
  2693. };
  2694. sharedPropertyDefinition.set = function proxySetter (val) {
  2695. this[sourceKey][key] = val;
  2696. };
  2697. Object.defineProperty(target, key, sharedPropertyDefinition);
  2698. }
  2699. function initState (vm) {
  2700. vm._watchers = [];
  2701. var opts = vm.$options;
  2702. if (opts.props) { initProps(vm, opts.props); }
  2703. if (opts.methods) { initMethods(vm, opts.methods); }
  2704. if (opts.data) {
  2705. initData(vm);
  2706. } else {
  2707. observe(vm._data = {}, true /* asRootData */);
  2708. }
  2709. if (opts.computed) { initComputed(vm, opts.computed); }
  2710. if (opts.watch) { initWatch(vm, opts.watch); }
  2711. }
  2712. var isReservedProp = {
  2713. key: 1,
  2714. ref: 1,
  2715. slot: 1
  2716. };
  2717. function initProps (vm, propsOptions) {
  2718. var propsData = vm.$options.propsData || {};
  2719. var props = vm._props = {};
  2720. // cache prop keys so that future props updates can iterate using Array
  2721. // instead of dynamic object key enumeration.
  2722. var keys = vm.$options._propKeys = [];
  2723. var isRoot = !vm.$parent;
  2724. // root instance props should be converted
  2725. observerState.shouldConvert = isRoot;
  2726. var loop = function ( key ) {
  2727. keys.push(key);
  2728. var value = validateProp(key, propsOptions, propsData, vm);
  2729. /* istanbul ignore else */
  2730. {
  2731. if (isReservedProp[key] || config.isReservedAttr(key)) {
  2732. warn(
  2733. ("\"" + key + "\" is a reserved attribute and cannot be used as component prop."),
  2734. vm
  2735. );
  2736. }
  2737. defineReactive$$1(props, key, value, function () {
  2738. if (vm.$parent && !observerState.isSettingProps) {
  2739. warn(
  2740. "Avoid mutating a prop directly since the value will be " +
  2741. "overwritten whenever the parent component re-renders. " +
  2742. "Instead, use a data or computed property based on the prop's " +
  2743. "value. Prop being mutated: \"" + key + "\"",
  2744. vm
  2745. );
  2746. }
  2747. });
  2748. }
  2749. // static props are already proxied on the component's prototype
  2750. // during Vue.extend(). We only need to proxy props defined at
  2751. // instantiation here.
  2752. if (!(key in vm)) {
  2753. proxy(vm, "_props", key);
  2754. }
  2755. };
  2756. for (var key in propsOptions) loop( key );
  2757. observerState.shouldConvert = true;
  2758. }
  2759. function initData (vm) {
  2760. var data = vm.$options.data;
  2761. data = vm._data = typeof data === 'function'
  2762. ? getData(data, vm)
  2763. : data || {};
  2764. if (!isPlainObject(data)) {
  2765. data = {};
  2766. "development" !== 'production' && warn(
  2767. 'data functions should return an object:\n' +
  2768. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  2769. vm
  2770. );
  2771. }
  2772. // proxy data on instance
  2773. var keys = Object.keys(data);
  2774. var props = vm.$options.props;
  2775. var i = keys.length;
  2776. while (i--) {
  2777. if (props && hasOwn(props, keys[i])) {
  2778. "development" !== 'production' && warn(
  2779. "The data property \"" + (keys[i]) + "\" is already declared as a prop. " +
  2780. "Use prop default value instead.",
  2781. vm
  2782. );
  2783. } else if (!isReserved(keys[i])) {
  2784. proxy(vm, "_data", keys[i]);
  2785. }
  2786. }
  2787. // observe data
  2788. observe(data, true /* asRootData */);
  2789. }
  2790. function getData (data, vm) {
  2791. try {
  2792. return data.call(vm)
  2793. } catch (e) {
  2794. handleError(e, vm, "data()");
  2795. return {}
  2796. }
  2797. }
  2798. var computedWatcherOptions = { lazy: true };
  2799. function initComputed (vm, computed) {
  2800. var watchers = vm._computedWatchers = Object.create(null);
  2801. for (var key in computed) {
  2802. var userDef = computed[key];
  2803. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  2804. {
  2805. if (getter === undefined) {
  2806. warn(
  2807. ("No getter function has been defined for computed property \"" + key + "\"."),
  2808. vm
  2809. );
  2810. getter = noop;
  2811. }
  2812. }
  2813. // create internal watcher for the computed property.
  2814. watchers[key] = new Watcher(vm, getter, noop, computedWatcherOptions);
  2815. // component-defined computed properties are already defined on the
  2816. // component prototype. We only need to define computed properties defined
  2817. // at instantiation here.
  2818. if (!(key in vm)) {
  2819. defineComputed(vm, key, userDef);
  2820. } else {
  2821. if (key in vm.$data) {
  2822. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  2823. } else if (vm.$options.props && key in vm.$options.props) {
  2824. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  2825. }
  2826. }
  2827. }
  2828. }
  2829. function defineComputed (target, key, userDef) {
  2830. if (typeof userDef === 'function') {
  2831. sharedPropertyDefinition.get = createComputedGetter(key);
  2832. sharedPropertyDefinition.set = noop;
  2833. } else {
  2834. sharedPropertyDefinition.get = userDef.get
  2835. ? userDef.cache !== false
  2836. ? createComputedGetter(key)
  2837. : userDef.get
  2838. : noop;
  2839. sharedPropertyDefinition.set = userDef.set
  2840. ? userDef.set
  2841. : noop;
  2842. }
  2843. Object.defineProperty(target, key, sharedPropertyDefinition);
  2844. }
  2845. function createComputedGetter (key) {
  2846. return function computedGetter () {
  2847. var watcher = this._computedWatchers && this._computedWatchers[key];
  2848. if (watcher) {
  2849. if (watcher.dirty) {
  2850. watcher.evaluate();
  2851. }
  2852. if (Dep.target) {
  2853. watcher.depend();
  2854. }
  2855. return watcher.value
  2856. }
  2857. }
  2858. }
  2859. function initMethods (vm, methods) {
  2860. var props = vm.$options.props;
  2861. for (var key in methods) {
  2862. vm[key] = methods[key] == null ? noop : bind(methods[key], vm);
  2863. {
  2864. if (methods[key] == null) {
  2865. warn(
  2866. "method \"" + key + "\" has an undefined value in the component definition. " +
  2867. "Did you reference the function correctly?",
  2868. vm
  2869. );
  2870. }
  2871. if (props && hasOwn(props, key)) {
  2872. warn(
  2873. ("method \"" + key + "\" has already been defined as a prop."),
  2874. vm
  2875. );
  2876. }
  2877. }
  2878. }
  2879. }
  2880. function initWatch (vm, watch) {
  2881. for (var key in watch) {
  2882. var handler = watch[key];
  2883. if (Array.isArray(handler)) {
  2884. for (var i = 0; i < handler.length; i++) {
  2885. createWatcher(vm, key, handler[i]);
  2886. }
  2887. } else {
  2888. createWatcher(vm, key, handler);
  2889. }
  2890. }
  2891. }
  2892. function createWatcher (vm, key, handler) {
  2893. var options;
  2894. if (isPlainObject(handler)) {
  2895. options = handler;
  2896. handler = handler.handler;
  2897. }
  2898. if (typeof handler === 'string') {
  2899. handler = vm[handler];
  2900. }
  2901. vm.$watch(key, handler, options);
  2902. }
  2903. function stateMixin (Vue) {
  2904. // flow somehow has problems with directly declared definition object
  2905. // when using Object.defineProperty, so we have to procedurally build up
  2906. // the object here.
  2907. var dataDef = {};
  2908. dataDef.get = function () { return this._data };
  2909. var propsDef = {};
  2910. propsDef.get = function () { return this._props };
  2911. {
  2912. dataDef.set = function (newData) {
  2913. warn(
  2914. 'Avoid replacing instance root $data. ' +
  2915. 'Use nested data properties instead.',
  2916. this
  2917. );
  2918. };
  2919. propsDef.set = function () {
  2920. warn("$props is readonly.", this);
  2921. };
  2922. }
  2923. Object.defineProperty(Vue.prototype, '$data', dataDef);
  2924. Object.defineProperty(Vue.prototype, '$props', propsDef);
  2925. Vue.prototype.$set = set;
  2926. Vue.prototype.$delete = del;
  2927. Vue.prototype.$watch = function (
  2928. expOrFn,
  2929. cb,
  2930. options
  2931. ) {
  2932. var vm = this;
  2933. options = options || {};
  2934. options.user = true;
  2935. var watcher = new Watcher(vm, expOrFn, cb, options);
  2936. if (options.immediate) {
  2937. cb.call(vm, watcher.value);
  2938. }
  2939. return function unwatchFn () {
  2940. watcher.teardown();
  2941. }
  2942. };
  2943. }
  2944. /* */
  2945. function initProvide (vm) {
  2946. var provide = vm.$options.provide;
  2947. if (provide) {
  2948. vm._provided = typeof provide === 'function'
  2949. ? provide.call(vm)
  2950. : provide;
  2951. }
  2952. }
  2953. function initInjections (vm) {
  2954. var result = resolveInject(vm.$options.inject, vm);
  2955. if (result) {
  2956. Object.keys(result).forEach(function (key) {
  2957. /* istanbul ignore else */
  2958. {
  2959. defineReactive$$1(vm, key, result[key], function () {
  2960. warn(
  2961. "Avoid mutating an injected value directly since the changes will be " +
  2962. "overwritten whenever the provided component re-renders. " +
  2963. "injection being mutated: \"" + key + "\"",
  2964. vm
  2965. );
  2966. });
  2967. }
  2968. });
  2969. }
  2970. }
  2971. function resolveInject (inject, vm) {
  2972. if (inject) {
  2973. // inject is :any because flow is not smart enough to figure out cached
  2974. // isArray here
  2975. var isArray = Array.isArray(inject);
  2976. var result = Object.create(null);
  2977. var keys = isArray
  2978. ? inject
  2979. : hasSymbol
  2980. ? Reflect.ownKeys(inject)
  2981. : Object.keys(inject);
  2982. for (var i = 0; i < keys.length; i++) {
  2983. var key = keys[i];
  2984. var provideKey = isArray ? key : inject[key];
  2985. var source = vm;
  2986. while (source) {
  2987. if (source._provided && provideKey in source._provided) {
  2988. result[key] = source._provided[provideKey];
  2989. break
  2990. }
  2991. source = source.$parent;
  2992. }
  2993. }
  2994. return result
  2995. }
  2996. }
  2997. /* */
  2998. function createFunctionalComponent (
  2999. Ctor,
  3000. propsData,
  3001. data,
  3002. context,
  3003. children
  3004. ) {
  3005. var props = {};
  3006. var propOptions = Ctor.options.props;
  3007. if (isDef(propOptions)) {
  3008. for (var key in propOptions) {
  3009. props[key] = validateProp(key, propOptions, propsData || {});
  3010. }
  3011. } else {
  3012. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  3013. if (isDef(data.props)) { mergeProps(props, data.props); }
  3014. }
  3015. // ensure the createElement function in functional components
  3016. // gets a unique context - this is necessary for correct named slot check
  3017. var _context = Object.create(context);
  3018. var h = function (a, b, c, d) { return createElement(_context, a, b, c, d, true); };
  3019. var vnode = Ctor.options.render.call(null, h, {
  3020. data: data,
  3021. props: props,
  3022. children: children,
  3023. parent: context,
  3024. listeners: data.on || {},
  3025. injections: resolveInject(Ctor.options.inject, context),
  3026. slots: function () { return resolveSlots(children, context); }
  3027. });
  3028. if (vnode instanceof VNode) {
  3029. vnode.functionalContext = context;
  3030. vnode.functionalOptions = Ctor.options;
  3031. if (data.slot) {
  3032. (vnode.data || (vnode.data = {})).slot = data.slot;
  3033. }
  3034. }
  3035. return vnode
  3036. }
  3037. function mergeProps (to, from) {
  3038. for (var key in from) {
  3039. to[camelize(key)] = from[key];
  3040. }
  3041. }
  3042. /* */
  3043. // hooks to be invoked on component VNodes during patch
  3044. var componentVNodeHooks = {
  3045. init: function init (
  3046. vnode,
  3047. hydrating,
  3048. parentElm,
  3049. refElm
  3050. ) {
  3051. if (!vnode.componentInstance || vnode.componentInstance._isDestroyed) {
  3052. var child = vnode.componentInstance = createComponentInstanceForVnode(
  3053. vnode,
  3054. activeInstance,
  3055. parentElm,
  3056. refElm
  3057. );
  3058. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  3059. } else if (vnode.data.keepAlive) {
  3060. // kept-alive components, treat as a patch
  3061. var mountedNode = vnode; // work around flow
  3062. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  3063. }
  3064. },
  3065. prepatch: function prepatch (oldVnode, vnode) {
  3066. var options = vnode.componentOptions;
  3067. var child = vnode.componentInstance = oldVnode.componentInstance;
  3068. updateChildComponent(
  3069. child,
  3070. options.propsData, // updated props
  3071. options.listeners, // updated listeners
  3072. vnode, // new parent vnode
  3073. options.children // new children
  3074. );
  3075. },
  3076. insert: function insert (vnode) {
  3077. var context = vnode.context;
  3078. var componentInstance = vnode.componentInstance;
  3079. if (!componentInstance._isMounted) {
  3080. componentInstance._isMounted = true;
  3081. callHook(componentInstance, 'mounted');
  3082. }
  3083. if (vnode.data.keepAlive) {
  3084. if (context._isMounted) {
  3085. // vue-router#1212
  3086. // During updates, a kept-alive component's child components may
  3087. // change, so directly walking the tree here may call activated hooks
  3088. // on incorrect children. Instead we push them into a queue which will
  3089. // be processed after the whole patch process ended.
  3090. queueActivatedComponent(componentInstance);
  3091. } else {
  3092. activateChildComponent(componentInstance, true /* direct */);
  3093. }
  3094. }
  3095. },
  3096. destroy: function destroy (vnode) {
  3097. var componentInstance = vnode.componentInstance;
  3098. if (!componentInstance._isDestroyed) {
  3099. if (!vnode.data.keepAlive) {
  3100. componentInstance.$destroy();
  3101. } else {
  3102. deactivateChildComponent(componentInstance, true /* direct */);
  3103. }
  3104. }
  3105. }
  3106. };
  3107. var hooksToMerge = Object.keys(componentVNodeHooks);
  3108. function createComponent (
  3109. Ctor,
  3110. data,
  3111. context,
  3112. children,
  3113. tag
  3114. ) {
  3115. if (isUndef(Ctor)) {
  3116. return
  3117. }
  3118. var baseCtor = context.$options._base;
  3119. // plain options object: turn it into a constructor
  3120. if (isObject(Ctor)) {
  3121. Ctor = baseCtor.extend(Ctor);
  3122. }
  3123. // if at this stage it's not a constructor or an async component factory,
  3124. // reject.
  3125. if (typeof Ctor !== 'function') {
  3126. {
  3127. warn(("Invalid Component definition: " + (String(Ctor))), context);
  3128. }
  3129. return
  3130. }
  3131. // async component
  3132. if (isUndef(Ctor.cid)) {
  3133. Ctor = resolveAsyncComponent(Ctor, baseCtor, context);
  3134. if (Ctor === undefined) {
  3135. // return nothing if this is indeed an async component
  3136. // wait for the callback to trigger parent update.
  3137. return
  3138. }
  3139. }
  3140. // resolve constructor options in case global mixins are applied after
  3141. // component constructor creation
  3142. resolveConstructorOptions(Ctor);
  3143. data = data || {};
  3144. // transform component v-model data into props & events
  3145. if (isDef(data.model)) {
  3146. transformModel(Ctor.options, data);
  3147. }
  3148. // extract props
  3149. var propsData = extractPropsFromVNodeData(data, Ctor, tag);
  3150. // functional component
  3151. if (isTrue(Ctor.options.functional)) {
  3152. return createFunctionalComponent(Ctor, propsData, data, context, children)
  3153. }
  3154. // extract listeners, since these needs to be treated as
  3155. // child component listeners instead of DOM listeners
  3156. var listeners = data.on;
  3157. // replace with listeners with .native modifier
  3158. data.on = data.nativeOn;
  3159. if (isTrue(Ctor.options.abstract)) {
  3160. // abstract components do not keep anything
  3161. // other than props & listeners
  3162. data = {};
  3163. }
  3164. // merge component management hooks onto the placeholder node
  3165. mergeHooks(data);
  3166. // return a placeholder vnode
  3167. var name = Ctor.options.name || tag;
  3168. var vnode = new VNode(
  3169. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  3170. data, undefined, undefined, undefined, context,
  3171. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }
  3172. );
  3173. return vnode
  3174. }
  3175. function createComponentInstanceForVnode (
  3176. vnode, // we know it's MountedComponentVNode but flow doesn't
  3177. parent, // activeInstance in lifecycle state
  3178. parentElm,
  3179. refElm
  3180. ) {
  3181. var vnodeComponentOptions = vnode.componentOptions;
  3182. var options = {
  3183. _isComponent: true,
  3184. parent: parent,
  3185. propsData: vnodeComponentOptions.propsData,
  3186. _componentTag: vnodeComponentOptions.tag,
  3187. _parentVnode: vnode,
  3188. _parentListeners: vnodeComponentOptions.listeners,
  3189. _renderChildren: vnodeComponentOptions.children,
  3190. _parentElm: parentElm || null,
  3191. _refElm: refElm || null
  3192. };
  3193. // check inline-template render functions
  3194. var inlineTemplate = vnode.data.inlineTemplate;
  3195. if (isDef(inlineTemplate)) {
  3196. options.render = inlineTemplate.render;
  3197. options.staticRenderFns = inlineTemplate.staticRenderFns;
  3198. }
  3199. return new vnodeComponentOptions.Ctor(options)
  3200. }
  3201. function mergeHooks (data) {
  3202. if (!data.hook) {
  3203. data.hook = {};
  3204. }
  3205. for (var i = 0; i < hooksToMerge.length; i++) {
  3206. var key = hooksToMerge[i];
  3207. var fromParent = data.hook[key];
  3208. var ours = componentVNodeHooks[key];
  3209. data.hook[key] = fromParent ? mergeHook$1(ours, fromParent) : ours;
  3210. }
  3211. }
  3212. function mergeHook$1 (one, two) {
  3213. return function (a, b, c, d) {
  3214. one(a, b, c, d);
  3215. two(a, b, c, d);
  3216. }
  3217. }
  3218. // transform component v-model info (value and callback) into
  3219. // prop and event handler respectively.
  3220. function transformModel (options, data) {
  3221. var prop = (options.model && options.model.prop) || 'value';
  3222. var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;
  3223. var on = data.on || (data.on = {});
  3224. if (isDef(on[event])) {
  3225. on[event] = [data.model.callback].concat(on[event]);
  3226. } else {
  3227. on[event] = data.model.callback;
  3228. }
  3229. }
  3230. /* */
  3231. var SIMPLE_NORMALIZE = 1;
  3232. var ALWAYS_NORMALIZE = 2;
  3233. // wrapper function for providing a more flexible interface
  3234. // without getting yelled at by flow
  3235. function createElement (
  3236. context,
  3237. tag,
  3238. data,
  3239. children,
  3240. normalizationType,
  3241. alwaysNormalize
  3242. ) {
  3243. if (Array.isArray(data) || isPrimitive(data)) {
  3244. normalizationType = children;
  3245. children = data;
  3246. data = undefined;
  3247. }
  3248. if (isTrue(alwaysNormalize)) {
  3249. normalizationType = ALWAYS_NORMALIZE;
  3250. }
  3251. return _createElement(context, tag, data, children, normalizationType)
  3252. }
  3253. function _createElement (
  3254. context,
  3255. tag,
  3256. data,
  3257. children,
  3258. normalizationType
  3259. ) {
  3260. if (isDef(data) && isDef((data).__ob__)) {
  3261. "development" !== 'production' && warn(
  3262. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  3263. 'Always create fresh vnode data objects in each render!',
  3264. context
  3265. );
  3266. return createEmptyVNode()
  3267. }
  3268. if (!tag) {
  3269. // in case of component :is set to falsy value
  3270. return createEmptyVNode()
  3271. }
  3272. // support single function children as default scoped slot
  3273. if (Array.isArray(children) &&
  3274. typeof children[0] === 'function'
  3275. ) {
  3276. data = data || {};
  3277. data.scopedSlots = { default: children[0] };
  3278. children.length = 0;
  3279. }
  3280. if (normalizationType === ALWAYS_NORMALIZE) {
  3281. children = normalizeChildren(children);
  3282. } else if (normalizationType === SIMPLE_NORMALIZE) {
  3283. children = simpleNormalizeChildren(children);
  3284. }
  3285. var vnode, ns;
  3286. if (typeof tag === 'string') {
  3287. var Ctor;
  3288. ns = config.getTagNamespace(tag);
  3289. if (config.isReservedTag(tag)) {
  3290. // platform built-in elements
  3291. vnode = new VNode(
  3292. config.parsePlatformTagName(tag), data, children,
  3293. undefined, undefined, context
  3294. );
  3295. } else if (isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  3296. // component
  3297. vnode = createComponent(Ctor, data, context, children, tag);
  3298. } else {
  3299. // unknown or unlisted namespaced elements
  3300. // check at runtime because it may get assigned a namespace when its
  3301. // parent normalizes children
  3302. vnode = new VNode(
  3303. tag, data, children,
  3304. undefined, undefined, context
  3305. );
  3306. }
  3307. } else {
  3308. // direct component options / constructor
  3309. vnode = createComponent(tag, data, context, children);
  3310. }
  3311. if (isDef(vnode)) {
  3312. if (ns) { applyNS(vnode, ns); }
  3313. return vnode
  3314. } else {
  3315. return createEmptyVNode()
  3316. }
  3317. }
  3318. function applyNS (vnode, ns) {
  3319. vnode.ns = ns;
  3320. if (vnode.tag === 'foreignObject') {
  3321. // use default namespace inside foreignObject
  3322. return
  3323. }
  3324. if (isDef(vnode.children)) {
  3325. for (var i = 0, l = vnode.children.length; i < l; i++) {
  3326. var child = vnode.children[i];
  3327. if (isDef(child.tag) && isUndef(child.ns)) {
  3328. applyNS(child, ns);
  3329. }
  3330. }
  3331. }
  3332. }
  3333. /* */
  3334. /**
  3335. * Runtime helper for rendering v-for lists.
  3336. */
  3337. function renderList (
  3338. val,
  3339. render
  3340. ) {
  3341. var ret, i, l, keys, key;
  3342. if (Array.isArray(val) || typeof val === 'string') {
  3343. ret = new Array(val.length);
  3344. for (i = 0, l = val.length; i < l; i++) {
  3345. ret[i] = render(val[i], i);
  3346. }
  3347. } else if (typeof val === 'number') {
  3348. ret = new Array(val);
  3349. for (i = 0; i < val; i++) {
  3350. ret[i] = render(i + 1, i);
  3351. }
  3352. } else if (isObject(val)) {
  3353. keys = Object.keys(val);
  3354. ret = new Array(keys.length);
  3355. for (i = 0, l = keys.length; i < l; i++) {
  3356. key = keys[i];
  3357. ret[i] = render(val[key], key, i);
  3358. }
  3359. }
  3360. if (isDef(ret)) {
  3361. (ret)._isVList = true;
  3362. }
  3363. return ret
  3364. }
  3365. /* */
  3366. /**
  3367. * Runtime helper for rendering <slot>
  3368. */
  3369. function renderSlot (
  3370. name,
  3371. fallback,
  3372. props,
  3373. bindObject
  3374. ) {
  3375. var scopedSlotFn = this.$scopedSlots[name];
  3376. if (scopedSlotFn) { // scoped slot
  3377. props = props || {};
  3378. if (bindObject) {
  3379. extend(props, bindObject);
  3380. }
  3381. return scopedSlotFn(props) || fallback
  3382. } else {
  3383. var slotNodes = this.$slots[name];
  3384. // warn duplicate slot usage
  3385. if (slotNodes && "development" !== 'production') {
  3386. slotNodes._rendered && warn(
  3387. "Duplicate presence of slot \"" + name + "\" found in the same render tree " +
  3388. "- this will likely cause render errors.",
  3389. this
  3390. );
  3391. slotNodes._rendered = true;
  3392. }
  3393. return slotNodes || fallback
  3394. }
  3395. }
  3396. /* */
  3397. /**
  3398. * Runtime helper for resolving filters
  3399. */
  3400. function resolveFilter (id) {
  3401. return resolveAsset(this.$options, 'filters', id, true) || identity
  3402. }
  3403. /* */
  3404. /**
  3405. * Runtime helper for checking keyCodes from config.
  3406. */
  3407. function checkKeyCodes (
  3408. eventKeyCode,
  3409. key,
  3410. builtInAlias
  3411. ) {
  3412. var keyCodes = config.keyCodes[key] || builtInAlias;
  3413. if (Array.isArray(keyCodes)) {
  3414. return keyCodes.indexOf(eventKeyCode) === -1
  3415. } else {
  3416. return keyCodes !== eventKeyCode
  3417. }
  3418. }
  3419. /* */
  3420. /**
  3421. * Runtime helper for merging v-bind="object" into a VNode's data.
  3422. */
  3423. function bindObjectProps (
  3424. data,
  3425. tag,
  3426. value,
  3427. asProp
  3428. ) {
  3429. if (value) {
  3430. if (!isObject(value)) {
  3431. "development" !== 'production' && warn(
  3432. 'v-bind without argument expects an Object or Array value',
  3433. this
  3434. );
  3435. } else {
  3436. if (Array.isArray(value)) {
  3437. value = toObject(value);
  3438. }
  3439. var hash;
  3440. for (var key in value) {
  3441. if (key === 'class' || key === 'style') {
  3442. hash = data;
  3443. } else {
  3444. var type = data.attrs && data.attrs.type;
  3445. hash = asProp || config.mustUseProp(tag, type, key)
  3446. ? data.domProps || (data.domProps = {})
  3447. : data.attrs || (data.attrs = {});
  3448. }
  3449. if (!(key in hash)) {
  3450. hash[key] = value[key];
  3451. }
  3452. }
  3453. }
  3454. }
  3455. return data
  3456. }
  3457. /* */
  3458. /**
  3459. * Runtime helper for rendering static trees.
  3460. */
  3461. function renderStatic (
  3462. index,
  3463. isInFor
  3464. ) {
  3465. var tree = this._staticTrees[index];
  3466. // if has already-rendered static tree and not inside v-for,
  3467. // we can reuse the same tree by doing a shallow clone.
  3468. if (tree && !isInFor) {
  3469. return Array.isArray(tree)
  3470. ? cloneVNodes(tree)
  3471. : cloneVNode(tree)
  3472. }
  3473. // otherwise, render a fresh tree.
  3474. tree = this._staticTrees[index] =
  3475. this.$options.staticRenderFns[index].call(this._renderProxy);
  3476. markStatic(tree, ("__static__" + index), false);
  3477. return tree
  3478. }
  3479. /**
  3480. * Runtime helper for v-once.
  3481. * Effectively it means marking the node as static with a unique key.
  3482. */
  3483. function markOnce (
  3484. tree,
  3485. index,
  3486. key
  3487. ) {
  3488. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  3489. return tree
  3490. }
  3491. function markStatic (
  3492. tree,
  3493. key,
  3494. isOnce
  3495. ) {
  3496. if (Array.isArray(tree)) {
  3497. for (var i = 0; i < tree.length; i++) {
  3498. if (tree[i] && typeof tree[i] !== 'string') {
  3499. markStaticNode(tree[i], (key + "_" + i), isOnce);
  3500. }
  3501. }
  3502. } else {
  3503. markStaticNode(tree, key, isOnce);
  3504. }
  3505. }
  3506. function markStaticNode (node, key, isOnce) {
  3507. node.isStatic = true;
  3508. node.key = key;
  3509. node.isOnce = isOnce;
  3510. }
  3511. /* */
  3512. function initRender (vm) {
  3513. vm._vnode = null; // the root of the child tree
  3514. vm._staticTrees = null;
  3515. var parentVnode = vm.$vnode = vm.$options._parentVnode; // the placeholder node in parent tree
  3516. var renderContext = parentVnode && parentVnode.context;
  3517. vm.$slots = resolveSlots(vm.$options._renderChildren, renderContext);
  3518. vm.$scopedSlots = emptyObject;
  3519. // bind the createElement fn to this instance
  3520. // so that we get proper render context inside it.
  3521. // args order: tag, data, children, normalizationType, alwaysNormalize
  3522. // internal version is used by render functions compiled from templates
  3523. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  3524. // normalization is always applied for the public version, used in
  3525. // user-written render functions.
  3526. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  3527. }
  3528. function renderMixin (Vue) {
  3529. Vue.prototype.$nextTick = function (fn) {
  3530. return nextTick(fn, this)
  3531. };
  3532. Vue.prototype._render = function () {
  3533. var vm = this;
  3534. var ref = vm.$options;
  3535. var render = ref.render;
  3536. var staticRenderFns = ref.staticRenderFns;
  3537. var _parentVnode = ref._parentVnode;
  3538. if (vm._isMounted) {
  3539. // clone slot nodes on re-renders
  3540. for (var key in vm.$slots) {
  3541. vm.$slots[key] = cloneVNodes(vm.$slots[key]);
  3542. }
  3543. }
  3544. vm.$scopedSlots = (_parentVnode && _parentVnode.data.scopedSlots) || emptyObject;
  3545. if (staticRenderFns && !vm._staticTrees) {
  3546. vm._staticTrees = [];
  3547. }
  3548. // set parent vnode. this allows render functions to have access
  3549. // to the data on the placeholder node.
  3550. vm.$vnode = _parentVnode;
  3551. // render self
  3552. var vnode;
  3553. try {
  3554. vnode = render.call(vm._renderProxy, vm.$createElement);
  3555. } catch (e) {
  3556. handleError(e, vm, "render function");
  3557. // return error render result,
  3558. // or previous vnode to prevent render error causing blank component
  3559. /* istanbul ignore else */
  3560. {
  3561. vnode = vm.$options.renderError
  3562. ? vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e)
  3563. : vm._vnode;
  3564. }
  3565. }
  3566. // return empty vnode in case the render function errored out
  3567. if (!(vnode instanceof VNode)) {
  3568. if ("development" !== 'production' && Array.isArray(vnode)) {
  3569. warn(
  3570. 'Multiple root nodes returned from render function. Render function ' +
  3571. 'should return a single root node.',
  3572. vm
  3573. );
  3574. }
  3575. vnode = createEmptyVNode();
  3576. }
  3577. // set parent
  3578. vnode.parent = _parentVnode;
  3579. return vnode
  3580. };
  3581. // internal render helpers.
  3582. // these are exposed on the instance prototype to reduce generated render
  3583. // code size.
  3584. Vue.prototype._o = markOnce;
  3585. Vue.prototype._n = toNumber;
  3586. Vue.prototype._s = toString;
  3587. Vue.prototype._l = renderList;
  3588. Vue.prototype._t = renderSlot;
  3589. Vue.prototype._q = looseEqual;
  3590. Vue.prototype._i = looseIndexOf;
  3591. Vue.prototype._m = renderStatic;
  3592. Vue.prototype._f = resolveFilter;
  3593. Vue.prototype._k = checkKeyCodes;
  3594. Vue.prototype._b = bindObjectProps;
  3595. Vue.prototype._v = createTextVNode;
  3596. Vue.prototype._e = createEmptyVNode;
  3597. Vue.prototype._u = resolveScopedSlots;
  3598. }
  3599. /* */
  3600. var uid$1 = 0;
  3601. function initMixin (Vue) {
  3602. Vue.prototype._init = function (options) {
  3603. var vm = this;
  3604. // a uid
  3605. vm._uid = uid$1++;
  3606. var startTag, endTag;
  3607. /* istanbul ignore if */
  3608. if ("development" !== 'production' && config.performance && mark) {
  3609. startTag = "vue-perf-init:" + (vm._uid);
  3610. endTag = "vue-perf-end:" + (vm._uid);
  3611. mark(startTag);
  3612. }
  3613. // a flag to avoid this being observed
  3614. vm._isVue = true;
  3615. // merge options
  3616. if (options && options._isComponent) {
  3617. // optimize internal component instantiation
  3618. // since dynamic options merging is pretty slow, and none of the
  3619. // internal component options needs special treatment.
  3620. initInternalComponent(vm, options);
  3621. } else {
  3622. vm.$options = mergeOptions(
  3623. resolveConstructorOptions(vm.constructor),
  3624. options || {},
  3625. vm
  3626. );
  3627. }
  3628. /* istanbul ignore else */
  3629. {
  3630. initProxy(vm);
  3631. }
  3632. // expose real self
  3633. vm._self = vm;
  3634. initLifecycle(vm);
  3635. initEvents(vm);
  3636. initRender(vm);
  3637. callHook(vm, 'beforeCreate');
  3638. initInjections(vm); // resolve injections before data/props
  3639. initState(vm);
  3640. initProvide(vm); // resolve provide after data/props
  3641. callHook(vm, 'created');
  3642. /* istanbul ignore if */
  3643. if ("development" !== 'production' && config.performance && mark) {
  3644. vm._name = formatComponentName(vm, false);
  3645. mark(endTag);
  3646. measure(((vm._name) + " init"), startTag, endTag);
  3647. }
  3648. if (vm.$options.el) {
  3649. vm.$mount(vm.$options.el);
  3650. }
  3651. };
  3652. }
  3653. function initInternalComponent (vm, options) {
  3654. var opts = vm.$options = Object.create(vm.constructor.options);
  3655. // doing this because it's faster than dynamic enumeration.
  3656. opts.parent = options.parent;
  3657. opts.propsData = options.propsData;
  3658. opts._parentVnode = options._parentVnode;
  3659. opts._parentListeners = options._parentListeners;
  3660. opts._renderChildren = options._renderChildren;
  3661. opts._componentTag = options._componentTag;
  3662. opts._parentElm = options._parentElm;
  3663. opts._refElm = options._refElm;
  3664. if (options.render) {
  3665. opts.render = options.render;
  3666. opts.staticRenderFns = options.staticRenderFns;
  3667. }
  3668. }
  3669. function resolveConstructorOptions (Ctor) {
  3670. var options = Ctor.options;
  3671. if (Ctor.super) {
  3672. var superOptions = resolveConstructorOptions(Ctor.super);
  3673. var cachedSuperOptions = Ctor.superOptions;
  3674. if (superOptions !== cachedSuperOptions) {
  3675. // super option changed,
  3676. // need to resolve new options.
  3677. Ctor.superOptions = superOptions;
  3678. // check if there are any late-modified/attached options (#4976)
  3679. var modifiedOptions = resolveModifiedOptions(Ctor);
  3680. // update base extend options
  3681. if (modifiedOptions) {
  3682. extend(Ctor.extendOptions, modifiedOptions);
  3683. }
  3684. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  3685. if (options.name) {
  3686. options.components[options.name] = Ctor;
  3687. }
  3688. }
  3689. }
  3690. return options
  3691. }
  3692. function resolveModifiedOptions (Ctor) {
  3693. var modified;
  3694. var latest = Ctor.options;
  3695. var extended = Ctor.extendOptions;
  3696. var sealed = Ctor.sealedOptions;
  3697. for (var key in latest) {
  3698. if (latest[key] !== sealed[key]) {
  3699. if (!modified) { modified = {}; }
  3700. modified[key] = dedupe(latest[key], extended[key], sealed[key]);
  3701. }
  3702. }
  3703. return modified
  3704. }
  3705. function dedupe (latest, extended, sealed) {
  3706. // compare latest and sealed to ensure lifecycle hooks won't be duplicated
  3707. // between merges
  3708. if (Array.isArray(latest)) {
  3709. var res = [];
  3710. sealed = Array.isArray(sealed) ? sealed : [sealed];
  3711. extended = Array.isArray(extended) ? extended : [extended];
  3712. for (var i = 0; i < latest.length; i++) {
  3713. // push original options and not sealed options to exclude duplicated options
  3714. if (extended.indexOf(latest[i]) >= 0 || sealed.indexOf(latest[i]) < 0) {
  3715. res.push(latest[i]);
  3716. }
  3717. }
  3718. return res
  3719. } else {
  3720. return latest
  3721. }
  3722. }
  3723. function Vue$3 (options) {
  3724. if ("development" !== 'production' &&
  3725. !(this instanceof Vue$3)
  3726. ) {
  3727. warn('Vue is a constructor and should be called with the `new` keyword');
  3728. }
  3729. this._init(options);
  3730. }
  3731. initMixin(Vue$3);
  3732. stateMixin(Vue$3);
  3733. eventsMixin(Vue$3);
  3734. lifecycleMixin(Vue$3);
  3735. renderMixin(Vue$3);
  3736. /* */
  3737. function initUse (Vue) {
  3738. Vue.use = function (plugin) {
  3739. /* istanbul ignore if */
  3740. if (plugin.installed) {
  3741. return this
  3742. }
  3743. // additional parameters
  3744. var args = toArray(arguments, 1);
  3745. args.unshift(this);
  3746. if (typeof plugin.install === 'function') {
  3747. plugin.install.apply(plugin, args);
  3748. } else if (typeof plugin === 'function') {
  3749. plugin.apply(null, args);
  3750. }
  3751. plugin.installed = true;
  3752. return this
  3753. };
  3754. }
  3755. /* */
  3756. function initMixin$1 (Vue) {
  3757. Vue.mixin = function (mixin) {
  3758. this.options = mergeOptions(this.options, mixin);
  3759. return this
  3760. };
  3761. }
  3762. /* */
  3763. function initExtend (Vue) {
  3764. /**
  3765. * Each instance constructor, including Vue, has a unique
  3766. * cid. This enables us to create wrapped "child
  3767. * constructors" for prototypal inheritance and cache them.
  3768. */
  3769. Vue.cid = 0;
  3770. var cid = 1;
  3771. /**
  3772. * Class inheritance
  3773. */
  3774. Vue.extend = function (extendOptions) {
  3775. extendOptions = extendOptions || {};
  3776. var Super = this;
  3777. var SuperId = Super.cid;
  3778. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  3779. if (cachedCtors[SuperId]) {
  3780. return cachedCtors[SuperId]
  3781. }
  3782. var name = extendOptions.name || Super.options.name;
  3783. {
  3784. if (!/^[a-zA-Z][\w-]*$/.test(name)) {
  3785. warn(
  3786. 'Invalid component name: "' + name + '". Component names ' +
  3787. 'can only contain alphanumeric characters and the hyphen, ' +
  3788. 'and must start with a letter.'
  3789. );
  3790. }
  3791. }
  3792. var Sub = function VueComponent (options) {
  3793. this._init(options);
  3794. };
  3795. Sub.prototype = Object.create(Super.prototype);
  3796. Sub.prototype.constructor = Sub;
  3797. Sub.cid = cid++;
  3798. Sub.options = mergeOptions(
  3799. Super.options,
  3800. extendOptions
  3801. );
  3802. Sub['super'] = Super;
  3803. // For props and computed properties, we define the proxy getters on
  3804. // the Vue instances at extension time, on the extended prototype. This
  3805. // avoids Object.defineProperty calls for each instance created.
  3806. if (Sub.options.props) {
  3807. initProps$1(Sub);
  3808. }
  3809. if (Sub.options.computed) {
  3810. initComputed$1(Sub);
  3811. }
  3812. // allow further extension/mixin/plugin usage
  3813. Sub.extend = Super.extend;
  3814. Sub.mixin = Super.mixin;
  3815. Sub.use = Super.use;
  3816. // create asset registers, so extended classes
  3817. // can have their private assets too.
  3818. ASSET_TYPES.forEach(function (type) {
  3819. Sub[type] = Super[type];
  3820. });
  3821. // enable recursive self-lookup
  3822. if (name) {
  3823. Sub.options.components[name] = Sub;
  3824. }
  3825. // keep a reference to the super options at extension time.
  3826. // later at instantiation we can check if Super's options have
  3827. // been updated.
  3828. Sub.superOptions = Super.options;
  3829. Sub.extendOptions = extendOptions;
  3830. Sub.sealedOptions = extend({}, Sub.options);
  3831. // cache constructor
  3832. cachedCtors[SuperId] = Sub;
  3833. return Sub
  3834. };
  3835. }
  3836. function initProps$1 (Comp) {
  3837. var props = Comp.options.props;
  3838. for (var key in props) {
  3839. proxy(Comp.prototype, "_props", key);
  3840. }
  3841. }
  3842. function initComputed$1 (Comp) {
  3843. var computed = Comp.options.computed;
  3844. for (var key in computed) {
  3845. defineComputed(Comp.prototype, key, computed[key]);
  3846. }
  3847. }
  3848. /* */
  3849. function initAssetRegisters (Vue) {
  3850. /**
  3851. * Create asset registration methods.
  3852. */
  3853. ASSET_TYPES.forEach(function (type) {
  3854. Vue[type] = function (
  3855. id,
  3856. definition
  3857. ) {
  3858. if (!definition) {
  3859. return this.options[type + 's'][id]
  3860. } else {
  3861. /* istanbul ignore if */
  3862. {
  3863. if (type === 'component' && config.isReservedTag(id)) {
  3864. warn(
  3865. 'Do not use built-in or reserved HTML elements as component ' +
  3866. 'id: ' + id
  3867. );
  3868. }
  3869. }
  3870. if (type === 'component' && isPlainObject(definition)) {
  3871. definition.name = definition.name || id;
  3872. definition = this.options._base.extend(definition);
  3873. }
  3874. if (type === 'directive' && typeof definition === 'function') {
  3875. definition = { bind: definition, update: definition };
  3876. }
  3877. this.options[type + 's'][id] = definition;
  3878. return definition
  3879. }
  3880. };
  3881. });
  3882. }
  3883. /* */
  3884. var patternTypes = [String, RegExp];
  3885. function getComponentName (opts) {
  3886. return opts && (opts.Ctor.options.name || opts.tag)
  3887. }
  3888. function matches (pattern, name) {
  3889. if (typeof pattern === 'string') {
  3890. return pattern.split(',').indexOf(name) > -1
  3891. } else if (isRegExp(pattern)) {
  3892. return pattern.test(name)
  3893. }
  3894. /* istanbul ignore next */
  3895. return false
  3896. }
  3897. function pruneCache (cache, current, filter) {
  3898. for (var key in cache) {
  3899. var cachedNode = cache[key];
  3900. if (cachedNode) {
  3901. var name = getComponentName(cachedNode.componentOptions);
  3902. if (name && !filter(name)) {
  3903. if (cachedNode !== current) {
  3904. pruneCacheEntry(cachedNode);
  3905. }
  3906. cache[key] = null;
  3907. }
  3908. }
  3909. }
  3910. }
  3911. function pruneCacheEntry (vnode) {
  3912. if (vnode) {
  3913. vnode.componentInstance.$destroy();
  3914. }
  3915. }
  3916. var KeepAlive = {
  3917. name: 'keep-alive',
  3918. abstract: true,
  3919. props: {
  3920. include: patternTypes,
  3921. exclude: patternTypes
  3922. },
  3923. created: function created () {
  3924. this.cache = Object.create(null);
  3925. },
  3926. destroyed: function destroyed () {
  3927. var this$1 = this;
  3928. for (var key in this$1.cache) {
  3929. pruneCacheEntry(this$1.cache[key]);
  3930. }
  3931. },
  3932. watch: {
  3933. include: function include (val) {
  3934. pruneCache(this.cache, this._vnode, function (name) { return matches(val, name); });
  3935. },
  3936. exclude: function exclude (val) {
  3937. pruneCache(this.cache, this._vnode, function (name) { return !matches(val, name); });
  3938. }
  3939. },
  3940. render: function render () {
  3941. var vnode = getFirstComponentChild(this.$slots.default);
  3942. var componentOptions = vnode && vnode.componentOptions;
  3943. if (componentOptions) {
  3944. // check pattern
  3945. var name = getComponentName(componentOptions);
  3946. if (name && (
  3947. (this.include && !matches(this.include, name)) ||
  3948. (this.exclude && matches(this.exclude, name))
  3949. )) {
  3950. return vnode
  3951. }
  3952. var key = vnode.key == null
  3953. // same constructor may get registered as different local components
  3954. // so cid alone is not enough (#3269)
  3955. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  3956. : vnode.key;
  3957. if (this.cache[key]) {
  3958. vnode.componentInstance = this.cache[key].componentInstance;
  3959. } else {
  3960. this.cache[key] = vnode;
  3961. }
  3962. vnode.data.keepAlive = true;
  3963. }
  3964. return vnode
  3965. }
  3966. };
  3967. var builtInComponents = {
  3968. KeepAlive: KeepAlive
  3969. };
  3970. /* */
  3971. function initGlobalAPI (Vue) {
  3972. // config
  3973. var configDef = {};
  3974. configDef.get = function () { return config; };
  3975. {
  3976. configDef.set = function () {
  3977. warn(
  3978. 'Do not replace the Vue.config object, set individual fields instead.'
  3979. );
  3980. };
  3981. }
  3982. Object.defineProperty(Vue, 'config', configDef);
  3983. // exposed util methods.
  3984. // NOTE: these are not considered part of the public API - avoid relying on
  3985. // them unless you are aware of the risk.
  3986. Vue.util = {
  3987. warn: warn,
  3988. extend: extend,
  3989. mergeOptions: mergeOptions,
  3990. defineReactive: defineReactive$$1
  3991. };
  3992. Vue.set = set;
  3993. Vue.delete = del;
  3994. Vue.nextTick = nextTick;
  3995. Vue.options = Object.create(null);
  3996. ASSET_TYPES.forEach(function (type) {
  3997. Vue.options[type + 's'] = Object.create(null);
  3998. });
  3999. // this is used to identify the "base" constructor to extend all plain-object
  4000. // components with in Weex's multi-instance scenarios.
  4001. Vue.options._base = Vue;
  4002. extend(Vue.options.components, builtInComponents);
  4003. initUse(Vue);
  4004. initMixin$1(Vue);
  4005. initExtend(Vue);
  4006. initAssetRegisters(Vue);
  4007. }
  4008. initGlobalAPI(Vue$3);
  4009. Object.defineProperty(Vue$3.prototype, '$isServer', {
  4010. get: isServerRendering
  4011. });
  4012. Object.defineProperty(Vue$3.prototype, '$ssrContext', {
  4013. get: function get () {
  4014. /* istanbul ignore next */
  4015. return this.$vnode.ssrContext
  4016. }
  4017. });
  4018. Vue$3.version = '2.3.3';
  4019. /* */
  4020. // these are reserved for web because they are directly compiled away
  4021. // during template compilation
  4022. var isReservedAttr = makeMap('style,class');
  4023. // attributes that should be using props for binding
  4024. var acceptValue = makeMap('input,textarea,option,select');
  4025. var mustUseProp = function (tag, type, attr) {
  4026. return (
  4027. (attr === 'value' && acceptValue(tag)) && type !== 'button' ||
  4028. (attr === 'selected' && tag === 'option') ||
  4029. (attr === 'checked' && tag === 'input') ||
  4030. (attr === 'muted' && tag === 'video')
  4031. )
  4032. };
  4033. var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
  4034. var isBooleanAttr = makeMap(
  4035. 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
  4036. 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
  4037. 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
  4038. 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
  4039. 'required,reversed,scoped,seamless,selected,sortable,translate,' +
  4040. 'truespeed,typemustmatch,visible'
  4041. );
  4042. var xlinkNS = 'http://www.w3.org/1999/xlink';
  4043. var isXlink = function (name) {
  4044. return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
  4045. };
  4046. var getXlinkProp = function (name) {
  4047. return isXlink(name) ? name.slice(6, name.length) : ''
  4048. };
  4049. var isFalsyAttrValue = function (val) {
  4050. return val == null || val === false
  4051. };
  4052. /* */
  4053. function genClassForVnode (vnode) {
  4054. var data = vnode.data;
  4055. var parentNode = vnode;
  4056. var childNode = vnode;
  4057. while (isDef(childNode.componentInstance)) {
  4058. childNode = childNode.componentInstance._vnode;
  4059. if (childNode.data) {
  4060. data = mergeClassData(childNode.data, data);
  4061. }
  4062. }
  4063. while (isDef(parentNode = parentNode.parent)) {
  4064. if (parentNode.data) {
  4065. data = mergeClassData(data, parentNode.data);
  4066. }
  4067. }
  4068. return genClassFromData(data)
  4069. }
  4070. function mergeClassData (child, parent) {
  4071. return {
  4072. staticClass: concat(child.staticClass, parent.staticClass),
  4073. class: isDef(child.class)
  4074. ? [child.class, parent.class]
  4075. : parent.class
  4076. }
  4077. }
  4078. function genClassFromData (data) {
  4079. var dynamicClass = data.class;
  4080. var staticClass = data.staticClass;
  4081. if (isDef(staticClass) || isDef(dynamicClass)) {
  4082. return concat(staticClass, stringifyClass(dynamicClass))
  4083. }
  4084. /* istanbul ignore next */
  4085. return ''
  4086. }
  4087. function concat (a, b) {
  4088. return a ? b ? (a + ' ' + b) : a : (b || '')
  4089. }
  4090. function stringifyClass (value) {
  4091. if (isUndef(value)) {
  4092. return ''
  4093. }
  4094. if (typeof value === 'string') {
  4095. return value
  4096. }
  4097. var res = '';
  4098. if (Array.isArray(value)) {
  4099. var stringified;
  4100. for (var i = 0, l = value.length; i < l; i++) {
  4101. if (isDef(value[i])) {
  4102. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  4103. res += stringified + ' ';
  4104. }
  4105. }
  4106. }
  4107. return res.slice(0, -1)
  4108. }
  4109. if (isObject(value)) {
  4110. for (var key in value) {
  4111. if (value[key]) { res += key + ' '; }
  4112. }
  4113. return res.slice(0, -1)
  4114. }
  4115. /* istanbul ignore next */
  4116. return res
  4117. }
  4118. /* */
  4119. var namespaceMap = {
  4120. svg: 'http://www.w3.org/2000/svg',
  4121. math: 'http://www.w3.org/1998/Math/MathML'
  4122. };
  4123. var isHTMLTag = makeMap(
  4124. 'html,body,base,head,link,meta,style,title,' +
  4125. 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
  4126. 'div,dd,dl,dt,figcaption,figure,hr,img,li,main,ol,p,pre,ul,' +
  4127. 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
  4128. 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
  4129. 'embed,object,param,source,canvas,script,noscript,del,ins,' +
  4130. 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
  4131. 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
  4132. 'output,progress,select,textarea,' +
  4133. 'details,dialog,menu,menuitem,summary,' +
  4134. 'content,element,shadow,template'
  4135. );
  4136. // this map is intentionally selective, only covering SVG elements that may
  4137. // contain child elements.
  4138. var isSVG = makeMap(
  4139. 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
  4140. 'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
  4141. 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
  4142. true
  4143. );
  4144. var isPreTag = function (tag) { return tag === 'pre'; };
  4145. var isReservedTag = function (tag) {
  4146. return isHTMLTag(tag) || isSVG(tag)
  4147. };
  4148. function getTagNamespace (tag) {
  4149. if (isSVG(tag)) {
  4150. return 'svg'
  4151. }
  4152. // basic support for MathML
  4153. // note it doesn't support other MathML elements being component roots
  4154. if (tag === 'math') {
  4155. return 'math'
  4156. }
  4157. }
  4158. var unknownElementCache = Object.create(null);
  4159. function isUnknownElement (tag) {
  4160. /* istanbul ignore if */
  4161. if (!inBrowser) {
  4162. return true
  4163. }
  4164. if (isReservedTag(tag)) {
  4165. return false
  4166. }
  4167. tag = tag.toLowerCase();
  4168. /* istanbul ignore if */
  4169. if (unknownElementCache[tag] != null) {
  4170. return unknownElementCache[tag]
  4171. }
  4172. var el = document.createElement(tag);
  4173. if (tag.indexOf('-') > -1) {
  4174. // http://stackoverflow.com/a/28210364/1070244
  4175. return (unknownElementCache[tag] = (
  4176. el.constructor === window.HTMLUnknownElement ||
  4177. el.constructor === window.HTMLElement
  4178. ))
  4179. } else {
  4180. return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
  4181. }
  4182. }
  4183. /* */
  4184. /**
  4185. * Query an element selector if it's not an element already.
  4186. */
  4187. function query (el) {
  4188. if (typeof el === 'string') {
  4189. var selected = document.querySelector(el);
  4190. if (!selected) {
  4191. "development" !== 'production' && warn(
  4192. 'Cannot find element: ' + el
  4193. );
  4194. return document.createElement('div')
  4195. }
  4196. return selected
  4197. } else {
  4198. return el
  4199. }
  4200. }
  4201. /* */
  4202. function createElement$1 (tagName, vnode) {
  4203. var elm = document.createElement(tagName);
  4204. if (tagName !== 'select') {
  4205. return elm
  4206. }
  4207. // false or null will remove the attribute but undefined will not
  4208. if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {
  4209. elm.setAttribute('multiple', 'multiple');
  4210. }
  4211. return elm
  4212. }
  4213. function createElementNS (namespace, tagName) {
  4214. return document.createElementNS(namespaceMap[namespace], tagName)
  4215. }
  4216. function createTextNode (text) {
  4217. return document.createTextNode(text)
  4218. }
  4219. function createComment (text) {
  4220. return document.createComment(text)
  4221. }
  4222. function insertBefore (parentNode, newNode, referenceNode) {
  4223. parentNode.insertBefore(newNode, referenceNode);
  4224. }
  4225. function removeChild (node, child) {
  4226. node.removeChild(child);
  4227. }
  4228. function appendChild (node, child) {
  4229. node.appendChild(child);
  4230. }
  4231. function parentNode (node) {
  4232. return node.parentNode
  4233. }
  4234. function nextSibling (node) {
  4235. return node.nextSibling
  4236. }
  4237. function tagName (node) {
  4238. return node.tagName
  4239. }
  4240. function setTextContent (node, text) {
  4241. node.textContent = text;
  4242. }
  4243. function setAttribute (node, key, val) {
  4244. node.setAttribute(key, val);
  4245. }
  4246. var nodeOps = Object.freeze({
  4247. createElement: createElement$1,
  4248. createElementNS: createElementNS,
  4249. createTextNode: createTextNode,
  4250. createComment: createComment,
  4251. insertBefore: insertBefore,
  4252. removeChild: removeChild,
  4253. appendChild: appendChild,
  4254. parentNode: parentNode,
  4255. nextSibling: nextSibling,
  4256. tagName: tagName,
  4257. setTextContent: setTextContent,
  4258. setAttribute: setAttribute
  4259. });
  4260. /* */
  4261. var ref = {
  4262. create: function create (_, vnode) {
  4263. registerRef(vnode);
  4264. },
  4265. update: function update (oldVnode, vnode) {
  4266. if (oldVnode.data.ref !== vnode.data.ref) {
  4267. registerRef(oldVnode, true);
  4268. registerRef(vnode);
  4269. }
  4270. },
  4271. destroy: function destroy (vnode) {
  4272. registerRef(vnode, true);
  4273. }
  4274. };
  4275. function registerRef (vnode, isRemoval) {
  4276. var key = vnode.data.ref;
  4277. if (!key) { return }
  4278. var vm = vnode.context;
  4279. var ref = vnode.componentInstance || vnode.elm;
  4280. var refs = vm.$refs;
  4281. if (isRemoval) {
  4282. if (Array.isArray(refs[key])) {
  4283. remove(refs[key], ref);
  4284. } else if (refs[key] === ref) {
  4285. refs[key] = undefined;
  4286. }
  4287. } else {
  4288. if (vnode.data.refInFor) {
  4289. if (Array.isArray(refs[key]) && refs[key].indexOf(ref) < 0) {
  4290. refs[key].push(ref);
  4291. } else {
  4292. refs[key] = [ref];
  4293. }
  4294. } else {
  4295. refs[key] = ref;
  4296. }
  4297. }
  4298. }
  4299. /**
  4300. * Virtual DOM patching algorithm based on Snabbdom by
  4301. * Simon Friis Vindum (@paldepind)
  4302. * Licensed under the MIT License
  4303. * https://github.com/paldepind/snabbdom/blob/master/LICENSE
  4304. *
  4305. * modified by Evan You (@yyx990803)
  4306. *
  4307. /*
  4308. * Not type-checking this because this file is perf-critical and the cost
  4309. * of making flow understand it is not worth it.
  4310. */
  4311. var emptyNode = new VNode('', {}, []);
  4312. var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
  4313. function sameVnode (a, b) {
  4314. return (
  4315. a.key === b.key &&
  4316. a.tag === b.tag &&
  4317. a.isComment === b.isComment &&
  4318. isDef(a.data) === isDef(b.data) &&
  4319. sameInputType(a, b)
  4320. )
  4321. }
  4322. // Some browsers do not support dynamically changing type for <input>
  4323. // so they need to be treated as different nodes
  4324. function sameInputType (a, b) {
  4325. if (a.tag !== 'input') { return true }
  4326. var i;
  4327. var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;
  4328. var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;
  4329. return typeA === typeB
  4330. }
  4331. function createKeyToOldIdx (children, beginIdx, endIdx) {
  4332. var i, key;
  4333. var map = {};
  4334. for (i = beginIdx; i <= endIdx; ++i) {
  4335. key = children[i].key;
  4336. if (isDef(key)) { map[key] = i; }
  4337. }
  4338. return map
  4339. }
  4340. function createPatchFunction (backend) {
  4341. var i, j;
  4342. var cbs = {};
  4343. var modules = backend.modules;
  4344. var nodeOps = backend.nodeOps;
  4345. for (i = 0; i < hooks.length; ++i) {
  4346. cbs[hooks[i]] = [];
  4347. for (j = 0; j < modules.length; ++j) {
  4348. if (isDef(modules[j][hooks[i]])) {
  4349. cbs[hooks[i]].push(modules[j][hooks[i]]);
  4350. }
  4351. }
  4352. }
  4353. function emptyNodeAt (elm) {
  4354. return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
  4355. }
  4356. function createRmCb (childElm, listeners) {
  4357. function remove$$1 () {
  4358. if (--remove$$1.listeners === 0) {
  4359. removeNode(childElm);
  4360. }
  4361. }
  4362. remove$$1.listeners = listeners;
  4363. return remove$$1
  4364. }
  4365. function removeNode (el) {
  4366. var parent = nodeOps.parentNode(el);
  4367. // element may have already been removed due to v-html / v-text
  4368. if (isDef(parent)) {
  4369. nodeOps.removeChild(parent, el);
  4370. }
  4371. }
  4372. var inPre = 0;
  4373. function createElm (vnode, insertedVnodeQueue, parentElm, refElm, nested) {
  4374. vnode.isRootInsert = !nested; // for transition enter check
  4375. if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
  4376. return
  4377. }
  4378. var data = vnode.data;
  4379. var children = vnode.children;
  4380. var tag = vnode.tag;
  4381. if (isDef(tag)) {
  4382. {
  4383. if (data && data.pre) {
  4384. inPre++;
  4385. }
  4386. if (
  4387. !inPre &&
  4388. !vnode.ns &&
  4389. !(config.ignoredElements.length && config.ignoredElements.indexOf(tag) > -1) &&
  4390. config.isUnknownElement(tag)
  4391. ) {
  4392. warn(
  4393. 'Unknown custom element: <' + tag + '> - did you ' +
  4394. 'register the component correctly? For recursive components, ' +
  4395. 'make sure to provide the "name" option.',
  4396. vnode.context
  4397. );
  4398. }
  4399. }
  4400. vnode.elm = vnode.ns
  4401. ? nodeOps.createElementNS(vnode.ns, tag)
  4402. : nodeOps.createElement(tag, vnode);
  4403. setScope(vnode);
  4404. /* istanbul ignore if */
  4405. {
  4406. createChildren(vnode, children, insertedVnodeQueue);
  4407. if (isDef(data)) {
  4408. invokeCreateHooks(vnode, insertedVnodeQueue);
  4409. }
  4410. insert(parentElm, vnode.elm, refElm);
  4411. }
  4412. if ("development" !== 'production' && data && data.pre) {
  4413. inPre--;
  4414. }
  4415. } else if (isTrue(vnode.isComment)) {
  4416. vnode.elm = nodeOps.createComment(vnode.text);
  4417. insert(parentElm, vnode.elm, refElm);
  4418. } else {
  4419. vnode.elm = nodeOps.createTextNode(vnode.text);
  4420. insert(parentElm, vnode.elm, refElm);
  4421. }
  4422. }
  4423. function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
  4424. var i = vnode.data;
  4425. if (isDef(i)) {
  4426. var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
  4427. if (isDef(i = i.hook) && isDef(i = i.init)) {
  4428. i(vnode, false /* hydrating */, parentElm, refElm);
  4429. }
  4430. // after calling the init hook, if the vnode is a child component
  4431. // it should've created a child instance and mounted it. the child
  4432. // component also has set the placeholder vnode's elm.
  4433. // in that case we can just return the element and be done.
  4434. if (isDef(vnode.componentInstance)) {
  4435. initComponent(vnode, insertedVnodeQueue);
  4436. if (isTrue(isReactivated)) {
  4437. reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
  4438. }
  4439. return true
  4440. }
  4441. }
  4442. }
  4443. function initComponent (vnode, insertedVnodeQueue) {
  4444. if (isDef(vnode.data.pendingInsert)) {
  4445. insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
  4446. }
  4447. vnode.elm = vnode.componentInstance.$el;
  4448. if (isPatchable(vnode)) {
  4449. invokeCreateHooks(vnode, insertedVnodeQueue);
  4450. setScope(vnode);
  4451. } else {
  4452. // empty component root.
  4453. // skip all element-related modules except for ref (#3455)
  4454. registerRef(vnode);
  4455. // make sure to invoke the insert hook
  4456. insertedVnodeQueue.push(vnode);
  4457. }
  4458. }
  4459. function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
  4460. var i;
  4461. // hack for #4339: a reactivated component with inner transition
  4462. // does not trigger because the inner node's created hooks are not called
  4463. // again. It's not ideal to involve module-specific logic in here but
  4464. // there doesn't seem to be a better way to do it.
  4465. var innerNode = vnode;
  4466. while (innerNode.componentInstance) {
  4467. innerNode = innerNode.componentInstance._vnode;
  4468. if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
  4469. for (i = 0; i < cbs.activate.length; ++i) {
  4470. cbs.activate[i](emptyNode, innerNode);
  4471. }
  4472. insertedVnodeQueue.push(innerNode);
  4473. break
  4474. }
  4475. }
  4476. // unlike a newly created component,
  4477. // a reactivated keep-alive component doesn't insert itself
  4478. insert(parentElm, vnode.elm, refElm);
  4479. }
  4480. function insert (parent, elm, ref) {
  4481. if (isDef(parent)) {
  4482. if (isDef(ref)) {
  4483. if (ref.parentNode === parent) {
  4484. nodeOps.insertBefore(parent, elm, ref);
  4485. }
  4486. } else {
  4487. nodeOps.appendChild(parent, elm);
  4488. }
  4489. }
  4490. }
  4491. function createChildren (vnode, children, insertedVnodeQueue) {
  4492. if (Array.isArray(children)) {
  4493. for (var i = 0; i < children.length; ++i) {
  4494. createElm(children[i], insertedVnodeQueue, vnode.elm, null, true);
  4495. }
  4496. } else if (isPrimitive(vnode.text)) {
  4497. nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(vnode.text));
  4498. }
  4499. }
  4500. function isPatchable (vnode) {
  4501. while (vnode.componentInstance) {
  4502. vnode = vnode.componentInstance._vnode;
  4503. }
  4504. return isDef(vnode.tag)
  4505. }
  4506. function invokeCreateHooks (vnode, insertedVnodeQueue) {
  4507. for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
  4508. cbs.create[i$1](emptyNode, vnode);
  4509. }
  4510. i = vnode.data.hook; // Reuse variable
  4511. if (isDef(i)) {
  4512. if (isDef(i.create)) { i.create(emptyNode, vnode); }
  4513. if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); }
  4514. }
  4515. }
  4516. // set scope id attribute for scoped CSS.
  4517. // this is implemented as a special case to avoid the overhead
  4518. // of going through the normal attribute patching process.
  4519. function setScope (vnode) {
  4520. var i;
  4521. var ancestor = vnode;
  4522. while (ancestor) {
  4523. if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
  4524. nodeOps.setAttribute(vnode.elm, i, '');
  4525. }
  4526. ancestor = ancestor.parent;
  4527. }
  4528. // for slot content they should also get the scopeId from the host instance.
  4529. if (isDef(i = activeInstance) &&
  4530. i !== vnode.context &&
  4531. isDef(i = i.$options._scopeId)
  4532. ) {
  4533. nodeOps.setAttribute(vnode.elm, i, '');
  4534. }
  4535. }
  4536. function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
  4537. for (; startIdx <= endIdx; ++startIdx) {
  4538. createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm);
  4539. }
  4540. }
  4541. function invokeDestroyHook (vnode) {
  4542. var i, j;
  4543. var data = vnode.data;
  4544. if (isDef(data)) {
  4545. if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
  4546. for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
  4547. }
  4548. if (isDef(i = vnode.children)) {
  4549. for (j = 0; j < vnode.children.length; ++j) {
  4550. invokeDestroyHook(vnode.children[j]);
  4551. }
  4552. }
  4553. }
  4554. function removeVnodes (parentElm, vnodes, startIdx, endIdx) {
  4555. for (; startIdx <= endIdx; ++startIdx) {
  4556. var ch = vnodes[startIdx];
  4557. if (isDef(ch)) {
  4558. if (isDef(ch.tag)) {
  4559. removeAndInvokeRemoveHook(ch);
  4560. invokeDestroyHook(ch);
  4561. } else { // Text node
  4562. removeNode(ch.elm);
  4563. }
  4564. }
  4565. }
  4566. }
  4567. function removeAndInvokeRemoveHook (vnode, rm) {
  4568. if (isDef(rm) || isDef(vnode.data)) {
  4569. var i;
  4570. var listeners = cbs.remove.length + 1;
  4571. if (isDef(rm)) {
  4572. // we have a recursively passed down rm callback
  4573. // increase the listeners count
  4574. rm.listeners += listeners;
  4575. } else {
  4576. // directly removing
  4577. rm = createRmCb(vnode.elm, listeners);
  4578. }
  4579. // recursively invoke hooks on child component root node
  4580. if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
  4581. removeAndInvokeRemoveHook(i, rm);
  4582. }
  4583. for (i = 0; i < cbs.remove.length; ++i) {
  4584. cbs.remove[i](vnode, rm);
  4585. }
  4586. if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
  4587. i(vnode, rm);
  4588. } else {
  4589. rm();
  4590. }
  4591. } else {
  4592. removeNode(vnode.elm);
  4593. }
  4594. }
  4595. function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
  4596. var oldStartIdx = 0;
  4597. var newStartIdx = 0;
  4598. var oldEndIdx = oldCh.length - 1;
  4599. var oldStartVnode = oldCh[0];
  4600. var oldEndVnode = oldCh[oldEndIdx];
  4601. var newEndIdx = newCh.length - 1;
  4602. var newStartVnode = newCh[0];
  4603. var newEndVnode = newCh[newEndIdx];
  4604. var oldKeyToIdx, idxInOld, elmToMove, refElm;
  4605. // removeOnly is a special flag used only by <transition-group>
  4606. // to ensure removed elements stay in correct relative positions
  4607. // during leaving transitions
  4608. var canMove = !removeOnly;
  4609. while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
  4610. if (isUndef(oldStartVnode)) {
  4611. oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
  4612. } else if (isUndef(oldEndVnode)) {
  4613. oldEndVnode = oldCh[--oldEndIdx];
  4614. } else if (sameVnode(oldStartVnode, newStartVnode)) {
  4615. patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue);
  4616. oldStartVnode = oldCh[++oldStartIdx];
  4617. newStartVnode = newCh[++newStartIdx];
  4618. } else if (sameVnode(oldEndVnode, newEndVnode)) {
  4619. patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue);
  4620. oldEndVnode = oldCh[--oldEndIdx];
  4621. newEndVnode = newCh[--newEndIdx];
  4622. } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
  4623. patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue);
  4624. canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
  4625. oldStartVnode = oldCh[++oldStartIdx];
  4626. newEndVnode = newCh[--newEndIdx];
  4627. } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
  4628. patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue);
  4629. canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
  4630. oldEndVnode = oldCh[--oldEndIdx];
  4631. newStartVnode = newCh[++newStartIdx];
  4632. } else {
  4633. if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
  4634. idxInOld = isDef(newStartVnode.key) ? oldKeyToIdx[newStartVnode.key] : null;
  4635. if (isUndef(idxInOld)) { // New element
  4636. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);
  4637. newStartVnode = newCh[++newStartIdx];
  4638. } else {
  4639. elmToMove = oldCh[idxInOld];
  4640. /* istanbul ignore if */
  4641. if ("development" !== 'production' && !elmToMove) {
  4642. warn(
  4643. 'It seems there are duplicate keys that is causing an update error. ' +
  4644. 'Make sure each v-for item has a unique key.'
  4645. );
  4646. }
  4647. if (sameVnode(elmToMove, newStartVnode)) {
  4648. patchVnode(elmToMove, newStartVnode, insertedVnodeQueue);
  4649. oldCh[idxInOld] = undefined;
  4650. canMove && nodeOps.insertBefore(parentElm, newStartVnode.elm, oldStartVnode.elm);
  4651. newStartVnode = newCh[++newStartIdx];
  4652. } else {
  4653. // same key but different element. treat as new element
  4654. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);
  4655. newStartVnode = newCh[++newStartIdx];
  4656. }
  4657. }
  4658. }
  4659. }
  4660. if (oldStartIdx > oldEndIdx) {
  4661. refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
  4662. addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
  4663. } else if (newStartIdx > newEndIdx) {
  4664. removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
  4665. }
  4666. }
  4667. function patchVnode (oldVnode, vnode, insertedVnodeQueue, removeOnly) {
  4668. if (oldVnode === vnode) {
  4669. return
  4670. }
  4671. // reuse element for static trees.
  4672. // note we only do this if the vnode is cloned -
  4673. // if the new node is not cloned it means the render functions have been
  4674. // reset by the hot-reload-api and we need to do a proper re-render.
  4675. if (isTrue(vnode.isStatic) &&
  4676. isTrue(oldVnode.isStatic) &&
  4677. vnode.key === oldVnode.key &&
  4678. (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))
  4679. ) {
  4680. vnode.elm = oldVnode.elm;
  4681. vnode.componentInstance = oldVnode.componentInstance;
  4682. return
  4683. }
  4684. var i;
  4685. var data = vnode.data;
  4686. if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {
  4687. i(oldVnode, vnode);
  4688. }
  4689. var elm = vnode.elm = oldVnode.elm;
  4690. var oldCh = oldVnode.children;
  4691. var ch = vnode.children;
  4692. if (isDef(data) && isPatchable(vnode)) {
  4693. for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
  4694. if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
  4695. }
  4696. if (isUndef(vnode.text)) {
  4697. if (isDef(oldCh) && isDef(ch)) {
  4698. if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
  4699. } else if (isDef(ch)) {
  4700. if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
  4701. addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
  4702. } else if (isDef(oldCh)) {
  4703. removeVnodes(elm, oldCh, 0, oldCh.length - 1);
  4704. } else if (isDef(oldVnode.text)) {
  4705. nodeOps.setTextContent(elm, '');
  4706. }
  4707. } else if (oldVnode.text !== vnode.text) {
  4708. nodeOps.setTextContent(elm, vnode.text);
  4709. }
  4710. if (isDef(data)) {
  4711. if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
  4712. }
  4713. }
  4714. function invokeInsertHook (vnode, queue, initial) {
  4715. // delay insert hooks for component root nodes, invoke them after the
  4716. // element is really inserted
  4717. if (isTrue(initial) && isDef(vnode.parent)) {
  4718. vnode.parent.data.pendingInsert = queue;
  4719. } else {
  4720. for (var i = 0; i < queue.length; ++i) {
  4721. queue[i].data.hook.insert(queue[i]);
  4722. }
  4723. }
  4724. }
  4725. var bailed = false;
  4726. // list of modules that can skip create hook during hydration because they
  4727. // are already rendered on the client or has no need for initialization
  4728. var isRenderedModule = makeMap('attrs,style,class,staticClass,staticStyle,key');
  4729. // Note: this is a browser-only function so we can assume elms are DOM nodes.
  4730. function hydrate (elm, vnode, insertedVnodeQueue) {
  4731. {
  4732. if (!assertNodeMatch(elm, vnode)) {
  4733. return false
  4734. }
  4735. }
  4736. vnode.elm = elm;
  4737. var tag = vnode.tag;
  4738. var data = vnode.data;
  4739. var children = vnode.children;
  4740. if (isDef(data)) {
  4741. if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
  4742. if (isDef(i = vnode.componentInstance)) {
  4743. // child component. it should have hydrated its own tree.
  4744. initComponent(vnode, insertedVnodeQueue);
  4745. return true
  4746. }
  4747. }
  4748. if (isDef(tag)) {
  4749. if (isDef(children)) {
  4750. // empty element, allow client to pick up and populate children
  4751. if (!elm.hasChildNodes()) {
  4752. createChildren(vnode, children, insertedVnodeQueue);
  4753. } else {
  4754. var childrenMatch = true;
  4755. var childNode = elm.firstChild;
  4756. for (var i$1 = 0; i$1 < children.length; i$1++) {
  4757. if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue)) {
  4758. childrenMatch = false;
  4759. break
  4760. }
  4761. childNode = childNode.nextSibling;
  4762. }
  4763. // if childNode is not null, it means the actual childNodes list is
  4764. // longer than the virtual children list.
  4765. if (!childrenMatch || childNode) {
  4766. if ("development" !== 'production' &&
  4767. typeof console !== 'undefined' &&
  4768. !bailed
  4769. ) {
  4770. bailed = true;
  4771. console.warn('Parent: ', elm);
  4772. console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
  4773. }
  4774. return false
  4775. }
  4776. }
  4777. }
  4778. if (isDef(data)) {
  4779. for (var key in data) {
  4780. if (!isRenderedModule(key)) {
  4781. invokeCreateHooks(vnode, insertedVnodeQueue);
  4782. break
  4783. }
  4784. }
  4785. }
  4786. } else if (elm.data !== vnode.text) {
  4787. elm.data = vnode.text;
  4788. }
  4789. return true
  4790. }
  4791. function assertNodeMatch (node, vnode) {
  4792. if (isDef(vnode.tag)) {
  4793. return (
  4794. vnode.tag.indexOf('vue-component') === 0 ||
  4795. vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
  4796. )
  4797. } else {
  4798. return node.nodeType === (vnode.isComment ? 8 : 3)
  4799. }
  4800. }
  4801. return function patch (oldVnode, vnode, hydrating, removeOnly, parentElm, refElm) {
  4802. if (isUndef(vnode)) {
  4803. if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); }
  4804. return
  4805. }
  4806. var isInitialPatch = false;
  4807. var insertedVnodeQueue = [];
  4808. if (isUndef(oldVnode)) {
  4809. // empty mount (likely as component), create new root element
  4810. isInitialPatch = true;
  4811. createElm(vnode, insertedVnodeQueue, parentElm, refElm);
  4812. } else {
  4813. var isRealElement = isDef(oldVnode.nodeType);
  4814. if (!isRealElement && sameVnode(oldVnode, vnode)) {
  4815. // patch existing root node
  4816. patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly);
  4817. } else {
  4818. if (isRealElement) {
  4819. // mounting to a real element
  4820. // check if this is server-rendered content and if we can perform
  4821. // a successful hydration.
  4822. if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
  4823. oldVnode.removeAttribute(SSR_ATTR);
  4824. hydrating = true;
  4825. }
  4826. if (isTrue(hydrating)) {
  4827. if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
  4828. invokeInsertHook(vnode, insertedVnodeQueue, true);
  4829. return oldVnode
  4830. } else {
  4831. warn(
  4832. 'The client-side rendered virtual DOM tree is not matching ' +
  4833. 'server-rendered content. This is likely caused by incorrect ' +
  4834. 'HTML markup, for example nesting block-level elements inside ' +
  4835. '<p>, or missing <tbody>. Bailing hydration and performing ' +
  4836. 'full client-side render.'
  4837. );
  4838. }
  4839. }
  4840. // either not server-rendered, or hydration failed.
  4841. // create an empty node and replace it
  4842. oldVnode = emptyNodeAt(oldVnode);
  4843. }
  4844. // replacing existing element
  4845. var oldElm = oldVnode.elm;
  4846. var parentElm$1 = nodeOps.parentNode(oldElm);
  4847. createElm(
  4848. vnode,
  4849. insertedVnodeQueue,
  4850. // extremely rare edge case: do not insert if old element is in a
  4851. // leaving transition. Only happens when combining transition +
  4852. // keep-alive + HOCs. (#4590)
  4853. oldElm._leaveCb ? null : parentElm$1,
  4854. nodeOps.nextSibling(oldElm)
  4855. );
  4856. if (isDef(vnode.parent)) {
  4857. // component root element replaced.
  4858. // update parent placeholder node element, recursively
  4859. var ancestor = vnode.parent;
  4860. while (ancestor) {
  4861. ancestor.elm = vnode.elm;
  4862. ancestor = ancestor.parent;
  4863. }
  4864. if (isPatchable(vnode)) {
  4865. for (var i = 0; i < cbs.create.length; ++i) {
  4866. cbs.create[i](emptyNode, vnode.parent);
  4867. }
  4868. }
  4869. }
  4870. if (isDef(parentElm$1)) {
  4871. removeVnodes(parentElm$1, [oldVnode], 0, 0);
  4872. } else if (isDef(oldVnode.tag)) {
  4873. invokeDestroyHook(oldVnode);
  4874. }
  4875. }
  4876. }
  4877. invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
  4878. return vnode.elm
  4879. }
  4880. }
  4881. /* */
  4882. var directives = {
  4883. create: updateDirectives,
  4884. update: updateDirectives,
  4885. destroy: function unbindDirectives (vnode) {
  4886. updateDirectives(vnode, emptyNode);
  4887. }
  4888. };
  4889. function updateDirectives (oldVnode, vnode) {
  4890. if (oldVnode.data.directives || vnode.data.directives) {
  4891. _update(oldVnode, vnode);
  4892. }
  4893. }
  4894. function _update (oldVnode, vnode) {
  4895. var isCreate = oldVnode === emptyNode;
  4896. var isDestroy = vnode === emptyNode;
  4897. var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
  4898. var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
  4899. var dirsWithInsert = [];
  4900. var dirsWithPostpatch = [];
  4901. var key, oldDir, dir;
  4902. for (key in newDirs) {
  4903. oldDir = oldDirs[key];
  4904. dir = newDirs[key];
  4905. if (!oldDir) {
  4906. // new directive, bind
  4907. callHook$1(dir, 'bind', vnode, oldVnode);
  4908. if (dir.def && dir.def.inserted) {
  4909. dirsWithInsert.push(dir);
  4910. }
  4911. } else {
  4912. // existing directive, update
  4913. dir.oldValue = oldDir.value;
  4914. callHook$1(dir, 'update', vnode, oldVnode);
  4915. if (dir.def && dir.def.componentUpdated) {
  4916. dirsWithPostpatch.push(dir);
  4917. }
  4918. }
  4919. }
  4920. if (dirsWithInsert.length) {
  4921. var callInsert = function () {
  4922. for (var i = 0; i < dirsWithInsert.length; i++) {
  4923. callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
  4924. }
  4925. };
  4926. if (isCreate) {
  4927. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', callInsert);
  4928. } else {
  4929. callInsert();
  4930. }
  4931. }
  4932. if (dirsWithPostpatch.length) {
  4933. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'postpatch', function () {
  4934. for (var i = 0; i < dirsWithPostpatch.length; i++) {
  4935. callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
  4936. }
  4937. });
  4938. }
  4939. if (!isCreate) {
  4940. for (key in oldDirs) {
  4941. if (!newDirs[key]) {
  4942. // no longer present, unbind
  4943. callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
  4944. }
  4945. }
  4946. }
  4947. }
  4948. var emptyModifiers = Object.create(null);
  4949. function normalizeDirectives$1 (
  4950. dirs,
  4951. vm
  4952. ) {
  4953. var res = Object.create(null);
  4954. if (!dirs) {
  4955. return res
  4956. }
  4957. var i, dir;
  4958. for (i = 0; i < dirs.length; i++) {
  4959. dir = dirs[i];
  4960. if (!dir.modifiers) {
  4961. dir.modifiers = emptyModifiers;
  4962. }
  4963. res[getRawDirName(dir)] = dir;
  4964. dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
  4965. }
  4966. return res
  4967. }
  4968. function getRawDirName (dir) {
  4969. return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
  4970. }
  4971. function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {
  4972. var fn = dir.def && dir.def[hook];
  4973. if (fn) {
  4974. try {
  4975. fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
  4976. } catch (e) {
  4977. handleError(e, vnode.context, ("directive " + (dir.name) + " " + hook + " hook"));
  4978. }
  4979. }
  4980. }
  4981. var baseModules = [
  4982. ref,
  4983. directives
  4984. ];
  4985. /* */
  4986. function updateAttrs (oldVnode, vnode) {
  4987. if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
  4988. return
  4989. }
  4990. var key, cur, old;
  4991. var elm = vnode.elm;
  4992. var oldAttrs = oldVnode.data.attrs || {};
  4993. var attrs = vnode.data.attrs || {};
  4994. // clone observed objects, as the user probably wants to mutate it
  4995. if (isDef(attrs.__ob__)) {
  4996. attrs = vnode.data.attrs = extend({}, attrs);
  4997. }
  4998. for (key in attrs) {
  4999. cur = attrs[key];
  5000. old = oldAttrs[key];
  5001. if (old !== cur) {
  5002. setAttr(elm, key, cur);
  5003. }
  5004. }
  5005. // #4391: in IE9, settings type can reset value for input[type=radio]
  5006. /* istanbul ignore if */
  5007. if (isIE9 && attrs.value !== oldAttrs.value) {
  5008. setAttr(elm, 'value', attrs.value);
  5009. }
  5010. for (key in oldAttrs) {
  5011. if (isUndef(attrs[key])) {
  5012. if (isXlink(key)) {
  5013. elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
  5014. } else if (!isEnumeratedAttr(key)) {
  5015. elm.removeAttribute(key);
  5016. }
  5017. }
  5018. }
  5019. }
  5020. function setAttr (el, key, value) {
  5021. if (isBooleanAttr(key)) {
  5022. // set attribute for blank value
  5023. // e.g. <option disabled>Select one</option>
  5024. if (isFalsyAttrValue(value)) {
  5025. el.removeAttribute(key);
  5026. } else {
  5027. el.setAttribute(key, key);
  5028. }
  5029. } else if (isEnumeratedAttr(key)) {
  5030. el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true');
  5031. } else if (isXlink(key)) {
  5032. if (isFalsyAttrValue(value)) {
  5033. el.removeAttributeNS(xlinkNS, getXlinkProp(key));
  5034. } else {
  5035. el.setAttributeNS(xlinkNS, key, value);
  5036. }
  5037. } else {
  5038. if (isFalsyAttrValue(value)) {
  5039. el.removeAttribute(key);
  5040. } else {
  5041. el.setAttribute(key, value);
  5042. }
  5043. }
  5044. }
  5045. var attrs = {
  5046. create: updateAttrs,
  5047. update: updateAttrs
  5048. };
  5049. /* */
  5050. function updateClass (oldVnode, vnode) {
  5051. var el = vnode.elm;
  5052. var data = vnode.data;
  5053. var oldData = oldVnode.data;
  5054. if (
  5055. isUndef(data.staticClass) &&
  5056. isUndef(data.class) && (
  5057. isUndef(oldData) || (
  5058. isUndef(oldData.staticClass) &&
  5059. isUndef(oldData.class)
  5060. )
  5061. )
  5062. ) {
  5063. return
  5064. }
  5065. var cls = genClassForVnode(vnode);
  5066. // handle transition classes
  5067. var transitionClass = el._transitionClasses;
  5068. if (isDef(transitionClass)) {
  5069. cls = concat(cls, stringifyClass(transitionClass));
  5070. }
  5071. // set the class
  5072. if (cls !== el._prevClass) {
  5073. el.setAttribute('class', cls);
  5074. el._prevClass = cls;
  5075. }
  5076. }
  5077. var klass = {
  5078. create: updateClass,
  5079. update: updateClass
  5080. };
  5081. /* */
  5082. var validDivisionCharRE = /[\w).+\-_$\]]/;
  5083. function parseFilters (exp) {
  5084. var inSingle = false;
  5085. var inDouble = false;
  5086. var inTemplateString = false;
  5087. var inRegex = false;
  5088. var curly = 0;
  5089. var square = 0;
  5090. var paren = 0;
  5091. var lastFilterIndex = 0;
  5092. var c, prev, i, expression, filters;
  5093. for (i = 0; i < exp.length; i++) {
  5094. prev = c;
  5095. c = exp.charCodeAt(i);
  5096. if (inSingle) {
  5097. if (c === 0x27 && prev !== 0x5C) { inSingle = false; }
  5098. } else if (inDouble) {
  5099. if (c === 0x22 && prev !== 0x5C) { inDouble = false; }
  5100. } else if (inTemplateString) {
  5101. if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }
  5102. } else if (inRegex) {
  5103. if (c === 0x2f && prev !== 0x5C) { inRegex = false; }
  5104. } else if (
  5105. c === 0x7C && // pipe
  5106. exp.charCodeAt(i + 1) !== 0x7C &&
  5107. exp.charCodeAt(i - 1) !== 0x7C &&
  5108. !curly && !square && !paren
  5109. ) {
  5110. if (expression === undefined) {
  5111. // first filter, end of expression
  5112. lastFilterIndex = i + 1;
  5113. expression = exp.slice(0, i).trim();
  5114. } else {
  5115. pushFilter();
  5116. }
  5117. } else {
  5118. switch (c) {
  5119. case 0x22: inDouble = true; break // "
  5120. case 0x27: inSingle = true; break // '
  5121. case 0x60: inTemplateString = true; break // `
  5122. case 0x28: paren++; break // (
  5123. case 0x29: paren--; break // )
  5124. case 0x5B: square++; break // [
  5125. case 0x5D: square--; break // ]
  5126. case 0x7B: curly++; break // {
  5127. case 0x7D: curly--; break // }
  5128. }
  5129. if (c === 0x2f) { // /
  5130. var j = i - 1;
  5131. var p = (void 0);
  5132. // find first non-whitespace prev char
  5133. for (; j >= 0; j--) {
  5134. p = exp.charAt(j);
  5135. if (p !== ' ') { break }
  5136. }
  5137. if (!p || !validDivisionCharRE.test(p)) {
  5138. inRegex = true;
  5139. }
  5140. }
  5141. }
  5142. }
  5143. if (expression === undefined) {
  5144. expression = exp.slice(0, i).trim();
  5145. } else if (lastFilterIndex !== 0) {
  5146. pushFilter();
  5147. }
  5148. function pushFilter () {
  5149. (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
  5150. lastFilterIndex = i + 1;
  5151. }
  5152. if (filters) {
  5153. for (i = 0; i < filters.length; i++) {
  5154. expression = wrapFilter(expression, filters[i]);
  5155. }
  5156. }
  5157. return expression
  5158. }
  5159. function wrapFilter (exp, filter) {
  5160. var i = filter.indexOf('(');
  5161. if (i < 0) {
  5162. // _f: resolveFilter
  5163. return ("_f(\"" + filter + "\")(" + exp + ")")
  5164. } else {
  5165. var name = filter.slice(0, i);
  5166. var args = filter.slice(i + 1);
  5167. return ("_f(\"" + name + "\")(" + exp + "," + args)
  5168. }
  5169. }
  5170. /* */
  5171. function baseWarn (msg) {
  5172. console.error(("[Vue compiler]: " + msg));
  5173. }
  5174. function pluckModuleFunction (
  5175. modules,
  5176. key
  5177. ) {
  5178. return modules
  5179. ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })
  5180. : []
  5181. }
  5182. function addProp (el, name, value) {
  5183. (el.props || (el.props = [])).push({ name: name, value: value });
  5184. }
  5185. function addAttr (el, name, value) {
  5186. (el.attrs || (el.attrs = [])).push({ name: name, value: value });
  5187. }
  5188. function addDirective (
  5189. el,
  5190. name,
  5191. rawName,
  5192. value,
  5193. arg,
  5194. modifiers
  5195. ) {
  5196. (el.directives || (el.directives = [])).push({ name: name, rawName: rawName, value: value, arg: arg, modifiers: modifiers });
  5197. }
  5198. function addHandler (
  5199. el,
  5200. name,
  5201. value,
  5202. modifiers,
  5203. important,
  5204. warn
  5205. ) {
  5206. // warn prevent and passive modifier
  5207. /* istanbul ignore if */
  5208. if (
  5209. "development" !== 'production' && warn &&
  5210. modifiers && modifiers.prevent && modifiers.passive
  5211. ) {
  5212. warn(
  5213. 'passive and prevent can\'t be used together. ' +
  5214. 'Passive handler can\'t prevent default event.'
  5215. );
  5216. }
  5217. // check capture modifier
  5218. if (modifiers && modifiers.capture) {
  5219. delete modifiers.capture;
  5220. name = '!' + name; // mark the event as captured
  5221. }
  5222. if (modifiers && modifiers.once) {
  5223. delete modifiers.once;
  5224. name = '~' + name; // mark the event as once
  5225. }
  5226. /* istanbul ignore if */
  5227. if (modifiers && modifiers.passive) {
  5228. delete modifiers.passive;
  5229. name = '&' + name; // mark the event as passive
  5230. }
  5231. var events;
  5232. if (modifiers && modifiers.native) {
  5233. delete modifiers.native;
  5234. events = el.nativeEvents || (el.nativeEvents = {});
  5235. } else {
  5236. events = el.events || (el.events = {});
  5237. }
  5238. var newHandler = { value: value, modifiers: modifiers };
  5239. var handlers = events[name];
  5240. /* istanbul ignore if */
  5241. if (Array.isArray(handlers)) {
  5242. important ? handlers.unshift(newHandler) : handlers.push(newHandler);
  5243. } else if (handlers) {
  5244. events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
  5245. } else {
  5246. events[name] = newHandler;
  5247. }
  5248. }
  5249. function getBindingAttr (
  5250. el,
  5251. name,
  5252. getStatic
  5253. ) {
  5254. var dynamicValue =
  5255. getAndRemoveAttr(el, ':' + name) ||
  5256. getAndRemoveAttr(el, 'v-bind:' + name);
  5257. if (dynamicValue != null) {
  5258. return parseFilters(dynamicValue)
  5259. } else if (getStatic !== false) {
  5260. var staticValue = getAndRemoveAttr(el, name);
  5261. if (staticValue != null) {
  5262. return JSON.stringify(staticValue)
  5263. }
  5264. }
  5265. }
  5266. function getAndRemoveAttr (el, name) {
  5267. var val;
  5268. if ((val = el.attrsMap[name]) != null) {
  5269. var list = el.attrsList;
  5270. for (var i = 0, l = list.length; i < l; i++) {
  5271. if (list[i].name === name) {
  5272. list.splice(i, 1);
  5273. break
  5274. }
  5275. }
  5276. }
  5277. return val
  5278. }
  5279. /* */
  5280. /**
  5281. * Cross-platform code generation for component v-model
  5282. */
  5283. function genComponentModel (
  5284. el,
  5285. value,
  5286. modifiers
  5287. ) {
  5288. var ref = modifiers || {};
  5289. var number = ref.number;
  5290. var trim = ref.trim;
  5291. var baseValueExpression = '$$v';
  5292. var valueExpression = baseValueExpression;
  5293. if (trim) {
  5294. valueExpression =
  5295. "(typeof " + baseValueExpression + " === 'string'" +
  5296. "? " + baseValueExpression + ".trim()" +
  5297. ": " + baseValueExpression + ")";
  5298. }
  5299. if (number) {
  5300. valueExpression = "_n(" + valueExpression + ")";
  5301. }
  5302. var assignment = genAssignmentCode(value, valueExpression);
  5303. el.model = {
  5304. value: ("(" + value + ")"),
  5305. expression: ("\"" + value + "\""),
  5306. callback: ("function (" + baseValueExpression + ") {" + assignment + "}")
  5307. };
  5308. }
  5309. /**
  5310. * Cross-platform codegen helper for generating v-model value assignment code.
  5311. */
  5312. function genAssignmentCode (
  5313. value,
  5314. assignment
  5315. ) {
  5316. var modelRs = parseModel(value);
  5317. if (modelRs.idx === null) {
  5318. return (value + "=" + assignment)
  5319. } else {
  5320. return "var $$exp = " + (modelRs.exp) + ", $$idx = " + (modelRs.idx) + ";" +
  5321. "if (!Array.isArray($$exp)){" +
  5322. value + "=" + assignment + "}" +
  5323. "else{$$exp.splice($$idx, 1, " + assignment + ")}"
  5324. }
  5325. }
  5326. /**
  5327. * parse directive model to do the array update transform. a[idx] = val => $$a.splice($$idx, 1, val)
  5328. *
  5329. * for loop possible cases:
  5330. *
  5331. * - test
  5332. * - test[idx]
  5333. * - test[test1[idx]]
  5334. * - test["a"][idx]
  5335. * - xxx.test[a[a].test1[idx]]
  5336. * - test.xxx.a["asa"][test1[idx]]
  5337. *
  5338. */
  5339. var len;
  5340. var str;
  5341. var chr;
  5342. var index$1;
  5343. var expressionPos;
  5344. var expressionEndPos;
  5345. function parseModel (val) {
  5346. str = val;
  5347. len = str.length;
  5348. index$1 = expressionPos = expressionEndPos = 0;
  5349. if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
  5350. return {
  5351. exp: val,
  5352. idx: null
  5353. }
  5354. }
  5355. while (!eof()) {
  5356. chr = next();
  5357. /* istanbul ignore if */
  5358. if (isStringStart(chr)) {
  5359. parseString(chr);
  5360. } else if (chr === 0x5B) {
  5361. parseBracket(chr);
  5362. }
  5363. }
  5364. return {
  5365. exp: val.substring(0, expressionPos),
  5366. idx: val.substring(expressionPos + 1, expressionEndPos)
  5367. }
  5368. }
  5369. function next () {
  5370. return str.charCodeAt(++index$1)
  5371. }
  5372. function eof () {
  5373. return index$1 >= len
  5374. }
  5375. function isStringStart (chr) {
  5376. return chr === 0x22 || chr === 0x27
  5377. }
  5378. function parseBracket (chr) {
  5379. var inBracket = 1;
  5380. expressionPos = index$1;
  5381. while (!eof()) {
  5382. chr = next();
  5383. if (isStringStart(chr)) {
  5384. parseString(chr);
  5385. continue
  5386. }
  5387. if (chr === 0x5B) { inBracket++; }
  5388. if (chr === 0x5D) { inBracket--; }
  5389. if (inBracket === 0) {
  5390. expressionEndPos = index$1;
  5391. break
  5392. }
  5393. }
  5394. }
  5395. function parseString (chr) {
  5396. var stringQuote = chr;
  5397. while (!eof()) {
  5398. chr = next();
  5399. if (chr === stringQuote) {
  5400. break
  5401. }
  5402. }
  5403. }
  5404. /* */
  5405. var warn$1;
  5406. // in some cases, the event used has to be determined at runtime
  5407. // so we used some reserved tokens during compile.
  5408. var RANGE_TOKEN = '__r';
  5409. var CHECKBOX_RADIO_TOKEN = '__c';
  5410. function model (
  5411. el,
  5412. dir,
  5413. _warn
  5414. ) {
  5415. warn$1 = _warn;
  5416. var value = dir.value;
  5417. var modifiers = dir.modifiers;
  5418. var tag = el.tag;
  5419. var type = el.attrsMap.type;
  5420. {
  5421. var dynamicType = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
  5422. if (tag === 'input' && dynamicType) {
  5423. warn$1(
  5424. "<input :type=\"" + dynamicType + "\" v-model=\"" + value + "\">:\n" +
  5425. "v-model does not support dynamic input types. Use v-if branches instead."
  5426. );
  5427. }
  5428. // inputs with type="file" are read only and settings the input's
  5429. // value will throw an error.
  5430. if (tag === 'input' && type === 'file') {
  5431. warn$1(
  5432. "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" +
  5433. "File inputs are read only. Use a v-on:change listener instead."
  5434. );
  5435. }
  5436. }
  5437. if (tag === 'select') {
  5438. genSelect(el, value, modifiers);
  5439. } else if (tag === 'input' && type === 'checkbox') {
  5440. genCheckboxModel(el, value, modifiers);
  5441. } else if (tag === 'input' && type === 'radio') {
  5442. genRadioModel(el, value, modifiers);
  5443. } else if (tag === 'input' || tag === 'textarea') {
  5444. genDefaultModel(el, value, modifiers);
  5445. } else if (!config.isReservedTag(tag)) {
  5446. genComponentModel(el, value, modifiers);
  5447. // component v-model doesn't need extra runtime
  5448. return false
  5449. } else {
  5450. warn$1(
  5451. "<" + (el.tag) + " v-model=\"" + value + "\">: " +
  5452. "v-model is not supported on this element type. " +
  5453. 'If you are working with contenteditable, it\'s recommended to ' +
  5454. 'wrap a library dedicated for that purpose inside a custom component.'
  5455. );
  5456. }
  5457. // ensure runtime directive metadata
  5458. return true
  5459. }
  5460. function genCheckboxModel (
  5461. el,
  5462. value,
  5463. modifiers
  5464. ) {
  5465. var number = modifiers && modifiers.number;
  5466. var valueBinding = getBindingAttr(el, 'value') || 'null';
  5467. var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
  5468. var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
  5469. addProp(el, 'checked',
  5470. "Array.isArray(" + value + ")" +
  5471. "?_i(" + value + "," + valueBinding + ")>-1" + (
  5472. trueValueBinding === 'true'
  5473. ? (":(" + value + ")")
  5474. : (":_q(" + value + "," + trueValueBinding + ")")
  5475. )
  5476. );
  5477. addHandler(el, CHECKBOX_RADIO_TOKEN,
  5478. "var $$a=" + value + "," +
  5479. '$$el=$event.target,' +
  5480. "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" +
  5481. 'if(Array.isArray($$a)){' +
  5482. "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," +
  5483. '$$i=_i($$a,$$v);' +
  5484. "if($$c){$$i<0&&(" + value + "=$$a.concat($$v))}" +
  5485. "else{$$i>-1&&(" + value + "=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}" +
  5486. "}else{" + (genAssignmentCode(value, '$$c')) + "}",
  5487. null, true
  5488. );
  5489. }
  5490. function genRadioModel (
  5491. el,
  5492. value,
  5493. modifiers
  5494. ) {
  5495. var number = modifiers && modifiers.number;
  5496. var valueBinding = getBindingAttr(el, 'value') || 'null';
  5497. valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding;
  5498. addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")"));
  5499. addHandler(el, CHECKBOX_RADIO_TOKEN, genAssignmentCode(value, valueBinding), null, true);
  5500. }
  5501. function genSelect (
  5502. el,
  5503. value,
  5504. modifiers
  5505. ) {
  5506. var number = modifiers && modifiers.number;
  5507. var selectedVal = "Array.prototype.filter" +
  5508. ".call($event.target.options,function(o){return o.selected})" +
  5509. ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" +
  5510. "return " + (number ? '_n(val)' : 'val') + "})";
  5511. var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]';
  5512. var code = "var $$selectedVal = " + selectedVal + ";";
  5513. code = code + " " + (genAssignmentCode(value, assignment));
  5514. addHandler(el, 'change', code, null, true);
  5515. }
  5516. function genDefaultModel (
  5517. el,
  5518. value,
  5519. modifiers
  5520. ) {
  5521. var type = el.attrsMap.type;
  5522. var ref = modifiers || {};
  5523. var lazy = ref.lazy;
  5524. var number = ref.number;
  5525. var trim = ref.trim;
  5526. var needCompositionGuard = !lazy && type !== 'range';
  5527. var event = lazy
  5528. ? 'change'
  5529. : type === 'range'
  5530. ? RANGE_TOKEN
  5531. : 'input';
  5532. var valueExpression = '$event.target.value';
  5533. if (trim) {
  5534. valueExpression = "$event.target.value.trim()";
  5535. }
  5536. if (number) {
  5537. valueExpression = "_n(" + valueExpression + ")";
  5538. }
  5539. var code = genAssignmentCode(value, valueExpression);
  5540. if (needCompositionGuard) {
  5541. code = "if($event.target.composing)return;" + code;
  5542. }
  5543. addProp(el, 'value', ("(" + value + ")"));
  5544. addHandler(el, event, code, null, true);
  5545. if (trim || number || type === 'number') {
  5546. addHandler(el, 'blur', '$forceUpdate()');
  5547. }
  5548. }
  5549. /* */
  5550. // normalize v-model event tokens that can only be determined at runtime.
  5551. // it's important to place the event as the first in the array because
  5552. // the whole point is ensuring the v-model callback gets called before
  5553. // user-attached handlers.
  5554. function normalizeEvents (on) {
  5555. var event;
  5556. /* istanbul ignore if */
  5557. if (isDef(on[RANGE_TOKEN])) {
  5558. // IE input[type=range] only supports `change` event
  5559. event = isIE ? 'change' : 'input';
  5560. on[event] = [].concat(on[RANGE_TOKEN], on[event] || []);
  5561. delete on[RANGE_TOKEN];
  5562. }
  5563. if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
  5564. // Chrome fires microtasks in between click/change, leads to #4521
  5565. event = isChrome ? 'click' : 'change';
  5566. on[event] = [].concat(on[CHECKBOX_RADIO_TOKEN], on[event] || []);
  5567. delete on[CHECKBOX_RADIO_TOKEN];
  5568. }
  5569. }
  5570. var target$1;
  5571. function add$1 (
  5572. event,
  5573. handler,
  5574. once$$1,
  5575. capture,
  5576. passive
  5577. ) {
  5578. if (once$$1) {
  5579. var oldHandler = handler;
  5580. var _target = target$1; // save current target element in closure
  5581. handler = function (ev) {
  5582. var res = arguments.length === 1
  5583. ? oldHandler(ev)
  5584. : oldHandler.apply(null, arguments);
  5585. if (res !== null) {
  5586. remove$2(event, handler, capture, _target);
  5587. }
  5588. };
  5589. }
  5590. target$1.addEventListener(
  5591. event,
  5592. handler,
  5593. supportsPassive
  5594. ? { capture: capture, passive: passive }
  5595. : capture
  5596. );
  5597. }
  5598. function remove$2 (
  5599. event,
  5600. handler,
  5601. capture,
  5602. _target
  5603. ) {
  5604. (_target || target$1).removeEventListener(event, handler, capture);
  5605. }
  5606. function updateDOMListeners (oldVnode, vnode) {
  5607. if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
  5608. return
  5609. }
  5610. var on = vnode.data.on || {};
  5611. var oldOn = oldVnode.data.on || {};
  5612. target$1 = vnode.elm;
  5613. normalizeEvents(on);
  5614. updateListeners(on, oldOn, add$1, remove$2, vnode.context);
  5615. }
  5616. var events = {
  5617. create: updateDOMListeners,
  5618. update: updateDOMListeners
  5619. };
  5620. /* */
  5621. function updateDOMProps (oldVnode, vnode) {
  5622. if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
  5623. return
  5624. }
  5625. var key, cur;
  5626. var elm = vnode.elm;
  5627. var oldProps = oldVnode.data.domProps || {};
  5628. var props = vnode.data.domProps || {};
  5629. // clone observed objects, as the user probably wants to mutate it
  5630. if (isDef(props.__ob__)) {
  5631. props = vnode.data.domProps = extend({}, props);
  5632. }
  5633. for (key in oldProps) {
  5634. if (isUndef(props[key])) {
  5635. elm[key] = '';
  5636. }
  5637. }
  5638. for (key in props) {
  5639. cur = props[key];
  5640. // ignore children if the node has textContent or innerHTML,
  5641. // as these will throw away existing DOM nodes and cause removal errors
  5642. // on subsequent patches (#3360)
  5643. if (key === 'textContent' || key === 'innerHTML') {
  5644. if (vnode.children) { vnode.children.length = 0; }
  5645. if (cur === oldProps[key]) { continue }
  5646. }
  5647. if (key === 'value') {
  5648. // store value as _value as well since
  5649. // non-string values will be stringified
  5650. elm._value = cur;
  5651. // avoid resetting cursor position when value is the same
  5652. var strCur = isUndef(cur) ? '' : String(cur);
  5653. if (shouldUpdateValue(elm, vnode, strCur)) {
  5654. elm.value = strCur;
  5655. }
  5656. } else {
  5657. elm[key] = cur;
  5658. }
  5659. }
  5660. }
  5661. // check platforms/web/util/attrs.js acceptValue
  5662. function shouldUpdateValue (
  5663. elm,
  5664. vnode,
  5665. checkVal
  5666. ) {
  5667. return (!elm.composing && (
  5668. vnode.tag === 'option' ||
  5669. isDirty(elm, checkVal) ||
  5670. isInputChanged(elm, checkVal)
  5671. ))
  5672. }
  5673. function isDirty (elm, checkVal) {
  5674. // return true when textbox (.number and .trim) loses focus and its value is not equal to the updated value
  5675. return document.activeElement !== elm && elm.value !== checkVal
  5676. }
  5677. function isInputChanged (elm, newVal) {
  5678. var value = elm.value;
  5679. var modifiers = elm._vModifiers; // injected by v-model runtime
  5680. if ((isDef(modifiers) && modifiers.number) || elm.type === 'number') {
  5681. return toNumber(value) !== toNumber(newVal)
  5682. }
  5683. if (isDef(modifiers) && modifiers.trim) {
  5684. return value.trim() !== newVal.trim()
  5685. }
  5686. return value !== newVal
  5687. }
  5688. var domProps = {
  5689. create: updateDOMProps,
  5690. update: updateDOMProps
  5691. };
  5692. /* */
  5693. var parseStyleText = cached(function (cssText) {
  5694. var res = {};
  5695. var listDelimiter = /;(?![^(]*\))/g;
  5696. var propertyDelimiter = /:(.+)/;
  5697. cssText.split(listDelimiter).forEach(function (item) {
  5698. if (item) {
  5699. var tmp = item.split(propertyDelimiter);
  5700. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  5701. }
  5702. });
  5703. return res
  5704. });
  5705. // merge static and dynamic style data on the same vnode
  5706. function normalizeStyleData (data) {
  5707. var style = normalizeStyleBinding(data.style);
  5708. // static style is pre-processed into an object during compilation
  5709. // and is always a fresh object, so it's safe to merge into it
  5710. return data.staticStyle
  5711. ? extend(data.staticStyle, style)
  5712. : style
  5713. }
  5714. // normalize possible array / string values into Object
  5715. function normalizeStyleBinding (bindingStyle) {
  5716. if (Array.isArray(bindingStyle)) {
  5717. return toObject(bindingStyle)
  5718. }
  5719. if (typeof bindingStyle === 'string') {
  5720. return parseStyleText(bindingStyle)
  5721. }
  5722. return bindingStyle
  5723. }
  5724. /**
  5725. * parent component style should be after child's
  5726. * so that parent component's style could override it
  5727. */
  5728. function getStyle (vnode, checkChild) {
  5729. var res = {};
  5730. var styleData;
  5731. if (checkChild) {
  5732. var childNode = vnode;
  5733. while (childNode.componentInstance) {
  5734. childNode = childNode.componentInstance._vnode;
  5735. if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {
  5736. extend(res, styleData);
  5737. }
  5738. }
  5739. }
  5740. if ((styleData = normalizeStyleData(vnode.data))) {
  5741. extend(res, styleData);
  5742. }
  5743. var parentNode = vnode;
  5744. while ((parentNode = parentNode.parent)) {
  5745. if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
  5746. extend(res, styleData);
  5747. }
  5748. }
  5749. return res
  5750. }
  5751. /* */
  5752. var cssVarRE = /^--/;
  5753. var importantRE = /\s*!important$/;
  5754. var setProp = function (el, name, val) {
  5755. /* istanbul ignore if */
  5756. if (cssVarRE.test(name)) {
  5757. el.style.setProperty(name, val);
  5758. } else if (importantRE.test(val)) {
  5759. el.style.setProperty(name, val.replace(importantRE, ''), 'important');
  5760. } else {
  5761. var normalizedName = normalize(name);
  5762. if (Array.isArray(val)) {
  5763. // Support values array created by autoprefixer, e.g.
  5764. // {display: ["-webkit-box", "-ms-flexbox", "flex"]}
  5765. // Set them one by one, and the browser will only set those it can recognize
  5766. for (var i = 0, len = val.length; i < len; i++) {
  5767. el.style[normalizedName] = val[i];
  5768. }
  5769. } else {
  5770. el.style[normalizedName] = val;
  5771. }
  5772. }
  5773. };
  5774. var prefixes = ['Webkit', 'Moz', 'ms'];
  5775. var testEl;
  5776. var normalize = cached(function (prop) {
  5777. testEl = testEl || document.createElement('div');
  5778. prop = camelize(prop);
  5779. if (prop !== 'filter' && (prop in testEl.style)) {
  5780. return prop
  5781. }
  5782. var upper = prop.charAt(0).toUpperCase() + prop.slice(1);
  5783. for (var i = 0; i < prefixes.length; i++) {
  5784. var prefixed = prefixes[i] + upper;
  5785. if (prefixed in testEl.style) {
  5786. return prefixed
  5787. }
  5788. }
  5789. });
  5790. function updateStyle (oldVnode, vnode) {
  5791. var data = vnode.data;
  5792. var oldData = oldVnode.data;
  5793. if (isUndef(data.staticStyle) && isUndef(data.style) &&
  5794. isUndef(oldData.staticStyle) && isUndef(oldData.style)
  5795. ) {
  5796. return
  5797. }
  5798. var cur, name;
  5799. var el = vnode.elm;
  5800. var oldStaticStyle = oldData.staticStyle;
  5801. var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};
  5802. // if static style exists, stylebinding already merged into it when doing normalizeStyleData
  5803. var oldStyle = oldStaticStyle || oldStyleBinding;
  5804. var style = normalizeStyleBinding(vnode.data.style) || {};
  5805. // store normalized style under a different key for next diff
  5806. // make sure to clone it if it's reactive, since the user likley wants
  5807. // to mutate it.
  5808. vnode.data.normalizedStyle = isDef(style.__ob__)
  5809. ? extend({}, style)
  5810. : style;
  5811. var newStyle = getStyle(vnode, true);
  5812. for (name in oldStyle) {
  5813. if (isUndef(newStyle[name])) {
  5814. setProp(el, name, '');
  5815. }
  5816. }
  5817. for (name in newStyle) {
  5818. cur = newStyle[name];
  5819. if (cur !== oldStyle[name]) {
  5820. // ie9 settings to null has no effect, must use empty string
  5821. setProp(el, name, cur == null ? '' : cur);
  5822. }
  5823. }
  5824. }
  5825. var style = {
  5826. create: updateStyle,
  5827. update: updateStyle
  5828. };
  5829. /* */
  5830. /**
  5831. * Add class with compatibility for SVG since classList is not supported on
  5832. * SVG elements in IE
  5833. */
  5834. function addClass (el, cls) {
  5835. /* istanbul ignore if */
  5836. if (!cls || !(cls = cls.trim())) {
  5837. return
  5838. }
  5839. /* istanbul ignore else */
  5840. if (el.classList) {
  5841. if (cls.indexOf(' ') > -1) {
  5842. cls.split(/\s+/).forEach(function (c) { return el.classList.add(c); });
  5843. } else {
  5844. el.classList.add(cls);
  5845. }
  5846. } else {
  5847. var cur = " " + (el.getAttribute('class') || '') + " ";
  5848. if (cur.indexOf(' ' + cls + ' ') < 0) {
  5849. el.setAttribute('class', (cur + cls).trim());
  5850. }
  5851. }
  5852. }
  5853. /**
  5854. * Remove class with compatibility for SVG since classList is not supported on
  5855. * SVG elements in IE
  5856. */
  5857. function removeClass (el, cls) {
  5858. /* istanbul ignore if */
  5859. if (!cls || !(cls = cls.trim())) {
  5860. return
  5861. }
  5862. /* istanbul ignore else */
  5863. if (el.classList) {
  5864. if (cls.indexOf(' ') > -1) {
  5865. cls.split(/\s+/).forEach(function (c) { return el.classList.remove(c); });
  5866. } else {
  5867. el.classList.remove(cls);
  5868. }
  5869. } else {
  5870. var cur = " " + (el.getAttribute('class') || '') + " ";
  5871. var tar = ' ' + cls + ' ';
  5872. while (cur.indexOf(tar) >= 0) {
  5873. cur = cur.replace(tar, ' ');
  5874. }
  5875. el.setAttribute('class', cur.trim());
  5876. }
  5877. }
  5878. /* */
  5879. function resolveTransition (def$$1) {
  5880. if (!def$$1) {
  5881. return
  5882. }
  5883. /* istanbul ignore else */
  5884. if (typeof def$$1 === 'object') {
  5885. var res = {};
  5886. if (def$$1.css !== false) {
  5887. extend(res, autoCssTransition(def$$1.name || 'v'));
  5888. }
  5889. extend(res, def$$1);
  5890. return res
  5891. } else if (typeof def$$1 === 'string') {
  5892. return autoCssTransition(def$$1)
  5893. }
  5894. }
  5895. var autoCssTransition = cached(function (name) {
  5896. return {
  5897. enterClass: (name + "-enter"),
  5898. enterToClass: (name + "-enter-to"),
  5899. enterActiveClass: (name + "-enter-active"),
  5900. leaveClass: (name + "-leave"),
  5901. leaveToClass: (name + "-leave-to"),
  5902. leaveActiveClass: (name + "-leave-active")
  5903. }
  5904. });
  5905. var hasTransition = inBrowser && !isIE9;
  5906. var TRANSITION = 'transition';
  5907. var ANIMATION = 'animation';
  5908. // Transition property/event sniffing
  5909. var transitionProp = 'transition';
  5910. var transitionEndEvent = 'transitionend';
  5911. var animationProp = 'animation';
  5912. var animationEndEvent = 'animationend';
  5913. if (hasTransition) {
  5914. /* istanbul ignore if */
  5915. if (window.ontransitionend === undefined &&
  5916. window.onwebkittransitionend !== undefined
  5917. ) {
  5918. transitionProp = 'WebkitTransition';
  5919. transitionEndEvent = 'webkitTransitionEnd';
  5920. }
  5921. if (window.onanimationend === undefined &&
  5922. window.onwebkitanimationend !== undefined
  5923. ) {
  5924. animationProp = 'WebkitAnimation';
  5925. animationEndEvent = 'webkitAnimationEnd';
  5926. }
  5927. }
  5928. // binding to window is necessary to make hot reload work in IE in strict mode
  5929. var raf = inBrowser && window.requestAnimationFrame
  5930. ? window.requestAnimationFrame.bind(window)
  5931. : setTimeout;
  5932. function nextFrame (fn) {
  5933. raf(function () {
  5934. raf(fn);
  5935. });
  5936. }
  5937. function addTransitionClass (el, cls) {
  5938. (el._transitionClasses || (el._transitionClasses = [])).push(cls);
  5939. addClass(el, cls);
  5940. }
  5941. function removeTransitionClass (el, cls) {
  5942. if (el._transitionClasses) {
  5943. remove(el._transitionClasses, cls);
  5944. }
  5945. removeClass(el, cls);
  5946. }
  5947. function whenTransitionEnds (
  5948. el,
  5949. expectedType,
  5950. cb
  5951. ) {
  5952. var ref = getTransitionInfo(el, expectedType);
  5953. var type = ref.type;
  5954. var timeout = ref.timeout;
  5955. var propCount = ref.propCount;
  5956. if (!type) { return cb() }
  5957. var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
  5958. var ended = 0;
  5959. var end = function () {
  5960. el.removeEventListener(event, onEnd);
  5961. cb();
  5962. };
  5963. var onEnd = function (e) {
  5964. if (e.target === el) {
  5965. if (++ended >= propCount) {
  5966. end();
  5967. }
  5968. }
  5969. };
  5970. setTimeout(function () {
  5971. if (ended < propCount) {
  5972. end();
  5973. }
  5974. }, timeout + 1);
  5975. el.addEventListener(event, onEnd);
  5976. }
  5977. var transformRE = /\b(transform|all)(,|$)/;
  5978. function getTransitionInfo (el, expectedType) {
  5979. var styles = window.getComputedStyle(el);
  5980. var transitionDelays = styles[transitionProp + 'Delay'].split(', ');
  5981. var transitionDurations = styles[transitionProp + 'Duration'].split(', ');
  5982. var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  5983. var animationDelays = styles[animationProp + 'Delay'].split(', ');
  5984. var animationDurations = styles[animationProp + 'Duration'].split(', ');
  5985. var animationTimeout = getTimeout(animationDelays, animationDurations);
  5986. var type;
  5987. var timeout = 0;
  5988. var propCount = 0;
  5989. /* istanbul ignore if */
  5990. if (expectedType === TRANSITION) {
  5991. if (transitionTimeout > 0) {
  5992. type = TRANSITION;
  5993. timeout = transitionTimeout;
  5994. propCount = transitionDurations.length;
  5995. }
  5996. } else if (expectedType === ANIMATION) {
  5997. if (animationTimeout > 0) {
  5998. type = ANIMATION;
  5999. timeout = animationTimeout;
  6000. propCount = animationDurations.length;
  6001. }
  6002. } else {
  6003. timeout = Math.max(transitionTimeout, animationTimeout);
  6004. type = timeout > 0
  6005. ? transitionTimeout > animationTimeout
  6006. ? TRANSITION
  6007. : ANIMATION
  6008. : null;
  6009. propCount = type
  6010. ? type === TRANSITION
  6011. ? transitionDurations.length
  6012. : animationDurations.length
  6013. : 0;
  6014. }
  6015. var hasTransform =
  6016. type === TRANSITION &&
  6017. transformRE.test(styles[transitionProp + 'Property']);
  6018. return {
  6019. type: type,
  6020. timeout: timeout,
  6021. propCount: propCount,
  6022. hasTransform: hasTransform
  6023. }
  6024. }
  6025. function getTimeout (delays, durations) {
  6026. /* istanbul ignore next */
  6027. while (delays.length < durations.length) {
  6028. delays = delays.concat(delays);
  6029. }
  6030. return Math.max.apply(null, durations.map(function (d, i) {
  6031. return toMs(d) + toMs(delays[i])
  6032. }))
  6033. }
  6034. function toMs (s) {
  6035. return Number(s.slice(0, -1)) * 1000
  6036. }
  6037. /* */
  6038. function enter (vnode, toggleDisplay) {
  6039. var el = vnode.elm;
  6040. // call leave callback now
  6041. if (isDef(el._leaveCb)) {
  6042. el._leaveCb.cancelled = true;
  6043. el._leaveCb();
  6044. }
  6045. var data = resolveTransition(vnode.data.transition);
  6046. if (isUndef(data)) {
  6047. return
  6048. }
  6049. /* istanbul ignore if */
  6050. if (isDef(el._enterCb) || el.nodeType !== 1) {
  6051. return
  6052. }
  6053. var css = data.css;
  6054. var type = data.type;
  6055. var enterClass = data.enterClass;
  6056. var enterToClass = data.enterToClass;
  6057. var enterActiveClass = data.enterActiveClass;
  6058. var appearClass = data.appearClass;
  6059. var appearToClass = data.appearToClass;
  6060. var appearActiveClass = data.appearActiveClass;
  6061. var beforeEnter = data.beforeEnter;
  6062. var enter = data.enter;
  6063. var afterEnter = data.afterEnter;
  6064. var enterCancelled = data.enterCancelled;
  6065. var beforeAppear = data.beforeAppear;
  6066. var appear = data.appear;
  6067. var afterAppear = data.afterAppear;
  6068. var appearCancelled = data.appearCancelled;
  6069. var duration = data.duration;
  6070. // activeInstance will always be the <transition> component managing this
  6071. // transition. One edge case to check is when the <transition> is placed
  6072. // as the root node of a child component. In that case we need to check
  6073. // <transition>'s parent for appear check.
  6074. var context = activeInstance;
  6075. var transitionNode = activeInstance.$vnode;
  6076. while (transitionNode && transitionNode.parent) {
  6077. transitionNode = transitionNode.parent;
  6078. context = transitionNode.context;
  6079. }
  6080. var isAppear = !context._isMounted || !vnode.isRootInsert;
  6081. if (isAppear && !appear && appear !== '') {
  6082. return
  6083. }
  6084. var startClass = isAppear && appearClass
  6085. ? appearClass
  6086. : enterClass;
  6087. var activeClass = isAppear && appearActiveClass
  6088. ? appearActiveClass
  6089. : enterActiveClass;
  6090. var toClass = isAppear && appearToClass
  6091. ? appearToClass
  6092. : enterToClass;
  6093. var beforeEnterHook = isAppear
  6094. ? (beforeAppear || beforeEnter)
  6095. : beforeEnter;
  6096. var enterHook = isAppear
  6097. ? (typeof appear === 'function' ? appear : enter)
  6098. : enter;
  6099. var afterEnterHook = isAppear
  6100. ? (afterAppear || afterEnter)
  6101. : afterEnter;
  6102. var enterCancelledHook = isAppear
  6103. ? (appearCancelled || enterCancelled)
  6104. : enterCancelled;
  6105. var explicitEnterDuration = toNumber(
  6106. isObject(duration)
  6107. ? duration.enter
  6108. : duration
  6109. );
  6110. if ("development" !== 'production' && explicitEnterDuration != null) {
  6111. checkDuration(explicitEnterDuration, 'enter', vnode);
  6112. }
  6113. var expectsCSS = css !== false && !isIE9;
  6114. var userWantsControl = getHookArgumentsLength(enterHook);
  6115. var cb = el._enterCb = once(function () {
  6116. if (expectsCSS) {
  6117. removeTransitionClass(el, toClass);
  6118. removeTransitionClass(el, activeClass);
  6119. }
  6120. if (cb.cancelled) {
  6121. if (expectsCSS) {
  6122. removeTransitionClass(el, startClass);
  6123. }
  6124. enterCancelledHook && enterCancelledHook(el);
  6125. } else {
  6126. afterEnterHook && afterEnterHook(el);
  6127. }
  6128. el._enterCb = null;
  6129. });
  6130. if (!vnode.data.show) {
  6131. // remove pending leave element on enter by injecting an insert hook
  6132. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', function () {
  6133. var parent = el.parentNode;
  6134. var pendingNode = parent && parent._pending && parent._pending[vnode.key];
  6135. if (pendingNode &&
  6136. pendingNode.tag === vnode.tag &&
  6137. pendingNode.elm._leaveCb
  6138. ) {
  6139. pendingNode.elm._leaveCb();
  6140. }
  6141. enterHook && enterHook(el, cb);
  6142. });
  6143. }
  6144. // start enter transition
  6145. beforeEnterHook && beforeEnterHook(el);
  6146. if (expectsCSS) {
  6147. addTransitionClass(el, startClass);
  6148. addTransitionClass(el, activeClass);
  6149. nextFrame(function () {
  6150. addTransitionClass(el, toClass);
  6151. removeTransitionClass(el, startClass);
  6152. if (!cb.cancelled && !userWantsControl) {
  6153. if (isValidDuration(explicitEnterDuration)) {
  6154. setTimeout(cb, explicitEnterDuration);
  6155. } else {
  6156. whenTransitionEnds(el, type, cb);
  6157. }
  6158. }
  6159. });
  6160. }
  6161. if (vnode.data.show) {
  6162. toggleDisplay && toggleDisplay();
  6163. enterHook && enterHook(el, cb);
  6164. }
  6165. if (!expectsCSS && !userWantsControl) {
  6166. cb();
  6167. }
  6168. }
  6169. function leave (vnode, rm) {
  6170. var el = vnode.elm;
  6171. // call enter callback now
  6172. if (isDef(el._enterCb)) {
  6173. el._enterCb.cancelled = true;
  6174. el._enterCb();
  6175. }
  6176. var data = resolveTransition(vnode.data.transition);
  6177. if (isUndef(data)) {
  6178. return rm()
  6179. }
  6180. /* istanbul ignore if */
  6181. if (isDef(el._leaveCb) || el.nodeType !== 1) {
  6182. return
  6183. }
  6184. var css = data.css;
  6185. var type = data.type;
  6186. var leaveClass = data.leaveClass;
  6187. var leaveToClass = data.leaveToClass;
  6188. var leaveActiveClass = data.leaveActiveClass;
  6189. var beforeLeave = data.beforeLeave;
  6190. var leave = data.leave;
  6191. var afterLeave = data.afterLeave;
  6192. var leaveCancelled = data.leaveCancelled;
  6193. var delayLeave = data.delayLeave;
  6194. var duration = data.duration;
  6195. var expectsCSS = css !== false && !isIE9;
  6196. var userWantsControl = getHookArgumentsLength(leave);
  6197. var explicitLeaveDuration = toNumber(
  6198. isObject(duration)
  6199. ? duration.leave
  6200. : duration
  6201. );
  6202. if ("development" !== 'production' && isDef(explicitLeaveDuration)) {
  6203. checkDuration(explicitLeaveDuration, 'leave', vnode);
  6204. }
  6205. var cb = el._leaveCb = once(function () {
  6206. if (el.parentNode && el.parentNode._pending) {
  6207. el.parentNode._pending[vnode.key] = null;
  6208. }
  6209. if (expectsCSS) {
  6210. removeTransitionClass(el, leaveToClass);
  6211. removeTransitionClass(el, leaveActiveClass);
  6212. }
  6213. if (cb.cancelled) {
  6214. if (expectsCSS) {
  6215. removeTransitionClass(el, leaveClass);
  6216. }
  6217. leaveCancelled && leaveCancelled(el);
  6218. } else {
  6219. rm();
  6220. afterLeave && afterLeave(el);
  6221. }
  6222. el._leaveCb = null;
  6223. });
  6224. if (delayLeave) {
  6225. delayLeave(performLeave);
  6226. } else {
  6227. performLeave();
  6228. }
  6229. function performLeave () {
  6230. // the delayed leave may have already been cancelled
  6231. if (cb.cancelled) {
  6232. return
  6233. }
  6234. // record leaving element
  6235. if (!vnode.data.show) {
  6236. (el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode;
  6237. }
  6238. beforeLeave && beforeLeave(el);
  6239. if (expectsCSS) {
  6240. addTransitionClass(el, leaveClass);
  6241. addTransitionClass(el, leaveActiveClass);
  6242. nextFrame(function () {
  6243. addTransitionClass(el, leaveToClass);
  6244. removeTransitionClass(el, leaveClass);
  6245. if (!cb.cancelled && !userWantsControl) {
  6246. if (isValidDuration(explicitLeaveDuration)) {
  6247. setTimeout(cb, explicitLeaveDuration);
  6248. } else {
  6249. whenTransitionEnds(el, type, cb);
  6250. }
  6251. }
  6252. });
  6253. }
  6254. leave && leave(el, cb);
  6255. if (!expectsCSS && !userWantsControl) {
  6256. cb();
  6257. }
  6258. }
  6259. }
  6260. // only used in dev mode
  6261. function checkDuration (val, name, vnode) {
  6262. if (typeof val !== 'number') {
  6263. warn(
  6264. "<transition> explicit " + name + " duration is not a valid number - " +
  6265. "got " + (JSON.stringify(val)) + ".",
  6266. vnode.context
  6267. );
  6268. } else if (isNaN(val)) {
  6269. warn(
  6270. "<transition> explicit " + name + " duration is NaN - " +
  6271. 'the duration expression might be incorrect.',
  6272. vnode.context
  6273. );
  6274. }
  6275. }
  6276. function isValidDuration (val) {
  6277. return typeof val === 'number' && !isNaN(val)
  6278. }
  6279. /**
  6280. * Normalize a transition hook's argument length. The hook may be:
  6281. * - a merged hook (invoker) with the original in .fns
  6282. * - a wrapped component method (check ._length)
  6283. * - a plain function (.length)
  6284. */
  6285. function getHookArgumentsLength (fn) {
  6286. if (isUndef(fn)) {
  6287. return false
  6288. }
  6289. var invokerFns = fn.fns;
  6290. if (isDef(invokerFns)) {
  6291. // invoker
  6292. return getHookArgumentsLength(
  6293. Array.isArray(invokerFns)
  6294. ? invokerFns[0]
  6295. : invokerFns
  6296. )
  6297. } else {
  6298. return (fn._length || fn.length) > 1
  6299. }
  6300. }
  6301. function _enter (_, vnode) {
  6302. if (vnode.data.show !== true) {
  6303. enter(vnode);
  6304. }
  6305. }
  6306. var transition = inBrowser ? {
  6307. create: _enter,
  6308. activate: _enter,
  6309. remove: function remove$$1 (vnode, rm) {
  6310. /* istanbul ignore else */
  6311. if (vnode.data.show !== true) {
  6312. leave(vnode, rm);
  6313. } else {
  6314. rm();
  6315. }
  6316. }
  6317. } : {};
  6318. var platformModules = [
  6319. attrs,
  6320. klass,
  6321. events,
  6322. domProps,
  6323. style,
  6324. transition
  6325. ];
  6326. /* */
  6327. // the directive module should be applied last, after all
  6328. // built-in modules have been applied.
  6329. var modules = platformModules.concat(baseModules);
  6330. var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });
  6331. /**
  6332. * Not type checking this file because flow doesn't like attaching
  6333. * properties to Elements.
  6334. */
  6335. /* istanbul ignore if */
  6336. if (isIE9) {
  6337. // http://www.matts411.com/post/internet-explorer-9-oninput/
  6338. document.addEventListener('selectionchange', function () {
  6339. var el = document.activeElement;
  6340. if (el && el.vmodel) {
  6341. trigger(el, 'input');
  6342. }
  6343. });
  6344. }
  6345. var model$1 = {
  6346. inserted: function inserted (el, binding, vnode) {
  6347. if (vnode.tag === 'select') {
  6348. var cb = function () {
  6349. setSelected(el, binding, vnode.context);
  6350. };
  6351. cb();
  6352. /* istanbul ignore if */
  6353. if (isIE || isEdge) {
  6354. setTimeout(cb, 0);
  6355. }
  6356. } else if (vnode.tag === 'textarea' || el.type === 'text' || el.type === 'password') {
  6357. el._vModifiers = binding.modifiers;
  6358. if (!binding.modifiers.lazy) {
  6359. // Safari < 10.2 & UIWebView doesn't fire compositionend when
  6360. // switching focus before confirming composition choice
  6361. // this also fixes the issue where some browsers e.g. iOS Chrome
  6362. // fires "change" instead of "input" on autocomplete.
  6363. el.addEventListener('change', onCompositionEnd);
  6364. if (!isAndroid) {
  6365. el.addEventListener('compositionstart', onCompositionStart);
  6366. el.addEventListener('compositionend', onCompositionEnd);
  6367. }
  6368. /* istanbul ignore if */
  6369. if (isIE9) {
  6370. el.vmodel = true;
  6371. }
  6372. }
  6373. }
  6374. },
  6375. componentUpdated: function componentUpdated (el, binding, vnode) {
  6376. if (vnode.tag === 'select') {
  6377. setSelected(el, binding, vnode.context);
  6378. // in case the options rendered by v-for have changed,
  6379. // it's possible that the value is out-of-sync with the rendered options.
  6380. // detect such cases and filter out values that no longer has a matching
  6381. // option in the DOM.
  6382. var needReset = el.multiple
  6383. ? binding.value.some(function (v) { return hasNoMatchingOption(v, el.options); })
  6384. : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, el.options);
  6385. if (needReset) {
  6386. trigger(el, 'change');
  6387. }
  6388. }
  6389. }
  6390. };
  6391. function setSelected (el, binding, vm) {
  6392. var value = binding.value;
  6393. var isMultiple = el.multiple;
  6394. if (isMultiple && !Array.isArray(value)) {
  6395. "development" !== 'production' && warn(
  6396. "<select multiple v-model=\"" + (binding.expression) + "\"> " +
  6397. "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)),
  6398. vm
  6399. );
  6400. return
  6401. }
  6402. var selected, option;
  6403. for (var i = 0, l = el.options.length; i < l; i++) {
  6404. option = el.options[i];
  6405. if (isMultiple) {
  6406. selected = looseIndexOf(value, getValue(option)) > -1;
  6407. if (option.selected !== selected) {
  6408. option.selected = selected;
  6409. }
  6410. } else {
  6411. if (looseEqual(getValue(option), value)) {
  6412. if (el.selectedIndex !== i) {
  6413. el.selectedIndex = i;
  6414. }
  6415. return
  6416. }
  6417. }
  6418. }
  6419. if (!isMultiple) {
  6420. el.selectedIndex = -1;
  6421. }
  6422. }
  6423. function hasNoMatchingOption (value, options) {
  6424. for (var i = 0, l = options.length; i < l; i++) {
  6425. if (looseEqual(getValue(options[i]), value)) {
  6426. return false
  6427. }
  6428. }
  6429. return true
  6430. }
  6431. function getValue (option) {
  6432. return '_value' in option
  6433. ? option._value
  6434. : option.value
  6435. }
  6436. function onCompositionStart (e) {
  6437. e.target.composing = true;
  6438. }
  6439. function onCompositionEnd (e) {
  6440. // prevent triggering an input event for no reason
  6441. if (!e.target.composing) { return }
  6442. e.target.composing = false;
  6443. trigger(e.target, 'input');
  6444. }
  6445. function trigger (el, type) {
  6446. var e = document.createEvent('HTMLEvents');
  6447. e.initEvent(type, true, true);
  6448. el.dispatchEvent(e);
  6449. }
  6450. /* */
  6451. // recursively search for possible transition defined inside the component root
  6452. function locateNode (vnode) {
  6453. return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
  6454. ? locateNode(vnode.componentInstance._vnode)
  6455. : vnode
  6456. }
  6457. var show = {
  6458. bind: function bind (el, ref, vnode) {
  6459. var value = ref.value;
  6460. vnode = locateNode(vnode);
  6461. var transition = vnode.data && vnode.data.transition;
  6462. var originalDisplay = el.__vOriginalDisplay =
  6463. el.style.display === 'none' ? '' : el.style.display;
  6464. if (value && transition && !isIE9) {
  6465. vnode.data.show = true;
  6466. enter(vnode, function () {
  6467. el.style.display = originalDisplay;
  6468. });
  6469. } else {
  6470. el.style.display = value ? originalDisplay : 'none';
  6471. }
  6472. },
  6473. update: function update (el, ref, vnode) {
  6474. var value = ref.value;
  6475. var oldValue = ref.oldValue;
  6476. /* istanbul ignore if */
  6477. if (value === oldValue) { return }
  6478. vnode = locateNode(vnode);
  6479. var transition = vnode.data && vnode.data.transition;
  6480. if (transition && !isIE9) {
  6481. vnode.data.show = true;
  6482. if (value) {
  6483. enter(vnode, function () {
  6484. el.style.display = el.__vOriginalDisplay;
  6485. });
  6486. } else {
  6487. leave(vnode, function () {
  6488. el.style.display = 'none';
  6489. });
  6490. }
  6491. } else {
  6492. el.style.display = value ? el.__vOriginalDisplay : 'none';
  6493. }
  6494. },
  6495. unbind: function unbind (
  6496. el,
  6497. binding,
  6498. vnode,
  6499. oldVnode,
  6500. isDestroy
  6501. ) {
  6502. if (!isDestroy) {
  6503. el.style.display = el.__vOriginalDisplay;
  6504. }
  6505. }
  6506. };
  6507. var platformDirectives = {
  6508. model: model$1,
  6509. show: show
  6510. };
  6511. /* */
  6512. // Provides transition support for a single element/component.
  6513. // supports transition mode (out-in / in-out)
  6514. var transitionProps = {
  6515. name: String,
  6516. appear: Boolean,
  6517. css: Boolean,
  6518. mode: String,
  6519. type: String,
  6520. enterClass: String,
  6521. leaveClass: String,
  6522. enterToClass: String,
  6523. leaveToClass: String,
  6524. enterActiveClass: String,
  6525. leaveActiveClass: String,
  6526. appearClass: String,
  6527. appearActiveClass: String,
  6528. appearToClass: String,
  6529. duration: [Number, String, Object]
  6530. };
  6531. // in case the child is also an abstract component, e.g. <keep-alive>
  6532. // we want to recursively retrieve the real component to be rendered
  6533. function getRealChild (vnode) {
  6534. var compOptions = vnode && vnode.componentOptions;
  6535. if (compOptions && compOptions.Ctor.options.abstract) {
  6536. return getRealChild(getFirstComponentChild(compOptions.children))
  6537. } else {
  6538. return vnode
  6539. }
  6540. }
  6541. function extractTransitionData (comp) {
  6542. var data = {};
  6543. var options = comp.$options;
  6544. // props
  6545. for (var key in options.propsData) {
  6546. data[key] = comp[key];
  6547. }
  6548. // events.
  6549. // extract listeners and pass them directly to the transition methods
  6550. var listeners = options._parentListeners;
  6551. for (var key$1 in listeners) {
  6552. data[camelize(key$1)] = listeners[key$1];
  6553. }
  6554. return data
  6555. }
  6556. function placeholder (h, rawChild) {
  6557. if (/\d-keep-alive$/.test(rawChild.tag)) {
  6558. return h('keep-alive', {
  6559. props: rawChild.componentOptions.propsData
  6560. })
  6561. }
  6562. }
  6563. function hasParentTransition (vnode) {
  6564. while ((vnode = vnode.parent)) {
  6565. if (vnode.data.transition) {
  6566. return true
  6567. }
  6568. }
  6569. }
  6570. function isSameChild (child, oldChild) {
  6571. return oldChild.key === child.key && oldChild.tag === child.tag
  6572. }
  6573. var Transition = {
  6574. name: 'transition',
  6575. props: transitionProps,
  6576. abstract: true,
  6577. render: function render (h) {
  6578. var this$1 = this;
  6579. var children = this.$slots.default;
  6580. if (!children) {
  6581. return
  6582. }
  6583. // filter out text nodes (possible whitespaces)
  6584. children = children.filter(function (c) { return c.tag; });
  6585. /* istanbul ignore if */
  6586. if (!children.length) {
  6587. return
  6588. }
  6589. // warn multiple elements
  6590. if ("development" !== 'production' && children.length > 1) {
  6591. warn(
  6592. '<transition> can only be used on a single element. Use ' +
  6593. '<transition-group> for lists.',
  6594. this.$parent
  6595. );
  6596. }
  6597. var mode = this.mode;
  6598. // warn invalid mode
  6599. if ("development" !== 'production' &&
  6600. mode && mode !== 'in-out' && mode !== 'out-in'
  6601. ) {
  6602. warn(
  6603. 'invalid <transition> mode: ' + mode,
  6604. this.$parent
  6605. );
  6606. }
  6607. var rawChild = children[0];
  6608. // if this is a component root node and the component's
  6609. // parent container node also has transition, skip.
  6610. if (hasParentTransition(this.$vnode)) {
  6611. return rawChild
  6612. }
  6613. // apply transition data to child
  6614. // use getRealChild() to ignore abstract components e.g. keep-alive
  6615. var child = getRealChild(rawChild);
  6616. /* istanbul ignore if */
  6617. if (!child) {
  6618. return rawChild
  6619. }
  6620. if (this._leaving) {
  6621. return placeholder(h, rawChild)
  6622. }
  6623. // ensure a key that is unique to the vnode type and to this transition
  6624. // component instance. This key will be used to remove pending leaving nodes
  6625. // during entering.
  6626. var id = "__transition-" + (this._uid) + "-";
  6627. child.key = child.key == null
  6628. ? id + child.tag
  6629. : isPrimitive(child.key)
  6630. ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)
  6631. : child.key;
  6632. var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
  6633. var oldRawChild = this._vnode;
  6634. var oldChild = getRealChild(oldRawChild);
  6635. // mark v-show
  6636. // so that the transition module can hand over the control to the directive
  6637. if (child.data.directives && child.data.directives.some(function (d) { return d.name === 'show'; })) {
  6638. child.data.show = true;
  6639. }
  6640. if (oldChild && oldChild.data && !isSameChild(child, oldChild)) {
  6641. // replace old child transition data with fresh one
  6642. // important for dynamic transitions!
  6643. var oldData = oldChild && (oldChild.data.transition = extend({}, data));
  6644. // handle transition mode
  6645. if (mode === 'out-in') {
  6646. // return placeholder node and queue update when leave finishes
  6647. this._leaving = true;
  6648. mergeVNodeHook(oldData, 'afterLeave', function () {
  6649. this$1._leaving = false;
  6650. this$1.$forceUpdate();
  6651. });
  6652. return placeholder(h, rawChild)
  6653. } else if (mode === 'in-out') {
  6654. var delayedLeave;
  6655. var performLeave = function () { delayedLeave(); };
  6656. mergeVNodeHook(data, 'afterEnter', performLeave);
  6657. mergeVNodeHook(data, 'enterCancelled', performLeave);
  6658. mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; });
  6659. }
  6660. }
  6661. return rawChild
  6662. }
  6663. };
  6664. /* */
  6665. // Provides transition support for list items.
  6666. // supports move transitions using the FLIP technique.
  6667. // Because the vdom's children update algorithm is "unstable" - i.e.
  6668. // it doesn't guarantee the relative positioning of removed elements,
  6669. // we force transition-group to update its children into two passes:
  6670. // in the first pass, we remove all nodes that need to be removed,
  6671. // triggering their leaving transition; in the second pass, we insert/move
  6672. // into the final desired state. This way in the second pass removed
  6673. // nodes will remain where they should be.
  6674. var props = extend({
  6675. tag: String,
  6676. moveClass: String
  6677. }, transitionProps);
  6678. delete props.mode;
  6679. var TransitionGroup = {
  6680. props: props,
  6681. render: function render (h) {
  6682. var tag = this.tag || this.$vnode.data.tag || 'span';
  6683. var map = Object.create(null);
  6684. var prevChildren = this.prevChildren = this.children;
  6685. var rawChildren = this.$slots.default || [];
  6686. var children = this.children = [];
  6687. var transitionData = extractTransitionData(this);
  6688. for (var i = 0; i < rawChildren.length; i++) {
  6689. var c = rawChildren[i];
  6690. if (c.tag) {
  6691. if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
  6692. children.push(c);
  6693. map[c.key] = c
  6694. ;(c.data || (c.data = {})).transition = transitionData;
  6695. } else {
  6696. var opts = c.componentOptions;
  6697. var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag;
  6698. warn(("<transition-group> children must be keyed: <" + name + ">"));
  6699. }
  6700. }
  6701. }
  6702. if (prevChildren) {
  6703. var kept = [];
  6704. var removed = [];
  6705. for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
  6706. var c$1 = prevChildren[i$1];
  6707. c$1.data.transition = transitionData;
  6708. c$1.data.pos = c$1.elm.getBoundingClientRect();
  6709. if (map[c$1.key]) {
  6710. kept.push(c$1);
  6711. } else {
  6712. removed.push(c$1);
  6713. }
  6714. }
  6715. this.kept = h(tag, null, kept);
  6716. this.removed = removed;
  6717. }
  6718. return h(tag, null, children)
  6719. },
  6720. beforeUpdate: function beforeUpdate () {
  6721. // force removing pass
  6722. this.__patch__(
  6723. this._vnode,
  6724. this.kept,
  6725. false, // hydrating
  6726. true // removeOnly (!important, avoids unnecessary moves)
  6727. );
  6728. this._vnode = this.kept;
  6729. },
  6730. updated: function updated () {
  6731. var children = this.prevChildren;
  6732. var moveClass = this.moveClass || ((this.name || 'v') + '-move');
  6733. if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
  6734. return
  6735. }
  6736. // we divide the work into three loops to avoid mixing DOM reads and writes
  6737. // in each iteration - which helps prevent layout thrashing.
  6738. children.forEach(callPendingCbs);
  6739. children.forEach(recordPosition);
  6740. children.forEach(applyTranslation);
  6741. // force reflow to put everything in position
  6742. var body = document.body;
  6743. var f = body.offsetHeight; // eslint-disable-line
  6744. children.forEach(function (c) {
  6745. if (c.data.moved) {
  6746. var el = c.elm;
  6747. var s = el.style;
  6748. addTransitionClass(el, moveClass);
  6749. s.transform = s.WebkitTransform = s.transitionDuration = '';
  6750. el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
  6751. if (!e || /transform$/.test(e.propertyName)) {
  6752. el.removeEventListener(transitionEndEvent, cb);
  6753. el._moveCb = null;
  6754. removeTransitionClass(el, moveClass);
  6755. }
  6756. });
  6757. }
  6758. });
  6759. },
  6760. methods: {
  6761. hasMove: function hasMove (el, moveClass) {
  6762. /* istanbul ignore if */
  6763. if (!hasTransition) {
  6764. return false
  6765. }
  6766. if (this._hasMove != null) {
  6767. return this._hasMove
  6768. }
  6769. // Detect whether an element with the move class applied has
  6770. // CSS transitions. Since the element may be inside an entering
  6771. // transition at this very moment, we make a clone of it and remove
  6772. // all other transition classes applied to ensure only the move class
  6773. // is applied.
  6774. var clone = el.cloneNode();
  6775. if (el._transitionClasses) {
  6776. el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); });
  6777. }
  6778. addClass(clone, moveClass);
  6779. clone.style.display = 'none';
  6780. this.$el.appendChild(clone);
  6781. var info = getTransitionInfo(clone);
  6782. this.$el.removeChild(clone);
  6783. return (this._hasMove = info.hasTransform)
  6784. }
  6785. }
  6786. };
  6787. function callPendingCbs (c) {
  6788. /* istanbul ignore if */
  6789. if (c.elm._moveCb) {
  6790. c.elm._moveCb();
  6791. }
  6792. /* istanbul ignore if */
  6793. if (c.elm._enterCb) {
  6794. c.elm._enterCb();
  6795. }
  6796. }
  6797. function recordPosition (c) {
  6798. c.data.newPos = c.elm.getBoundingClientRect();
  6799. }
  6800. function applyTranslation (c) {
  6801. var oldPos = c.data.pos;
  6802. var newPos = c.data.newPos;
  6803. var dx = oldPos.left - newPos.left;
  6804. var dy = oldPos.top - newPos.top;
  6805. if (dx || dy) {
  6806. c.data.moved = true;
  6807. var s = c.elm.style;
  6808. s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
  6809. s.transitionDuration = '0s';
  6810. }
  6811. }
  6812. var platformComponents = {
  6813. Transition: Transition,
  6814. TransitionGroup: TransitionGroup
  6815. };
  6816. /* */
  6817. // install platform specific utils
  6818. Vue$3.config.mustUseProp = mustUseProp;
  6819. Vue$3.config.isReservedTag = isReservedTag;
  6820. Vue$3.config.isReservedAttr = isReservedAttr;
  6821. Vue$3.config.getTagNamespace = getTagNamespace;
  6822. Vue$3.config.isUnknownElement = isUnknownElement;
  6823. // install platform runtime directives & components
  6824. extend(Vue$3.options.directives, platformDirectives);
  6825. extend(Vue$3.options.components, platformComponents);
  6826. // install platform patch function
  6827. Vue$3.prototype.__patch__ = inBrowser ? patch : noop;
  6828. // public mount method
  6829. Vue$3.prototype.$mount = function (
  6830. el,
  6831. hydrating
  6832. ) {
  6833. el = el && inBrowser ? query(el) : undefined;
  6834. return mountComponent(this, el, hydrating)
  6835. };
  6836. // devtools global hook
  6837. /* istanbul ignore next */
  6838. setTimeout(function () {
  6839. if (config.devtools) {
  6840. if (devtools) {
  6841. devtools.emit('init', Vue$3);
  6842. } else if ("development" !== 'production' && isChrome) {
  6843. console[console.info ? 'info' : 'log'](
  6844. 'Download the Vue Devtools extension for a better development experience:\n' +
  6845. 'https://github.com/vuejs/vue-devtools'
  6846. );
  6847. }
  6848. }
  6849. if ("development" !== 'production' &&
  6850. config.productionTip !== false &&
  6851. inBrowser && typeof console !== 'undefined'
  6852. ) {
  6853. console[console.info ? 'info' : 'log'](
  6854. "You are running Vue in development mode.\n" +
  6855. "Make sure to turn on production mode when deploying for production.\n" +
  6856. "See more tips at https://vuejs.org/guide/deployment.html"
  6857. );
  6858. }
  6859. }, 0);
  6860. /* */
  6861. // check whether current browser encodes a char inside attribute values
  6862. function shouldDecode (content, encoded) {
  6863. var div = document.createElement('div');
  6864. div.innerHTML = "<div a=\"" + content + "\">";
  6865. return div.innerHTML.indexOf(encoded) > 0
  6866. }
  6867. // #3663
  6868. // IE encodes newlines inside attribute values while other browsers don't
  6869. var shouldDecodeNewlines = inBrowser ? shouldDecode('\n', '&#10;') : false;
  6870. /* */
  6871. var isUnaryTag = makeMap(
  6872. 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
  6873. 'link,meta,param,source,track,wbr'
  6874. );
  6875. // Elements that you can, intentionally, leave open
  6876. // (and which close themselves)
  6877. var canBeLeftOpenTag = makeMap(
  6878. 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source'
  6879. );
  6880. // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
  6881. // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
  6882. var isNonPhrasingTag = makeMap(
  6883. 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
  6884. 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
  6885. 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
  6886. 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
  6887. 'title,tr,track'
  6888. );
  6889. /* */
  6890. var decoder;
  6891. function decode (html) {
  6892. decoder = decoder || document.createElement('div');
  6893. decoder.innerHTML = html;
  6894. return decoder.textContent
  6895. }
  6896. /**
  6897. * Not type-checking this file because it's mostly vendor code.
  6898. */
  6899. /*!
  6900. * HTML Parser By John Resig (ejohn.org)
  6901. * Modified by Juriy "kangax" Zaytsev
  6902. * Original code by Erik Arvidsson, Mozilla Public License
  6903. * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
  6904. */
  6905. // Regular Expressions for parsing tags and attributes
  6906. var singleAttrIdentifier = /([^\s"'<>/=]+)/;
  6907. var singleAttrAssign = /(?:=)/;
  6908. var singleAttrValues = [
  6909. // attr value double quotes
  6910. /"([^"]*)"+/.source,
  6911. // attr value, single quotes
  6912. /'([^']*)'+/.source,
  6913. // attr value, no quotes
  6914. /([^\s"'=<>`]+)/.source
  6915. ];
  6916. var attribute = new RegExp(
  6917. '^\\s*' + singleAttrIdentifier.source +
  6918. '(?:\\s*(' + singleAttrAssign.source + ')' +
  6919. '\\s*(?:' + singleAttrValues.join('|') + '))?'
  6920. );
  6921. // could use https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-QName
  6922. // but for Vue templates we can enforce a simple charset
  6923. var ncname = '[a-zA-Z_][\\w\\-\\.]*';
  6924. var qnameCapture = '((?:' + ncname + '\\:)?' + ncname + ')';
  6925. var startTagOpen = new RegExp('^<' + qnameCapture);
  6926. var startTagClose = /^\s*(\/?)>/;
  6927. var endTag = new RegExp('^<\\/' + qnameCapture + '[^>]*>');
  6928. var doctype = /^<!DOCTYPE [^>]+>/i;
  6929. var comment = /^<!--/;
  6930. var conditionalComment = /^<!\[/;
  6931. var IS_REGEX_CAPTURING_BROKEN = false;
  6932. 'x'.replace(/x(.)?/g, function (m, g) {
  6933. IS_REGEX_CAPTURING_BROKEN = g === '';
  6934. });
  6935. // Special Elements (can contain anything)
  6936. var isPlainTextElement = makeMap('script,style,textarea', true);
  6937. var reCache = {};
  6938. var decodingMap = {
  6939. '&lt;': '<',
  6940. '&gt;': '>',
  6941. '&quot;': '"',
  6942. '&amp;': '&',
  6943. '&#10;': '\n'
  6944. };
  6945. var encodedAttr = /&(?:lt|gt|quot|amp);/g;
  6946. var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#10);/g;
  6947. function decodeAttr (value, shouldDecodeNewlines) {
  6948. var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;
  6949. return value.replace(re, function (match) { return decodingMap[match]; })
  6950. }
  6951. function parseHTML (html, options) {
  6952. var stack = [];
  6953. var expectHTML = options.expectHTML;
  6954. var isUnaryTag$$1 = options.isUnaryTag || no;
  6955. var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no;
  6956. var index = 0;
  6957. var last, lastTag;
  6958. while (html) {
  6959. last = html;
  6960. // Make sure we're not in a plaintext content element like script/style
  6961. if (!lastTag || !isPlainTextElement(lastTag)) {
  6962. var textEnd = html.indexOf('<');
  6963. if (textEnd === 0) {
  6964. // Comment:
  6965. if (comment.test(html)) {
  6966. var commentEnd = html.indexOf('-->');
  6967. if (commentEnd >= 0) {
  6968. advance(commentEnd + 3);
  6969. continue
  6970. }
  6971. }
  6972. // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
  6973. if (conditionalComment.test(html)) {
  6974. var conditionalEnd = html.indexOf(']>');
  6975. if (conditionalEnd >= 0) {
  6976. advance(conditionalEnd + 2);
  6977. continue
  6978. }
  6979. }
  6980. // Doctype:
  6981. var doctypeMatch = html.match(doctype);
  6982. if (doctypeMatch) {
  6983. advance(doctypeMatch[0].length);
  6984. continue
  6985. }
  6986. // End tag:
  6987. var endTagMatch = html.match(endTag);
  6988. if (endTagMatch) {
  6989. var curIndex = index;
  6990. advance(endTagMatch[0].length);
  6991. parseEndTag(endTagMatch[1], curIndex, index);
  6992. continue
  6993. }
  6994. // Start tag:
  6995. var startTagMatch = parseStartTag();
  6996. if (startTagMatch) {
  6997. handleStartTag(startTagMatch);
  6998. continue
  6999. }
  7000. }
  7001. var text = (void 0), rest$1 = (void 0), next = (void 0);
  7002. if (textEnd >= 0) {
  7003. rest$1 = html.slice(textEnd);
  7004. while (
  7005. !endTag.test(rest$1) &&
  7006. !startTagOpen.test(rest$1) &&
  7007. !comment.test(rest$1) &&
  7008. !conditionalComment.test(rest$1)
  7009. ) {
  7010. // < in plain text, be forgiving and treat it as text
  7011. next = rest$1.indexOf('<', 1);
  7012. if (next < 0) { break }
  7013. textEnd += next;
  7014. rest$1 = html.slice(textEnd);
  7015. }
  7016. text = html.substring(0, textEnd);
  7017. advance(textEnd);
  7018. }
  7019. if (textEnd < 0) {
  7020. text = html;
  7021. html = '';
  7022. }
  7023. if (options.chars && text) {
  7024. options.chars(text);
  7025. }
  7026. } else {
  7027. var stackedTag = lastTag.toLowerCase();
  7028. var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));
  7029. var endTagLength = 0;
  7030. var rest = html.replace(reStackedTag, function (all, text, endTag) {
  7031. endTagLength = endTag.length;
  7032. if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {
  7033. text = text
  7034. .replace(/<!--([\s\S]*?)-->/g, '$1')
  7035. .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
  7036. }
  7037. if (options.chars) {
  7038. options.chars(text);
  7039. }
  7040. return ''
  7041. });
  7042. index += html.length - rest.length;
  7043. html = rest;
  7044. parseEndTag(stackedTag, index - endTagLength, index);
  7045. }
  7046. if (html === last) {
  7047. options.chars && options.chars(html);
  7048. if ("development" !== 'production' && !stack.length && options.warn) {
  7049. options.warn(("Mal-formatted tag at end of template: \"" + html + "\""));
  7050. }
  7051. break
  7052. }
  7053. }
  7054. // Clean up any remaining tags
  7055. parseEndTag();
  7056. function advance (n) {
  7057. index += n;
  7058. html = html.substring(n);
  7059. }
  7060. function parseStartTag () {
  7061. var start = html.match(startTagOpen);
  7062. if (start) {
  7063. var match = {
  7064. tagName: start[1],
  7065. attrs: [],
  7066. start: index
  7067. };
  7068. advance(start[0].length);
  7069. var end, attr;
  7070. while (!(end = html.match(startTagClose)) && (attr = html.match(attribute))) {
  7071. advance(attr[0].length);
  7072. match.attrs.push(attr);
  7073. }
  7074. if (end) {
  7075. match.unarySlash = end[1];
  7076. advance(end[0].length);
  7077. match.end = index;
  7078. return match
  7079. }
  7080. }
  7081. }
  7082. function handleStartTag (match) {
  7083. var tagName = match.tagName;
  7084. var unarySlash = match.unarySlash;
  7085. if (expectHTML) {
  7086. if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
  7087. parseEndTag(lastTag);
  7088. }
  7089. if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) {
  7090. parseEndTag(tagName);
  7091. }
  7092. }
  7093. var unary = isUnaryTag$$1(tagName) || tagName === 'html' && lastTag === 'head' || !!unarySlash;
  7094. var l = match.attrs.length;
  7095. var attrs = new Array(l);
  7096. for (var i = 0; i < l; i++) {
  7097. var args = match.attrs[i];
  7098. // hackish work around FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=369778
  7099. if (IS_REGEX_CAPTURING_BROKEN && args[0].indexOf('""') === -1) {
  7100. if (args[3] === '') { delete args[3]; }
  7101. if (args[4] === '') { delete args[4]; }
  7102. if (args[5] === '') { delete args[5]; }
  7103. }
  7104. var value = args[3] || args[4] || args[5] || '';
  7105. attrs[i] = {
  7106. name: args[1],
  7107. value: decodeAttr(
  7108. value,
  7109. options.shouldDecodeNewlines
  7110. )
  7111. };
  7112. }
  7113. if (!unary) {
  7114. stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs });
  7115. lastTag = tagName;
  7116. }
  7117. if (options.start) {
  7118. options.start(tagName, attrs, unary, match.start, match.end);
  7119. }
  7120. }
  7121. function parseEndTag (tagName, start, end) {
  7122. var pos, lowerCasedTagName;
  7123. if (start == null) { start = index; }
  7124. if (end == null) { end = index; }
  7125. if (tagName) {
  7126. lowerCasedTagName = tagName.toLowerCase();
  7127. }
  7128. // Find the closest opened tag of the same type
  7129. if (tagName) {
  7130. for (pos = stack.length - 1; pos >= 0; pos--) {
  7131. if (stack[pos].lowerCasedTag === lowerCasedTagName) {
  7132. break
  7133. }
  7134. }
  7135. } else {
  7136. // If no tag name is provided, clean shop
  7137. pos = 0;
  7138. }
  7139. if (pos >= 0) {
  7140. // Close all the open elements, up the stack
  7141. for (var i = stack.length - 1; i >= pos; i--) {
  7142. if ("development" !== 'production' &&
  7143. (i > pos || !tagName) &&
  7144. options.warn
  7145. ) {
  7146. options.warn(
  7147. ("tag <" + (stack[i].tag) + "> has no matching end tag.")
  7148. );
  7149. }
  7150. if (options.end) {
  7151. options.end(stack[i].tag, start, end);
  7152. }
  7153. }
  7154. // Remove the open elements from the stack
  7155. stack.length = pos;
  7156. lastTag = pos && stack[pos - 1].tag;
  7157. } else if (lowerCasedTagName === 'br') {
  7158. if (options.start) {
  7159. options.start(tagName, [], true, start, end);
  7160. }
  7161. } else if (lowerCasedTagName === 'p') {
  7162. if (options.start) {
  7163. options.start(tagName, [], false, start, end);
  7164. }
  7165. if (options.end) {
  7166. options.end(tagName, start, end);
  7167. }
  7168. }
  7169. }
  7170. }
  7171. /* */
  7172. var defaultTagRE = /\{\{((?:.|\n)+?)\}\}/g;
  7173. var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
  7174. var buildRegex = cached(function (delimiters) {
  7175. var open = delimiters[0].replace(regexEscapeRE, '\\$&');
  7176. var close = delimiters[1].replace(regexEscapeRE, '\\$&');
  7177. return new RegExp(open + '((?:.|\\n)+?)' + close, 'g')
  7178. });
  7179. function parseText (
  7180. text,
  7181. delimiters
  7182. ) {
  7183. var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
  7184. if (!tagRE.test(text)) {
  7185. return
  7186. }
  7187. var tokens = [];
  7188. var lastIndex = tagRE.lastIndex = 0;
  7189. var match, index;
  7190. while ((match = tagRE.exec(text))) {
  7191. index = match.index;
  7192. // push text token
  7193. if (index > lastIndex) {
  7194. tokens.push(JSON.stringify(text.slice(lastIndex, index)));
  7195. }
  7196. // tag token
  7197. var exp = parseFilters(match[1].trim());
  7198. tokens.push(("_s(" + exp + ")"));
  7199. lastIndex = index + match[0].length;
  7200. }
  7201. if (lastIndex < text.length) {
  7202. tokens.push(JSON.stringify(text.slice(lastIndex)));
  7203. }
  7204. return tokens.join('+')
  7205. }
  7206. /* */
  7207. var onRE = /^@|^v-on:/;
  7208. var dirRE = /^v-|^@|^:/;
  7209. var forAliasRE = /(.*?)\s+(?:in|of)\s+(.*)/;
  7210. var forIteratorRE = /\((\{[^}]*\}|[^,]*),([^,]*)(?:,([^,]*))?\)/;
  7211. var argRE = /:(.*)$/;
  7212. var bindRE = /^:|^v-bind:/;
  7213. var modifierRE = /\.[^.]+/g;
  7214. var decodeHTMLCached = cached(decode);
  7215. // configurable state
  7216. var warn$2;
  7217. var delimiters;
  7218. var transforms;
  7219. var preTransforms;
  7220. var postTransforms;
  7221. var platformIsPreTag;
  7222. var platformMustUseProp;
  7223. var platformGetTagNamespace;
  7224. /**
  7225. * Convert HTML string to AST.
  7226. */
  7227. function parse (
  7228. template,
  7229. options
  7230. ) {
  7231. warn$2 = options.warn || baseWarn;
  7232. platformGetTagNamespace = options.getTagNamespace || no;
  7233. platformMustUseProp = options.mustUseProp || no;
  7234. platformIsPreTag = options.isPreTag || no;
  7235. preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
  7236. transforms = pluckModuleFunction(options.modules, 'transformNode');
  7237. postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
  7238. delimiters = options.delimiters;
  7239. var stack = [];
  7240. var preserveWhitespace = options.preserveWhitespace !== false;
  7241. var root;
  7242. var currentParent;
  7243. var inVPre = false;
  7244. var inPre = false;
  7245. var warned = false;
  7246. function warnOnce (msg) {
  7247. if (!warned) {
  7248. warned = true;
  7249. warn$2(msg);
  7250. }
  7251. }
  7252. function endPre (element) {
  7253. // check pre state
  7254. if (element.pre) {
  7255. inVPre = false;
  7256. }
  7257. if (platformIsPreTag(element.tag)) {
  7258. inPre = false;
  7259. }
  7260. }
  7261. parseHTML(template, {
  7262. warn: warn$2,
  7263. expectHTML: options.expectHTML,
  7264. isUnaryTag: options.isUnaryTag,
  7265. canBeLeftOpenTag: options.canBeLeftOpenTag,
  7266. shouldDecodeNewlines: options.shouldDecodeNewlines,
  7267. start: function start (tag, attrs, unary) {
  7268. // check namespace.
  7269. // inherit parent ns if there is one
  7270. var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
  7271. // handle IE svg bug
  7272. /* istanbul ignore if */
  7273. if (isIE && ns === 'svg') {
  7274. attrs = guardIESVGBug(attrs);
  7275. }
  7276. var element = {
  7277. type: 1,
  7278. tag: tag,
  7279. attrsList: attrs,
  7280. attrsMap: makeAttrsMap(attrs),
  7281. parent: currentParent,
  7282. children: []
  7283. };
  7284. if (ns) {
  7285. element.ns = ns;
  7286. }
  7287. if (isForbiddenTag(element) && !isServerRendering()) {
  7288. element.forbidden = true;
  7289. "development" !== 'production' && warn$2(
  7290. 'Templates should only be responsible for mapping the state to the ' +
  7291. 'UI. Avoid placing tags with side-effects in your templates, such as ' +
  7292. "<" + tag + ">" + ', as they will not be parsed.'
  7293. );
  7294. }
  7295. // apply pre-transforms
  7296. for (var i = 0; i < preTransforms.length; i++) {
  7297. preTransforms[i](element, options);
  7298. }
  7299. if (!inVPre) {
  7300. processPre(element);
  7301. if (element.pre) {
  7302. inVPre = true;
  7303. }
  7304. }
  7305. if (platformIsPreTag(element.tag)) {
  7306. inPre = true;
  7307. }
  7308. if (inVPre) {
  7309. processRawAttrs(element);
  7310. } else {
  7311. processFor(element);
  7312. processIf(element);
  7313. processOnce(element);
  7314. processKey(element);
  7315. // determine whether this is a plain element after
  7316. // removing structural attributes
  7317. element.plain = !element.key && !attrs.length;
  7318. processRef(element);
  7319. processSlot(element);
  7320. processComponent(element);
  7321. for (var i$1 = 0; i$1 < transforms.length; i$1++) {
  7322. transforms[i$1](element, options);
  7323. }
  7324. processAttrs(element);
  7325. }
  7326. function checkRootConstraints (el) {
  7327. {
  7328. if (el.tag === 'slot' || el.tag === 'template') {
  7329. warnOnce(
  7330. "Cannot use <" + (el.tag) + "> as component root element because it may " +
  7331. 'contain multiple nodes.'
  7332. );
  7333. }
  7334. if (el.attrsMap.hasOwnProperty('v-for')) {
  7335. warnOnce(
  7336. 'Cannot use v-for on stateful component root element because ' +
  7337. 'it renders multiple elements.'
  7338. );
  7339. }
  7340. }
  7341. }
  7342. // tree management
  7343. if (!root) {
  7344. root = element;
  7345. checkRootConstraints(root);
  7346. } else if (!stack.length) {
  7347. // allow root elements with v-if, v-else-if and v-else
  7348. if (root.if && (element.elseif || element.else)) {
  7349. checkRootConstraints(element);
  7350. addIfCondition(root, {
  7351. exp: element.elseif,
  7352. block: element
  7353. });
  7354. } else {
  7355. warnOnce(
  7356. "Component template should contain exactly one root element. " +
  7357. "If you are using v-if on multiple elements, " +
  7358. "use v-else-if to chain them instead."
  7359. );
  7360. }
  7361. }
  7362. if (currentParent && !element.forbidden) {
  7363. if (element.elseif || element.else) {
  7364. processIfConditions(element, currentParent);
  7365. } else if (element.slotScope) { // scoped slot
  7366. currentParent.plain = false;
  7367. var name = element.slotTarget || '"default"';(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
  7368. } else {
  7369. currentParent.children.push(element);
  7370. element.parent = currentParent;
  7371. }
  7372. }
  7373. if (!unary) {
  7374. currentParent = element;
  7375. stack.push(element);
  7376. } else {
  7377. endPre(element);
  7378. }
  7379. // apply post-transforms
  7380. for (var i$2 = 0; i$2 < postTransforms.length; i$2++) {
  7381. postTransforms[i$2](element, options);
  7382. }
  7383. },
  7384. end: function end () {
  7385. // remove trailing whitespace
  7386. var element = stack[stack.length - 1];
  7387. var lastNode = element.children[element.children.length - 1];
  7388. if (lastNode && lastNode.type === 3 && lastNode.text === ' ' && !inPre) {
  7389. element.children.pop();
  7390. }
  7391. // pop stack
  7392. stack.length -= 1;
  7393. currentParent = stack[stack.length - 1];
  7394. endPre(element);
  7395. },
  7396. chars: function chars (text) {
  7397. if (!currentParent) {
  7398. {
  7399. if (text === template) {
  7400. warnOnce(
  7401. 'Component template requires a root element, rather than just text.'
  7402. );
  7403. } else if ((text = text.trim())) {
  7404. warnOnce(
  7405. ("text \"" + text + "\" outside root element will be ignored.")
  7406. );
  7407. }
  7408. }
  7409. return
  7410. }
  7411. // IE textarea placeholder bug
  7412. /* istanbul ignore if */
  7413. if (isIE &&
  7414. currentParent.tag === 'textarea' &&
  7415. currentParent.attrsMap.placeholder === text
  7416. ) {
  7417. return
  7418. }
  7419. var children = currentParent.children;
  7420. text = inPre || text.trim()
  7421. ? isTextTag(currentParent) ? text : decodeHTMLCached(text)
  7422. // only preserve whitespace if its not right after a starting tag
  7423. : preserveWhitespace && children.length ? ' ' : '';
  7424. if (text) {
  7425. var expression;
  7426. if (!inVPre && text !== ' ' && (expression = parseText(text, delimiters))) {
  7427. children.push({
  7428. type: 2,
  7429. expression: expression,
  7430. text: text
  7431. });
  7432. } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') {
  7433. children.push({
  7434. type: 3,
  7435. text: text
  7436. });
  7437. }
  7438. }
  7439. }
  7440. });
  7441. return root
  7442. }
  7443. function processPre (el) {
  7444. if (getAndRemoveAttr(el, 'v-pre') != null) {
  7445. el.pre = true;
  7446. }
  7447. }
  7448. function processRawAttrs (el) {
  7449. var l = el.attrsList.length;
  7450. if (l) {
  7451. var attrs = el.attrs = new Array(l);
  7452. for (var i = 0; i < l; i++) {
  7453. attrs[i] = {
  7454. name: el.attrsList[i].name,
  7455. value: JSON.stringify(el.attrsList[i].value)
  7456. };
  7457. }
  7458. } else if (!el.pre) {
  7459. // non root node in pre blocks with no attributes
  7460. el.plain = true;
  7461. }
  7462. }
  7463. function processKey (el) {
  7464. var exp = getBindingAttr(el, 'key');
  7465. if (exp) {
  7466. if ("development" !== 'production' && el.tag === 'template') {
  7467. warn$2("<template> cannot be keyed. Place the key on real elements instead.");
  7468. }
  7469. el.key = exp;
  7470. }
  7471. }
  7472. function processRef (el) {
  7473. var ref = getBindingAttr(el, 'ref');
  7474. if (ref) {
  7475. el.ref = ref;
  7476. el.refInFor = checkInFor(el);
  7477. }
  7478. }
  7479. function processFor (el) {
  7480. var exp;
  7481. if ((exp = getAndRemoveAttr(el, 'v-for'))) {
  7482. var inMatch = exp.match(forAliasRE);
  7483. if (!inMatch) {
  7484. "development" !== 'production' && warn$2(
  7485. ("Invalid v-for expression: " + exp)
  7486. );
  7487. return
  7488. }
  7489. el.for = inMatch[2].trim();
  7490. var alias = inMatch[1].trim();
  7491. var iteratorMatch = alias.match(forIteratorRE);
  7492. if (iteratorMatch) {
  7493. el.alias = iteratorMatch[1].trim();
  7494. el.iterator1 = iteratorMatch[2].trim();
  7495. if (iteratorMatch[3]) {
  7496. el.iterator2 = iteratorMatch[3].trim();
  7497. }
  7498. } else {
  7499. el.alias = alias;
  7500. }
  7501. }
  7502. }
  7503. function processIf (el) {
  7504. var exp = getAndRemoveAttr(el, 'v-if');
  7505. if (exp) {
  7506. el.if = exp;
  7507. addIfCondition(el, {
  7508. exp: exp,
  7509. block: el
  7510. });
  7511. } else {
  7512. if (getAndRemoveAttr(el, 'v-else') != null) {
  7513. el.else = true;
  7514. }
  7515. var elseif = getAndRemoveAttr(el, 'v-else-if');
  7516. if (elseif) {
  7517. el.elseif = elseif;
  7518. }
  7519. }
  7520. }
  7521. function processIfConditions (el, parent) {
  7522. var prev = findPrevElement(parent.children);
  7523. if (prev && prev.if) {
  7524. addIfCondition(prev, {
  7525. exp: el.elseif,
  7526. block: el
  7527. });
  7528. } else {
  7529. warn$2(
  7530. "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " +
  7531. "used on element <" + (el.tag) + "> without corresponding v-if."
  7532. );
  7533. }
  7534. }
  7535. function findPrevElement (children) {
  7536. var i = children.length;
  7537. while (i--) {
  7538. if (children[i].type === 1) {
  7539. return children[i]
  7540. } else {
  7541. if ("development" !== 'production' && children[i].text !== ' ') {
  7542. warn$2(
  7543. "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " +
  7544. "will be ignored."
  7545. );
  7546. }
  7547. children.pop();
  7548. }
  7549. }
  7550. }
  7551. function addIfCondition (el, condition) {
  7552. if (!el.ifConditions) {
  7553. el.ifConditions = [];
  7554. }
  7555. el.ifConditions.push(condition);
  7556. }
  7557. function processOnce (el) {
  7558. var once$$1 = getAndRemoveAttr(el, 'v-once');
  7559. if (once$$1 != null) {
  7560. el.once = true;
  7561. }
  7562. }
  7563. function processSlot (el) {
  7564. if (el.tag === 'slot') {
  7565. el.slotName = getBindingAttr(el, 'name');
  7566. if ("development" !== 'production' && el.key) {
  7567. warn$2(
  7568. "`key` does not work on <slot> because slots are abstract outlets " +
  7569. "and can possibly expand into multiple elements. " +
  7570. "Use the key on a wrapping element instead."
  7571. );
  7572. }
  7573. } else {
  7574. var slotTarget = getBindingAttr(el, 'slot');
  7575. if (slotTarget) {
  7576. el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
  7577. }
  7578. if (el.tag === 'template') {
  7579. el.slotScope = getAndRemoveAttr(el, 'scope');
  7580. }
  7581. }
  7582. }
  7583. function processComponent (el) {
  7584. var binding;
  7585. if ((binding = getBindingAttr(el, 'is'))) {
  7586. el.component = binding;
  7587. }
  7588. if (getAndRemoveAttr(el, 'inline-template') != null) {
  7589. el.inlineTemplate = true;
  7590. }
  7591. }
  7592. function processAttrs (el) {
  7593. var list = el.attrsList;
  7594. var i, l, name, rawName, value, modifiers, isProp;
  7595. for (i = 0, l = list.length; i < l; i++) {
  7596. name = rawName = list[i].name;
  7597. value = list[i].value;
  7598. if (dirRE.test(name)) {
  7599. // mark element as dynamic
  7600. el.hasBindings = true;
  7601. // modifiers
  7602. modifiers = parseModifiers(name);
  7603. if (modifiers) {
  7604. name = name.replace(modifierRE, '');
  7605. }
  7606. if (bindRE.test(name)) { // v-bind
  7607. name = name.replace(bindRE, '');
  7608. value = parseFilters(value);
  7609. isProp = false;
  7610. if (modifiers) {
  7611. if (modifiers.prop) {
  7612. isProp = true;
  7613. name = camelize(name);
  7614. if (name === 'innerHtml') { name = 'innerHTML'; }
  7615. }
  7616. if (modifiers.camel) {
  7617. name = camelize(name);
  7618. }
  7619. if (modifiers.sync) {
  7620. addHandler(
  7621. el,
  7622. ("update:" + (camelize(name))),
  7623. genAssignmentCode(value, "$event")
  7624. );
  7625. }
  7626. }
  7627. if (isProp || platformMustUseProp(el.tag, el.attrsMap.type, name)) {
  7628. addProp(el, name, value);
  7629. } else {
  7630. addAttr(el, name, value);
  7631. }
  7632. } else if (onRE.test(name)) { // v-on
  7633. name = name.replace(onRE, '');
  7634. addHandler(el, name, value, modifiers, false, warn$2);
  7635. } else { // normal directives
  7636. name = name.replace(dirRE, '');
  7637. // parse arg
  7638. var argMatch = name.match(argRE);
  7639. var arg = argMatch && argMatch[1];
  7640. if (arg) {
  7641. name = name.slice(0, -(arg.length + 1));
  7642. }
  7643. addDirective(el, name, rawName, value, arg, modifiers);
  7644. if ("development" !== 'production' && name === 'model') {
  7645. checkForAliasModel(el, value);
  7646. }
  7647. }
  7648. } else {
  7649. // literal attribute
  7650. {
  7651. var expression = parseText(value, delimiters);
  7652. if (expression) {
  7653. warn$2(
  7654. name + "=\"" + value + "\": " +
  7655. 'Interpolation inside attributes has been removed. ' +
  7656. 'Use v-bind or the colon shorthand instead. For example, ' +
  7657. 'instead of <div id="{{ val }}">, use <div :id="val">.'
  7658. );
  7659. }
  7660. }
  7661. addAttr(el, name, JSON.stringify(value));
  7662. }
  7663. }
  7664. }
  7665. function checkInFor (el) {
  7666. var parent = el;
  7667. while (parent) {
  7668. if (parent.for !== undefined) {
  7669. return true
  7670. }
  7671. parent = parent.parent;
  7672. }
  7673. return false
  7674. }
  7675. function parseModifiers (name) {
  7676. var match = name.match(modifierRE);
  7677. if (match) {
  7678. var ret = {};
  7679. match.forEach(function (m) { ret[m.slice(1)] = true; });
  7680. return ret
  7681. }
  7682. }
  7683. function makeAttrsMap (attrs) {
  7684. var map = {};
  7685. for (var i = 0, l = attrs.length; i < l; i++) {
  7686. if (
  7687. "development" !== 'production' &&
  7688. map[attrs[i].name] && !isIE && !isEdge
  7689. ) {
  7690. warn$2('duplicate attribute: ' + attrs[i].name);
  7691. }
  7692. map[attrs[i].name] = attrs[i].value;
  7693. }
  7694. return map
  7695. }
  7696. // for script (e.g. type="x/template") or style, do not decode content
  7697. function isTextTag (el) {
  7698. return el.tag === 'script' || el.tag === 'style'
  7699. }
  7700. function isForbiddenTag (el) {
  7701. return (
  7702. el.tag === 'style' ||
  7703. (el.tag === 'script' && (
  7704. !el.attrsMap.type ||
  7705. el.attrsMap.type === 'text/javascript'
  7706. ))
  7707. )
  7708. }
  7709. var ieNSBug = /^xmlns:NS\d+/;
  7710. var ieNSPrefix = /^NS\d+:/;
  7711. /* istanbul ignore next */
  7712. function guardIESVGBug (attrs) {
  7713. var res = [];
  7714. for (var i = 0; i < attrs.length; i++) {
  7715. var attr = attrs[i];
  7716. if (!ieNSBug.test(attr.name)) {
  7717. attr.name = attr.name.replace(ieNSPrefix, '');
  7718. res.push(attr);
  7719. }
  7720. }
  7721. return res
  7722. }
  7723. function checkForAliasModel (el, value) {
  7724. var _el = el;
  7725. while (_el) {
  7726. if (_el.for && _el.alias === value) {
  7727. warn$2(
  7728. "<" + (el.tag) + " v-model=\"" + value + "\">: " +
  7729. "You are binding v-model directly to a v-for iteration alias. " +
  7730. "This will not be able to modify the v-for source array because " +
  7731. "writing to the alias is like modifying a function local variable. " +
  7732. "Consider using an array of objects and use v-model on an object property instead."
  7733. );
  7734. }
  7735. _el = _el.parent;
  7736. }
  7737. }
  7738. /* */
  7739. var isStaticKey;
  7740. var isPlatformReservedTag;
  7741. var genStaticKeysCached = cached(genStaticKeys$1);
  7742. /**
  7743. * Goal of the optimizer: walk the generated template AST tree
  7744. * and detect sub-trees that are purely static, i.e. parts of
  7745. * the DOM that never needs to change.
  7746. *
  7747. * Once we detect these sub-trees, we can:
  7748. *
  7749. * 1. Hoist them into constants, so that we no longer need to
  7750. * create fresh nodes for them on each re-render;
  7751. * 2. Completely skip them in the patching process.
  7752. */
  7753. function optimize (root, options) {
  7754. if (!root) { return }
  7755. isStaticKey = genStaticKeysCached(options.staticKeys || '');
  7756. isPlatformReservedTag = options.isReservedTag || no;
  7757. // first pass: mark all non-static nodes.
  7758. markStatic$1(root);
  7759. // second pass: mark static roots.
  7760. markStaticRoots(root, false);
  7761. }
  7762. function genStaticKeys$1 (keys) {
  7763. return makeMap(
  7764. 'type,tag,attrsList,attrsMap,plain,parent,children,attrs' +
  7765. (keys ? ',' + keys : '')
  7766. )
  7767. }
  7768. function markStatic$1 (node) {
  7769. node.static = isStatic(node);
  7770. if (node.type === 1) {
  7771. // do not make component slot content static. this avoids
  7772. // 1. components not able to mutate slot nodes
  7773. // 2. static slot content fails for hot-reloading
  7774. if (
  7775. !isPlatformReservedTag(node.tag) &&
  7776. node.tag !== 'slot' &&
  7777. node.attrsMap['inline-template'] == null
  7778. ) {
  7779. return
  7780. }
  7781. for (var i = 0, l = node.children.length; i < l; i++) {
  7782. var child = node.children[i];
  7783. markStatic$1(child);
  7784. if (!child.static) {
  7785. node.static = false;
  7786. }
  7787. }
  7788. }
  7789. }
  7790. function markStaticRoots (node, isInFor) {
  7791. if (node.type === 1) {
  7792. if (node.static || node.once) {
  7793. node.staticInFor = isInFor;
  7794. }
  7795. // For a node to qualify as a static root, it should have children that
  7796. // are not just static text. Otherwise the cost of hoisting out will
  7797. // outweigh the benefits and it's better off to just always render it fresh.
  7798. if (node.static && node.children.length && !(
  7799. node.children.length === 1 &&
  7800. node.children[0].type === 3
  7801. )) {
  7802. node.staticRoot = true;
  7803. return
  7804. } else {
  7805. node.staticRoot = false;
  7806. }
  7807. if (node.children) {
  7808. for (var i = 0, l = node.children.length; i < l; i++) {
  7809. markStaticRoots(node.children[i], isInFor || !!node.for);
  7810. }
  7811. }
  7812. if (node.ifConditions) {
  7813. walkThroughConditionsBlocks(node.ifConditions, isInFor);
  7814. }
  7815. }
  7816. }
  7817. function walkThroughConditionsBlocks (conditionBlocks, isInFor) {
  7818. for (var i = 1, len = conditionBlocks.length; i < len; i++) {
  7819. markStaticRoots(conditionBlocks[i].block, isInFor);
  7820. }
  7821. }
  7822. function isStatic (node) {
  7823. if (node.type === 2) { // expression
  7824. return false
  7825. }
  7826. if (node.type === 3) { // text
  7827. return true
  7828. }
  7829. return !!(node.pre || (
  7830. !node.hasBindings && // no dynamic bindings
  7831. !node.if && !node.for && // not v-if or v-for or v-else
  7832. !isBuiltInTag(node.tag) && // not a built-in
  7833. isPlatformReservedTag(node.tag) && // not a component
  7834. !isDirectChildOfTemplateFor(node) &&
  7835. Object.keys(node).every(isStaticKey)
  7836. ))
  7837. }
  7838. function isDirectChildOfTemplateFor (node) {
  7839. while (node.parent) {
  7840. node = node.parent;
  7841. if (node.tag !== 'template') {
  7842. return false
  7843. }
  7844. if (node.for) {
  7845. return true
  7846. }
  7847. }
  7848. return false
  7849. }
  7850. /* */
  7851. var fnExpRE = /^\s*([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/;
  7852. var simplePathRE = /^\s*[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?']|\[".*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*\s*$/;
  7853. // keyCode aliases
  7854. var keyCodes = {
  7855. esc: 27,
  7856. tab: 9,
  7857. enter: 13,
  7858. space: 32,
  7859. up: 38,
  7860. left: 37,
  7861. right: 39,
  7862. down: 40,
  7863. 'delete': [8, 46]
  7864. };
  7865. // #4868: modifiers that prevent the execution of the listener
  7866. // need to explicitly return null so that we can determine whether to remove
  7867. // the listener for .once
  7868. var genGuard = function (condition) { return ("if(" + condition + ")return null;"); };
  7869. var modifierCode = {
  7870. stop: '$event.stopPropagation();',
  7871. prevent: '$event.preventDefault();',
  7872. self: genGuard("$event.target !== $event.currentTarget"),
  7873. ctrl: genGuard("!$event.ctrlKey"),
  7874. shift: genGuard("!$event.shiftKey"),
  7875. alt: genGuard("!$event.altKey"),
  7876. meta: genGuard("!$event.metaKey"),
  7877. left: genGuard("'button' in $event && $event.button !== 0"),
  7878. middle: genGuard("'button' in $event && $event.button !== 1"),
  7879. right: genGuard("'button' in $event && $event.button !== 2")
  7880. };
  7881. function genHandlers (
  7882. events,
  7883. isNative,
  7884. warn
  7885. ) {
  7886. var res = isNative ? 'nativeOn:{' : 'on:{';
  7887. for (var name in events) {
  7888. var handler = events[name];
  7889. // #5330: warn click.right, since right clicks do not actually fire click events.
  7890. if ("development" !== 'production' &&
  7891. name === 'click' &&
  7892. handler && handler.modifiers && handler.modifiers.right
  7893. ) {
  7894. warn(
  7895. "Use \"contextmenu\" instead of \"click.right\" since right clicks " +
  7896. "do not actually fire \"click\" events."
  7897. );
  7898. }
  7899. res += "\"" + name + "\":" + (genHandler(name, handler)) + ",";
  7900. }
  7901. return res.slice(0, -1) + '}'
  7902. }
  7903. function genHandler (
  7904. name,
  7905. handler
  7906. ) {
  7907. if (!handler) {
  7908. return 'function(){}'
  7909. }
  7910. if (Array.isArray(handler)) {
  7911. return ("[" + (handler.map(function (handler) { return genHandler(name, handler); }).join(',')) + "]")
  7912. }
  7913. var isMethodPath = simplePathRE.test(handler.value);
  7914. var isFunctionExpression = fnExpRE.test(handler.value);
  7915. if (!handler.modifiers) {
  7916. return isMethodPath || isFunctionExpression
  7917. ? handler.value
  7918. : ("function($event){" + (handler.value) + "}") // inline statement
  7919. } else {
  7920. var code = '';
  7921. var genModifierCode = '';
  7922. var keys = [];
  7923. for (var key in handler.modifiers) {
  7924. if (modifierCode[key]) {
  7925. genModifierCode += modifierCode[key];
  7926. // left/right
  7927. if (keyCodes[key]) {
  7928. keys.push(key);
  7929. }
  7930. } else {
  7931. keys.push(key);
  7932. }
  7933. }
  7934. if (keys.length) {
  7935. code += genKeyFilter(keys);
  7936. }
  7937. // Make sure modifiers like prevent and stop get executed after key filtering
  7938. if (genModifierCode) {
  7939. code += genModifierCode;
  7940. }
  7941. var handlerCode = isMethodPath
  7942. ? handler.value + '($event)'
  7943. : isFunctionExpression
  7944. ? ("(" + (handler.value) + ")($event)")
  7945. : handler.value;
  7946. return ("function($event){" + code + handlerCode + "}")
  7947. }
  7948. }
  7949. function genKeyFilter (keys) {
  7950. return ("if(!('button' in $event)&&" + (keys.map(genFilterCode).join('&&')) + ")return null;")
  7951. }
  7952. function genFilterCode (key) {
  7953. var keyVal = parseInt(key, 10);
  7954. if (keyVal) {
  7955. return ("$event.keyCode!==" + keyVal)
  7956. }
  7957. var alias = keyCodes[key];
  7958. return ("_k($event.keyCode," + (JSON.stringify(key)) + (alias ? ',' + JSON.stringify(alias) : '') + ")")
  7959. }
  7960. /* */
  7961. function bind$1 (el, dir) {
  7962. el.wrapData = function (code) {
  7963. return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + (dir.modifiers && dir.modifiers.prop ? ',true' : '') + ")")
  7964. };
  7965. }
  7966. /* */
  7967. var baseDirectives = {
  7968. bind: bind$1,
  7969. cloak: noop
  7970. };
  7971. /* */
  7972. // configurable state
  7973. var warn$3;
  7974. var transforms$1;
  7975. var dataGenFns;
  7976. var platformDirectives$1;
  7977. var isPlatformReservedTag$1;
  7978. var staticRenderFns;
  7979. var onceCount;
  7980. var currentOptions;
  7981. function generate (
  7982. ast,
  7983. options
  7984. ) {
  7985. // save previous staticRenderFns so generate calls can be nested
  7986. var prevStaticRenderFns = staticRenderFns;
  7987. var currentStaticRenderFns = staticRenderFns = [];
  7988. var prevOnceCount = onceCount;
  7989. onceCount = 0;
  7990. currentOptions = options;
  7991. warn$3 = options.warn || baseWarn;
  7992. transforms$1 = pluckModuleFunction(options.modules, 'transformCode');
  7993. dataGenFns = pluckModuleFunction(options.modules, 'genData');
  7994. platformDirectives$1 = options.directives || {};
  7995. isPlatformReservedTag$1 = options.isReservedTag || no;
  7996. var code = ast ? genElement(ast) : '_c("div")';
  7997. staticRenderFns = prevStaticRenderFns;
  7998. onceCount = prevOnceCount;
  7999. return {
  8000. render: ("with(this){return " + code + "}"),
  8001. staticRenderFns: currentStaticRenderFns
  8002. }
  8003. }
  8004. function genElement (el) {
  8005. if (el.staticRoot && !el.staticProcessed) {
  8006. return genStatic(el)
  8007. } else if (el.once && !el.onceProcessed) {
  8008. return genOnce(el)
  8009. } else if (el.for && !el.forProcessed) {
  8010. return genFor(el)
  8011. } else if (el.if && !el.ifProcessed) {
  8012. return genIf(el)
  8013. } else if (el.tag === 'template' && !el.slotTarget) {
  8014. return genChildren(el) || 'void 0'
  8015. } else if (el.tag === 'slot') {
  8016. return genSlot(el)
  8017. } else {
  8018. // component or element
  8019. var code;
  8020. if (el.component) {
  8021. code = genComponent(el.component, el);
  8022. } else {
  8023. var data = el.plain ? undefined : genData(el);
  8024. var children = el.inlineTemplate ? null : genChildren(el, true);
  8025. code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")";
  8026. }
  8027. // module transforms
  8028. for (var i = 0; i < transforms$1.length; i++) {
  8029. code = transforms$1[i](el, code);
  8030. }
  8031. return code
  8032. }
  8033. }
  8034. // hoist static sub-trees out
  8035. function genStatic (el) {
  8036. el.staticProcessed = true;
  8037. staticRenderFns.push(("with(this){return " + (genElement(el)) + "}"));
  8038. return ("_m(" + (staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")")
  8039. }
  8040. // v-once
  8041. function genOnce (el) {
  8042. el.onceProcessed = true;
  8043. if (el.if && !el.ifProcessed) {
  8044. return genIf(el)
  8045. } else if (el.staticInFor) {
  8046. var key = '';
  8047. var parent = el.parent;
  8048. while (parent) {
  8049. if (parent.for) {
  8050. key = parent.key;
  8051. break
  8052. }
  8053. parent = parent.parent;
  8054. }
  8055. if (!key) {
  8056. "development" !== 'production' && warn$3(
  8057. "v-once can only be used inside v-for that is keyed. "
  8058. );
  8059. return genElement(el)
  8060. }
  8061. return ("_o(" + (genElement(el)) + "," + (onceCount++) + (key ? ("," + key) : "") + ")")
  8062. } else {
  8063. return genStatic(el)
  8064. }
  8065. }
  8066. function genIf (el) {
  8067. el.ifProcessed = true; // avoid recursion
  8068. return genIfConditions(el.ifConditions.slice())
  8069. }
  8070. function genIfConditions (conditions) {
  8071. if (!conditions.length) {
  8072. return '_e()'
  8073. }
  8074. var condition = conditions.shift();
  8075. if (condition.exp) {
  8076. return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions)))
  8077. } else {
  8078. return ("" + (genTernaryExp(condition.block)))
  8079. }
  8080. // v-if with v-once should generate code like (a)?_m(0):_m(1)
  8081. function genTernaryExp (el) {
  8082. return el.once ? genOnce(el) : genElement(el)
  8083. }
  8084. }
  8085. function genFor (el) {
  8086. var exp = el.for;
  8087. var alias = el.alias;
  8088. var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
  8089. var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
  8090. if (
  8091. "development" !== 'production' &&
  8092. maybeComponent(el) && el.tag !== 'slot' && el.tag !== 'template' && !el.key
  8093. ) {
  8094. warn$3(
  8095. "<" + (el.tag) + " v-for=\"" + alias + " in " + exp + "\">: component lists rendered with " +
  8096. "v-for should have explicit keys. " +
  8097. "See https://vuejs.org/guide/list.html#key for more info.",
  8098. true /* tip */
  8099. );
  8100. }
  8101. el.forProcessed = true; // avoid recursion
  8102. return "_l((" + exp + ")," +
  8103. "function(" + alias + iterator1 + iterator2 + "){" +
  8104. "return " + (genElement(el)) +
  8105. '})'
  8106. }
  8107. function genData (el) {
  8108. var data = '{';
  8109. // directives first.
  8110. // directives may mutate the el's other properties before they are generated.
  8111. var dirs = genDirectives(el);
  8112. if (dirs) { data += dirs + ','; }
  8113. // key
  8114. if (el.key) {
  8115. data += "key:" + (el.key) + ",";
  8116. }
  8117. // ref
  8118. if (el.ref) {
  8119. data += "ref:" + (el.ref) + ",";
  8120. }
  8121. if (el.refInFor) {
  8122. data += "refInFor:true,";
  8123. }
  8124. // pre
  8125. if (el.pre) {
  8126. data += "pre:true,";
  8127. }
  8128. // record original tag name for components using "is" attribute
  8129. if (el.component) {
  8130. data += "tag:\"" + (el.tag) + "\",";
  8131. }
  8132. // module data generation functions
  8133. for (var i = 0; i < dataGenFns.length; i++) {
  8134. data += dataGenFns[i](el);
  8135. }
  8136. // attributes
  8137. if (el.attrs) {
  8138. data += "attrs:{" + (genProps(el.attrs)) + "},";
  8139. }
  8140. // DOM props
  8141. if (el.props) {
  8142. data += "domProps:{" + (genProps(el.props)) + "},";
  8143. }
  8144. // event handlers
  8145. if (el.events) {
  8146. data += (genHandlers(el.events, false, warn$3)) + ",";
  8147. }
  8148. if (el.nativeEvents) {
  8149. data += (genHandlers(el.nativeEvents, true, warn$3)) + ",";
  8150. }
  8151. // slot target
  8152. if (el.slotTarget) {
  8153. data += "slot:" + (el.slotTarget) + ",";
  8154. }
  8155. // scoped slots
  8156. if (el.scopedSlots) {
  8157. data += (genScopedSlots(el.scopedSlots)) + ",";
  8158. }
  8159. // component v-model
  8160. if (el.model) {
  8161. data += "model:{value:" + (el.model.value) + ",callback:" + (el.model.callback) + ",expression:" + (el.model.expression) + "},";
  8162. }
  8163. // inline-template
  8164. if (el.inlineTemplate) {
  8165. var inlineTemplate = genInlineTemplate(el);
  8166. if (inlineTemplate) {
  8167. data += inlineTemplate + ",";
  8168. }
  8169. }
  8170. data = data.replace(/,$/, '') + '}';
  8171. // v-bind data wrap
  8172. if (el.wrapData) {
  8173. data = el.wrapData(data);
  8174. }
  8175. return data
  8176. }
  8177. function genDirectives (el) {
  8178. var dirs = el.directives;
  8179. if (!dirs) { return }
  8180. var res = 'directives:[';
  8181. var hasRuntime = false;
  8182. var i, l, dir, needRuntime;
  8183. for (i = 0, l = dirs.length; i < l; i++) {
  8184. dir = dirs[i];
  8185. needRuntime = true;
  8186. var gen = platformDirectives$1[dir.name] || baseDirectives[dir.name];
  8187. if (gen) {
  8188. // compile-time directive that manipulates AST.
  8189. // returns true if it also needs a runtime counterpart.
  8190. needRuntime = !!gen(el, dir, warn$3);
  8191. }
  8192. if (needRuntime) {
  8193. hasRuntime = true;
  8194. res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:\"" + (dir.arg) + "\"") : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},";
  8195. }
  8196. }
  8197. if (hasRuntime) {
  8198. return res.slice(0, -1) + ']'
  8199. }
  8200. }
  8201. function genInlineTemplate (el) {
  8202. var ast = el.children[0];
  8203. if ("development" !== 'production' && (
  8204. el.children.length > 1 || ast.type !== 1
  8205. )) {
  8206. warn$3('Inline-template components must have exactly one child element.');
  8207. }
  8208. if (ast.type === 1) {
  8209. var inlineRenderFns = generate(ast, currentOptions);
  8210. return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}")
  8211. }
  8212. }
  8213. function genScopedSlots (slots) {
  8214. return ("scopedSlots:_u([" + (Object.keys(slots).map(function (key) { return genScopedSlot(key, slots[key]); }).join(',')) + "])")
  8215. }
  8216. function genScopedSlot (key, el) {
  8217. if (el.for && !el.forProcessed) {
  8218. return genForScopedSlot(key, el)
  8219. }
  8220. return "{key:" + key + ",fn:function(" + (String(el.attrsMap.scope)) + "){" +
  8221. "return " + (el.tag === 'template'
  8222. ? genChildren(el) || 'void 0'
  8223. : genElement(el)) + "}}"
  8224. }
  8225. function genForScopedSlot (key, el) {
  8226. var exp = el.for;
  8227. var alias = el.alias;
  8228. var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
  8229. var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
  8230. el.forProcessed = true; // avoid recursion
  8231. return "_l((" + exp + ")," +
  8232. "function(" + alias + iterator1 + iterator2 + "){" +
  8233. "return " + (genScopedSlot(key, el)) +
  8234. '})'
  8235. }
  8236. function genChildren (el, checkSkip) {
  8237. var children = el.children;
  8238. if (children.length) {
  8239. var el$1 = children[0];
  8240. // optimize single v-for
  8241. if (children.length === 1 &&
  8242. el$1.for &&
  8243. el$1.tag !== 'template' &&
  8244. el$1.tag !== 'slot'
  8245. ) {
  8246. return genElement(el$1)
  8247. }
  8248. var normalizationType = checkSkip ? getNormalizationType(children) : 0;
  8249. return ("[" + (children.map(genNode).join(',')) + "]" + (normalizationType ? ("," + normalizationType) : ''))
  8250. }
  8251. }
  8252. // determine the normalization needed for the children array.
  8253. // 0: no normalization needed
  8254. // 1: simple normalization needed (possible 1-level deep nested array)
  8255. // 2: full normalization needed
  8256. function getNormalizationType (children) {
  8257. var res = 0;
  8258. for (var i = 0; i < children.length; i++) {
  8259. var el = children[i];
  8260. if (el.type !== 1) {
  8261. continue
  8262. }
  8263. if (needsNormalization(el) ||
  8264. (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
  8265. res = 2;
  8266. break
  8267. }
  8268. if (maybeComponent(el) ||
  8269. (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
  8270. res = 1;
  8271. }
  8272. }
  8273. return res
  8274. }
  8275. function needsNormalization (el) {
  8276. return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'
  8277. }
  8278. function maybeComponent (el) {
  8279. return !isPlatformReservedTag$1(el.tag)
  8280. }
  8281. function genNode (node) {
  8282. if (node.type === 1) {
  8283. return genElement(node)
  8284. } else {
  8285. return genText(node)
  8286. }
  8287. }
  8288. function genText (text) {
  8289. return ("_v(" + (text.type === 2
  8290. ? text.expression // no need for () because already wrapped in _s()
  8291. : transformSpecialNewlines(JSON.stringify(text.text))) + ")")
  8292. }
  8293. function genSlot (el) {
  8294. var slotName = el.slotName || '"default"';
  8295. var children = genChildren(el);
  8296. var res = "_t(" + slotName + (children ? ("," + children) : '');
  8297. var attrs = el.attrs && ("{" + (el.attrs.map(function (a) { return ((camelize(a.name)) + ":" + (a.value)); }).join(',')) + "}");
  8298. var bind$$1 = el.attrsMap['v-bind'];
  8299. if ((attrs || bind$$1) && !children) {
  8300. res += ",null";
  8301. }
  8302. if (attrs) {
  8303. res += "," + attrs;
  8304. }
  8305. if (bind$$1) {
  8306. res += (attrs ? '' : ',null') + "," + bind$$1;
  8307. }
  8308. return res + ')'
  8309. }
  8310. // componentName is el.component, take it as argument to shun flow's pessimistic refinement
  8311. function genComponent (componentName, el) {
  8312. var children = el.inlineTemplate ? null : genChildren(el, true);
  8313. return ("_c(" + componentName + "," + (genData(el)) + (children ? ("," + children) : '') + ")")
  8314. }
  8315. function genProps (props) {
  8316. var res = '';
  8317. for (var i = 0; i < props.length; i++) {
  8318. var prop = props[i];
  8319. res += "\"" + (prop.name) + "\":" + (transformSpecialNewlines(prop.value)) + ",";
  8320. }
  8321. return res.slice(0, -1)
  8322. }
  8323. // #3895, #4268
  8324. function transformSpecialNewlines (text) {
  8325. return text
  8326. .replace(/\u2028/g, '\\u2028')
  8327. .replace(/\u2029/g, '\\u2029')
  8328. }
  8329. /* */
  8330. // these keywords should not appear inside expressions, but operators like
  8331. // typeof, instanceof and in are allowed
  8332. var prohibitedKeywordRE = new RegExp('\\b' + (
  8333. 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
  8334. 'super,throw,while,yield,delete,export,import,return,switch,default,' +
  8335. 'extends,finally,continue,debugger,function,arguments'
  8336. ).split(',').join('\\b|\\b') + '\\b');
  8337. // these unary operators should not be used as property/method names
  8338. var unaryOperatorsRE = new RegExp('\\b' + (
  8339. 'delete,typeof,void'
  8340. ).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
  8341. // check valid identifier for v-for
  8342. var identRE = /[A-Za-z_$][\w$]*/;
  8343. // strip strings in expressions
  8344. var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
  8345. // detect problematic expressions in a template
  8346. function detectErrors (ast) {
  8347. var errors = [];
  8348. if (ast) {
  8349. checkNode(ast, errors);
  8350. }
  8351. return errors
  8352. }
  8353. function checkNode (node, errors) {
  8354. if (node.type === 1) {
  8355. for (var name in node.attrsMap) {
  8356. if (dirRE.test(name)) {
  8357. var value = node.attrsMap[name];
  8358. if (value) {
  8359. if (name === 'v-for') {
  8360. checkFor(node, ("v-for=\"" + value + "\""), errors);
  8361. } else if (onRE.test(name)) {
  8362. checkEvent(value, (name + "=\"" + value + "\""), errors);
  8363. } else {
  8364. checkExpression(value, (name + "=\"" + value + "\""), errors);
  8365. }
  8366. }
  8367. }
  8368. }
  8369. if (node.children) {
  8370. for (var i = 0; i < node.children.length; i++) {
  8371. checkNode(node.children[i], errors);
  8372. }
  8373. }
  8374. } else if (node.type === 2) {
  8375. checkExpression(node.expression, node.text, errors);
  8376. }
  8377. }
  8378. function checkEvent (exp, text, errors) {
  8379. var stipped = exp.replace(stripStringRE, '');
  8380. var keywordMatch = stipped.match(unaryOperatorsRE);
  8381. if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') {
  8382. errors.push(
  8383. "avoid using JavaScript unary operator as property name: " +
  8384. "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim())
  8385. );
  8386. }
  8387. checkExpression(exp, text, errors);
  8388. }
  8389. function checkFor (node, text, errors) {
  8390. checkExpression(node.for || '', text, errors);
  8391. checkIdentifier(node.alias, 'v-for alias', text, errors);
  8392. checkIdentifier(node.iterator1, 'v-for iterator', text, errors);
  8393. checkIdentifier(node.iterator2, 'v-for iterator', text, errors);
  8394. }
  8395. function checkIdentifier (ident, type, text, errors) {
  8396. if (typeof ident === 'string' && !identRE.test(ident)) {
  8397. errors.push(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())));
  8398. }
  8399. }
  8400. function checkExpression (exp, text, errors) {
  8401. try {
  8402. new Function(("return " + exp));
  8403. } catch (e) {
  8404. var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
  8405. if (keywordMatch) {
  8406. errors.push(
  8407. "avoid using JavaScript keyword as property name: " +
  8408. "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim())
  8409. );
  8410. } else {
  8411. errors.push(("invalid expression: " + (text.trim())));
  8412. }
  8413. }
  8414. }
  8415. /* */
  8416. function baseCompile (
  8417. template,
  8418. options
  8419. ) {
  8420. var ast = parse(template.trim(), options);
  8421. optimize(ast, options);
  8422. var code = generate(ast, options);
  8423. return {
  8424. ast: ast,
  8425. render: code.render,
  8426. staticRenderFns: code.staticRenderFns
  8427. }
  8428. }
  8429. function makeFunction (code, errors) {
  8430. try {
  8431. return new Function(code)
  8432. } catch (err) {
  8433. errors.push({ err: err, code: code });
  8434. return noop
  8435. }
  8436. }
  8437. function createCompiler (baseOptions) {
  8438. var functionCompileCache = Object.create(null);
  8439. function compile (
  8440. template,
  8441. options
  8442. ) {
  8443. var finalOptions = Object.create(baseOptions);
  8444. var errors = [];
  8445. var tips = [];
  8446. finalOptions.warn = function (msg, tip$$1) {
  8447. (tip$$1 ? tips : errors).push(msg);
  8448. };
  8449. if (options) {
  8450. // merge custom modules
  8451. if (options.modules) {
  8452. finalOptions.modules = (baseOptions.modules || []).concat(options.modules);
  8453. }
  8454. // merge custom directives
  8455. if (options.directives) {
  8456. finalOptions.directives = extend(
  8457. Object.create(baseOptions.directives),
  8458. options.directives
  8459. );
  8460. }
  8461. // copy other options
  8462. for (var key in options) {
  8463. if (key !== 'modules' && key !== 'directives') {
  8464. finalOptions[key] = options[key];
  8465. }
  8466. }
  8467. }
  8468. var compiled = baseCompile(template, finalOptions);
  8469. {
  8470. errors.push.apply(errors, detectErrors(compiled.ast));
  8471. }
  8472. compiled.errors = errors;
  8473. compiled.tips = tips;
  8474. return compiled
  8475. }
  8476. function compileToFunctions (
  8477. template,
  8478. options,
  8479. vm
  8480. ) {
  8481. options = options || {};
  8482. /* istanbul ignore if */
  8483. {
  8484. // detect possible CSP restriction
  8485. try {
  8486. new Function('return 1');
  8487. } catch (e) {
  8488. if (e.toString().match(/unsafe-eval|CSP/)) {
  8489. warn(
  8490. 'It seems you are using the standalone build of Vue.js in an ' +
  8491. 'environment with Content Security Policy that prohibits unsafe-eval. ' +
  8492. 'The template compiler cannot work in this environment. Consider ' +
  8493. 'relaxing the policy to allow unsafe-eval or pre-compiling your ' +
  8494. 'templates into render functions.'
  8495. );
  8496. }
  8497. }
  8498. }
  8499. // check cache
  8500. var key = options.delimiters
  8501. ? String(options.delimiters) + template
  8502. : template;
  8503. if (functionCompileCache[key]) {
  8504. return functionCompileCache[key]
  8505. }
  8506. // compile
  8507. var compiled = compile(template, options);
  8508. // check compilation errors/tips
  8509. {
  8510. if (compiled.errors && compiled.errors.length) {
  8511. warn(
  8512. "Error compiling template:\n\n" + template + "\n\n" +
  8513. compiled.errors.map(function (e) { return ("- " + e); }).join('\n') + '\n',
  8514. vm
  8515. );
  8516. }
  8517. if (compiled.tips && compiled.tips.length) {
  8518. compiled.tips.forEach(function (msg) { return tip(msg, vm); });
  8519. }
  8520. }
  8521. // turn code into functions
  8522. var res = {};
  8523. var fnGenErrors = [];
  8524. res.render = makeFunction(compiled.render, fnGenErrors);
  8525. var l = compiled.staticRenderFns.length;
  8526. res.staticRenderFns = new Array(l);
  8527. for (var i = 0; i < l; i++) {
  8528. res.staticRenderFns[i] = makeFunction(compiled.staticRenderFns[i], fnGenErrors);
  8529. }
  8530. // check function generation errors.
  8531. // this should only happen if there is a bug in the compiler itself.
  8532. // mostly for codegen development use
  8533. /* istanbul ignore if */
  8534. {
  8535. if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {
  8536. warn(
  8537. "Failed to generate render function:\n\n" +
  8538. fnGenErrors.map(function (ref) {
  8539. var err = ref.err;
  8540. var code = ref.code;
  8541. return ((err.toString()) + " in\n\n" + code + "\n");
  8542. }).join('\n'),
  8543. vm
  8544. );
  8545. }
  8546. }
  8547. return (functionCompileCache[key] = res)
  8548. }
  8549. return {
  8550. compile: compile,
  8551. compileToFunctions: compileToFunctions
  8552. }
  8553. }
  8554. /* */
  8555. function transformNode (el, options) {
  8556. var warn = options.warn || baseWarn;
  8557. var staticClass = getAndRemoveAttr(el, 'class');
  8558. if ("development" !== 'production' && staticClass) {
  8559. var expression = parseText(staticClass, options.delimiters);
  8560. if (expression) {
  8561. warn(
  8562. "class=\"" + staticClass + "\": " +
  8563. 'Interpolation inside attributes has been removed. ' +
  8564. 'Use v-bind or the colon shorthand instead. For example, ' +
  8565. 'instead of <div class="{{ val }}">, use <div :class="val">.'
  8566. );
  8567. }
  8568. }
  8569. if (staticClass) {
  8570. el.staticClass = JSON.stringify(staticClass);
  8571. }
  8572. var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
  8573. if (classBinding) {
  8574. el.classBinding = classBinding;
  8575. }
  8576. }
  8577. function genData$1 (el) {
  8578. var data = '';
  8579. if (el.staticClass) {
  8580. data += "staticClass:" + (el.staticClass) + ",";
  8581. }
  8582. if (el.classBinding) {
  8583. data += "class:" + (el.classBinding) + ",";
  8584. }
  8585. return data
  8586. }
  8587. var klass$1 = {
  8588. staticKeys: ['staticClass'],
  8589. transformNode: transformNode,
  8590. genData: genData$1
  8591. };
  8592. /* */
  8593. function transformNode$1 (el, options) {
  8594. var warn = options.warn || baseWarn;
  8595. var staticStyle = getAndRemoveAttr(el, 'style');
  8596. if (staticStyle) {
  8597. /* istanbul ignore if */
  8598. {
  8599. var expression = parseText(staticStyle, options.delimiters);
  8600. if (expression) {
  8601. warn(
  8602. "style=\"" + staticStyle + "\": " +
  8603. 'Interpolation inside attributes has been removed. ' +
  8604. 'Use v-bind or the colon shorthand instead. For example, ' +
  8605. 'instead of <div style="{{ val }}">, use <div :style="val">.'
  8606. );
  8607. }
  8608. }
  8609. el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
  8610. }
  8611. var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
  8612. if (styleBinding) {
  8613. el.styleBinding = styleBinding;
  8614. }
  8615. }
  8616. function genData$2 (el) {
  8617. var data = '';
  8618. if (el.staticStyle) {
  8619. data += "staticStyle:" + (el.staticStyle) + ",";
  8620. }
  8621. if (el.styleBinding) {
  8622. data += "style:(" + (el.styleBinding) + "),";
  8623. }
  8624. return data
  8625. }
  8626. var style$1 = {
  8627. staticKeys: ['staticStyle'],
  8628. transformNode: transformNode$1,
  8629. genData: genData$2
  8630. };
  8631. var modules$1 = [
  8632. klass$1,
  8633. style$1
  8634. ];
  8635. /* */
  8636. function text (el, dir) {
  8637. if (dir.value) {
  8638. addProp(el, 'textContent', ("_s(" + (dir.value) + ")"));
  8639. }
  8640. }
  8641. /* */
  8642. function html (el, dir) {
  8643. if (dir.value) {
  8644. addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"));
  8645. }
  8646. }
  8647. var directives$1 = {
  8648. model: model,
  8649. text: text,
  8650. html: html
  8651. };
  8652. /* */
  8653. var baseOptions = {
  8654. expectHTML: true,
  8655. modules: modules$1,
  8656. directives: directives$1,
  8657. isPreTag: isPreTag,
  8658. isUnaryTag: isUnaryTag,
  8659. mustUseProp: mustUseProp,
  8660. canBeLeftOpenTag: canBeLeftOpenTag,
  8661. isReservedTag: isReservedTag,
  8662. getTagNamespace: getTagNamespace,
  8663. staticKeys: genStaticKeys(modules$1)
  8664. };
  8665. var ref$1 = createCompiler(baseOptions);
  8666. var compileToFunctions = ref$1.compileToFunctions;
  8667. /* */
  8668. var idToTemplate = cached(function (id) {
  8669. var el = query(id);
  8670. return el && el.innerHTML
  8671. });
  8672. var mount = Vue$3.prototype.$mount;
  8673. Vue$3.prototype.$mount = function (
  8674. el,
  8675. hydrating
  8676. ) {
  8677. el = el && query(el);
  8678. /* istanbul ignore if */
  8679. if (el === document.body || el === document.documentElement) {
  8680. "development" !== 'production' && warn(
  8681. "Do not mount Vue to <html> or <body> - mount to normal elements instead."
  8682. );
  8683. return this
  8684. }
  8685. var options = this.$options;
  8686. // resolve template/el and convert to render function
  8687. if (!options.render) {
  8688. var template = options.template;
  8689. if (template) {
  8690. if (typeof template === 'string') {
  8691. if (template.charAt(0) === '#') {
  8692. template = idToTemplate(template);
  8693. /* istanbul ignore if */
  8694. if ("development" !== 'production' && !template) {
  8695. warn(
  8696. ("Template element not found or is empty: " + (options.template)),
  8697. this
  8698. );
  8699. }
  8700. }
  8701. } else if (template.nodeType) {
  8702. template = template.innerHTML;
  8703. } else {
  8704. {
  8705. warn('invalid template option:' + template, this);
  8706. }
  8707. return this
  8708. }
  8709. } else if (el) {
  8710. template = getOuterHTML(el);
  8711. }
  8712. if (template) {
  8713. /* istanbul ignore if */
  8714. if ("development" !== 'production' && config.performance && mark) {
  8715. mark('compile');
  8716. }
  8717. var ref = compileToFunctions(template, {
  8718. shouldDecodeNewlines: shouldDecodeNewlines,
  8719. delimiters: options.delimiters
  8720. }, this);
  8721. var render = ref.render;
  8722. var staticRenderFns = ref.staticRenderFns;
  8723. options.render = render;
  8724. options.staticRenderFns = staticRenderFns;
  8725. /* istanbul ignore if */
  8726. if ("development" !== 'production' && config.performance && mark) {
  8727. mark('compile end');
  8728. measure(((this._name) + " compile"), 'compile', 'compile end');
  8729. }
  8730. }
  8731. }
  8732. return mount.call(this, el, hydrating)
  8733. };
  8734. /**
  8735. * Get outerHTML of elements, taking care
  8736. * of SVG elements in IE as well.
  8737. */
  8738. function getOuterHTML (el) {
  8739. if (el.outerHTML) {
  8740. return el.outerHTML
  8741. } else {
  8742. var container = document.createElement('div');
  8743. container.appendChild(el.cloneNode(true));
  8744. return container.innerHTML
  8745. }
  8746. }
  8747. Vue$3.compile = compileToFunctions;
  8748. return Vue$3;
  8749. })));