vue.runtime.esm.js 296 KB

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