Keine Beschreibung

vue@2.2.6.js 239KB

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