vue.js 313 KB

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