vue-2.1.6.js 212 KB

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