runtime-core.cjs.prod.js 183 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438
  1. /**
  2. * @vue/runtime-core v3.4.25
  3. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  4. * @license MIT
  5. **/
  6. 'use strict';
  7. Object.defineProperty(exports, '__esModule', { value: true });
  8. var reactivity = require('@vue/reactivity');
  9. var shared = require('@vue/shared');
  10. function assertNumber(val, type) {
  11. return;
  12. }
  13. const ErrorCodes = {
  14. "SETUP_FUNCTION": 0,
  15. "0": "SETUP_FUNCTION",
  16. "RENDER_FUNCTION": 1,
  17. "1": "RENDER_FUNCTION",
  18. "WATCH_GETTER": 2,
  19. "2": "WATCH_GETTER",
  20. "WATCH_CALLBACK": 3,
  21. "3": "WATCH_CALLBACK",
  22. "WATCH_CLEANUP": 4,
  23. "4": "WATCH_CLEANUP",
  24. "NATIVE_EVENT_HANDLER": 5,
  25. "5": "NATIVE_EVENT_HANDLER",
  26. "COMPONENT_EVENT_HANDLER": 6,
  27. "6": "COMPONENT_EVENT_HANDLER",
  28. "VNODE_HOOK": 7,
  29. "7": "VNODE_HOOK",
  30. "DIRECTIVE_HOOK": 8,
  31. "8": "DIRECTIVE_HOOK",
  32. "TRANSITION_HOOK": 9,
  33. "9": "TRANSITION_HOOK",
  34. "APP_ERROR_HANDLER": 10,
  35. "10": "APP_ERROR_HANDLER",
  36. "APP_WARN_HANDLER": 11,
  37. "11": "APP_WARN_HANDLER",
  38. "FUNCTION_REF": 12,
  39. "12": "FUNCTION_REF",
  40. "ASYNC_COMPONENT_LOADER": 13,
  41. "13": "ASYNC_COMPONENT_LOADER",
  42. "SCHEDULER": 14,
  43. "14": "SCHEDULER"
  44. };
  45. const ErrorTypeStrings$1 = {
  46. ["sp"]: "serverPrefetch hook",
  47. ["bc"]: "beforeCreate hook",
  48. ["c"]: "created hook",
  49. ["bm"]: "beforeMount hook",
  50. ["m"]: "mounted hook",
  51. ["bu"]: "beforeUpdate hook",
  52. ["u"]: "updated",
  53. ["bum"]: "beforeUnmount hook",
  54. ["um"]: "unmounted hook",
  55. ["a"]: "activated hook",
  56. ["da"]: "deactivated hook",
  57. ["ec"]: "errorCaptured hook",
  58. ["rtc"]: "renderTracked hook",
  59. ["rtg"]: "renderTriggered hook",
  60. [0]: "setup function",
  61. [1]: "render function",
  62. [2]: "watcher getter",
  63. [3]: "watcher callback",
  64. [4]: "watcher cleanup function",
  65. [5]: "native event handler",
  66. [6]: "component event handler",
  67. [7]: "vnode hook",
  68. [8]: "directive hook",
  69. [9]: "transition hook",
  70. [10]: "app errorHandler",
  71. [11]: "app warnHandler",
  72. [12]: "ref function",
  73. [13]: "async component loader",
  74. [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."
  75. };
  76. function callWithErrorHandling(fn, instance, type, args) {
  77. try {
  78. return args ? fn(...args) : fn();
  79. } catch (err) {
  80. handleError(err, instance, type);
  81. }
  82. }
  83. function callWithAsyncErrorHandling(fn, instance, type, args) {
  84. if (shared.isFunction(fn)) {
  85. const res = callWithErrorHandling(fn, instance, type, args);
  86. if (res && shared.isPromise(res)) {
  87. res.catch((err) => {
  88. handleError(err, instance, type);
  89. });
  90. }
  91. return res;
  92. }
  93. if (shared.isArray(fn)) {
  94. const values = [];
  95. for (let i = 0; i < fn.length; i++) {
  96. values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
  97. }
  98. return values;
  99. }
  100. }
  101. function handleError(err, instance, type, throwInDev = true) {
  102. const contextVNode = instance ? instance.vnode : null;
  103. if (instance) {
  104. let cur = instance.parent;
  105. const exposedInstance = instance.proxy;
  106. const errorInfo = `https://vuejs.org/error-reference/#runtime-${type}`;
  107. while (cur) {
  108. const errorCapturedHooks = cur.ec;
  109. if (errorCapturedHooks) {
  110. for (let i = 0; i < errorCapturedHooks.length; i++) {
  111. if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
  112. return;
  113. }
  114. }
  115. }
  116. cur = cur.parent;
  117. }
  118. const appErrorHandler = instance.appContext.config.errorHandler;
  119. if (appErrorHandler) {
  120. reactivity.pauseTracking();
  121. callWithErrorHandling(
  122. appErrorHandler,
  123. null,
  124. 10,
  125. [err, exposedInstance, errorInfo]
  126. );
  127. reactivity.resetTracking();
  128. return;
  129. }
  130. }
  131. logError(err, type, contextVNode, throwInDev);
  132. }
  133. function logError(err, type, contextVNode, throwInDev = true) {
  134. {
  135. console.error(err);
  136. }
  137. }
  138. let isFlushing = false;
  139. let isFlushPending = false;
  140. const queue = [];
  141. let flushIndex = 0;
  142. const pendingPostFlushCbs = [];
  143. let activePostFlushCbs = null;
  144. let postFlushIndex = 0;
  145. const resolvedPromise = /* @__PURE__ */ Promise.resolve();
  146. let currentFlushPromise = null;
  147. function nextTick(fn) {
  148. const p = currentFlushPromise || resolvedPromise;
  149. return fn ? p.then(this ? fn.bind(this) : fn) : p;
  150. }
  151. function findInsertionIndex(id) {
  152. let start = flushIndex + 1;
  153. let end = queue.length;
  154. while (start < end) {
  155. const middle = start + end >>> 1;
  156. const middleJob = queue[middle];
  157. const middleJobId = getId(middleJob);
  158. if (middleJobId < id || middleJobId === id && middleJob.pre) {
  159. start = middle + 1;
  160. } else {
  161. end = middle;
  162. }
  163. }
  164. return start;
  165. }
  166. function queueJob(job) {
  167. if (!queue.length || !queue.includes(
  168. job,
  169. isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex
  170. )) {
  171. if (job.id == null) {
  172. queue.push(job);
  173. } else {
  174. queue.splice(findInsertionIndex(job.id), 0, job);
  175. }
  176. queueFlush();
  177. }
  178. }
  179. function queueFlush() {
  180. if (!isFlushing && !isFlushPending) {
  181. isFlushPending = true;
  182. currentFlushPromise = resolvedPromise.then(flushJobs);
  183. }
  184. }
  185. function invalidateJob(job) {
  186. const i = queue.indexOf(job);
  187. if (i > flushIndex) {
  188. queue.splice(i, 1);
  189. }
  190. }
  191. function queuePostFlushCb(cb) {
  192. if (!shared.isArray(cb)) {
  193. if (!activePostFlushCbs || !activePostFlushCbs.includes(
  194. cb,
  195. cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex
  196. )) {
  197. pendingPostFlushCbs.push(cb);
  198. }
  199. } else {
  200. pendingPostFlushCbs.push(...cb);
  201. }
  202. queueFlush();
  203. }
  204. function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
  205. for (; i < queue.length; i++) {
  206. const cb = queue[i];
  207. if (cb && cb.pre) {
  208. if (instance && cb.id !== instance.uid) {
  209. continue;
  210. }
  211. queue.splice(i, 1);
  212. i--;
  213. cb();
  214. }
  215. }
  216. }
  217. function flushPostFlushCbs(seen) {
  218. if (pendingPostFlushCbs.length) {
  219. const deduped = [...new Set(pendingPostFlushCbs)].sort(
  220. (a, b) => getId(a) - getId(b)
  221. );
  222. pendingPostFlushCbs.length = 0;
  223. if (activePostFlushCbs) {
  224. activePostFlushCbs.push(...deduped);
  225. return;
  226. }
  227. activePostFlushCbs = deduped;
  228. for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
  229. activePostFlushCbs[postFlushIndex]();
  230. }
  231. activePostFlushCbs = null;
  232. postFlushIndex = 0;
  233. }
  234. }
  235. const getId = (job) => job.id == null ? Infinity : job.id;
  236. const comparator = (a, b) => {
  237. const diff = getId(a) - getId(b);
  238. if (diff === 0) {
  239. if (a.pre && !b.pre)
  240. return -1;
  241. if (b.pre && !a.pre)
  242. return 1;
  243. }
  244. return diff;
  245. };
  246. function flushJobs(seen) {
  247. isFlushPending = false;
  248. isFlushing = true;
  249. queue.sort(comparator);
  250. try {
  251. for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
  252. const job = queue[flushIndex];
  253. if (job && job.active !== false) {
  254. if (false) ;
  255. callWithErrorHandling(job, null, 14);
  256. }
  257. }
  258. } finally {
  259. flushIndex = 0;
  260. queue.length = 0;
  261. flushPostFlushCbs();
  262. isFlushing = false;
  263. currentFlushPromise = null;
  264. if (queue.length || pendingPostFlushCbs.length) {
  265. flushJobs();
  266. }
  267. }
  268. }
  269. function emit(instance, event, ...rawArgs) {
  270. if (instance.isUnmounted)
  271. return;
  272. const props = instance.vnode.props || shared.EMPTY_OBJ;
  273. let args = rawArgs;
  274. const isModelListener = event.startsWith("update:");
  275. const modelArg = isModelListener && event.slice(7);
  276. if (modelArg && modelArg in props) {
  277. const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`;
  278. const { number, trim } = props[modifiersKey] || shared.EMPTY_OBJ;
  279. if (trim) {
  280. args = rawArgs.map((a) => shared.isString(a) ? a.trim() : a);
  281. }
  282. if (number) {
  283. args = rawArgs.map(shared.looseToNumber);
  284. }
  285. }
  286. let handlerName;
  287. let handler = props[handlerName = shared.toHandlerKey(event)] || // also try camelCase event handler (#2249)
  288. props[handlerName = shared.toHandlerKey(shared.camelize(event))];
  289. if (!handler && isModelListener) {
  290. handler = props[handlerName = shared.toHandlerKey(shared.hyphenate(event))];
  291. }
  292. if (handler) {
  293. callWithAsyncErrorHandling(
  294. handler,
  295. instance,
  296. 6,
  297. args
  298. );
  299. }
  300. const onceHandler = props[handlerName + `Once`];
  301. if (onceHandler) {
  302. if (!instance.emitted) {
  303. instance.emitted = {};
  304. } else if (instance.emitted[handlerName]) {
  305. return;
  306. }
  307. instance.emitted[handlerName] = true;
  308. callWithAsyncErrorHandling(
  309. onceHandler,
  310. instance,
  311. 6,
  312. args
  313. );
  314. }
  315. }
  316. function normalizeEmitsOptions(comp, appContext, asMixin = false) {
  317. const cache = appContext.emitsCache;
  318. const cached = cache.get(comp);
  319. if (cached !== void 0) {
  320. return cached;
  321. }
  322. const raw = comp.emits;
  323. let normalized = {};
  324. let hasExtends = false;
  325. if (!shared.isFunction(comp)) {
  326. const extendEmits = (raw2) => {
  327. const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
  328. if (normalizedFromExtend) {
  329. hasExtends = true;
  330. shared.extend(normalized, normalizedFromExtend);
  331. }
  332. };
  333. if (!asMixin && appContext.mixins.length) {
  334. appContext.mixins.forEach(extendEmits);
  335. }
  336. if (comp.extends) {
  337. extendEmits(comp.extends);
  338. }
  339. if (comp.mixins) {
  340. comp.mixins.forEach(extendEmits);
  341. }
  342. }
  343. if (!raw && !hasExtends) {
  344. if (shared.isObject(comp)) {
  345. cache.set(comp, null);
  346. }
  347. return null;
  348. }
  349. if (shared.isArray(raw)) {
  350. raw.forEach((key) => normalized[key] = null);
  351. } else {
  352. shared.extend(normalized, raw);
  353. }
  354. if (shared.isObject(comp)) {
  355. cache.set(comp, normalized);
  356. }
  357. return normalized;
  358. }
  359. function isEmitListener(options, key) {
  360. if (!options || !shared.isOn(key)) {
  361. return false;
  362. }
  363. key = key.slice(2).replace(/Once$/, "");
  364. return shared.hasOwn(options, key[0].toLowerCase() + key.slice(1)) || shared.hasOwn(options, shared.hyphenate(key)) || shared.hasOwn(options, key);
  365. }
  366. let currentRenderingInstance = null;
  367. let currentScopeId = null;
  368. function setCurrentRenderingInstance(instance) {
  369. const prev = currentRenderingInstance;
  370. currentRenderingInstance = instance;
  371. currentScopeId = instance && instance.type.__scopeId || null;
  372. return prev;
  373. }
  374. function pushScopeId(id) {
  375. currentScopeId = id;
  376. }
  377. function popScopeId() {
  378. currentScopeId = null;
  379. }
  380. const withScopeId = (_id) => withCtx;
  381. function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
  382. if (!ctx)
  383. return fn;
  384. if (fn._n) {
  385. return fn;
  386. }
  387. const renderFnWithContext = (...args) => {
  388. if (renderFnWithContext._d) {
  389. setBlockTracking(-1);
  390. }
  391. const prevInstance = setCurrentRenderingInstance(ctx);
  392. let res;
  393. try {
  394. res = fn(...args);
  395. } finally {
  396. setCurrentRenderingInstance(prevInstance);
  397. if (renderFnWithContext._d) {
  398. setBlockTracking(1);
  399. }
  400. }
  401. return res;
  402. };
  403. renderFnWithContext._n = true;
  404. renderFnWithContext._c = true;
  405. renderFnWithContext._d = true;
  406. return renderFnWithContext;
  407. }
  408. function markAttrsAccessed() {
  409. }
  410. function renderComponentRoot(instance) {
  411. const {
  412. type: Component,
  413. vnode,
  414. proxy,
  415. withProxy,
  416. propsOptions: [propsOptions],
  417. slots,
  418. attrs,
  419. emit,
  420. render,
  421. renderCache,
  422. props,
  423. data,
  424. setupState,
  425. ctx,
  426. inheritAttrs
  427. } = instance;
  428. const prev = setCurrentRenderingInstance(instance);
  429. let result;
  430. let fallthroughAttrs;
  431. try {
  432. if (vnode.shapeFlag & 4) {
  433. const proxyToUse = withProxy || proxy;
  434. const thisProxy = false ? new Proxy(proxyToUse, {
  435. get(target, key, receiver) {
  436. warn(
  437. `Property '${String(
  438. key
  439. )}' was accessed via 'this'. Avoid using 'this' in templates.`
  440. );
  441. return Reflect.get(target, key, receiver);
  442. }
  443. }) : proxyToUse;
  444. result = normalizeVNode(
  445. render.call(
  446. thisProxy,
  447. proxyToUse,
  448. renderCache,
  449. false ? shallowReadonly(props) : props,
  450. setupState,
  451. data,
  452. ctx
  453. )
  454. );
  455. fallthroughAttrs = attrs;
  456. } else {
  457. const render2 = Component;
  458. if (false) ;
  459. result = normalizeVNode(
  460. render2.length > 1 ? render2(
  461. false ? shallowReadonly(props) : props,
  462. false ? {
  463. get attrs() {
  464. markAttrsAccessed();
  465. return attrs;
  466. },
  467. slots,
  468. emit
  469. } : { attrs, slots, emit }
  470. ) : render2(
  471. false ? shallowReadonly(props) : props,
  472. null
  473. )
  474. );
  475. fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
  476. }
  477. } catch (err) {
  478. blockStack.length = 0;
  479. handleError(err, instance, 1);
  480. result = createVNode(Comment);
  481. }
  482. let root = result;
  483. if (fallthroughAttrs && inheritAttrs !== false) {
  484. const keys = Object.keys(fallthroughAttrs);
  485. const { shapeFlag } = root;
  486. if (keys.length) {
  487. if (shapeFlag & (1 | 6)) {
  488. if (propsOptions && keys.some(shared.isModelListener)) {
  489. fallthroughAttrs = filterModelListeners(
  490. fallthroughAttrs,
  491. propsOptions
  492. );
  493. }
  494. root = cloneVNode(root, fallthroughAttrs);
  495. }
  496. }
  497. }
  498. if (vnode.dirs) {
  499. root = cloneVNode(root);
  500. root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
  501. }
  502. if (vnode.transition) {
  503. root.transition = vnode.transition;
  504. }
  505. {
  506. result = root;
  507. }
  508. setCurrentRenderingInstance(prev);
  509. return result;
  510. }
  511. function filterSingleRoot(children, recurse = true) {
  512. let singleRoot;
  513. for (let i = 0; i < children.length; i++) {
  514. const child = children[i];
  515. if (isVNode(child)) {
  516. if (child.type !== Comment || child.children === "v-if") {
  517. if (singleRoot) {
  518. return;
  519. } else {
  520. singleRoot = child;
  521. }
  522. }
  523. } else {
  524. return;
  525. }
  526. }
  527. return singleRoot;
  528. }
  529. const getFunctionalFallthrough = (attrs) => {
  530. let res;
  531. for (const key in attrs) {
  532. if (key === "class" || key === "style" || shared.isOn(key)) {
  533. (res || (res = {}))[key] = attrs[key];
  534. }
  535. }
  536. return res;
  537. };
  538. const filterModelListeners = (attrs, props) => {
  539. const res = {};
  540. for (const key in attrs) {
  541. if (!shared.isModelListener(key) || !(key.slice(9) in props)) {
  542. res[key] = attrs[key];
  543. }
  544. }
  545. return res;
  546. };
  547. function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
  548. const { props: prevProps, children: prevChildren, component } = prevVNode;
  549. const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
  550. const emits = component.emitsOptions;
  551. if (nextVNode.dirs || nextVNode.transition) {
  552. return true;
  553. }
  554. if (optimized && patchFlag >= 0) {
  555. if (patchFlag & 1024) {
  556. return true;
  557. }
  558. if (patchFlag & 16) {
  559. if (!prevProps) {
  560. return !!nextProps;
  561. }
  562. return hasPropsChanged(prevProps, nextProps, emits);
  563. } else if (patchFlag & 8) {
  564. const dynamicProps = nextVNode.dynamicProps;
  565. for (let i = 0; i < dynamicProps.length; i++) {
  566. const key = dynamicProps[i];
  567. if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
  568. return true;
  569. }
  570. }
  571. }
  572. } else {
  573. if (prevChildren || nextChildren) {
  574. if (!nextChildren || !nextChildren.$stable) {
  575. return true;
  576. }
  577. }
  578. if (prevProps === nextProps) {
  579. return false;
  580. }
  581. if (!prevProps) {
  582. return !!nextProps;
  583. }
  584. if (!nextProps) {
  585. return true;
  586. }
  587. return hasPropsChanged(prevProps, nextProps, emits);
  588. }
  589. return false;
  590. }
  591. function hasPropsChanged(prevProps, nextProps, emitsOptions) {
  592. const nextKeys = Object.keys(nextProps);
  593. if (nextKeys.length !== Object.keys(prevProps).length) {
  594. return true;
  595. }
  596. for (let i = 0; i < nextKeys.length; i++) {
  597. const key = nextKeys[i];
  598. if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
  599. return true;
  600. }
  601. }
  602. return false;
  603. }
  604. function updateHOCHostEl({ vnode, parent }, el) {
  605. while (parent) {
  606. const root = parent.subTree;
  607. if (root.suspense && root.suspense.activeBranch === vnode) {
  608. root.el = vnode.el;
  609. }
  610. if (root === vnode) {
  611. (vnode = parent.vnode).el = el;
  612. parent = parent.parent;
  613. } else {
  614. break;
  615. }
  616. }
  617. }
  618. const COMPONENTS = "components";
  619. const DIRECTIVES = "directives";
  620. function resolveComponent(name, maybeSelfReference) {
  621. return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
  622. }
  623. const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
  624. function resolveDynamicComponent(component) {
  625. if (shared.isString(component)) {
  626. return resolveAsset(COMPONENTS, component, false) || component;
  627. } else {
  628. return component || NULL_DYNAMIC_COMPONENT;
  629. }
  630. }
  631. function resolveDirective(name) {
  632. return resolveAsset(DIRECTIVES, name);
  633. }
  634. function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
  635. const instance = currentRenderingInstance || currentInstance;
  636. if (instance) {
  637. const Component = instance.type;
  638. if (type === COMPONENTS) {
  639. const selfName = getComponentName(
  640. Component,
  641. false
  642. );
  643. if (selfName && (selfName === name || selfName === shared.camelize(name) || selfName === shared.capitalize(shared.camelize(name)))) {
  644. return Component;
  645. }
  646. }
  647. const res = (
  648. // local registration
  649. // check instance[type] first which is resolved for options API
  650. resolve(instance[type] || Component[type], name) || // global registration
  651. resolve(instance.appContext[type], name)
  652. );
  653. if (!res && maybeSelfReference) {
  654. return Component;
  655. }
  656. return res;
  657. }
  658. }
  659. function resolve(registry, name) {
  660. return registry && (registry[name] || registry[shared.camelize(name)] || registry[shared.capitalize(shared.camelize(name))]);
  661. }
  662. const isSuspense = (type) => type.__isSuspense;
  663. let suspenseId = 0;
  664. const SuspenseImpl = {
  665. name: "Suspense",
  666. // In order to make Suspense tree-shakable, we need to avoid importing it
  667. // directly in the renderer. The renderer checks for the __isSuspense flag
  668. // on a vnode's type and calls the `process` method, passing in renderer
  669. // internals.
  670. __isSuspense: true,
  671. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
  672. if (n1 == null) {
  673. mountSuspense(
  674. n2,
  675. container,
  676. anchor,
  677. parentComponent,
  678. parentSuspense,
  679. namespace,
  680. slotScopeIds,
  681. optimized,
  682. rendererInternals
  683. );
  684. } else {
  685. if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
  686. n2.suspense = n1.suspense;
  687. n2.suspense.vnode = n2;
  688. n2.el = n1.el;
  689. return;
  690. }
  691. patchSuspense(
  692. n1,
  693. n2,
  694. container,
  695. anchor,
  696. parentComponent,
  697. namespace,
  698. slotScopeIds,
  699. optimized,
  700. rendererInternals
  701. );
  702. }
  703. },
  704. hydrate: hydrateSuspense,
  705. create: createSuspenseBoundary,
  706. normalize: normalizeSuspenseChildren
  707. };
  708. const Suspense = SuspenseImpl ;
  709. function triggerEvent(vnode, name) {
  710. const eventListener = vnode.props && vnode.props[name];
  711. if (shared.isFunction(eventListener)) {
  712. eventListener();
  713. }
  714. }
  715. function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
  716. const {
  717. p: patch,
  718. o: { createElement }
  719. } = rendererInternals;
  720. const hiddenContainer = createElement("div");
  721. const suspense = vnode.suspense = createSuspenseBoundary(
  722. vnode,
  723. parentSuspense,
  724. parentComponent,
  725. container,
  726. hiddenContainer,
  727. anchor,
  728. namespace,
  729. slotScopeIds,
  730. optimized,
  731. rendererInternals
  732. );
  733. patch(
  734. null,
  735. suspense.pendingBranch = vnode.ssContent,
  736. hiddenContainer,
  737. null,
  738. parentComponent,
  739. suspense,
  740. namespace,
  741. slotScopeIds
  742. );
  743. if (suspense.deps > 0) {
  744. triggerEvent(vnode, "onPending");
  745. triggerEvent(vnode, "onFallback");
  746. patch(
  747. null,
  748. vnode.ssFallback,
  749. container,
  750. anchor,
  751. parentComponent,
  752. null,
  753. // fallback tree will not have suspense context
  754. namespace,
  755. slotScopeIds
  756. );
  757. setActiveBranch(suspense, vnode.ssFallback);
  758. } else {
  759. suspense.resolve(false, true);
  760. }
  761. }
  762. function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
  763. const suspense = n2.suspense = n1.suspense;
  764. suspense.vnode = n2;
  765. n2.el = n1.el;
  766. const newBranch = n2.ssContent;
  767. const newFallback = n2.ssFallback;
  768. const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
  769. if (pendingBranch) {
  770. suspense.pendingBranch = newBranch;
  771. if (isSameVNodeType(newBranch, pendingBranch)) {
  772. patch(
  773. pendingBranch,
  774. newBranch,
  775. suspense.hiddenContainer,
  776. null,
  777. parentComponent,
  778. suspense,
  779. namespace,
  780. slotScopeIds,
  781. optimized
  782. );
  783. if (suspense.deps <= 0) {
  784. suspense.resolve();
  785. } else if (isInFallback) {
  786. if (!isHydrating) {
  787. patch(
  788. activeBranch,
  789. newFallback,
  790. container,
  791. anchor,
  792. parentComponent,
  793. null,
  794. // fallback tree will not have suspense context
  795. namespace,
  796. slotScopeIds,
  797. optimized
  798. );
  799. setActiveBranch(suspense, newFallback);
  800. }
  801. }
  802. } else {
  803. suspense.pendingId = suspenseId++;
  804. if (isHydrating) {
  805. suspense.isHydrating = false;
  806. suspense.activeBranch = pendingBranch;
  807. } else {
  808. unmount(pendingBranch, parentComponent, suspense);
  809. }
  810. suspense.deps = 0;
  811. suspense.effects.length = 0;
  812. suspense.hiddenContainer = createElement("div");
  813. if (isInFallback) {
  814. patch(
  815. null,
  816. newBranch,
  817. suspense.hiddenContainer,
  818. null,
  819. parentComponent,
  820. suspense,
  821. namespace,
  822. slotScopeIds,
  823. optimized
  824. );
  825. if (suspense.deps <= 0) {
  826. suspense.resolve();
  827. } else {
  828. patch(
  829. activeBranch,
  830. newFallback,
  831. container,
  832. anchor,
  833. parentComponent,
  834. null,
  835. // fallback tree will not have suspense context
  836. namespace,
  837. slotScopeIds,
  838. optimized
  839. );
  840. setActiveBranch(suspense, newFallback);
  841. }
  842. } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
  843. patch(
  844. activeBranch,
  845. newBranch,
  846. container,
  847. anchor,
  848. parentComponent,
  849. suspense,
  850. namespace,
  851. slotScopeIds,
  852. optimized
  853. );
  854. suspense.resolve(true);
  855. } else {
  856. patch(
  857. null,
  858. newBranch,
  859. suspense.hiddenContainer,
  860. null,
  861. parentComponent,
  862. suspense,
  863. namespace,
  864. slotScopeIds,
  865. optimized
  866. );
  867. if (suspense.deps <= 0) {
  868. suspense.resolve();
  869. }
  870. }
  871. }
  872. } else {
  873. if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
  874. patch(
  875. activeBranch,
  876. newBranch,
  877. container,
  878. anchor,
  879. parentComponent,
  880. suspense,
  881. namespace,
  882. slotScopeIds,
  883. optimized
  884. );
  885. setActiveBranch(suspense, newBranch);
  886. } else {
  887. triggerEvent(n2, "onPending");
  888. suspense.pendingBranch = newBranch;
  889. if (newBranch.shapeFlag & 512) {
  890. suspense.pendingId = newBranch.component.suspenseId;
  891. } else {
  892. suspense.pendingId = suspenseId++;
  893. }
  894. patch(
  895. null,
  896. newBranch,
  897. suspense.hiddenContainer,
  898. null,
  899. parentComponent,
  900. suspense,
  901. namespace,
  902. slotScopeIds,
  903. optimized
  904. );
  905. if (suspense.deps <= 0) {
  906. suspense.resolve();
  907. } else {
  908. const { timeout, pendingId } = suspense;
  909. if (timeout > 0) {
  910. setTimeout(() => {
  911. if (suspense.pendingId === pendingId) {
  912. suspense.fallback(newFallback);
  913. }
  914. }, timeout);
  915. } else if (timeout === 0) {
  916. suspense.fallback(newFallback);
  917. }
  918. }
  919. }
  920. }
  921. }
  922. function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
  923. const {
  924. p: patch,
  925. m: move,
  926. um: unmount,
  927. n: next,
  928. o: { parentNode, remove }
  929. } = rendererInternals;
  930. let parentSuspenseId;
  931. const isSuspensible = isVNodeSuspensible(vnode);
  932. if (isSuspensible) {
  933. if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) {
  934. parentSuspenseId = parentSuspense.pendingId;
  935. parentSuspense.deps++;
  936. }
  937. }
  938. const timeout = vnode.props ? shared.toNumber(vnode.props.timeout) : void 0;
  939. const initialAnchor = anchor;
  940. const suspense = {
  941. vnode,
  942. parent: parentSuspense,
  943. parentComponent,
  944. namespace,
  945. container,
  946. hiddenContainer,
  947. deps: 0,
  948. pendingId: suspenseId++,
  949. timeout: typeof timeout === "number" ? timeout : -1,
  950. activeBranch: null,
  951. pendingBranch: null,
  952. isInFallback: !isHydrating,
  953. isHydrating,
  954. isUnmounted: false,
  955. effects: [],
  956. resolve(resume = false, sync = false) {
  957. const {
  958. vnode: vnode2,
  959. activeBranch,
  960. pendingBranch,
  961. pendingId,
  962. effects,
  963. parentComponent: parentComponent2,
  964. container: container2
  965. } = suspense;
  966. let delayEnter = false;
  967. if (suspense.isHydrating) {
  968. suspense.isHydrating = false;
  969. } else if (!resume) {
  970. delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
  971. if (delayEnter) {
  972. activeBranch.transition.afterLeave = () => {
  973. if (pendingId === suspense.pendingId) {
  974. move(
  975. pendingBranch,
  976. container2,
  977. anchor === initialAnchor ? next(activeBranch) : anchor,
  978. 0
  979. );
  980. queuePostFlushCb(effects);
  981. }
  982. };
  983. }
  984. if (activeBranch) {
  985. if (parentNode(activeBranch.el) !== suspense.hiddenContainer) {
  986. anchor = next(activeBranch);
  987. }
  988. unmount(activeBranch, parentComponent2, suspense, true);
  989. }
  990. if (!delayEnter) {
  991. move(pendingBranch, container2, anchor, 0);
  992. }
  993. }
  994. setActiveBranch(suspense, pendingBranch);
  995. suspense.pendingBranch = null;
  996. suspense.isInFallback = false;
  997. let parent = suspense.parent;
  998. let hasUnresolvedAncestor = false;
  999. while (parent) {
  1000. if (parent.pendingBranch) {
  1001. parent.effects.push(...effects);
  1002. hasUnresolvedAncestor = true;
  1003. break;
  1004. }
  1005. parent = parent.parent;
  1006. }
  1007. if (!hasUnresolvedAncestor && !delayEnter) {
  1008. queuePostFlushCb(effects);
  1009. }
  1010. suspense.effects = [];
  1011. if (isSuspensible) {
  1012. if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
  1013. parentSuspense.deps--;
  1014. if (parentSuspense.deps === 0 && !sync) {
  1015. parentSuspense.resolve();
  1016. }
  1017. }
  1018. }
  1019. triggerEvent(vnode2, "onResolve");
  1020. },
  1021. fallback(fallbackVNode) {
  1022. if (!suspense.pendingBranch) {
  1023. return;
  1024. }
  1025. const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
  1026. triggerEvent(vnode2, "onFallback");
  1027. const anchor2 = next(activeBranch);
  1028. const mountFallback = () => {
  1029. if (!suspense.isInFallback) {
  1030. return;
  1031. }
  1032. patch(
  1033. null,
  1034. fallbackVNode,
  1035. container2,
  1036. anchor2,
  1037. parentComponent2,
  1038. null,
  1039. // fallback tree will not have suspense context
  1040. namespace2,
  1041. slotScopeIds,
  1042. optimized
  1043. );
  1044. setActiveBranch(suspense, fallbackVNode);
  1045. };
  1046. const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
  1047. if (delayEnter) {
  1048. activeBranch.transition.afterLeave = mountFallback;
  1049. }
  1050. suspense.isInFallback = true;
  1051. unmount(
  1052. activeBranch,
  1053. parentComponent2,
  1054. null,
  1055. // no suspense so unmount hooks fire now
  1056. true
  1057. // shouldRemove
  1058. );
  1059. if (!delayEnter) {
  1060. mountFallback();
  1061. }
  1062. },
  1063. move(container2, anchor2, type) {
  1064. suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
  1065. suspense.container = container2;
  1066. },
  1067. next() {
  1068. return suspense.activeBranch && next(suspense.activeBranch);
  1069. },
  1070. registerDep(instance, setupRenderEffect) {
  1071. const isInPendingSuspense = !!suspense.pendingBranch;
  1072. if (isInPendingSuspense) {
  1073. suspense.deps++;
  1074. }
  1075. const hydratedEl = instance.vnode.el;
  1076. instance.asyncDep.catch((err) => {
  1077. handleError(err, instance, 0);
  1078. }).then((asyncSetupResult) => {
  1079. if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
  1080. return;
  1081. }
  1082. instance.asyncResolved = true;
  1083. const { vnode: vnode2 } = instance;
  1084. handleSetupResult(instance, asyncSetupResult, false);
  1085. if (hydratedEl) {
  1086. vnode2.el = hydratedEl;
  1087. }
  1088. const placeholder = !hydratedEl && instance.subTree.el;
  1089. setupRenderEffect(
  1090. instance,
  1091. vnode2,
  1092. // component may have been moved before resolve.
  1093. // if this is not a hydration, instance.subTree will be the comment
  1094. // placeholder.
  1095. parentNode(hydratedEl || instance.subTree.el),
  1096. // anchor will not be used if this is hydration, so only need to
  1097. // consider the comment placeholder case.
  1098. hydratedEl ? null : next(instance.subTree),
  1099. suspense,
  1100. namespace,
  1101. optimized
  1102. );
  1103. if (placeholder) {
  1104. remove(placeholder);
  1105. }
  1106. updateHOCHostEl(instance, vnode2.el);
  1107. if (isInPendingSuspense && --suspense.deps === 0) {
  1108. suspense.resolve();
  1109. }
  1110. });
  1111. },
  1112. unmount(parentSuspense2, doRemove) {
  1113. suspense.isUnmounted = true;
  1114. if (suspense.activeBranch) {
  1115. unmount(
  1116. suspense.activeBranch,
  1117. parentComponent,
  1118. parentSuspense2,
  1119. doRemove
  1120. );
  1121. }
  1122. if (suspense.pendingBranch) {
  1123. unmount(
  1124. suspense.pendingBranch,
  1125. parentComponent,
  1126. parentSuspense2,
  1127. doRemove
  1128. );
  1129. }
  1130. }
  1131. };
  1132. return suspense;
  1133. }
  1134. function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
  1135. const suspense = vnode.suspense = createSuspenseBoundary(
  1136. vnode,
  1137. parentSuspense,
  1138. parentComponent,
  1139. node.parentNode,
  1140. // eslint-disable-next-line no-restricted-globals
  1141. document.createElement("div"),
  1142. null,
  1143. namespace,
  1144. slotScopeIds,
  1145. optimized,
  1146. rendererInternals,
  1147. true
  1148. );
  1149. const result = hydrateNode(
  1150. node,
  1151. suspense.pendingBranch = vnode.ssContent,
  1152. parentComponent,
  1153. suspense,
  1154. slotScopeIds,
  1155. optimized
  1156. );
  1157. if (suspense.deps === 0) {
  1158. suspense.resolve(false, true);
  1159. }
  1160. return result;
  1161. }
  1162. function normalizeSuspenseChildren(vnode) {
  1163. const { shapeFlag, children } = vnode;
  1164. const isSlotChildren = shapeFlag & 32;
  1165. vnode.ssContent = normalizeSuspenseSlot(
  1166. isSlotChildren ? children.default : children
  1167. );
  1168. vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment);
  1169. }
  1170. function normalizeSuspenseSlot(s) {
  1171. let block;
  1172. if (shared.isFunction(s)) {
  1173. const trackBlock = isBlockTreeEnabled && s._c;
  1174. if (trackBlock) {
  1175. s._d = false;
  1176. openBlock();
  1177. }
  1178. s = s();
  1179. if (trackBlock) {
  1180. s._d = true;
  1181. block = currentBlock;
  1182. closeBlock();
  1183. }
  1184. }
  1185. if (shared.isArray(s)) {
  1186. const singleChild = filterSingleRoot(s);
  1187. s = singleChild;
  1188. }
  1189. s = normalizeVNode(s);
  1190. if (block && !s.dynamicChildren) {
  1191. s.dynamicChildren = block.filter((c) => c !== s);
  1192. }
  1193. return s;
  1194. }
  1195. function queueEffectWithSuspense(fn, suspense) {
  1196. if (suspense && suspense.pendingBranch) {
  1197. if (shared.isArray(fn)) {
  1198. suspense.effects.push(...fn);
  1199. } else {
  1200. suspense.effects.push(fn);
  1201. }
  1202. } else {
  1203. queuePostFlushCb(fn);
  1204. }
  1205. }
  1206. function setActiveBranch(suspense, branch) {
  1207. suspense.activeBranch = branch;
  1208. const { vnode, parentComponent } = suspense;
  1209. let el = branch.el;
  1210. while (!el && branch.component) {
  1211. branch = branch.component.subTree;
  1212. el = branch.el;
  1213. }
  1214. vnode.el = el;
  1215. if (parentComponent && parentComponent.subTree === vnode) {
  1216. parentComponent.vnode.el = el;
  1217. updateHOCHostEl(parentComponent, el);
  1218. }
  1219. }
  1220. function isVNodeSuspensible(vnode) {
  1221. var _a;
  1222. return ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
  1223. }
  1224. const ssrContextKey = Symbol.for("v-scx");
  1225. const useSSRContext = () => {
  1226. {
  1227. const ctx = inject(ssrContextKey);
  1228. return ctx;
  1229. }
  1230. };
  1231. function watchEffect(effect, options) {
  1232. return doWatch(effect, null, options);
  1233. }
  1234. function watchPostEffect(effect, options) {
  1235. return doWatch(
  1236. effect,
  1237. null,
  1238. { flush: "post" }
  1239. );
  1240. }
  1241. function watchSyncEffect(effect, options) {
  1242. return doWatch(
  1243. effect,
  1244. null,
  1245. { flush: "sync" }
  1246. );
  1247. }
  1248. const INITIAL_WATCHER_VALUE = {};
  1249. function watch(source, cb, options) {
  1250. return doWatch(source, cb, options);
  1251. }
  1252. function doWatch(source, cb, {
  1253. immediate,
  1254. deep,
  1255. flush,
  1256. once,
  1257. onTrack,
  1258. onTrigger
  1259. } = shared.EMPTY_OBJ) {
  1260. if (cb && once) {
  1261. const _cb = cb;
  1262. cb = (...args) => {
  1263. _cb(...args);
  1264. unwatch();
  1265. };
  1266. }
  1267. const instance = currentInstance;
  1268. const reactiveGetter = (source2) => deep === true ? source2 : (
  1269. // for deep: false, only traverse root-level properties
  1270. traverse(source2, deep === false ? 1 : void 0)
  1271. );
  1272. let getter;
  1273. let forceTrigger = false;
  1274. let isMultiSource = false;
  1275. if (reactivity.isRef(source)) {
  1276. getter = () => source.value;
  1277. forceTrigger = reactivity.isShallow(source);
  1278. } else if (reactivity.isReactive(source)) {
  1279. getter = () => reactiveGetter(source);
  1280. forceTrigger = true;
  1281. } else if (shared.isArray(source)) {
  1282. isMultiSource = true;
  1283. forceTrigger = source.some((s) => reactivity.isReactive(s) || reactivity.isShallow(s));
  1284. getter = () => source.map((s) => {
  1285. if (reactivity.isRef(s)) {
  1286. return s.value;
  1287. } else if (reactivity.isReactive(s)) {
  1288. return reactiveGetter(s);
  1289. } else if (shared.isFunction(s)) {
  1290. return callWithErrorHandling(s, instance, 2);
  1291. } else ;
  1292. });
  1293. } else if (shared.isFunction(source)) {
  1294. if (cb) {
  1295. getter = () => callWithErrorHandling(source, instance, 2);
  1296. } else {
  1297. getter = () => {
  1298. if (cleanup) {
  1299. cleanup();
  1300. }
  1301. return callWithAsyncErrorHandling(
  1302. source,
  1303. instance,
  1304. 3,
  1305. [onCleanup]
  1306. );
  1307. };
  1308. }
  1309. } else {
  1310. getter = shared.NOOP;
  1311. }
  1312. if (cb && deep) {
  1313. const baseGetter = getter;
  1314. getter = () => traverse(baseGetter());
  1315. }
  1316. let cleanup;
  1317. let onCleanup = (fn) => {
  1318. cleanup = effect.onStop = () => {
  1319. callWithErrorHandling(fn, instance, 4);
  1320. cleanup = effect.onStop = void 0;
  1321. };
  1322. };
  1323. let ssrCleanup;
  1324. if (isInSSRComponentSetup) {
  1325. onCleanup = shared.NOOP;
  1326. if (!cb) {
  1327. getter();
  1328. } else if (immediate) {
  1329. callWithAsyncErrorHandling(cb, instance, 3, [
  1330. getter(),
  1331. isMultiSource ? [] : void 0,
  1332. onCleanup
  1333. ]);
  1334. }
  1335. if (flush === "sync") {
  1336. const ctx = useSSRContext();
  1337. ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
  1338. } else {
  1339. return shared.NOOP;
  1340. }
  1341. }
  1342. let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
  1343. const job = () => {
  1344. if (!effect.active || !effect.dirty) {
  1345. return;
  1346. }
  1347. if (cb) {
  1348. const newValue = effect.run();
  1349. if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => shared.hasChanged(v, oldValue[i])) : shared.hasChanged(newValue, oldValue)) || false) {
  1350. if (cleanup) {
  1351. cleanup();
  1352. }
  1353. callWithAsyncErrorHandling(cb, instance, 3, [
  1354. newValue,
  1355. // pass undefined as the old value when it's changed for the first time
  1356. oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
  1357. onCleanup
  1358. ]);
  1359. oldValue = newValue;
  1360. }
  1361. } else {
  1362. effect.run();
  1363. }
  1364. };
  1365. job.allowRecurse = !!cb;
  1366. let scheduler;
  1367. if (flush === "sync") {
  1368. scheduler = job;
  1369. } else if (flush === "post") {
  1370. scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
  1371. } else {
  1372. job.pre = true;
  1373. if (instance)
  1374. job.id = instance.uid;
  1375. scheduler = () => queueJob(job);
  1376. }
  1377. const effect = new reactivity.ReactiveEffect(getter, shared.NOOP, scheduler);
  1378. const scope = reactivity.getCurrentScope();
  1379. const unwatch = () => {
  1380. effect.stop();
  1381. if (scope) {
  1382. shared.remove(scope.effects, effect);
  1383. }
  1384. };
  1385. if (cb) {
  1386. if (immediate) {
  1387. job();
  1388. } else {
  1389. oldValue = effect.run();
  1390. }
  1391. } else if (flush === "post") {
  1392. queuePostRenderEffect(
  1393. effect.run.bind(effect),
  1394. instance && instance.suspense
  1395. );
  1396. } else {
  1397. effect.run();
  1398. }
  1399. if (ssrCleanup)
  1400. ssrCleanup.push(unwatch);
  1401. return unwatch;
  1402. }
  1403. function instanceWatch(source, value, options) {
  1404. const publicThis = this.proxy;
  1405. const getter = shared.isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  1406. let cb;
  1407. if (shared.isFunction(value)) {
  1408. cb = value;
  1409. } else {
  1410. cb = value.handler;
  1411. options = value;
  1412. }
  1413. const reset = setCurrentInstance(this);
  1414. const res = doWatch(getter, cb.bind(publicThis), options);
  1415. reset();
  1416. return res;
  1417. }
  1418. function createPathGetter(ctx, path) {
  1419. const segments = path.split(".");
  1420. return () => {
  1421. let cur = ctx;
  1422. for (let i = 0; i < segments.length && cur; i++) {
  1423. cur = cur[segments[i]];
  1424. }
  1425. return cur;
  1426. };
  1427. }
  1428. function traverse(value, depth, currentDepth = 0, seen) {
  1429. if (!shared.isObject(value) || value["__v_skip"]) {
  1430. return value;
  1431. }
  1432. if (depth && depth > 0) {
  1433. if (currentDepth >= depth) {
  1434. return value;
  1435. }
  1436. currentDepth++;
  1437. }
  1438. seen = seen || /* @__PURE__ */ new Set();
  1439. if (seen.has(value)) {
  1440. return value;
  1441. }
  1442. seen.add(value);
  1443. if (reactivity.isRef(value)) {
  1444. traverse(value.value, depth, currentDepth, seen);
  1445. } else if (shared.isArray(value)) {
  1446. for (let i = 0; i < value.length; i++) {
  1447. traverse(value[i], depth, currentDepth, seen);
  1448. }
  1449. } else if (shared.isSet(value) || shared.isMap(value)) {
  1450. value.forEach((v) => {
  1451. traverse(v, depth, currentDepth, seen);
  1452. });
  1453. } else if (shared.isPlainObject(value)) {
  1454. for (const key in value) {
  1455. traverse(value[key], depth, currentDepth, seen);
  1456. }
  1457. }
  1458. return value;
  1459. }
  1460. function withDirectives(vnode, directives) {
  1461. if (currentRenderingInstance === null) {
  1462. return vnode;
  1463. }
  1464. const instance = getExposeProxy(currentRenderingInstance) || currentRenderingInstance.proxy;
  1465. const bindings = vnode.dirs || (vnode.dirs = []);
  1466. for (let i = 0; i < directives.length; i++) {
  1467. let [dir, value, arg, modifiers = shared.EMPTY_OBJ] = directives[i];
  1468. if (dir) {
  1469. if (shared.isFunction(dir)) {
  1470. dir = {
  1471. mounted: dir,
  1472. updated: dir
  1473. };
  1474. }
  1475. if (dir.deep) {
  1476. traverse(value);
  1477. }
  1478. bindings.push({
  1479. dir,
  1480. instance,
  1481. value,
  1482. oldValue: void 0,
  1483. arg,
  1484. modifiers
  1485. });
  1486. }
  1487. }
  1488. return vnode;
  1489. }
  1490. function invokeDirectiveHook(vnode, prevVNode, instance, name) {
  1491. const bindings = vnode.dirs;
  1492. const oldBindings = prevVNode && prevVNode.dirs;
  1493. for (let i = 0; i < bindings.length; i++) {
  1494. const binding = bindings[i];
  1495. if (oldBindings) {
  1496. binding.oldValue = oldBindings[i].value;
  1497. }
  1498. let hook = binding.dir[name];
  1499. if (hook) {
  1500. reactivity.pauseTracking();
  1501. callWithAsyncErrorHandling(hook, instance, 8, [
  1502. vnode.el,
  1503. binding,
  1504. vnode,
  1505. prevVNode
  1506. ]);
  1507. reactivity.resetTracking();
  1508. }
  1509. }
  1510. }
  1511. const leaveCbKey = Symbol("_leaveCb");
  1512. const enterCbKey = Symbol("_enterCb");
  1513. function useTransitionState() {
  1514. const state = {
  1515. isMounted: false,
  1516. isLeaving: false,
  1517. isUnmounting: false,
  1518. leavingVNodes: /* @__PURE__ */ new Map()
  1519. };
  1520. onMounted(() => {
  1521. state.isMounted = true;
  1522. });
  1523. onBeforeUnmount(() => {
  1524. state.isUnmounting = true;
  1525. });
  1526. return state;
  1527. }
  1528. const TransitionHookValidator = [Function, Array];
  1529. const BaseTransitionPropsValidators = {
  1530. mode: String,
  1531. appear: Boolean,
  1532. persisted: Boolean,
  1533. // enter
  1534. onBeforeEnter: TransitionHookValidator,
  1535. onEnter: TransitionHookValidator,
  1536. onAfterEnter: TransitionHookValidator,
  1537. onEnterCancelled: TransitionHookValidator,
  1538. // leave
  1539. onBeforeLeave: TransitionHookValidator,
  1540. onLeave: TransitionHookValidator,
  1541. onAfterLeave: TransitionHookValidator,
  1542. onLeaveCancelled: TransitionHookValidator,
  1543. // appear
  1544. onBeforeAppear: TransitionHookValidator,
  1545. onAppear: TransitionHookValidator,
  1546. onAfterAppear: TransitionHookValidator,
  1547. onAppearCancelled: TransitionHookValidator
  1548. };
  1549. const BaseTransitionImpl = {
  1550. name: `BaseTransition`,
  1551. props: BaseTransitionPropsValidators,
  1552. setup(props, { slots }) {
  1553. const instance = getCurrentInstance();
  1554. const state = useTransitionState();
  1555. return () => {
  1556. const children = slots.default && getTransitionRawChildren(slots.default(), true);
  1557. if (!children || !children.length) {
  1558. return;
  1559. }
  1560. let child = children[0];
  1561. if (children.length > 1) {
  1562. for (const c of children) {
  1563. if (c.type !== Comment) {
  1564. child = c;
  1565. break;
  1566. }
  1567. }
  1568. }
  1569. const rawProps = reactivity.toRaw(props);
  1570. const { mode } = rawProps;
  1571. if (state.isLeaving) {
  1572. return emptyPlaceholder(child);
  1573. }
  1574. const innerChild = getKeepAliveChild(child);
  1575. if (!innerChild) {
  1576. return emptyPlaceholder(child);
  1577. }
  1578. const enterHooks = resolveTransitionHooks(
  1579. innerChild,
  1580. rawProps,
  1581. state,
  1582. instance
  1583. );
  1584. setTransitionHooks(innerChild, enterHooks);
  1585. const oldChild = instance.subTree;
  1586. const oldInnerChild = oldChild && getKeepAliveChild(oldChild);
  1587. if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild)) {
  1588. const leavingHooks = resolveTransitionHooks(
  1589. oldInnerChild,
  1590. rawProps,
  1591. state,
  1592. instance
  1593. );
  1594. setTransitionHooks(oldInnerChild, leavingHooks);
  1595. if (mode === "out-in") {
  1596. state.isLeaving = true;
  1597. leavingHooks.afterLeave = () => {
  1598. state.isLeaving = false;
  1599. if (instance.update.active !== false) {
  1600. instance.effect.dirty = true;
  1601. instance.update();
  1602. }
  1603. };
  1604. return emptyPlaceholder(child);
  1605. } else if (mode === "in-out" && innerChild.type !== Comment) {
  1606. leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
  1607. const leavingVNodesCache = getLeavingNodesForType(
  1608. state,
  1609. oldInnerChild
  1610. );
  1611. leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
  1612. el[leaveCbKey] = () => {
  1613. earlyRemove();
  1614. el[leaveCbKey] = void 0;
  1615. delete enterHooks.delayedLeave;
  1616. };
  1617. enterHooks.delayedLeave = delayedLeave;
  1618. };
  1619. }
  1620. }
  1621. return child;
  1622. };
  1623. }
  1624. };
  1625. const BaseTransition = BaseTransitionImpl;
  1626. function getLeavingNodesForType(state, vnode) {
  1627. const { leavingVNodes } = state;
  1628. let leavingVNodesCache = leavingVNodes.get(vnode.type);
  1629. if (!leavingVNodesCache) {
  1630. leavingVNodesCache = /* @__PURE__ */ Object.create(null);
  1631. leavingVNodes.set(vnode.type, leavingVNodesCache);
  1632. }
  1633. return leavingVNodesCache;
  1634. }
  1635. function resolveTransitionHooks(vnode, props, state, instance) {
  1636. const {
  1637. appear,
  1638. mode,
  1639. persisted = false,
  1640. onBeforeEnter,
  1641. onEnter,
  1642. onAfterEnter,
  1643. onEnterCancelled,
  1644. onBeforeLeave,
  1645. onLeave,
  1646. onAfterLeave,
  1647. onLeaveCancelled,
  1648. onBeforeAppear,
  1649. onAppear,
  1650. onAfterAppear,
  1651. onAppearCancelled
  1652. } = props;
  1653. const key = String(vnode.key);
  1654. const leavingVNodesCache = getLeavingNodesForType(state, vnode);
  1655. const callHook = (hook, args) => {
  1656. hook && callWithAsyncErrorHandling(
  1657. hook,
  1658. instance,
  1659. 9,
  1660. args
  1661. );
  1662. };
  1663. const callAsyncHook = (hook, args) => {
  1664. const done = args[1];
  1665. callHook(hook, args);
  1666. if (shared.isArray(hook)) {
  1667. if (hook.every((hook2) => hook2.length <= 1))
  1668. done();
  1669. } else if (hook.length <= 1) {
  1670. done();
  1671. }
  1672. };
  1673. const hooks = {
  1674. mode,
  1675. persisted,
  1676. beforeEnter(el) {
  1677. let hook = onBeforeEnter;
  1678. if (!state.isMounted) {
  1679. if (appear) {
  1680. hook = onBeforeAppear || onBeforeEnter;
  1681. } else {
  1682. return;
  1683. }
  1684. }
  1685. if (el[leaveCbKey]) {
  1686. el[leaveCbKey](
  1687. true
  1688. /* cancelled */
  1689. );
  1690. }
  1691. const leavingVNode = leavingVNodesCache[key];
  1692. if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
  1693. leavingVNode.el[leaveCbKey]();
  1694. }
  1695. callHook(hook, [el]);
  1696. },
  1697. enter(el) {
  1698. let hook = onEnter;
  1699. let afterHook = onAfterEnter;
  1700. let cancelHook = onEnterCancelled;
  1701. if (!state.isMounted) {
  1702. if (appear) {
  1703. hook = onAppear || onEnter;
  1704. afterHook = onAfterAppear || onAfterEnter;
  1705. cancelHook = onAppearCancelled || onEnterCancelled;
  1706. } else {
  1707. return;
  1708. }
  1709. }
  1710. let called = false;
  1711. const done = el[enterCbKey] = (cancelled) => {
  1712. if (called)
  1713. return;
  1714. called = true;
  1715. if (cancelled) {
  1716. callHook(cancelHook, [el]);
  1717. } else {
  1718. callHook(afterHook, [el]);
  1719. }
  1720. if (hooks.delayedLeave) {
  1721. hooks.delayedLeave();
  1722. }
  1723. el[enterCbKey] = void 0;
  1724. };
  1725. if (hook) {
  1726. callAsyncHook(hook, [el, done]);
  1727. } else {
  1728. done();
  1729. }
  1730. },
  1731. leave(el, remove) {
  1732. const key2 = String(vnode.key);
  1733. if (el[enterCbKey]) {
  1734. el[enterCbKey](
  1735. true
  1736. /* cancelled */
  1737. );
  1738. }
  1739. if (state.isUnmounting) {
  1740. return remove();
  1741. }
  1742. callHook(onBeforeLeave, [el]);
  1743. let called = false;
  1744. const done = el[leaveCbKey] = (cancelled) => {
  1745. if (called)
  1746. return;
  1747. called = true;
  1748. remove();
  1749. if (cancelled) {
  1750. callHook(onLeaveCancelled, [el]);
  1751. } else {
  1752. callHook(onAfterLeave, [el]);
  1753. }
  1754. el[leaveCbKey] = void 0;
  1755. if (leavingVNodesCache[key2] === vnode) {
  1756. delete leavingVNodesCache[key2];
  1757. }
  1758. };
  1759. leavingVNodesCache[key2] = vnode;
  1760. if (onLeave) {
  1761. callAsyncHook(onLeave, [el, done]);
  1762. } else {
  1763. done();
  1764. }
  1765. },
  1766. clone(vnode2) {
  1767. return resolveTransitionHooks(vnode2, props, state, instance);
  1768. }
  1769. };
  1770. return hooks;
  1771. }
  1772. function emptyPlaceholder(vnode) {
  1773. if (isKeepAlive(vnode)) {
  1774. vnode = cloneVNode(vnode);
  1775. vnode.children = null;
  1776. return vnode;
  1777. }
  1778. }
  1779. function getKeepAliveChild(vnode) {
  1780. if (!isKeepAlive(vnode)) {
  1781. return vnode;
  1782. }
  1783. const { shapeFlag, children } = vnode;
  1784. if (children) {
  1785. if (shapeFlag & 16) {
  1786. return children[0];
  1787. }
  1788. if (shapeFlag & 32 && shared.isFunction(children.default)) {
  1789. return children.default();
  1790. }
  1791. }
  1792. }
  1793. function setTransitionHooks(vnode, hooks) {
  1794. if (vnode.shapeFlag & 6 && vnode.component) {
  1795. setTransitionHooks(vnode.component.subTree, hooks);
  1796. } else if (vnode.shapeFlag & 128) {
  1797. vnode.ssContent.transition = hooks.clone(vnode.ssContent);
  1798. vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
  1799. } else {
  1800. vnode.transition = hooks;
  1801. }
  1802. }
  1803. function getTransitionRawChildren(children, keepComment = false, parentKey) {
  1804. let ret = [];
  1805. let keyedFragmentCount = 0;
  1806. for (let i = 0; i < children.length; i++) {
  1807. let child = children[i];
  1808. const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);
  1809. if (child.type === Fragment) {
  1810. if (child.patchFlag & 128)
  1811. keyedFragmentCount++;
  1812. ret = ret.concat(
  1813. getTransitionRawChildren(child.children, keepComment, key)
  1814. );
  1815. } else if (keepComment || child.type !== Comment) {
  1816. ret.push(key != null ? cloneVNode(child, { key }) : child);
  1817. }
  1818. }
  1819. if (keyedFragmentCount > 1) {
  1820. for (let i = 0; i < ret.length; i++) {
  1821. ret[i].patchFlag = -2;
  1822. }
  1823. }
  1824. return ret;
  1825. }
  1826. /*! #__NO_SIDE_EFFECTS__ */
  1827. // @__NO_SIDE_EFFECTS__
  1828. function defineComponent(options, extraOptions) {
  1829. return shared.isFunction(options) ? (
  1830. // #8326: extend call and options.name access are considered side-effects
  1831. // by Rollup, so we have to wrap it in a pure-annotated IIFE.
  1832. /* @__PURE__ */ (() => shared.extend({ name: options.name }, extraOptions, { setup: options }))()
  1833. ) : options;
  1834. }
  1835. const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
  1836. /*! #__NO_SIDE_EFFECTS__ */
  1837. // @__NO_SIDE_EFFECTS__
  1838. function defineAsyncComponent(source) {
  1839. if (shared.isFunction(source)) {
  1840. source = { loader: source };
  1841. }
  1842. const {
  1843. loader,
  1844. loadingComponent,
  1845. errorComponent,
  1846. delay = 200,
  1847. timeout,
  1848. // undefined = never times out
  1849. suspensible = true,
  1850. onError: userOnError
  1851. } = source;
  1852. let pendingRequest = null;
  1853. let resolvedComp;
  1854. let retries = 0;
  1855. const retry = () => {
  1856. retries++;
  1857. pendingRequest = null;
  1858. return load();
  1859. };
  1860. const load = () => {
  1861. let thisRequest;
  1862. return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
  1863. err = err instanceof Error ? err : new Error(String(err));
  1864. if (userOnError) {
  1865. return new Promise((resolve, reject) => {
  1866. const userRetry = () => resolve(retry());
  1867. const userFail = () => reject(err);
  1868. userOnError(err, userRetry, userFail, retries + 1);
  1869. });
  1870. } else {
  1871. throw err;
  1872. }
  1873. }).then((comp) => {
  1874. if (thisRequest !== pendingRequest && pendingRequest) {
  1875. return pendingRequest;
  1876. }
  1877. if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
  1878. comp = comp.default;
  1879. }
  1880. resolvedComp = comp;
  1881. return comp;
  1882. }));
  1883. };
  1884. return defineComponent({
  1885. name: "AsyncComponentWrapper",
  1886. __asyncLoader: load,
  1887. get __asyncResolved() {
  1888. return resolvedComp;
  1889. },
  1890. setup() {
  1891. const instance = currentInstance;
  1892. if (resolvedComp) {
  1893. return () => createInnerComp(resolvedComp, instance);
  1894. }
  1895. const onError = (err) => {
  1896. pendingRequest = null;
  1897. handleError(
  1898. err,
  1899. instance,
  1900. 13,
  1901. !errorComponent
  1902. );
  1903. };
  1904. if (suspensible && instance.suspense || isInSSRComponentSetup) {
  1905. return load().then((comp) => {
  1906. return () => createInnerComp(comp, instance);
  1907. }).catch((err) => {
  1908. onError(err);
  1909. return () => errorComponent ? createVNode(errorComponent, {
  1910. error: err
  1911. }) : null;
  1912. });
  1913. }
  1914. const loaded = reactivity.ref(false);
  1915. const error = reactivity.ref();
  1916. const delayed = reactivity.ref(!!delay);
  1917. if (delay) {
  1918. setTimeout(() => {
  1919. delayed.value = false;
  1920. }, delay);
  1921. }
  1922. if (timeout != null) {
  1923. setTimeout(() => {
  1924. if (!loaded.value && !error.value) {
  1925. const err = new Error(
  1926. `Async component timed out after ${timeout}ms.`
  1927. );
  1928. onError(err);
  1929. error.value = err;
  1930. }
  1931. }, timeout);
  1932. }
  1933. load().then(() => {
  1934. loaded.value = true;
  1935. if (instance.parent && isKeepAlive(instance.parent.vnode)) {
  1936. instance.parent.effect.dirty = true;
  1937. queueJob(instance.parent.update);
  1938. }
  1939. }).catch((err) => {
  1940. onError(err);
  1941. error.value = err;
  1942. });
  1943. return () => {
  1944. if (loaded.value && resolvedComp) {
  1945. return createInnerComp(resolvedComp, instance);
  1946. } else if (error.value && errorComponent) {
  1947. return createVNode(errorComponent, {
  1948. error: error.value
  1949. });
  1950. } else if (loadingComponent && !delayed.value) {
  1951. return createVNode(loadingComponent);
  1952. }
  1953. };
  1954. }
  1955. });
  1956. }
  1957. function createInnerComp(comp, parent) {
  1958. const { ref: ref2, props, children, ce } = parent.vnode;
  1959. const vnode = createVNode(comp, props, children);
  1960. vnode.ref = ref2;
  1961. vnode.ce = ce;
  1962. delete parent.vnode.ce;
  1963. return vnode;
  1964. }
  1965. const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
  1966. const KeepAliveImpl = {
  1967. name: `KeepAlive`,
  1968. // Marker for special handling inside the renderer. We are not using a ===
  1969. // check directly on KeepAlive in the renderer, because importing it directly
  1970. // would prevent it from being tree-shaken.
  1971. __isKeepAlive: true,
  1972. props: {
  1973. include: [String, RegExp, Array],
  1974. exclude: [String, RegExp, Array],
  1975. max: [String, Number]
  1976. },
  1977. setup(props, { slots }) {
  1978. const instance = getCurrentInstance();
  1979. const sharedContext = instance.ctx;
  1980. if (!sharedContext.renderer) {
  1981. return () => {
  1982. const children = slots.default && slots.default();
  1983. return children && children.length === 1 ? children[0] : children;
  1984. };
  1985. }
  1986. const cache = /* @__PURE__ */ new Map();
  1987. const keys = /* @__PURE__ */ new Set();
  1988. let current = null;
  1989. const parentSuspense = instance.suspense;
  1990. const {
  1991. renderer: {
  1992. p: patch,
  1993. m: move,
  1994. um: _unmount,
  1995. o: { createElement }
  1996. }
  1997. } = sharedContext;
  1998. const storageContainer = createElement("div");
  1999. sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
  2000. const instance2 = vnode.component;
  2001. move(vnode, container, anchor, 0, parentSuspense);
  2002. patch(
  2003. instance2.vnode,
  2004. vnode,
  2005. container,
  2006. anchor,
  2007. instance2,
  2008. parentSuspense,
  2009. namespace,
  2010. vnode.slotScopeIds,
  2011. optimized
  2012. );
  2013. queuePostRenderEffect(() => {
  2014. instance2.isDeactivated = false;
  2015. if (instance2.a) {
  2016. shared.invokeArrayFns(instance2.a);
  2017. }
  2018. const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
  2019. if (vnodeHook) {
  2020. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  2021. }
  2022. }, parentSuspense);
  2023. };
  2024. sharedContext.deactivate = (vnode) => {
  2025. const instance2 = vnode.component;
  2026. move(vnode, storageContainer, null, 1, parentSuspense);
  2027. queuePostRenderEffect(() => {
  2028. if (instance2.da) {
  2029. shared.invokeArrayFns(instance2.da);
  2030. }
  2031. const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
  2032. if (vnodeHook) {
  2033. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  2034. }
  2035. instance2.isDeactivated = true;
  2036. }, parentSuspense);
  2037. };
  2038. function unmount(vnode) {
  2039. resetShapeFlag(vnode);
  2040. _unmount(vnode, instance, parentSuspense, true);
  2041. }
  2042. function pruneCache(filter) {
  2043. cache.forEach((vnode, key) => {
  2044. const name = getComponentName(vnode.type);
  2045. if (name && (!filter || !filter(name))) {
  2046. pruneCacheEntry(key);
  2047. }
  2048. });
  2049. }
  2050. function pruneCacheEntry(key) {
  2051. const cached = cache.get(key);
  2052. if (!current || !isSameVNodeType(cached, current)) {
  2053. unmount(cached);
  2054. } else if (current) {
  2055. resetShapeFlag(current);
  2056. }
  2057. cache.delete(key);
  2058. keys.delete(key);
  2059. }
  2060. watch(
  2061. () => [props.include, props.exclude],
  2062. ([include, exclude]) => {
  2063. include && pruneCache((name) => matches(include, name));
  2064. exclude && pruneCache((name) => !matches(exclude, name));
  2065. },
  2066. // prune post-render after `current` has been updated
  2067. { flush: "post", deep: true }
  2068. );
  2069. let pendingCacheKey = null;
  2070. const cacheSubtree = () => {
  2071. if (pendingCacheKey != null) {
  2072. cache.set(pendingCacheKey, getInnerChild(instance.subTree));
  2073. }
  2074. };
  2075. onMounted(cacheSubtree);
  2076. onUpdated(cacheSubtree);
  2077. onBeforeUnmount(() => {
  2078. cache.forEach((cached) => {
  2079. const { subTree, suspense } = instance;
  2080. const vnode = getInnerChild(subTree);
  2081. if (cached.type === vnode.type && cached.key === vnode.key) {
  2082. resetShapeFlag(vnode);
  2083. const da = vnode.component.da;
  2084. da && queuePostRenderEffect(da, suspense);
  2085. return;
  2086. }
  2087. unmount(cached);
  2088. });
  2089. });
  2090. return () => {
  2091. pendingCacheKey = null;
  2092. if (!slots.default) {
  2093. return current = null;
  2094. }
  2095. const children = slots.default();
  2096. const rawVNode = children[0];
  2097. if (children.length > 1) {
  2098. current = null;
  2099. return children;
  2100. } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
  2101. current = null;
  2102. return rawVNode;
  2103. }
  2104. let vnode = getInnerChild(rawVNode);
  2105. const comp = vnode.type;
  2106. const name = getComponentName(
  2107. isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
  2108. );
  2109. const { include, exclude, max } = props;
  2110. if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
  2111. current = vnode;
  2112. return rawVNode;
  2113. }
  2114. const key = vnode.key == null ? comp : vnode.key;
  2115. const cachedVNode = cache.get(key);
  2116. if (vnode.el) {
  2117. vnode = cloneVNode(vnode);
  2118. if (rawVNode.shapeFlag & 128) {
  2119. rawVNode.ssContent = vnode;
  2120. }
  2121. }
  2122. pendingCacheKey = key;
  2123. if (cachedVNode) {
  2124. vnode.el = cachedVNode.el;
  2125. vnode.component = cachedVNode.component;
  2126. if (vnode.transition) {
  2127. setTransitionHooks(vnode, vnode.transition);
  2128. }
  2129. vnode.shapeFlag |= 512;
  2130. keys.delete(key);
  2131. keys.add(key);
  2132. } else {
  2133. keys.add(key);
  2134. if (max && keys.size > parseInt(max, 10)) {
  2135. pruneCacheEntry(keys.values().next().value);
  2136. }
  2137. }
  2138. vnode.shapeFlag |= 256;
  2139. current = vnode;
  2140. return isSuspense(rawVNode.type) ? rawVNode : vnode;
  2141. };
  2142. }
  2143. };
  2144. const KeepAlive = KeepAliveImpl;
  2145. function matches(pattern, name) {
  2146. if (shared.isArray(pattern)) {
  2147. return pattern.some((p) => matches(p, name));
  2148. } else if (shared.isString(pattern)) {
  2149. return pattern.split(",").includes(name);
  2150. } else if (shared.isRegExp(pattern)) {
  2151. return pattern.test(name);
  2152. }
  2153. return false;
  2154. }
  2155. function onActivated(hook, target) {
  2156. registerKeepAliveHook(hook, "a", target);
  2157. }
  2158. function onDeactivated(hook, target) {
  2159. registerKeepAliveHook(hook, "da", target);
  2160. }
  2161. function registerKeepAliveHook(hook, type, target = currentInstance) {
  2162. const wrappedHook = hook.__wdc || (hook.__wdc = () => {
  2163. let current = target;
  2164. while (current) {
  2165. if (current.isDeactivated) {
  2166. return;
  2167. }
  2168. current = current.parent;
  2169. }
  2170. return hook();
  2171. });
  2172. injectHook(type, wrappedHook, target);
  2173. if (target) {
  2174. let current = target.parent;
  2175. while (current && current.parent) {
  2176. if (isKeepAlive(current.parent.vnode)) {
  2177. injectToKeepAliveRoot(wrappedHook, type, target, current);
  2178. }
  2179. current = current.parent;
  2180. }
  2181. }
  2182. }
  2183. function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  2184. const injected = injectHook(
  2185. type,
  2186. hook,
  2187. keepAliveRoot,
  2188. true
  2189. /* prepend */
  2190. );
  2191. onUnmounted(() => {
  2192. shared.remove(keepAliveRoot[type], injected);
  2193. }, target);
  2194. }
  2195. function resetShapeFlag(vnode) {
  2196. vnode.shapeFlag &= ~256;
  2197. vnode.shapeFlag &= ~512;
  2198. }
  2199. function getInnerChild(vnode) {
  2200. return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
  2201. }
  2202. function injectHook(type, hook, target = currentInstance, prepend = false) {
  2203. if (target) {
  2204. const hooks = target[type] || (target[type] = []);
  2205. const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
  2206. if (target.isUnmounted) {
  2207. return;
  2208. }
  2209. reactivity.pauseTracking();
  2210. const reset = setCurrentInstance(target);
  2211. const res = callWithAsyncErrorHandling(hook, target, type, args);
  2212. reset();
  2213. reactivity.resetTracking();
  2214. return res;
  2215. });
  2216. if (prepend) {
  2217. hooks.unshift(wrappedHook);
  2218. } else {
  2219. hooks.push(wrappedHook);
  2220. }
  2221. return wrappedHook;
  2222. }
  2223. }
  2224. const createHook = (lifecycle) => (hook, target = currentInstance) => (
  2225. // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
  2226. (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target)
  2227. );
  2228. const onBeforeMount = createHook("bm");
  2229. const onMounted = createHook("m");
  2230. const onBeforeUpdate = createHook("bu");
  2231. const onUpdated = createHook("u");
  2232. const onBeforeUnmount = createHook("bum");
  2233. const onUnmounted = createHook("um");
  2234. const onServerPrefetch = createHook("sp");
  2235. const onRenderTriggered = createHook(
  2236. "rtg"
  2237. );
  2238. const onRenderTracked = createHook(
  2239. "rtc"
  2240. );
  2241. function onErrorCaptured(hook, target = currentInstance) {
  2242. injectHook("ec", hook, target);
  2243. }
  2244. function renderList(source, renderItem, cache, index) {
  2245. let ret;
  2246. const cached = cache && cache[index];
  2247. if (shared.isArray(source) || shared.isString(source)) {
  2248. ret = new Array(source.length);
  2249. for (let i = 0, l = source.length; i < l; i++) {
  2250. ret[i] = renderItem(source[i], i, void 0, cached && cached[i]);
  2251. }
  2252. } else if (typeof source === "number") {
  2253. ret = new Array(source);
  2254. for (let i = 0; i < source; i++) {
  2255. ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
  2256. }
  2257. } else if (shared.isObject(source)) {
  2258. if (source[Symbol.iterator]) {
  2259. ret = Array.from(
  2260. source,
  2261. (item, i) => renderItem(item, i, void 0, cached && cached[i])
  2262. );
  2263. } else {
  2264. const keys = Object.keys(source);
  2265. ret = new Array(keys.length);
  2266. for (let i = 0, l = keys.length; i < l; i++) {
  2267. const key = keys[i];
  2268. ret[i] = renderItem(source[key], key, i, cached && cached[i]);
  2269. }
  2270. }
  2271. } else {
  2272. ret = [];
  2273. }
  2274. if (cache) {
  2275. cache[index] = ret;
  2276. }
  2277. return ret;
  2278. }
  2279. function createSlots(slots, dynamicSlots) {
  2280. for (let i = 0; i < dynamicSlots.length; i++) {
  2281. const slot = dynamicSlots[i];
  2282. if (shared.isArray(slot)) {
  2283. for (let j = 0; j < slot.length; j++) {
  2284. slots[slot[j].name] = slot[j].fn;
  2285. }
  2286. } else if (slot) {
  2287. slots[slot.name] = slot.key ? (...args) => {
  2288. const res = slot.fn(...args);
  2289. if (res)
  2290. res.key = slot.key;
  2291. return res;
  2292. } : slot.fn;
  2293. }
  2294. }
  2295. return slots;
  2296. }
  2297. function renderSlot(slots, name, props = {}, fallback, noSlotted) {
  2298. if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) {
  2299. if (name !== "default")
  2300. props.name = name;
  2301. return createVNode("slot", props, fallback && fallback());
  2302. }
  2303. let slot = slots[name];
  2304. if (slot && slot._c) {
  2305. slot._d = false;
  2306. }
  2307. openBlock();
  2308. const validSlotContent = slot && ensureValidVNode(slot(props));
  2309. const rendered = createBlock(
  2310. Fragment,
  2311. {
  2312. key: props.key || // slot content array of a dynamic conditional slot may have a branch
  2313. // key attached in the `createSlots` helper, respect that
  2314. validSlotContent && validSlotContent.key || `_${name}`
  2315. },
  2316. validSlotContent || (fallback ? fallback() : []),
  2317. validSlotContent && slots._ === 1 ? 64 : -2
  2318. );
  2319. if (!noSlotted && rendered.scopeId) {
  2320. rendered.slotScopeIds = [rendered.scopeId + "-s"];
  2321. }
  2322. if (slot && slot._c) {
  2323. slot._d = true;
  2324. }
  2325. return rendered;
  2326. }
  2327. function ensureValidVNode(vnodes) {
  2328. return vnodes.some((child) => {
  2329. if (!isVNode(child))
  2330. return true;
  2331. if (child.type === Comment)
  2332. return false;
  2333. if (child.type === Fragment && !ensureValidVNode(child.children))
  2334. return false;
  2335. return true;
  2336. }) ? vnodes : null;
  2337. }
  2338. function toHandlers(obj, preserveCaseIfNecessary) {
  2339. const ret = {};
  2340. for (const key in obj) {
  2341. ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : shared.toHandlerKey(key)] = obj[key];
  2342. }
  2343. return ret;
  2344. }
  2345. const getPublicInstance = (i) => {
  2346. if (!i)
  2347. return null;
  2348. if (isStatefulComponent(i))
  2349. return getExposeProxy(i) || i.proxy;
  2350. return getPublicInstance(i.parent);
  2351. };
  2352. const publicPropertiesMap = (
  2353. // Move PURE marker to new line to workaround compiler discarding it
  2354. // due to type annotation
  2355. /* @__PURE__ */ shared.extend(/* @__PURE__ */ Object.create(null), {
  2356. $: (i) => i,
  2357. $el: (i) => i.vnode.el,
  2358. $data: (i) => i.data,
  2359. $props: (i) => i.props,
  2360. $attrs: (i) => i.attrs,
  2361. $slots: (i) => i.slots,
  2362. $refs: (i) => i.refs,
  2363. $parent: (i) => getPublicInstance(i.parent),
  2364. $root: (i) => getPublicInstance(i.root),
  2365. $emit: (i) => i.emit,
  2366. $options: (i) => resolveMergedOptions(i) ,
  2367. $forceUpdate: (i) => i.f || (i.f = () => {
  2368. i.effect.dirty = true;
  2369. queueJob(i.update);
  2370. }),
  2371. $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
  2372. $watch: (i) => instanceWatch.bind(i)
  2373. })
  2374. );
  2375. const hasSetupBinding = (state, key) => state !== shared.EMPTY_OBJ && !state.__isScriptSetup && shared.hasOwn(state, key);
  2376. const PublicInstanceProxyHandlers = {
  2377. get({ _: instance }, key) {
  2378. if (key === "__v_skip") {
  2379. return true;
  2380. }
  2381. const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
  2382. let normalizedProps;
  2383. if (key[0] !== "$") {
  2384. const n = accessCache[key];
  2385. if (n !== void 0) {
  2386. switch (n) {
  2387. case 1 /* SETUP */:
  2388. return setupState[key];
  2389. case 2 /* DATA */:
  2390. return data[key];
  2391. case 4 /* CONTEXT */:
  2392. return ctx[key];
  2393. case 3 /* PROPS */:
  2394. return props[key];
  2395. }
  2396. } else if (hasSetupBinding(setupState, key)) {
  2397. accessCache[key] = 1 /* SETUP */;
  2398. return setupState[key];
  2399. } else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) {
  2400. accessCache[key] = 2 /* DATA */;
  2401. return data[key];
  2402. } else if (
  2403. // only cache other properties when instance has declared (thus stable)
  2404. // props
  2405. (normalizedProps = instance.propsOptions[0]) && shared.hasOwn(normalizedProps, key)
  2406. ) {
  2407. accessCache[key] = 3 /* PROPS */;
  2408. return props[key];
  2409. } else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) {
  2410. accessCache[key] = 4 /* CONTEXT */;
  2411. return ctx[key];
  2412. } else if (shouldCacheAccess) {
  2413. accessCache[key] = 0 /* OTHER */;
  2414. }
  2415. }
  2416. const publicGetter = publicPropertiesMap[key];
  2417. let cssModule, globalProperties;
  2418. if (publicGetter) {
  2419. if (key === "$attrs") {
  2420. reactivity.track(instance.attrs, "get", "");
  2421. }
  2422. return publicGetter(instance);
  2423. } else if (
  2424. // css module (injected by vue-loader)
  2425. (cssModule = type.__cssModules) && (cssModule = cssModule[key])
  2426. ) {
  2427. return cssModule;
  2428. } else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) {
  2429. accessCache[key] = 4 /* CONTEXT */;
  2430. return ctx[key];
  2431. } else if (
  2432. // global properties
  2433. globalProperties = appContext.config.globalProperties, shared.hasOwn(globalProperties, key)
  2434. ) {
  2435. {
  2436. return globalProperties[key];
  2437. }
  2438. } else ;
  2439. },
  2440. set({ _: instance }, key, value) {
  2441. const { data, setupState, ctx } = instance;
  2442. if (hasSetupBinding(setupState, key)) {
  2443. setupState[key] = value;
  2444. return true;
  2445. } else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) {
  2446. data[key] = value;
  2447. return true;
  2448. } else if (shared.hasOwn(instance.props, key)) {
  2449. return false;
  2450. }
  2451. if (key[0] === "$" && key.slice(1) in instance) {
  2452. return false;
  2453. } else {
  2454. {
  2455. ctx[key] = value;
  2456. }
  2457. }
  2458. return true;
  2459. },
  2460. has({
  2461. _: { data, setupState, accessCache, ctx, appContext, propsOptions }
  2462. }, key) {
  2463. let normalizedProps;
  2464. return !!accessCache[key] || data !== shared.EMPTY_OBJ && shared.hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && shared.hasOwn(normalizedProps, key) || shared.hasOwn(ctx, key) || shared.hasOwn(publicPropertiesMap, key) || shared.hasOwn(appContext.config.globalProperties, key);
  2465. },
  2466. defineProperty(target, key, descriptor) {
  2467. if (descriptor.get != null) {
  2468. target._.accessCache[key] = 0;
  2469. } else if (shared.hasOwn(descriptor, "value")) {
  2470. this.set(target, key, descriptor.value, null);
  2471. }
  2472. return Reflect.defineProperty(target, key, descriptor);
  2473. }
  2474. };
  2475. const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ shared.extend(
  2476. {},
  2477. PublicInstanceProxyHandlers,
  2478. {
  2479. get(target, key) {
  2480. if (key === Symbol.unscopables) {
  2481. return;
  2482. }
  2483. return PublicInstanceProxyHandlers.get(target, key, target);
  2484. },
  2485. has(_, key) {
  2486. const has = key[0] !== "_" && !shared.isGloballyAllowed(key);
  2487. return has;
  2488. }
  2489. }
  2490. );
  2491. function defineProps() {
  2492. return null;
  2493. }
  2494. function defineEmits() {
  2495. return null;
  2496. }
  2497. function defineExpose(exposed) {
  2498. }
  2499. function defineOptions(options) {
  2500. }
  2501. function defineSlots() {
  2502. return null;
  2503. }
  2504. function defineModel() {
  2505. }
  2506. function withDefaults(props, defaults) {
  2507. return null;
  2508. }
  2509. function useSlots() {
  2510. return getContext().slots;
  2511. }
  2512. function useAttrs() {
  2513. return getContext().attrs;
  2514. }
  2515. function getContext() {
  2516. const i = getCurrentInstance();
  2517. return i.setupContext || (i.setupContext = createSetupContext(i));
  2518. }
  2519. function normalizePropsOrEmits(props) {
  2520. return shared.isArray(props) ? props.reduce(
  2521. (normalized, p) => (normalized[p] = null, normalized),
  2522. {}
  2523. ) : props;
  2524. }
  2525. function mergeDefaults(raw, defaults) {
  2526. const props = normalizePropsOrEmits(raw);
  2527. for (const key in defaults) {
  2528. if (key.startsWith("__skip"))
  2529. continue;
  2530. let opt = props[key];
  2531. if (opt) {
  2532. if (shared.isArray(opt) || shared.isFunction(opt)) {
  2533. opt = props[key] = { type: opt, default: defaults[key] };
  2534. } else {
  2535. opt.default = defaults[key];
  2536. }
  2537. } else if (opt === null) {
  2538. opt = props[key] = { default: defaults[key] };
  2539. } else ;
  2540. if (opt && defaults[`__skip_${key}`]) {
  2541. opt.skipFactory = true;
  2542. }
  2543. }
  2544. return props;
  2545. }
  2546. function mergeModels(a, b) {
  2547. if (!a || !b)
  2548. return a || b;
  2549. if (shared.isArray(a) && shared.isArray(b))
  2550. return a.concat(b);
  2551. return shared.extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
  2552. }
  2553. function createPropsRestProxy(props, excludedKeys) {
  2554. const ret = {};
  2555. for (const key in props) {
  2556. if (!excludedKeys.includes(key)) {
  2557. Object.defineProperty(ret, key, {
  2558. enumerable: true,
  2559. get: () => props[key]
  2560. });
  2561. }
  2562. }
  2563. return ret;
  2564. }
  2565. function withAsyncContext(getAwaitable) {
  2566. const ctx = getCurrentInstance();
  2567. let awaitable = getAwaitable();
  2568. unsetCurrentInstance();
  2569. if (shared.isPromise(awaitable)) {
  2570. awaitable = awaitable.catch((e) => {
  2571. setCurrentInstance(ctx);
  2572. throw e;
  2573. });
  2574. }
  2575. return [awaitable, () => setCurrentInstance(ctx)];
  2576. }
  2577. let shouldCacheAccess = true;
  2578. function applyOptions(instance) {
  2579. const options = resolveMergedOptions(instance);
  2580. const publicThis = instance.proxy;
  2581. const ctx = instance.ctx;
  2582. shouldCacheAccess = false;
  2583. if (options.beforeCreate) {
  2584. callHook(options.beforeCreate, instance, "bc");
  2585. }
  2586. const {
  2587. // state
  2588. data: dataOptions,
  2589. computed: computedOptions,
  2590. methods,
  2591. watch: watchOptions,
  2592. provide: provideOptions,
  2593. inject: injectOptions,
  2594. // lifecycle
  2595. created,
  2596. beforeMount,
  2597. mounted,
  2598. beforeUpdate,
  2599. updated,
  2600. activated,
  2601. deactivated,
  2602. beforeDestroy,
  2603. beforeUnmount,
  2604. destroyed,
  2605. unmounted,
  2606. render,
  2607. renderTracked,
  2608. renderTriggered,
  2609. errorCaptured,
  2610. serverPrefetch,
  2611. // public API
  2612. expose,
  2613. inheritAttrs,
  2614. // assets
  2615. components,
  2616. directives,
  2617. filters
  2618. } = options;
  2619. const checkDuplicateProperties = null;
  2620. if (injectOptions) {
  2621. resolveInjections(injectOptions, ctx, checkDuplicateProperties);
  2622. }
  2623. if (methods) {
  2624. for (const key in methods) {
  2625. const methodHandler = methods[key];
  2626. if (shared.isFunction(methodHandler)) {
  2627. {
  2628. ctx[key] = methodHandler.bind(publicThis);
  2629. }
  2630. }
  2631. }
  2632. }
  2633. if (dataOptions) {
  2634. const data = dataOptions.call(publicThis, publicThis);
  2635. if (!shared.isObject(data)) ; else {
  2636. instance.data = reactivity.reactive(data);
  2637. }
  2638. }
  2639. shouldCacheAccess = true;
  2640. if (computedOptions) {
  2641. for (const key in computedOptions) {
  2642. const opt = computedOptions[key];
  2643. const get = shared.isFunction(opt) ? opt.bind(publicThis, publicThis) : shared.isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : shared.NOOP;
  2644. const set = !shared.isFunction(opt) && shared.isFunction(opt.set) ? opt.set.bind(publicThis) : shared.NOOP;
  2645. const c = computed({
  2646. get,
  2647. set
  2648. });
  2649. Object.defineProperty(ctx, key, {
  2650. enumerable: true,
  2651. configurable: true,
  2652. get: () => c.value,
  2653. set: (v) => c.value = v
  2654. });
  2655. }
  2656. }
  2657. if (watchOptions) {
  2658. for (const key in watchOptions) {
  2659. createWatcher(watchOptions[key], ctx, publicThis, key);
  2660. }
  2661. }
  2662. if (provideOptions) {
  2663. const provides = shared.isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
  2664. Reflect.ownKeys(provides).forEach((key) => {
  2665. provide(key, provides[key]);
  2666. });
  2667. }
  2668. if (created) {
  2669. callHook(created, instance, "c");
  2670. }
  2671. function registerLifecycleHook(register, hook) {
  2672. if (shared.isArray(hook)) {
  2673. hook.forEach((_hook) => register(_hook.bind(publicThis)));
  2674. } else if (hook) {
  2675. register(hook.bind(publicThis));
  2676. }
  2677. }
  2678. registerLifecycleHook(onBeforeMount, beforeMount);
  2679. registerLifecycleHook(onMounted, mounted);
  2680. registerLifecycleHook(onBeforeUpdate, beforeUpdate);
  2681. registerLifecycleHook(onUpdated, updated);
  2682. registerLifecycleHook(onActivated, activated);
  2683. registerLifecycleHook(onDeactivated, deactivated);
  2684. registerLifecycleHook(onErrorCaptured, errorCaptured);
  2685. registerLifecycleHook(onRenderTracked, renderTracked);
  2686. registerLifecycleHook(onRenderTriggered, renderTriggered);
  2687. registerLifecycleHook(onBeforeUnmount, beforeUnmount);
  2688. registerLifecycleHook(onUnmounted, unmounted);
  2689. registerLifecycleHook(onServerPrefetch, serverPrefetch);
  2690. if (shared.isArray(expose)) {
  2691. if (expose.length) {
  2692. const exposed = instance.exposed || (instance.exposed = {});
  2693. expose.forEach((key) => {
  2694. Object.defineProperty(exposed, key, {
  2695. get: () => publicThis[key],
  2696. set: (val) => publicThis[key] = val
  2697. });
  2698. });
  2699. } else if (!instance.exposed) {
  2700. instance.exposed = {};
  2701. }
  2702. }
  2703. if (render && instance.render === shared.NOOP) {
  2704. instance.render = render;
  2705. }
  2706. if (inheritAttrs != null) {
  2707. instance.inheritAttrs = inheritAttrs;
  2708. }
  2709. if (components)
  2710. instance.components = components;
  2711. if (directives)
  2712. instance.directives = directives;
  2713. }
  2714. function resolveInjections(injectOptions, ctx, checkDuplicateProperties = shared.NOOP) {
  2715. if (shared.isArray(injectOptions)) {
  2716. injectOptions = normalizeInject(injectOptions);
  2717. }
  2718. for (const key in injectOptions) {
  2719. const opt = injectOptions[key];
  2720. let injected;
  2721. if (shared.isObject(opt)) {
  2722. if ("default" in opt) {
  2723. injected = inject(
  2724. opt.from || key,
  2725. opt.default,
  2726. true
  2727. );
  2728. } else {
  2729. injected = inject(opt.from || key);
  2730. }
  2731. } else {
  2732. injected = inject(opt);
  2733. }
  2734. if (reactivity.isRef(injected)) {
  2735. Object.defineProperty(ctx, key, {
  2736. enumerable: true,
  2737. configurable: true,
  2738. get: () => injected.value,
  2739. set: (v) => injected.value = v
  2740. });
  2741. } else {
  2742. ctx[key] = injected;
  2743. }
  2744. }
  2745. }
  2746. function callHook(hook, instance, type) {
  2747. callWithAsyncErrorHandling(
  2748. shared.isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy),
  2749. instance,
  2750. type
  2751. );
  2752. }
  2753. function createWatcher(raw, ctx, publicThis, key) {
  2754. const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  2755. if (shared.isString(raw)) {
  2756. const handler = ctx[raw];
  2757. if (shared.isFunction(handler)) {
  2758. watch(getter, handler);
  2759. }
  2760. } else if (shared.isFunction(raw)) {
  2761. watch(getter, raw.bind(publicThis));
  2762. } else if (shared.isObject(raw)) {
  2763. if (shared.isArray(raw)) {
  2764. raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
  2765. } else {
  2766. const handler = shared.isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
  2767. if (shared.isFunction(handler)) {
  2768. watch(getter, handler, raw);
  2769. }
  2770. }
  2771. } else ;
  2772. }
  2773. function resolveMergedOptions(instance) {
  2774. const base = instance.type;
  2775. const { mixins, extends: extendsOptions } = base;
  2776. const {
  2777. mixins: globalMixins,
  2778. optionsCache: cache,
  2779. config: { optionMergeStrategies }
  2780. } = instance.appContext;
  2781. const cached = cache.get(base);
  2782. let resolved;
  2783. if (cached) {
  2784. resolved = cached;
  2785. } else if (!globalMixins.length && !mixins && !extendsOptions) {
  2786. {
  2787. resolved = base;
  2788. }
  2789. } else {
  2790. resolved = {};
  2791. if (globalMixins.length) {
  2792. globalMixins.forEach(
  2793. (m) => mergeOptions(resolved, m, optionMergeStrategies, true)
  2794. );
  2795. }
  2796. mergeOptions(resolved, base, optionMergeStrategies);
  2797. }
  2798. if (shared.isObject(base)) {
  2799. cache.set(base, resolved);
  2800. }
  2801. return resolved;
  2802. }
  2803. function mergeOptions(to, from, strats, asMixin = false) {
  2804. const { mixins, extends: extendsOptions } = from;
  2805. if (extendsOptions) {
  2806. mergeOptions(to, extendsOptions, strats, true);
  2807. }
  2808. if (mixins) {
  2809. mixins.forEach(
  2810. (m) => mergeOptions(to, m, strats, true)
  2811. );
  2812. }
  2813. for (const key in from) {
  2814. if (asMixin && key === "expose") ; else {
  2815. const strat = internalOptionMergeStrats[key] || strats && strats[key];
  2816. to[key] = strat ? strat(to[key], from[key]) : from[key];
  2817. }
  2818. }
  2819. return to;
  2820. }
  2821. const internalOptionMergeStrats = {
  2822. data: mergeDataFn,
  2823. props: mergeEmitsOrPropsOptions,
  2824. emits: mergeEmitsOrPropsOptions,
  2825. // objects
  2826. methods: mergeObjectOptions,
  2827. computed: mergeObjectOptions,
  2828. // lifecycle
  2829. beforeCreate: mergeAsArray,
  2830. created: mergeAsArray,
  2831. beforeMount: mergeAsArray,
  2832. mounted: mergeAsArray,
  2833. beforeUpdate: mergeAsArray,
  2834. updated: mergeAsArray,
  2835. beforeDestroy: mergeAsArray,
  2836. beforeUnmount: mergeAsArray,
  2837. destroyed: mergeAsArray,
  2838. unmounted: mergeAsArray,
  2839. activated: mergeAsArray,
  2840. deactivated: mergeAsArray,
  2841. errorCaptured: mergeAsArray,
  2842. serverPrefetch: mergeAsArray,
  2843. // assets
  2844. components: mergeObjectOptions,
  2845. directives: mergeObjectOptions,
  2846. // watch
  2847. watch: mergeWatchOptions,
  2848. // provide / inject
  2849. provide: mergeDataFn,
  2850. inject: mergeInject
  2851. };
  2852. function mergeDataFn(to, from) {
  2853. if (!from) {
  2854. return to;
  2855. }
  2856. if (!to) {
  2857. return from;
  2858. }
  2859. return function mergedDataFn() {
  2860. return (shared.extend)(
  2861. shared.isFunction(to) ? to.call(this, this) : to,
  2862. shared.isFunction(from) ? from.call(this, this) : from
  2863. );
  2864. };
  2865. }
  2866. function mergeInject(to, from) {
  2867. return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
  2868. }
  2869. function normalizeInject(raw) {
  2870. if (shared.isArray(raw)) {
  2871. const res = {};
  2872. for (let i = 0; i < raw.length; i++) {
  2873. res[raw[i]] = raw[i];
  2874. }
  2875. return res;
  2876. }
  2877. return raw;
  2878. }
  2879. function mergeAsArray(to, from) {
  2880. return to ? [...new Set([].concat(to, from))] : from;
  2881. }
  2882. function mergeObjectOptions(to, from) {
  2883. return to ? shared.extend(/* @__PURE__ */ Object.create(null), to, from) : from;
  2884. }
  2885. function mergeEmitsOrPropsOptions(to, from) {
  2886. if (to) {
  2887. if (shared.isArray(to) && shared.isArray(from)) {
  2888. return [.../* @__PURE__ */ new Set([...to, ...from])];
  2889. }
  2890. return shared.extend(
  2891. /* @__PURE__ */ Object.create(null),
  2892. normalizePropsOrEmits(to),
  2893. normalizePropsOrEmits(from != null ? from : {})
  2894. );
  2895. } else {
  2896. return from;
  2897. }
  2898. }
  2899. function mergeWatchOptions(to, from) {
  2900. if (!to)
  2901. return from;
  2902. if (!from)
  2903. return to;
  2904. const merged = shared.extend(/* @__PURE__ */ Object.create(null), to);
  2905. for (const key in from) {
  2906. merged[key] = mergeAsArray(to[key], from[key]);
  2907. }
  2908. return merged;
  2909. }
  2910. function createAppContext() {
  2911. return {
  2912. app: null,
  2913. config: {
  2914. isNativeTag: shared.NO,
  2915. performance: false,
  2916. globalProperties: {},
  2917. optionMergeStrategies: {},
  2918. errorHandler: void 0,
  2919. warnHandler: void 0,
  2920. compilerOptions: {}
  2921. },
  2922. mixins: [],
  2923. components: {},
  2924. directives: {},
  2925. provides: /* @__PURE__ */ Object.create(null),
  2926. optionsCache: /* @__PURE__ */ new WeakMap(),
  2927. propsCache: /* @__PURE__ */ new WeakMap(),
  2928. emitsCache: /* @__PURE__ */ new WeakMap()
  2929. };
  2930. }
  2931. let uid$1 = 0;
  2932. function createAppAPI(render, hydrate) {
  2933. return function createApp(rootComponent, rootProps = null) {
  2934. if (!shared.isFunction(rootComponent)) {
  2935. rootComponent = shared.extend({}, rootComponent);
  2936. }
  2937. if (rootProps != null && !shared.isObject(rootProps)) {
  2938. rootProps = null;
  2939. }
  2940. const context = createAppContext();
  2941. const installedPlugins = /* @__PURE__ */ new WeakSet();
  2942. let isMounted = false;
  2943. const app = context.app = {
  2944. _uid: uid$1++,
  2945. _component: rootComponent,
  2946. _props: rootProps,
  2947. _container: null,
  2948. _context: context,
  2949. _instance: null,
  2950. version,
  2951. get config() {
  2952. return context.config;
  2953. },
  2954. set config(v) {
  2955. },
  2956. use(plugin, ...options) {
  2957. if (installedPlugins.has(plugin)) ; else if (plugin && shared.isFunction(plugin.install)) {
  2958. installedPlugins.add(plugin);
  2959. plugin.install(app, ...options);
  2960. } else if (shared.isFunction(plugin)) {
  2961. installedPlugins.add(plugin);
  2962. plugin(app, ...options);
  2963. } else ;
  2964. return app;
  2965. },
  2966. mixin(mixin) {
  2967. {
  2968. if (!context.mixins.includes(mixin)) {
  2969. context.mixins.push(mixin);
  2970. }
  2971. }
  2972. return app;
  2973. },
  2974. component(name, component) {
  2975. if (!component) {
  2976. return context.components[name];
  2977. }
  2978. context.components[name] = component;
  2979. return app;
  2980. },
  2981. directive(name, directive) {
  2982. if (!directive) {
  2983. return context.directives[name];
  2984. }
  2985. context.directives[name] = directive;
  2986. return app;
  2987. },
  2988. mount(rootContainer, isHydrate, namespace) {
  2989. if (!isMounted) {
  2990. const vnode = createVNode(rootComponent, rootProps);
  2991. vnode.appContext = context;
  2992. if (namespace === true) {
  2993. namespace = "svg";
  2994. } else if (namespace === false) {
  2995. namespace = void 0;
  2996. }
  2997. if (isHydrate && hydrate) {
  2998. hydrate(vnode, rootContainer);
  2999. } else {
  3000. render(vnode, rootContainer, namespace);
  3001. }
  3002. isMounted = true;
  3003. app._container = rootContainer;
  3004. rootContainer.__vue_app__ = app;
  3005. return getExposeProxy(vnode.component) || vnode.component.proxy;
  3006. }
  3007. },
  3008. unmount() {
  3009. if (isMounted) {
  3010. render(null, app._container);
  3011. delete app._container.__vue_app__;
  3012. }
  3013. },
  3014. provide(key, value) {
  3015. context.provides[key] = value;
  3016. return app;
  3017. },
  3018. runWithContext(fn) {
  3019. const lastApp = currentApp;
  3020. currentApp = app;
  3021. try {
  3022. return fn();
  3023. } finally {
  3024. currentApp = lastApp;
  3025. }
  3026. }
  3027. };
  3028. return app;
  3029. };
  3030. }
  3031. let currentApp = null;
  3032. function provide(key, value) {
  3033. if (!currentInstance) ; else {
  3034. let provides = currentInstance.provides;
  3035. const parentProvides = currentInstance.parent && currentInstance.parent.provides;
  3036. if (parentProvides === provides) {
  3037. provides = currentInstance.provides = Object.create(parentProvides);
  3038. }
  3039. provides[key] = value;
  3040. }
  3041. }
  3042. function inject(key, defaultValue, treatDefaultAsFactory = false) {
  3043. const instance = currentInstance || currentRenderingInstance;
  3044. if (instance || currentApp) {
  3045. const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
  3046. if (provides && key in provides) {
  3047. return provides[key];
  3048. } else if (arguments.length > 1) {
  3049. return treatDefaultAsFactory && shared.isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
  3050. } else ;
  3051. }
  3052. }
  3053. function hasInjectionContext() {
  3054. return !!(currentInstance || currentRenderingInstance || currentApp);
  3055. }
  3056. const internalObjectProto = {};
  3057. const createInternalObject = () => Object.create(internalObjectProto);
  3058. const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
  3059. function initProps(instance, rawProps, isStateful, isSSR = false) {
  3060. const props = {};
  3061. const attrs = createInternalObject();
  3062. instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  3063. setFullProps(instance, rawProps, props, attrs);
  3064. for (const key in instance.propsOptions[0]) {
  3065. if (!(key in props)) {
  3066. props[key] = void 0;
  3067. }
  3068. }
  3069. if (isStateful) {
  3070. instance.props = isSSR ? props : reactivity.shallowReactive(props);
  3071. } else {
  3072. if (!instance.type.props) {
  3073. instance.props = attrs;
  3074. } else {
  3075. instance.props = props;
  3076. }
  3077. }
  3078. instance.attrs = attrs;
  3079. }
  3080. function updateProps(instance, rawProps, rawPrevProps, optimized) {
  3081. const {
  3082. props,
  3083. attrs,
  3084. vnode: { patchFlag }
  3085. } = instance;
  3086. const rawCurrentProps = reactivity.toRaw(props);
  3087. const [options] = instance.propsOptions;
  3088. let hasAttrsChanged = false;
  3089. if (
  3090. // always force full diff in dev
  3091. // - #1942 if hmr is enabled with sfc component
  3092. // - vite#872 non-sfc component used by sfc component
  3093. (optimized || patchFlag > 0) && !(patchFlag & 16)
  3094. ) {
  3095. if (patchFlag & 8) {
  3096. const propsToUpdate = instance.vnode.dynamicProps;
  3097. for (let i = 0; i < propsToUpdate.length; i++) {
  3098. let key = propsToUpdate[i];
  3099. if (isEmitListener(instance.emitsOptions, key)) {
  3100. continue;
  3101. }
  3102. const value = rawProps[key];
  3103. if (options) {
  3104. if (shared.hasOwn(attrs, key)) {
  3105. if (value !== attrs[key]) {
  3106. attrs[key] = value;
  3107. hasAttrsChanged = true;
  3108. }
  3109. } else {
  3110. const camelizedKey = shared.camelize(key);
  3111. props[camelizedKey] = resolvePropValue(
  3112. options,
  3113. rawCurrentProps,
  3114. camelizedKey,
  3115. value,
  3116. instance,
  3117. false
  3118. );
  3119. }
  3120. } else {
  3121. if (value !== attrs[key]) {
  3122. attrs[key] = value;
  3123. hasAttrsChanged = true;
  3124. }
  3125. }
  3126. }
  3127. }
  3128. } else {
  3129. if (setFullProps(instance, rawProps, props, attrs)) {
  3130. hasAttrsChanged = true;
  3131. }
  3132. let kebabKey;
  3133. for (const key in rawCurrentProps) {
  3134. if (!rawProps || // for camelCase
  3135. !shared.hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
  3136. // and converted to camelCase (#955)
  3137. ((kebabKey = shared.hyphenate(key)) === key || !shared.hasOwn(rawProps, kebabKey))) {
  3138. if (options) {
  3139. if (rawPrevProps && // for camelCase
  3140. (rawPrevProps[key] !== void 0 || // for kebab-case
  3141. rawPrevProps[kebabKey] !== void 0)) {
  3142. props[key] = resolvePropValue(
  3143. options,
  3144. rawCurrentProps,
  3145. key,
  3146. void 0,
  3147. instance,
  3148. true
  3149. );
  3150. }
  3151. } else {
  3152. delete props[key];
  3153. }
  3154. }
  3155. }
  3156. if (attrs !== rawCurrentProps) {
  3157. for (const key in attrs) {
  3158. if (!rawProps || !shared.hasOwn(rawProps, key) && true) {
  3159. delete attrs[key];
  3160. hasAttrsChanged = true;
  3161. }
  3162. }
  3163. }
  3164. }
  3165. if (hasAttrsChanged) {
  3166. reactivity.trigger(instance.attrs, "set", "");
  3167. }
  3168. }
  3169. function setFullProps(instance, rawProps, props, attrs) {
  3170. const [options, needCastKeys] = instance.propsOptions;
  3171. let hasAttrsChanged = false;
  3172. let rawCastValues;
  3173. if (rawProps) {
  3174. for (let key in rawProps) {
  3175. if (shared.isReservedProp(key)) {
  3176. continue;
  3177. }
  3178. const value = rawProps[key];
  3179. let camelKey;
  3180. if (options && shared.hasOwn(options, camelKey = shared.camelize(key))) {
  3181. if (!needCastKeys || !needCastKeys.includes(camelKey)) {
  3182. props[camelKey] = value;
  3183. } else {
  3184. (rawCastValues || (rawCastValues = {}))[camelKey] = value;
  3185. }
  3186. } else if (!isEmitListener(instance.emitsOptions, key)) {
  3187. if (!(key in attrs) || value !== attrs[key]) {
  3188. attrs[key] = value;
  3189. hasAttrsChanged = true;
  3190. }
  3191. }
  3192. }
  3193. }
  3194. if (needCastKeys) {
  3195. const rawCurrentProps = reactivity.toRaw(props);
  3196. const castValues = rawCastValues || shared.EMPTY_OBJ;
  3197. for (let i = 0; i < needCastKeys.length; i++) {
  3198. const key = needCastKeys[i];
  3199. props[key] = resolvePropValue(
  3200. options,
  3201. rawCurrentProps,
  3202. key,
  3203. castValues[key],
  3204. instance,
  3205. !shared.hasOwn(castValues, key)
  3206. );
  3207. }
  3208. }
  3209. return hasAttrsChanged;
  3210. }
  3211. function resolvePropValue(options, props, key, value, instance, isAbsent) {
  3212. const opt = options[key];
  3213. if (opt != null) {
  3214. const hasDefault = shared.hasOwn(opt, "default");
  3215. if (hasDefault && value === void 0) {
  3216. const defaultValue = opt.default;
  3217. if (opt.type !== Function && !opt.skipFactory && shared.isFunction(defaultValue)) {
  3218. const { propsDefaults } = instance;
  3219. if (key in propsDefaults) {
  3220. value = propsDefaults[key];
  3221. } else {
  3222. const reset = setCurrentInstance(instance);
  3223. value = propsDefaults[key] = defaultValue.call(
  3224. null,
  3225. props
  3226. );
  3227. reset();
  3228. }
  3229. } else {
  3230. value = defaultValue;
  3231. }
  3232. }
  3233. if (opt[0 /* shouldCast */]) {
  3234. if (isAbsent && !hasDefault) {
  3235. value = false;
  3236. } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === shared.hyphenate(key))) {
  3237. value = true;
  3238. }
  3239. }
  3240. }
  3241. return value;
  3242. }
  3243. function normalizePropsOptions(comp, appContext, asMixin = false) {
  3244. const cache = appContext.propsCache;
  3245. const cached = cache.get(comp);
  3246. if (cached) {
  3247. return cached;
  3248. }
  3249. const raw = comp.props;
  3250. const normalized = {};
  3251. const needCastKeys = [];
  3252. let hasExtends = false;
  3253. if (!shared.isFunction(comp)) {
  3254. const extendProps = (raw2) => {
  3255. hasExtends = true;
  3256. const [props, keys] = normalizePropsOptions(raw2, appContext, true);
  3257. shared.extend(normalized, props);
  3258. if (keys)
  3259. needCastKeys.push(...keys);
  3260. };
  3261. if (!asMixin && appContext.mixins.length) {
  3262. appContext.mixins.forEach(extendProps);
  3263. }
  3264. if (comp.extends) {
  3265. extendProps(comp.extends);
  3266. }
  3267. if (comp.mixins) {
  3268. comp.mixins.forEach(extendProps);
  3269. }
  3270. }
  3271. if (!raw && !hasExtends) {
  3272. if (shared.isObject(comp)) {
  3273. cache.set(comp, shared.EMPTY_ARR);
  3274. }
  3275. return shared.EMPTY_ARR;
  3276. }
  3277. if (shared.isArray(raw)) {
  3278. for (let i = 0; i < raw.length; i++) {
  3279. const normalizedKey = shared.camelize(raw[i]);
  3280. if (validatePropName(normalizedKey)) {
  3281. normalized[normalizedKey] = shared.EMPTY_OBJ;
  3282. }
  3283. }
  3284. } else if (raw) {
  3285. for (const key in raw) {
  3286. const normalizedKey = shared.camelize(key);
  3287. if (validatePropName(normalizedKey)) {
  3288. const opt = raw[key];
  3289. const prop = normalized[normalizedKey] = shared.isArray(opt) || shared.isFunction(opt) ? { type: opt } : shared.extend({}, opt);
  3290. if (prop) {
  3291. const booleanIndex = getTypeIndex(Boolean, prop.type);
  3292. const stringIndex = getTypeIndex(String, prop.type);
  3293. prop[0 /* shouldCast */] = booleanIndex > -1;
  3294. prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex;
  3295. if (booleanIndex > -1 || shared.hasOwn(prop, "default")) {
  3296. needCastKeys.push(normalizedKey);
  3297. }
  3298. }
  3299. }
  3300. }
  3301. }
  3302. const res = [normalized, needCastKeys];
  3303. if (shared.isObject(comp)) {
  3304. cache.set(comp, res);
  3305. }
  3306. return res;
  3307. }
  3308. function validatePropName(key) {
  3309. if (key[0] !== "$" && !shared.isReservedProp(key)) {
  3310. return true;
  3311. }
  3312. return false;
  3313. }
  3314. function getType(ctor) {
  3315. if (ctor === null) {
  3316. return "null";
  3317. }
  3318. if (typeof ctor === "function") {
  3319. return ctor.name || "";
  3320. } else if (typeof ctor === "object") {
  3321. const name = ctor.constructor && ctor.constructor.name;
  3322. return name || "";
  3323. }
  3324. return "";
  3325. }
  3326. function isSameType(a, b) {
  3327. return getType(a) === getType(b);
  3328. }
  3329. function getTypeIndex(type, expectedTypes) {
  3330. if (shared.isArray(expectedTypes)) {
  3331. return expectedTypes.findIndex((t) => isSameType(t, type));
  3332. } else if (shared.isFunction(expectedTypes)) {
  3333. return isSameType(expectedTypes, type) ? 0 : -1;
  3334. }
  3335. return -1;
  3336. }
  3337. const isInternalKey = (key) => key[0] === "_" || key === "$stable";
  3338. const normalizeSlotValue = (value) => shared.isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
  3339. const normalizeSlot = (key, rawSlot, ctx) => {
  3340. if (rawSlot._n) {
  3341. return rawSlot;
  3342. }
  3343. const normalized = withCtx((...args) => {
  3344. if (false) ;
  3345. return normalizeSlotValue(rawSlot(...args));
  3346. }, ctx);
  3347. normalized._c = false;
  3348. return normalized;
  3349. };
  3350. const normalizeObjectSlots = (rawSlots, slots, instance) => {
  3351. const ctx = rawSlots._ctx;
  3352. for (const key in rawSlots) {
  3353. if (isInternalKey(key))
  3354. continue;
  3355. const value = rawSlots[key];
  3356. if (shared.isFunction(value)) {
  3357. slots[key] = normalizeSlot(key, value, ctx);
  3358. } else if (value != null) {
  3359. const normalized = normalizeSlotValue(value);
  3360. slots[key] = () => normalized;
  3361. }
  3362. }
  3363. };
  3364. const normalizeVNodeSlots = (instance, children) => {
  3365. const normalized = normalizeSlotValue(children);
  3366. instance.slots.default = () => normalized;
  3367. };
  3368. const initSlots = (instance, children) => {
  3369. const slots = instance.slots = createInternalObject();
  3370. if (instance.vnode.shapeFlag & 32) {
  3371. const type = children._;
  3372. if (type) {
  3373. shared.extend(slots, children);
  3374. shared.def(slots, "_", type);
  3375. } else {
  3376. normalizeObjectSlots(children, slots);
  3377. }
  3378. } else if (children) {
  3379. normalizeVNodeSlots(instance, children);
  3380. }
  3381. };
  3382. const updateSlots = (instance, children, optimized) => {
  3383. const { vnode, slots } = instance;
  3384. let needDeletionCheck = true;
  3385. let deletionComparisonTarget = shared.EMPTY_OBJ;
  3386. if (vnode.shapeFlag & 32) {
  3387. const type = children._;
  3388. if (type) {
  3389. if (optimized && type === 1) {
  3390. needDeletionCheck = false;
  3391. } else {
  3392. shared.extend(slots, children);
  3393. if (!optimized && type === 1) {
  3394. delete slots._;
  3395. }
  3396. }
  3397. } else {
  3398. needDeletionCheck = !children.$stable;
  3399. normalizeObjectSlots(children, slots);
  3400. }
  3401. deletionComparisonTarget = children;
  3402. } else if (children) {
  3403. normalizeVNodeSlots(instance, children);
  3404. deletionComparisonTarget = { default: 1 };
  3405. }
  3406. if (needDeletionCheck) {
  3407. for (const key in slots) {
  3408. if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
  3409. delete slots[key];
  3410. }
  3411. }
  3412. }
  3413. };
  3414. function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
  3415. if (shared.isArray(rawRef)) {
  3416. rawRef.forEach(
  3417. (r, i) => setRef(
  3418. r,
  3419. oldRawRef && (shared.isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
  3420. parentSuspense,
  3421. vnode,
  3422. isUnmount
  3423. )
  3424. );
  3425. return;
  3426. }
  3427. if (isAsyncWrapper(vnode) && !isUnmount) {
  3428. return;
  3429. }
  3430. const refValue = vnode.shapeFlag & 4 ? getExposeProxy(vnode.component) || vnode.component.proxy : vnode.el;
  3431. const value = isUnmount ? null : refValue;
  3432. const { i: owner, r: ref } = rawRef;
  3433. const oldRef = oldRawRef && oldRawRef.r;
  3434. const refs = owner.refs === shared.EMPTY_OBJ ? owner.refs = {} : owner.refs;
  3435. const setupState = owner.setupState;
  3436. if (oldRef != null && oldRef !== ref) {
  3437. if (shared.isString(oldRef)) {
  3438. refs[oldRef] = null;
  3439. if (shared.hasOwn(setupState, oldRef)) {
  3440. setupState[oldRef] = null;
  3441. }
  3442. } else if (reactivity.isRef(oldRef)) {
  3443. oldRef.value = null;
  3444. }
  3445. }
  3446. if (shared.isFunction(ref)) {
  3447. callWithErrorHandling(ref, owner, 12, [value, refs]);
  3448. } else {
  3449. const _isString = shared.isString(ref);
  3450. const _isRef = reactivity.isRef(ref);
  3451. if (_isString || _isRef) {
  3452. const doSet = () => {
  3453. if (rawRef.f) {
  3454. const existing = _isString ? shared.hasOwn(setupState, ref) ? setupState[ref] : refs[ref] : ref.value;
  3455. if (isUnmount) {
  3456. shared.isArray(existing) && shared.remove(existing, refValue);
  3457. } else {
  3458. if (!shared.isArray(existing)) {
  3459. if (_isString) {
  3460. refs[ref] = [refValue];
  3461. if (shared.hasOwn(setupState, ref)) {
  3462. setupState[ref] = refs[ref];
  3463. }
  3464. } else {
  3465. ref.value = [refValue];
  3466. if (rawRef.k)
  3467. refs[rawRef.k] = ref.value;
  3468. }
  3469. } else if (!existing.includes(refValue)) {
  3470. existing.push(refValue);
  3471. }
  3472. }
  3473. } else if (_isString) {
  3474. refs[ref] = value;
  3475. if (shared.hasOwn(setupState, ref)) {
  3476. setupState[ref] = value;
  3477. }
  3478. } else if (_isRef) {
  3479. ref.value = value;
  3480. if (rawRef.k)
  3481. refs[rawRef.k] = value;
  3482. } else ;
  3483. };
  3484. if (value) {
  3485. doSet.id = -1;
  3486. queuePostRenderEffect(doSet, parentSuspense);
  3487. } else {
  3488. doSet();
  3489. }
  3490. }
  3491. }
  3492. }
  3493. let hasMismatch = false;
  3494. const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
  3495. const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
  3496. const getContainerType = (container) => {
  3497. if (isSVGContainer(container))
  3498. return "svg";
  3499. if (isMathMLContainer(container))
  3500. return "mathml";
  3501. return void 0;
  3502. };
  3503. const isComment = (node) => node.nodeType === 8 /* COMMENT */;
  3504. function createHydrationFunctions(rendererInternals) {
  3505. const {
  3506. mt: mountComponent,
  3507. p: patch,
  3508. o: {
  3509. patchProp,
  3510. createText,
  3511. nextSibling,
  3512. parentNode,
  3513. remove,
  3514. insert,
  3515. createComment
  3516. }
  3517. } = rendererInternals;
  3518. const hydrate = (vnode, container) => {
  3519. if (!container.hasChildNodes()) {
  3520. patch(null, vnode, container);
  3521. flushPostFlushCbs();
  3522. container._vnode = vnode;
  3523. return;
  3524. }
  3525. hasMismatch = false;
  3526. hydrateNode(container.firstChild, vnode, null, null, null);
  3527. flushPostFlushCbs();
  3528. container._vnode = vnode;
  3529. if (hasMismatch && true) {
  3530. console.error(`Hydration completed but contains mismatches.`);
  3531. }
  3532. };
  3533. const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
  3534. optimized = optimized || !!vnode.dynamicChildren;
  3535. const isFragmentStart = isComment(node) && node.data === "[";
  3536. const onMismatch = () => handleMismatch(
  3537. node,
  3538. vnode,
  3539. parentComponent,
  3540. parentSuspense,
  3541. slotScopeIds,
  3542. isFragmentStart
  3543. );
  3544. const { type, ref, shapeFlag, patchFlag } = vnode;
  3545. let domType = node.nodeType;
  3546. vnode.el = node;
  3547. if (patchFlag === -2) {
  3548. optimized = false;
  3549. vnode.dynamicChildren = null;
  3550. }
  3551. let nextNode = null;
  3552. switch (type) {
  3553. case Text:
  3554. if (domType !== 3 /* TEXT */) {
  3555. if (vnode.children === "") {
  3556. insert(vnode.el = createText(""), parentNode(node), node);
  3557. nextNode = node;
  3558. } else {
  3559. nextNode = onMismatch();
  3560. }
  3561. } else {
  3562. if (node.data !== vnode.children) {
  3563. hasMismatch = true;
  3564. node.data = vnode.children;
  3565. }
  3566. nextNode = nextSibling(node);
  3567. }
  3568. break;
  3569. case Comment:
  3570. if (isTemplateNode(node)) {
  3571. nextNode = nextSibling(node);
  3572. replaceNode(
  3573. vnode.el = node.content.firstChild,
  3574. node,
  3575. parentComponent
  3576. );
  3577. } else if (domType !== 8 /* COMMENT */ || isFragmentStart) {
  3578. nextNode = onMismatch();
  3579. } else {
  3580. nextNode = nextSibling(node);
  3581. }
  3582. break;
  3583. case Static:
  3584. if (isFragmentStart) {
  3585. node = nextSibling(node);
  3586. domType = node.nodeType;
  3587. }
  3588. if (domType === 1 /* ELEMENT */ || domType === 3 /* TEXT */) {
  3589. nextNode = node;
  3590. const needToAdoptContent = !vnode.children.length;
  3591. for (let i = 0; i < vnode.staticCount; i++) {
  3592. if (needToAdoptContent)
  3593. vnode.children += nextNode.nodeType === 1 /* ELEMENT */ ? nextNode.outerHTML : nextNode.data;
  3594. if (i === vnode.staticCount - 1) {
  3595. vnode.anchor = nextNode;
  3596. }
  3597. nextNode = nextSibling(nextNode);
  3598. }
  3599. return isFragmentStart ? nextSibling(nextNode) : nextNode;
  3600. } else {
  3601. onMismatch();
  3602. }
  3603. break;
  3604. case Fragment:
  3605. if (!isFragmentStart) {
  3606. nextNode = onMismatch();
  3607. } else {
  3608. nextNode = hydrateFragment(
  3609. node,
  3610. vnode,
  3611. parentComponent,
  3612. parentSuspense,
  3613. slotScopeIds,
  3614. optimized
  3615. );
  3616. }
  3617. break;
  3618. default:
  3619. if (shapeFlag & 1) {
  3620. if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
  3621. nextNode = onMismatch();
  3622. } else {
  3623. nextNode = hydrateElement(
  3624. node,
  3625. vnode,
  3626. parentComponent,
  3627. parentSuspense,
  3628. slotScopeIds,
  3629. optimized
  3630. );
  3631. }
  3632. } else if (shapeFlag & 6) {
  3633. vnode.slotScopeIds = slotScopeIds;
  3634. const container = parentNode(node);
  3635. if (isFragmentStart) {
  3636. nextNode = locateClosingAnchor(node);
  3637. } else if (isComment(node) && node.data === "teleport start") {
  3638. nextNode = locateClosingAnchor(node, node.data, "teleport end");
  3639. } else {
  3640. nextNode = nextSibling(node);
  3641. }
  3642. mountComponent(
  3643. vnode,
  3644. container,
  3645. null,
  3646. parentComponent,
  3647. parentSuspense,
  3648. getContainerType(container),
  3649. optimized
  3650. );
  3651. if (isAsyncWrapper(vnode)) {
  3652. let subTree;
  3653. if (isFragmentStart) {
  3654. subTree = createVNode(Fragment);
  3655. subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
  3656. } else {
  3657. subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
  3658. }
  3659. subTree.el = node;
  3660. vnode.component.subTree = subTree;
  3661. }
  3662. } else if (shapeFlag & 64) {
  3663. if (domType !== 8 /* COMMENT */) {
  3664. nextNode = onMismatch();
  3665. } else {
  3666. nextNode = vnode.type.hydrate(
  3667. node,
  3668. vnode,
  3669. parentComponent,
  3670. parentSuspense,
  3671. slotScopeIds,
  3672. optimized,
  3673. rendererInternals,
  3674. hydrateChildren
  3675. );
  3676. }
  3677. } else if (shapeFlag & 128) {
  3678. nextNode = vnode.type.hydrate(
  3679. node,
  3680. vnode,
  3681. parentComponent,
  3682. parentSuspense,
  3683. getContainerType(parentNode(node)),
  3684. slotScopeIds,
  3685. optimized,
  3686. rendererInternals,
  3687. hydrateNode
  3688. );
  3689. } else ;
  3690. }
  3691. if (ref != null) {
  3692. setRef(ref, null, parentSuspense, vnode);
  3693. }
  3694. return nextNode;
  3695. };
  3696. const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  3697. optimized = optimized || !!vnode.dynamicChildren;
  3698. const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
  3699. const forcePatch = type === "input" || type === "option";
  3700. if (forcePatch || patchFlag !== -1) {
  3701. if (dirs) {
  3702. invokeDirectiveHook(vnode, null, parentComponent, "created");
  3703. }
  3704. let needCallTransitionHooks = false;
  3705. if (isTemplateNode(el)) {
  3706. needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
  3707. const content = el.content.firstChild;
  3708. if (needCallTransitionHooks) {
  3709. transition.beforeEnter(content);
  3710. }
  3711. replaceNode(content, el, parentComponent);
  3712. vnode.el = el = content;
  3713. }
  3714. if (shapeFlag & 16 && // skip if element has innerHTML / textContent
  3715. !(props && (props.innerHTML || props.textContent))) {
  3716. let next = hydrateChildren(
  3717. el.firstChild,
  3718. vnode,
  3719. el,
  3720. parentComponent,
  3721. parentSuspense,
  3722. slotScopeIds,
  3723. optimized
  3724. );
  3725. while (next) {
  3726. hasMismatch = true;
  3727. const cur = next;
  3728. next = next.nextSibling;
  3729. remove(cur);
  3730. }
  3731. } else if (shapeFlag & 8) {
  3732. if (el.textContent !== vnode.children) {
  3733. hasMismatch = true;
  3734. el.textContent = vnode.children;
  3735. }
  3736. }
  3737. if (props) {
  3738. if (forcePatch || !optimized || patchFlag & (16 | 32)) {
  3739. for (const key in props) {
  3740. if (forcePatch && (key.endsWith("value") || key === "indeterminate") || shared.isOn(key) && !shared.isReservedProp(key) || // force hydrate v-bind with .prop modifiers
  3741. key[0] === ".") {
  3742. patchProp(
  3743. el,
  3744. key,
  3745. null,
  3746. props[key],
  3747. void 0,
  3748. void 0,
  3749. parentComponent
  3750. );
  3751. }
  3752. }
  3753. } else if (props.onClick) {
  3754. patchProp(
  3755. el,
  3756. "onClick",
  3757. null,
  3758. props.onClick,
  3759. void 0,
  3760. void 0,
  3761. parentComponent
  3762. );
  3763. }
  3764. }
  3765. let vnodeHooks;
  3766. if (vnodeHooks = props && props.onVnodeBeforeMount) {
  3767. invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  3768. }
  3769. if (dirs) {
  3770. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  3771. }
  3772. if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
  3773. queueEffectWithSuspense(() => {
  3774. vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  3775. needCallTransitionHooks && transition.enter(el);
  3776. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  3777. }, parentSuspense);
  3778. }
  3779. }
  3780. return el.nextSibling;
  3781. };
  3782. const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  3783. optimized = optimized || !!parentVNode.dynamicChildren;
  3784. const children = parentVNode.children;
  3785. const l = children.length;
  3786. for (let i = 0; i < l; i++) {
  3787. const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
  3788. if (node) {
  3789. node = hydrateNode(
  3790. node,
  3791. vnode,
  3792. parentComponent,
  3793. parentSuspense,
  3794. slotScopeIds,
  3795. optimized
  3796. );
  3797. } else if (vnode.type === Text && !vnode.children) {
  3798. continue;
  3799. } else {
  3800. hasMismatch = true;
  3801. patch(
  3802. null,
  3803. vnode,
  3804. container,
  3805. null,
  3806. parentComponent,
  3807. parentSuspense,
  3808. getContainerType(container),
  3809. slotScopeIds
  3810. );
  3811. }
  3812. }
  3813. return node;
  3814. };
  3815. const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  3816. const { slotScopeIds: fragmentSlotScopeIds } = vnode;
  3817. if (fragmentSlotScopeIds) {
  3818. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  3819. }
  3820. const container = parentNode(node);
  3821. const next = hydrateChildren(
  3822. nextSibling(node),
  3823. vnode,
  3824. container,
  3825. parentComponent,
  3826. parentSuspense,
  3827. slotScopeIds,
  3828. optimized
  3829. );
  3830. if (next && isComment(next) && next.data === "]") {
  3831. return nextSibling(vnode.anchor = next);
  3832. } else {
  3833. hasMismatch = true;
  3834. insert(vnode.anchor = createComment(`]`), container, next);
  3835. return next;
  3836. }
  3837. };
  3838. const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
  3839. hasMismatch = true;
  3840. vnode.el = null;
  3841. if (isFragment) {
  3842. const end = locateClosingAnchor(node);
  3843. while (true) {
  3844. const next2 = nextSibling(node);
  3845. if (next2 && next2 !== end) {
  3846. remove(next2);
  3847. } else {
  3848. break;
  3849. }
  3850. }
  3851. }
  3852. const next = nextSibling(node);
  3853. const container = parentNode(node);
  3854. remove(node);
  3855. patch(
  3856. null,
  3857. vnode,
  3858. container,
  3859. next,
  3860. parentComponent,
  3861. parentSuspense,
  3862. getContainerType(container),
  3863. slotScopeIds
  3864. );
  3865. return next;
  3866. };
  3867. const locateClosingAnchor = (node, open = "[", close = "]") => {
  3868. let match = 0;
  3869. while (node) {
  3870. node = nextSibling(node);
  3871. if (node && isComment(node)) {
  3872. if (node.data === open)
  3873. match++;
  3874. if (node.data === close) {
  3875. if (match === 0) {
  3876. return nextSibling(node);
  3877. } else {
  3878. match--;
  3879. }
  3880. }
  3881. }
  3882. }
  3883. return node;
  3884. };
  3885. const replaceNode = (newNode, oldNode, parentComponent) => {
  3886. const parentNode2 = oldNode.parentNode;
  3887. if (parentNode2) {
  3888. parentNode2.replaceChild(newNode, oldNode);
  3889. }
  3890. let parent = parentComponent;
  3891. while (parent) {
  3892. if (parent.vnode.el === oldNode) {
  3893. parent.vnode.el = parent.subTree.el = newNode;
  3894. }
  3895. parent = parent.parent;
  3896. }
  3897. };
  3898. const isTemplateNode = (node) => {
  3899. return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template";
  3900. };
  3901. return [hydrate, hydrateNode];
  3902. }
  3903. const queuePostRenderEffect = queueEffectWithSuspense ;
  3904. function createRenderer(options) {
  3905. return baseCreateRenderer(options);
  3906. }
  3907. function createHydrationRenderer(options) {
  3908. return baseCreateRenderer(options, createHydrationFunctions);
  3909. }
  3910. function baseCreateRenderer(options, createHydrationFns) {
  3911. const target = shared.getGlobalThis();
  3912. target.__VUE__ = true;
  3913. const {
  3914. insert: hostInsert,
  3915. remove: hostRemove,
  3916. patchProp: hostPatchProp,
  3917. createElement: hostCreateElement,
  3918. createText: hostCreateText,
  3919. createComment: hostCreateComment,
  3920. setText: hostSetText,
  3921. setElementText: hostSetElementText,
  3922. parentNode: hostParentNode,
  3923. nextSibling: hostNextSibling,
  3924. setScopeId: hostSetScopeId = shared.NOOP,
  3925. insertStaticContent: hostInsertStaticContent
  3926. } = options;
  3927. const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!n2.dynamicChildren) => {
  3928. if (n1 === n2) {
  3929. return;
  3930. }
  3931. if (n1 && !isSameVNodeType(n1, n2)) {
  3932. anchor = getNextHostNode(n1);
  3933. unmount(n1, parentComponent, parentSuspense, true);
  3934. n1 = null;
  3935. }
  3936. if (n2.patchFlag === -2) {
  3937. optimized = false;
  3938. n2.dynamicChildren = null;
  3939. }
  3940. const { type, ref, shapeFlag } = n2;
  3941. switch (type) {
  3942. case Text:
  3943. processText(n1, n2, container, anchor);
  3944. break;
  3945. case Comment:
  3946. processCommentNode(n1, n2, container, anchor);
  3947. break;
  3948. case Static:
  3949. if (n1 == null) {
  3950. mountStaticNode(n2, container, anchor, namespace);
  3951. }
  3952. break;
  3953. case Fragment:
  3954. processFragment(
  3955. n1,
  3956. n2,
  3957. container,
  3958. anchor,
  3959. parentComponent,
  3960. parentSuspense,
  3961. namespace,
  3962. slotScopeIds,
  3963. optimized
  3964. );
  3965. break;
  3966. default:
  3967. if (shapeFlag & 1) {
  3968. processElement(
  3969. n1,
  3970. n2,
  3971. container,
  3972. anchor,
  3973. parentComponent,
  3974. parentSuspense,
  3975. namespace,
  3976. slotScopeIds,
  3977. optimized
  3978. );
  3979. } else if (shapeFlag & 6) {
  3980. processComponent(
  3981. n1,
  3982. n2,
  3983. container,
  3984. anchor,
  3985. parentComponent,
  3986. parentSuspense,
  3987. namespace,
  3988. slotScopeIds,
  3989. optimized
  3990. );
  3991. } else if (shapeFlag & 64) {
  3992. type.process(
  3993. n1,
  3994. n2,
  3995. container,
  3996. anchor,
  3997. parentComponent,
  3998. parentSuspense,
  3999. namespace,
  4000. slotScopeIds,
  4001. optimized,
  4002. internals
  4003. );
  4004. } else if (shapeFlag & 128) {
  4005. type.process(
  4006. n1,
  4007. n2,
  4008. container,
  4009. anchor,
  4010. parentComponent,
  4011. parentSuspense,
  4012. namespace,
  4013. slotScopeIds,
  4014. optimized,
  4015. internals
  4016. );
  4017. } else ;
  4018. }
  4019. if (ref != null && parentComponent) {
  4020. setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
  4021. }
  4022. };
  4023. const processText = (n1, n2, container, anchor) => {
  4024. if (n1 == null) {
  4025. hostInsert(
  4026. n2.el = hostCreateText(n2.children),
  4027. container,
  4028. anchor
  4029. );
  4030. } else {
  4031. const el = n2.el = n1.el;
  4032. if (n2.children !== n1.children) {
  4033. hostSetText(el, n2.children);
  4034. }
  4035. }
  4036. };
  4037. const processCommentNode = (n1, n2, container, anchor) => {
  4038. if (n1 == null) {
  4039. hostInsert(
  4040. n2.el = hostCreateComment(n2.children || ""),
  4041. container,
  4042. anchor
  4043. );
  4044. } else {
  4045. n2.el = n1.el;
  4046. }
  4047. };
  4048. const mountStaticNode = (n2, container, anchor, namespace) => {
  4049. [n2.el, n2.anchor] = hostInsertStaticContent(
  4050. n2.children,
  4051. container,
  4052. anchor,
  4053. namespace,
  4054. n2.el,
  4055. n2.anchor
  4056. );
  4057. };
  4058. const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
  4059. let next;
  4060. while (el && el !== anchor) {
  4061. next = hostNextSibling(el);
  4062. hostInsert(el, container, nextSibling);
  4063. el = next;
  4064. }
  4065. hostInsert(anchor, container, nextSibling);
  4066. };
  4067. const removeStaticNode = ({ el, anchor }) => {
  4068. let next;
  4069. while (el && el !== anchor) {
  4070. next = hostNextSibling(el);
  4071. hostRemove(el);
  4072. el = next;
  4073. }
  4074. hostRemove(anchor);
  4075. };
  4076. const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4077. if (n2.type === "svg") {
  4078. namespace = "svg";
  4079. } else if (n2.type === "math") {
  4080. namespace = "mathml";
  4081. }
  4082. if (n1 == null) {
  4083. mountElement(
  4084. n2,
  4085. container,
  4086. anchor,
  4087. parentComponent,
  4088. parentSuspense,
  4089. namespace,
  4090. slotScopeIds,
  4091. optimized
  4092. );
  4093. } else {
  4094. patchElement(
  4095. n1,
  4096. n2,
  4097. parentComponent,
  4098. parentSuspense,
  4099. namespace,
  4100. slotScopeIds,
  4101. optimized
  4102. );
  4103. }
  4104. };
  4105. const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4106. let el;
  4107. let vnodeHook;
  4108. const { props, shapeFlag, transition, dirs } = vnode;
  4109. el = vnode.el = hostCreateElement(
  4110. vnode.type,
  4111. namespace,
  4112. props && props.is,
  4113. props
  4114. );
  4115. if (shapeFlag & 8) {
  4116. hostSetElementText(el, vnode.children);
  4117. } else if (shapeFlag & 16) {
  4118. mountChildren(
  4119. vnode.children,
  4120. el,
  4121. null,
  4122. parentComponent,
  4123. parentSuspense,
  4124. resolveChildrenNamespace(vnode, namespace),
  4125. slotScopeIds,
  4126. optimized
  4127. );
  4128. }
  4129. if (dirs) {
  4130. invokeDirectiveHook(vnode, null, parentComponent, "created");
  4131. }
  4132. setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
  4133. if (props) {
  4134. for (const key in props) {
  4135. if (key !== "value" && !shared.isReservedProp(key)) {
  4136. hostPatchProp(
  4137. el,
  4138. key,
  4139. null,
  4140. props[key],
  4141. namespace,
  4142. vnode.children,
  4143. parentComponent,
  4144. parentSuspense,
  4145. unmountChildren
  4146. );
  4147. }
  4148. }
  4149. if ("value" in props) {
  4150. hostPatchProp(el, "value", null, props.value, namespace);
  4151. }
  4152. if (vnodeHook = props.onVnodeBeforeMount) {
  4153. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  4154. }
  4155. }
  4156. if (dirs) {
  4157. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  4158. }
  4159. const needCallTransitionHooks = needTransition(parentSuspense, transition);
  4160. if (needCallTransitionHooks) {
  4161. transition.beforeEnter(el);
  4162. }
  4163. hostInsert(el, container, anchor);
  4164. if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
  4165. queuePostRenderEffect(() => {
  4166. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  4167. needCallTransitionHooks && transition.enter(el);
  4168. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  4169. }, parentSuspense);
  4170. }
  4171. };
  4172. const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
  4173. if (scopeId) {
  4174. hostSetScopeId(el, scopeId);
  4175. }
  4176. if (slotScopeIds) {
  4177. for (let i = 0; i < slotScopeIds.length; i++) {
  4178. hostSetScopeId(el, slotScopeIds[i]);
  4179. }
  4180. }
  4181. if (parentComponent) {
  4182. let subTree = parentComponent.subTree;
  4183. if (vnode === subTree) {
  4184. const parentVNode = parentComponent.vnode;
  4185. setScopeId(
  4186. el,
  4187. parentVNode,
  4188. parentVNode.scopeId,
  4189. parentVNode.slotScopeIds,
  4190. parentComponent.parent
  4191. );
  4192. }
  4193. }
  4194. };
  4195. const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
  4196. for (let i = start; i < children.length; i++) {
  4197. const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
  4198. patch(
  4199. null,
  4200. child,
  4201. container,
  4202. anchor,
  4203. parentComponent,
  4204. parentSuspense,
  4205. namespace,
  4206. slotScopeIds,
  4207. optimized
  4208. );
  4209. }
  4210. };
  4211. const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4212. const el = n2.el = n1.el;
  4213. let { patchFlag, dynamicChildren, dirs } = n2;
  4214. patchFlag |= n1.patchFlag & 16;
  4215. const oldProps = n1.props || shared.EMPTY_OBJ;
  4216. const newProps = n2.props || shared.EMPTY_OBJ;
  4217. let vnodeHook;
  4218. parentComponent && toggleRecurse(parentComponent, false);
  4219. if (vnodeHook = newProps.onVnodeBeforeUpdate) {
  4220. invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  4221. }
  4222. if (dirs) {
  4223. invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
  4224. }
  4225. parentComponent && toggleRecurse(parentComponent, true);
  4226. if (dynamicChildren) {
  4227. patchBlockChildren(
  4228. n1.dynamicChildren,
  4229. dynamicChildren,
  4230. el,
  4231. parentComponent,
  4232. parentSuspense,
  4233. resolveChildrenNamespace(n2, namespace),
  4234. slotScopeIds
  4235. );
  4236. } else if (!optimized) {
  4237. patchChildren(
  4238. n1,
  4239. n2,
  4240. el,
  4241. null,
  4242. parentComponent,
  4243. parentSuspense,
  4244. resolveChildrenNamespace(n2, namespace),
  4245. slotScopeIds,
  4246. false
  4247. );
  4248. }
  4249. if (patchFlag > 0) {
  4250. if (patchFlag & 16) {
  4251. patchProps(
  4252. el,
  4253. n2,
  4254. oldProps,
  4255. newProps,
  4256. parentComponent,
  4257. parentSuspense,
  4258. namespace
  4259. );
  4260. } else {
  4261. if (patchFlag & 2) {
  4262. if (oldProps.class !== newProps.class) {
  4263. hostPatchProp(el, "class", null, newProps.class, namespace);
  4264. }
  4265. }
  4266. if (patchFlag & 4) {
  4267. hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
  4268. }
  4269. if (patchFlag & 8) {
  4270. const propsToUpdate = n2.dynamicProps;
  4271. for (let i = 0; i < propsToUpdate.length; i++) {
  4272. const key = propsToUpdate[i];
  4273. const prev = oldProps[key];
  4274. const next = newProps[key];
  4275. if (next !== prev || key === "value") {
  4276. hostPatchProp(
  4277. el,
  4278. key,
  4279. prev,
  4280. next,
  4281. namespace,
  4282. n1.children,
  4283. parentComponent,
  4284. parentSuspense,
  4285. unmountChildren
  4286. );
  4287. }
  4288. }
  4289. }
  4290. }
  4291. if (patchFlag & 1) {
  4292. if (n1.children !== n2.children) {
  4293. hostSetElementText(el, n2.children);
  4294. }
  4295. }
  4296. } else if (!optimized && dynamicChildren == null) {
  4297. patchProps(
  4298. el,
  4299. n2,
  4300. oldProps,
  4301. newProps,
  4302. parentComponent,
  4303. parentSuspense,
  4304. namespace
  4305. );
  4306. }
  4307. if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
  4308. queuePostRenderEffect(() => {
  4309. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  4310. dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
  4311. }, parentSuspense);
  4312. }
  4313. };
  4314. const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
  4315. for (let i = 0; i < newChildren.length; i++) {
  4316. const oldVNode = oldChildren[i];
  4317. const newVNode = newChildren[i];
  4318. const container = (
  4319. // oldVNode may be an errored async setup() component inside Suspense
  4320. // which will not have a mounted element
  4321. oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
  4322. // of the Fragment itself so it can move its children.
  4323. (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
  4324. // which also requires the correct parent container
  4325. !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
  4326. oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : (
  4327. // In other cases, the parent container is not actually used so we
  4328. // just pass the block element here to avoid a DOM parentNode call.
  4329. fallbackContainer
  4330. )
  4331. );
  4332. patch(
  4333. oldVNode,
  4334. newVNode,
  4335. container,
  4336. null,
  4337. parentComponent,
  4338. parentSuspense,
  4339. namespace,
  4340. slotScopeIds,
  4341. true
  4342. );
  4343. }
  4344. };
  4345. const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, namespace) => {
  4346. if (oldProps !== newProps) {
  4347. if (oldProps !== shared.EMPTY_OBJ) {
  4348. for (const key in oldProps) {
  4349. if (!shared.isReservedProp(key) && !(key in newProps)) {
  4350. hostPatchProp(
  4351. el,
  4352. key,
  4353. oldProps[key],
  4354. null,
  4355. namespace,
  4356. vnode.children,
  4357. parentComponent,
  4358. parentSuspense,
  4359. unmountChildren
  4360. );
  4361. }
  4362. }
  4363. }
  4364. for (const key in newProps) {
  4365. if (shared.isReservedProp(key))
  4366. continue;
  4367. const next = newProps[key];
  4368. const prev = oldProps[key];
  4369. if (next !== prev && key !== "value") {
  4370. hostPatchProp(
  4371. el,
  4372. key,
  4373. prev,
  4374. next,
  4375. namespace,
  4376. vnode.children,
  4377. parentComponent,
  4378. parentSuspense,
  4379. unmountChildren
  4380. );
  4381. }
  4382. }
  4383. if ("value" in newProps) {
  4384. hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
  4385. }
  4386. }
  4387. };
  4388. const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4389. const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
  4390. const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
  4391. let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
  4392. if (fragmentSlotScopeIds) {
  4393. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  4394. }
  4395. if (n1 == null) {
  4396. hostInsert(fragmentStartAnchor, container, anchor);
  4397. hostInsert(fragmentEndAnchor, container, anchor);
  4398. mountChildren(
  4399. // #10007
  4400. // such fragment like `<></>` will be compiled into
  4401. // a fragment which doesn't have a children.
  4402. // In this case fallback to an empty array
  4403. n2.children || [],
  4404. container,
  4405. fragmentEndAnchor,
  4406. parentComponent,
  4407. parentSuspense,
  4408. namespace,
  4409. slotScopeIds,
  4410. optimized
  4411. );
  4412. } else {
  4413. if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
  4414. // of renderSlot() with no valid children
  4415. n1.dynamicChildren) {
  4416. patchBlockChildren(
  4417. n1.dynamicChildren,
  4418. dynamicChildren,
  4419. container,
  4420. parentComponent,
  4421. parentSuspense,
  4422. namespace,
  4423. slotScopeIds
  4424. );
  4425. if (
  4426. // #2080 if the stable fragment has a key, it's a <template v-for> that may
  4427. // get moved around. Make sure all root level vnodes inherit el.
  4428. // #2134 or if it's a component root, it may also get moved around
  4429. // as the component is being moved.
  4430. n2.key != null || parentComponent && n2 === parentComponent.subTree
  4431. ) {
  4432. traverseStaticChildren(
  4433. n1,
  4434. n2,
  4435. true
  4436. /* shallow */
  4437. );
  4438. }
  4439. } else {
  4440. patchChildren(
  4441. n1,
  4442. n2,
  4443. container,
  4444. fragmentEndAnchor,
  4445. parentComponent,
  4446. parentSuspense,
  4447. namespace,
  4448. slotScopeIds,
  4449. optimized
  4450. );
  4451. }
  4452. }
  4453. };
  4454. const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4455. n2.slotScopeIds = slotScopeIds;
  4456. if (n1 == null) {
  4457. if (n2.shapeFlag & 512) {
  4458. parentComponent.ctx.activate(
  4459. n2,
  4460. container,
  4461. anchor,
  4462. namespace,
  4463. optimized
  4464. );
  4465. } else {
  4466. mountComponent(
  4467. n2,
  4468. container,
  4469. anchor,
  4470. parentComponent,
  4471. parentSuspense,
  4472. namespace,
  4473. optimized
  4474. );
  4475. }
  4476. } else {
  4477. updateComponent(n1, n2, optimized);
  4478. }
  4479. };
  4480. const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
  4481. const instance = (initialVNode.component = createComponentInstance(
  4482. initialVNode,
  4483. parentComponent,
  4484. parentSuspense
  4485. ));
  4486. if (isKeepAlive(initialVNode)) {
  4487. instance.ctx.renderer = internals;
  4488. }
  4489. {
  4490. setupComponent(instance);
  4491. }
  4492. if (instance.asyncDep) {
  4493. parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect);
  4494. if (!initialVNode.el) {
  4495. const placeholder = instance.subTree = createVNode(Comment);
  4496. processCommentNode(null, placeholder, container, anchor);
  4497. }
  4498. } else {
  4499. setupRenderEffect(
  4500. instance,
  4501. initialVNode,
  4502. container,
  4503. anchor,
  4504. parentSuspense,
  4505. namespace,
  4506. optimized
  4507. );
  4508. }
  4509. };
  4510. const updateComponent = (n1, n2, optimized) => {
  4511. const instance = n2.component = n1.component;
  4512. if (shouldUpdateComponent(n1, n2, optimized)) {
  4513. if (instance.asyncDep && !instance.asyncResolved) {
  4514. updateComponentPreRender(instance, n2, optimized);
  4515. return;
  4516. } else {
  4517. instance.next = n2;
  4518. invalidateJob(instance.update);
  4519. instance.effect.dirty = true;
  4520. instance.update();
  4521. }
  4522. } else {
  4523. n2.el = n1.el;
  4524. instance.vnode = n2;
  4525. }
  4526. };
  4527. const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
  4528. const componentUpdateFn = () => {
  4529. if (!instance.isMounted) {
  4530. let vnodeHook;
  4531. const { el, props } = initialVNode;
  4532. const { bm, m, parent } = instance;
  4533. const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
  4534. toggleRecurse(instance, false);
  4535. if (bm) {
  4536. shared.invokeArrayFns(bm);
  4537. }
  4538. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
  4539. invokeVNodeHook(vnodeHook, parent, initialVNode);
  4540. }
  4541. toggleRecurse(instance, true);
  4542. if (el && hydrateNode) {
  4543. const hydrateSubTree = () => {
  4544. instance.subTree = renderComponentRoot(instance);
  4545. hydrateNode(
  4546. el,
  4547. instance.subTree,
  4548. instance,
  4549. parentSuspense,
  4550. null
  4551. );
  4552. };
  4553. if (isAsyncWrapperVNode) {
  4554. initialVNode.type.__asyncLoader().then(
  4555. // note: we are moving the render call into an async callback,
  4556. // which means it won't track dependencies - but it's ok because
  4557. // a server-rendered async wrapper is already in resolved state
  4558. // and it will never need to change.
  4559. () => !instance.isUnmounted && hydrateSubTree()
  4560. );
  4561. } else {
  4562. hydrateSubTree();
  4563. }
  4564. } else {
  4565. const subTree = instance.subTree = renderComponentRoot(instance);
  4566. patch(
  4567. null,
  4568. subTree,
  4569. container,
  4570. anchor,
  4571. instance,
  4572. parentSuspense,
  4573. namespace
  4574. );
  4575. initialVNode.el = subTree.el;
  4576. }
  4577. if (m) {
  4578. queuePostRenderEffect(m, parentSuspense);
  4579. }
  4580. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
  4581. const scopedInitialVNode = initialVNode;
  4582. queuePostRenderEffect(
  4583. () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
  4584. parentSuspense
  4585. );
  4586. }
  4587. if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
  4588. instance.a && queuePostRenderEffect(instance.a, parentSuspense);
  4589. }
  4590. instance.isMounted = true;
  4591. initialVNode = container = anchor = null;
  4592. } else {
  4593. let { next, bu, u, parent, vnode } = instance;
  4594. {
  4595. const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
  4596. if (nonHydratedAsyncRoot) {
  4597. if (next) {
  4598. next.el = vnode.el;
  4599. updateComponentPreRender(instance, next, optimized);
  4600. }
  4601. nonHydratedAsyncRoot.asyncDep.then(() => {
  4602. if (!instance.isUnmounted) {
  4603. componentUpdateFn();
  4604. }
  4605. });
  4606. return;
  4607. }
  4608. }
  4609. let originNext = next;
  4610. let vnodeHook;
  4611. toggleRecurse(instance, false);
  4612. if (next) {
  4613. next.el = vnode.el;
  4614. updateComponentPreRender(instance, next, optimized);
  4615. } else {
  4616. next = vnode;
  4617. }
  4618. if (bu) {
  4619. shared.invokeArrayFns(bu);
  4620. }
  4621. if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
  4622. invokeVNodeHook(vnodeHook, parent, next, vnode);
  4623. }
  4624. toggleRecurse(instance, true);
  4625. const nextTree = renderComponentRoot(instance);
  4626. const prevTree = instance.subTree;
  4627. instance.subTree = nextTree;
  4628. patch(
  4629. prevTree,
  4630. nextTree,
  4631. // parent may have changed if it's in a teleport
  4632. hostParentNode(prevTree.el),
  4633. // anchor may have changed if it's in a fragment
  4634. getNextHostNode(prevTree),
  4635. instance,
  4636. parentSuspense,
  4637. namespace
  4638. );
  4639. next.el = nextTree.el;
  4640. if (originNext === null) {
  4641. updateHOCHostEl(instance, nextTree.el);
  4642. }
  4643. if (u) {
  4644. queuePostRenderEffect(u, parentSuspense);
  4645. }
  4646. if (vnodeHook = next.props && next.props.onVnodeUpdated) {
  4647. queuePostRenderEffect(
  4648. () => invokeVNodeHook(vnodeHook, parent, next, vnode),
  4649. parentSuspense
  4650. );
  4651. }
  4652. }
  4653. };
  4654. const effect = instance.effect = new reactivity.ReactiveEffect(
  4655. componentUpdateFn,
  4656. shared.NOOP,
  4657. () => queueJob(update),
  4658. instance.scope
  4659. // track it in component's effect scope
  4660. );
  4661. const update = instance.update = () => {
  4662. if (effect.dirty) {
  4663. effect.run();
  4664. }
  4665. };
  4666. update.id = instance.uid;
  4667. toggleRecurse(instance, true);
  4668. update();
  4669. };
  4670. const updateComponentPreRender = (instance, nextVNode, optimized) => {
  4671. nextVNode.component = instance;
  4672. const prevProps = instance.vnode.props;
  4673. instance.vnode = nextVNode;
  4674. instance.next = null;
  4675. updateProps(instance, nextVNode.props, prevProps, optimized);
  4676. updateSlots(instance, nextVNode.children, optimized);
  4677. reactivity.pauseTracking();
  4678. flushPreFlushCbs(instance);
  4679. reactivity.resetTracking();
  4680. };
  4681. const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
  4682. const c1 = n1 && n1.children;
  4683. const prevShapeFlag = n1 ? n1.shapeFlag : 0;
  4684. const c2 = n2.children;
  4685. const { patchFlag, shapeFlag } = n2;
  4686. if (patchFlag > 0) {
  4687. if (patchFlag & 128) {
  4688. patchKeyedChildren(
  4689. c1,
  4690. c2,
  4691. container,
  4692. anchor,
  4693. parentComponent,
  4694. parentSuspense,
  4695. namespace,
  4696. slotScopeIds,
  4697. optimized
  4698. );
  4699. return;
  4700. } else if (patchFlag & 256) {
  4701. patchUnkeyedChildren(
  4702. c1,
  4703. c2,
  4704. container,
  4705. anchor,
  4706. parentComponent,
  4707. parentSuspense,
  4708. namespace,
  4709. slotScopeIds,
  4710. optimized
  4711. );
  4712. return;
  4713. }
  4714. }
  4715. if (shapeFlag & 8) {
  4716. if (prevShapeFlag & 16) {
  4717. unmountChildren(c1, parentComponent, parentSuspense);
  4718. }
  4719. if (c2 !== c1) {
  4720. hostSetElementText(container, c2);
  4721. }
  4722. } else {
  4723. if (prevShapeFlag & 16) {
  4724. if (shapeFlag & 16) {
  4725. patchKeyedChildren(
  4726. c1,
  4727. c2,
  4728. container,
  4729. anchor,
  4730. parentComponent,
  4731. parentSuspense,
  4732. namespace,
  4733. slotScopeIds,
  4734. optimized
  4735. );
  4736. } else {
  4737. unmountChildren(c1, parentComponent, parentSuspense, true);
  4738. }
  4739. } else {
  4740. if (prevShapeFlag & 8) {
  4741. hostSetElementText(container, "");
  4742. }
  4743. if (shapeFlag & 16) {
  4744. mountChildren(
  4745. c2,
  4746. container,
  4747. anchor,
  4748. parentComponent,
  4749. parentSuspense,
  4750. namespace,
  4751. slotScopeIds,
  4752. optimized
  4753. );
  4754. }
  4755. }
  4756. }
  4757. };
  4758. const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4759. c1 = c1 || shared.EMPTY_ARR;
  4760. c2 = c2 || shared.EMPTY_ARR;
  4761. const oldLength = c1.length;
  4762. const newLength = c2.length;
  4763. const commonLength = Math.min(oldLength, newLength);
  4764. let i;
  4765. for (i = 0; i < commonLength; i++) {
  4766. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  4767. patch(
  4768. c1[i],
  4769. nextChild,
  4770. container,
  4771. null,
  4772. parentComponent,
  4773. parentSuspense,
  4774. namespace,
  4775. slotScopeIds,
  4776. optimized
  4777. );
  4778. }
  4779. if (oldLength > newLength) {
  4780. unmountChildren(
  4781. c1,
  4782. parentComponent,
  4783. parentSuspense,
  4784. true,
  4785. false,
  4786. commonLength
  4787. );
  4788. } else {
  4789. mountChildren(
  4790. c2,
  4791. container,
  4792. anchor,
  4793. parentComponent,
  4794. parentSuspense,
  4795. namespace,
  4796. slotScopeIds,
  4797. optimized,
  4798. commonLength
  4799. );
  4800. }
  4801. };
  4802. const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4803. let i = 0;
  4804. const l2 = c2.length;
  4805. let e1 = c1.length - 1;
  4806. let e2 = l2 - 1;
  4807. while (i <= e1 && i <= e2) {
  4808. const n1 = c1[i];
  4809. const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  4810. if (isSameVNodeType(n1, n2)) {
  4811. patch(
  4812. n1,
  4813. n2,
  4814. container,
  4815. null,
  4816. parentComponent,
  4817. parentSuspense,
  4818. namespace,
  4819. slotScopeIds,
  4820. optimized
  4821. );
  4822. } else {
  4823. break;
  4824. }
  4825. i++;
  4826. }
  4827. while (i <= e1 && i <= e2) {
  4828. const n1 = c1[e1];
  4829. const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
  4830. if (isSameVNodeType(n1, n2)) {
  4831. patch(
  4832. n1,
  4833. n2,
  4834. container,
  4835. null,
  4836. parentComponent,
  4837. parentSuspense,
  4838. namespace,
  4839. slotScopeIds,
  4840. optimized
  4841. );
  4842. } else {
  4843. break;
  4844. }
  4845. e1--;
  4846. e2--;
  4847. }
  4848. if (i > e1) {
  4849. if (i <= e2) {
  4850. const nextPos = e2 + 1;
  4851. const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
  4852. while (i <= e2) {
  4853. patch(
  4854. null,
  4855. c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
  4856. container,
  4857. anchor,
  4858. parentComponent,
  4859. parentSuspense,
  4860. namespace,
  4861. slotScopeIds,
  4862. optimized
  4863. );
  4864. i++;
  4865. }
  4866. }
  4867. } else if (i > e2) {
  4868. while (i <= e1) {
  4869. unmount(c1[i], parentComponent, parentSuspense, true);
  4870. i++;
  4871. }
  4872. } else {
  4873. const s1 = i;
  4874. const s2 = i;
  4875. const keyToNewIndexMap = /* @__PURE__ */ new Map();
  4876. for (i = s2; i <= e2; i++) {
  4877. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  4878. if (nextChild.key != null) {
  4879. keyToNewIndexMap.set(nextChild.key, i);
  4880. }
  4881. }
  4882. let j;
  4883. let patched = 0;
  4884. const toBePatched = e2 - s2 + 1;
  4885. let moved = false;
  4886. let maxNewIndexSoFar = 0;
  4887. const newIndexToOldIndexMap = new Array(toBePatched);
  4888. for (i = 0; i < toBePatched; i++)
  4889. newIndexToOldIndexMap[i] = 0;
  4890. for (i = s1; i <= e1; i++) {
  4891. const prevChild = c1[i];
  4892. if (patched >= toBePatched) {
  4893. unmount(prevChild, parentComponent, parentSuspense, true);
  4894. continue;
  4895. }
  4896. let newIndex;
  4897. if (prevChild.key != null) {
  4898. newIndex = keyToNewIndexMap.get(prevChild.key);
  4899. } else {
  4900. for (j = s2; j <= e2; j++) {
  4901. if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
  4902. newIndex = j;
  4903. break;
  4904. }
  4905. }
  4906. }
  4907. if (newIndex === void 0) {
  4908. unmount(prevChild, parentComponent, parentSuspense, true);
  4909. } else {
  4910. newIndexToOldIndexMap[newIndex - s2] = i + 1;
  4911. if (newIndex >= maxNewIndexSoFar) {
  4912. maxNewIndexSoFar = newIndex;
  4913. } else {
  4914. moved = true;
  4915. }
  4916. patch(
  4917. prevChild,
  4918. c2[newIndex],
  4919. container,
  4920. null,
  4921. parentComponent,
  4922. parentSuspense,
  4923. namespace,
  4924. slotScopeIds,
  4925. optimized
  4926. );
  4927. patched++;
  4928. }
  4929. }
  4930. const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : shared.EMPTY_ARR;
  4931. j = increasingNewIndexSequence.length - 1;
  4932. for (i = toBePatched - 1; i >= 0; i--) {
  4933. const nextIndex = s2 + i;
  4934. const nextChild = c2[nextIndex];
  4935. const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
  4936. if (newIndexToOldIndexMap[i] === 0) {
  4937. patch(
  4938. null,
  4939. nextChild,
  4940. container,
  4941. anchor,
  4942. parentComponent,
  4943. parentSuspense,
  4944. namespace,
  4945. slotScopeIds,
  4946. optimized
  4947. );
  4948. } else if (moved) {
  4949. if (j < 0 || i !== increasingNewIndexSequence[j]) {
  4950. move(nextChild, container, anchor, 2);
  4951. } else {
  4952. j--;
  4953. }
  4954. }
  4955. }
  4956. }
  4957. };
  4958. const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
  4959. const { el, type, transition, children, shapeFlag } = vnode;
  4960. if (shapeFlag & 6) {
  4961. move(vnode.component.subTree, container, anchor, moveType);
  4962. return;
  4963. }
  4964. if (shapeFlag & 128) {
  4965. vnode.suspense.move(container, anchor, moveType);
  4966. return;
  4967. }
  4968. if (shapeFlag & 64) {
  4969. type.move(vnode, container, anchor, internals);
  4970. return;
  4971. }
  4972. if (type === Fragment) {
  4973. hostInsert(el, container, anchor);
  4974. for (let i = 0; i < children.length; i++) {
  4975. move(children[i], container, anchor, moveType);
  4976. }
  4977. hostInsert(vnode.anchor, container, anchor);
  4978. return;
  4979. }
  4980. if (type === Static) {
  4981. moveStaticNode(vnode, container, anchor);
  4982. return;
  4983. }
  4984. const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
  4985. if (needTransition2) {
  4986. if (moveType === 0) {
  4987. transition.beforeEnter(el);
  4988. hostInsert(el, container, anchor);
  4989. queuePostRenderEffect(() => transition.enter(el), parentSuspense);
  4990. } else {
  4991. const { leave, delayLeave, afterLeave } = transition;
  4992. const remove2 = () => hostInsert(el, container, anchor);
  4993. const performLeave = () => {
  4994. leave(el, () => {
  4995. remove2();
  4996. afterLeave && afterLeave();
  4997. });
  4998. };
  4999. if (delayLeave) {
  5000. delayLeave(el, remove2, performLeave);
  5001. } else {
  5002. performLeave();
  5003. }
  5004. }
  5005. } else {
  5006. hostInsert(el, container, anchor);
  5007. }
  5008. };
  5009. const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
  5010. const {
  5011. type,
  5012. props,
  5013. ref,
  5014. children,
  5015. dynamicChildren,
  5016. shapeFlag,
  5017. patchFlag,
  5018. dirs
  5019. } = vnode;
  5020. if (ref != null) {
  5021. setRef(ref, null, parentSuspense, vnode, true);
  5022. }
  5023. if (shapeFlag & 256) {
  5024. parentComponent.ctx.deactivate(vnode);
  5025. return;
  5026. }
  5027. const shouldInvokeDirs = shapeFlag & 1 && dirs;
  5028. const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
  5029. let vnodeHook;
  5030. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
  5031. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  5032. }
  5033. if (shapeFlag & 6) {
  5034. unmountComponent(vnode.component, parentSuspense, doRemove);
  5035. } else {
  5036. if (shapeFlag & 128) {
  5037. vnode.suspense.unmount(parentSuspense, doRemove);
  5038. return;
  5039. }
  5040. if (shouldInvokeDirs) {
  5041. invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
  5042. }
  5043. if (shapeFlag & 64) {
  5044. vnode.type.remove(
  5045. vnode,
  5046. parentComponent,
  5047. parentSuspense,
  5048. optimized,
  5049. internals,
  5050. doRemove
  5051. );
  5052. } else if (dynamicChildren && // #1153: fast path should not be taken for non-stable (v-for) fragments
  5053. (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
  5054. unmountChildren(
  5055. dynamicChildren,
  5056. parentComponent,
  5057. parentSuspense,
  5058. false,
  5059. true
  5060. );
  5061. } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
  5062. unmountChildren(children, parentComponent, parentSuspense);
  5063. }
  5064. if (doRemove) {
  5065. remove(vnode);
  5066. }
  5067. }
  5068. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
  5069. queuePostRenderEffect(() => {
  5070. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  5071. shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
  5072. }, parentSuspense);
  5073. }
  5074. };
  5075. const remove = (vnode) => {
  5076. const { type, el, anchor, transition } = vnode;
  5077. if (type === Fragment) {
  5078. {
  5079. removeFragment(el, anchor);
  5080. }
  5081. return;
  5082. }
  5083. if (type === Static) {
  5084. removeStaticNode(vnode);
  5085. return;
  5086. }
  5087. const performRemove = () => {
  5088. hostRemove(el);
  5089. if (transition && !transition.persisted && transition.afterLeave) {
  5090. transition.afterLeave();
  5091. }
  5092. };
  5093. if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
  5094. const { leave, delayLeave } = transition;
  5095. const performLeave = () => leave(el, performRemove);
  5096. if (delayLeave) {
  5097. delayLeave(vnode.el, performRemove, performLeave);
  5098. } else {
  5099. performLeave();
  5100. }
  5101. } else {
  5102. performRemove();
  5103. }
  5104. };
  5105. const removeFragment = (cur, end) => {
  5106. let next;
  5107. while (cur !== end) {
  5108. next = hostNextSibling(cur);
  5109. hostRemove(cur);
  5110. cur = next;
  5111. }
  5112. hostRemove(end);
  5113. };
  5114. const unmountComponent = (instance, parentSuspense, doRemove) => {
  5115. const { bum, scope, update, subTree, um } = instance;
  5116. if (bum) {
  5117. shared.invokeArrayFns(bum);
  5118. }
  5119. scope.stop();
  5120. if (update) {
  5121. update.active = false;
  5122. unmount(subTree, instance, parentSuspense, doRemove);
  5123. }
  5124. if (um) {
  5125. queuePostRenderEffect(um, parentSuspense);
  5126. }
  5127. queuePostRenderEffect(() => {
  5128. instance.isUnmounted = true;
  5129. }, parentSuspense);
  5130. if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
  5131. parentSuspense.deps--;
  5132. if (parentSuspense.deps === 0) {
  5133. parentSuspense.resolve();
  5134. }
  5135. }
  5136. };
  5137. const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
  5138. for (let i = start; i < children.length; i++) {
  5139. unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
  5140. }
  5141. };
  5142. const getNextHostNode = (vnode) => {
  5143. if (vnode.shapeFlag & 6) {
  5144. return getNextHostNode(vnode.component.subTree);
  5145. }
  5146. if (vnode.shapeFlag & 128) {
  5147. return vnode.suspense.next();
  5148. }
  5149. return hostNextSibling(vnode.anchor || vnode.el);
  5150. };
  5151. let isFlushing = false;
  5152. const render = (vnode, container, namespace) => {
  5153. if (vnode == null) {
  5154. if (container._vnode) {
  5155. unmount(container._vnode, null, null, true);
  5156. }
  5157. } else {
  5158. patch(
  5159. container._vnode || null,
  5160. vnode,
  5161. container,
  5162. null,
  5163. null,
  5164. null,
  5165. namespace
  5166. );
  5167. }
  5168. if (!isFlushing) {
  5169. isFlushing = true;
  5170. flushPreFlushCbs();
  5171. flushPostFlushCbs();
  5172. isFlushing = false;
  5173. }
  5174. container._vnode = vnode;
  5175. };
  5176. const internals = {
  5177. p: patch,
  5178. um: unmount,
  5179. m: move,
  5180. r: remove,
  5181. mt: mountComponent,
  5182. mc: mountChildren,
  5183. pc: patchChildren,
  5184. pbc: patchBlockChildren,
  5185. n: getNextHostNode,
  5186. o: options
  5187. };
  5188. let hydrate;
  5189. let hydrateNode;
  5190. if (createHydrationFns) {
  5191. [hydrate, hydrateNode] = createHydrationFns(
  5192. internals
  5193. );
  5194. }
  5195. return {
  5196. render,
  5197. hydrate,
  5198. createApp: createAppAPI(render, hydrate)
  5199. };
  5200. }
  5201. function resolveChildrenNamespace({ type, props }, currentNamespace) {
  5202. return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
  5203. }
  5204. function toggleRecurse({ effect, update }, allowed) {
  5205. effect.allowRecurse = update.allowRecurse = allowed;
  5206. }
  5207. function needTransition(parentSuspense, transition) {
  5208. return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
  5209. }
  5210. function traverseStaticChildren(n1, n2, shallow = false) {
  5211. const ch1 = n1.children;
  5212. const ch2 = n2.children;
  5213. if (shared.isArray(ch1) && shared.isArray(ch2)) {
  5214. for (let i = 0; i < ch1.length; i++) {
  5215. const c1 = ch1[i];
  5216. let c2 = ch2[i];
  5217. if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
  5218. if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
  5219. c2 = ch2[i] = cloneIfMounted(ch2[i]);
  5220. c2.el = c1.el;
  5221. }
  5222. if (!shallow)
  5223. traverseStaticChildren(c1, c2);
  5224. }
  5225. if (c2.type === Text) {
  5226. c2.el = c1.el;
  5227. }
  5228. }
  5229. }
  5230. }
  5231. function getSequence(arr) {
  5232. const p = arr.slice();
  5233. const result = [0];
  5234. let i, j, u, v, c;
  5235. const len = arr.length;
  5236. for (i = 0; i < len; i++) {
  5237. const arrI = arr[i];
  5238. if (arrI !== 0) {
  5239. j = result[result.length - 1];
  5240. if (arr[j] < arrI) {
  5241. p[i] = j;
  5242. result.push(i);
  5243. continue;
  5244. }
  5245. u = 0;
  5246. v = result.length - 1;
  5247. while (u < v) {
  5248. c = u + v >> 1;
  5249. if (arr[result[c]] < arrI) {
  5250. u = c + 1;
  5251. } else {
  5252. v = c;
  5253. }
  5254. }
  5255. if (arrI < arr[result[u]]) {
  5256. if (u > 0) {
  5257. p[i] = result[u - 1];
  5258. }
  5259. result[u] = i;
  5260. }
  5261. }
  5262. }
  5263. u = result.length;
  5264. v = result[u - 1];
  5265. while (u-- > 0) {
  5266. result[u] = v;
  5267. v = p[v];
  5268. }
  5269. return result;
  5270. }
  5271. function locateNonHydratedAsyncRoot(instance) {
  5272. const subComponent = instance.subTree.component;
  5273. if (subComponent) {
  5274. if (subComponent.asyncDep && !subComponent.asyncResolved) {
  5275. return subComponent;
  5276. } else {
  5277. return locateNonHydratedAsyncRoot(subComponent);
  5278. }
  5279. }
  5280. }
  5281. const isTeleport = (type) => type.__isTeleport;
  5282. const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
  5283. const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
  5284. const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
  5285. const resolveTarget = (props, select) => {
  5286. const targetSelector = props && props.to;
  5287. if (shared.isString(targetSelector)) {
  5288. if (!select) {
  5289. return null;
  5290. } else {
  5291. const target = select(targetSelector);
  5292. return target;
  5293. }
  5294. } else {
  5295. return targetSelector;
  5296. }
  5297. };
  5298. const TeleportImpl = {
  5299. name: "Teleport",
  5300. __isTeleport: true,
  5301. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
  5302. const {
  5303. mc: mountChildren,
  5304. pc: patchChildren,
  5305. pbc: patchBlockChildren,
  5306. o: { insert, querySelector, createText, createComment }
  5307. } = internals;
  5308. const disabled = isTeleportDisabled(n2.props);
  5309. let { shapeFlag, children, dynamicChildren } = n2;
  5310. if (n1 == null) {
  5311. const placeholder = n2.el = createText("");
  5312. const mainAnchor = n2.anchor = createText("");
  5313. insert(placeholder, container, anchor);
  5314. insert(mainAnchor, container, anchor);
  5315. const target = n2.target = resolveTarget(n2.props, querySelector);
  5316. const targetAnchor = n2.targetAnchor = createText("");
  5317. if (target) {
  5318. insert(targetAnchor, target);
  5319. if (namespace === "svg" || isTargetSVG(target)) {
  5320. namespace = "svg";
  5321. } else if (namespace === "mathml" || isTargetMathML(target)) {
  5322. namespace = "mathml";
  5323. }
  5324. }
  5325. const mount = (container2, anchor2) => {
  5326. if (shapeFlag & 16) {
  5327. mountChildren(
  5328. children,
  5329. container2,
  5330. anchor2,
  5331. parentComponent,
  5332. parentSuspense,
  5333. namespace,
  5334. slotScopeIds,
  5335. optimized
  5336. );
  5337. }
  5338. };
  5339. if (disabled) {
  5340. mount(container, mainAnchor);
  5341. } else if (target) {
  5342. mount(target, targetAnchor);
  5343. }
  5344. } else {
  5345. n2.el = n1.el;
  5346. const mainAnchor = n2.anchor = n1.anchor;
  5347. const target = n2.target = n1.target;
  5348. const targetAnchor = n2.targetAnchor = n1.targetAnchor;
  5349. const wasDisabled = isTeleportDisabled(n1.props);
  5350. const currentContainer = wasDisabled ? container : target;
  5351. const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
  5352. if (namespace === "svg" || isTargetSVG(target)) {
  5353. namespace = "svg";
  5354. } else if (namespace === "mathml" || isTargetMathML(target)) {
  5355. namespace = "mathml";
  5356. }
  5357. if (dynamicChildren) {
  5358. patchBlockChildren(
  5359. n1.dynamicChildren,
  5360. dynamicChildren,
  5361. currentContainer,
  5362. parentComponent,
  5363. parentSuspense,
  5364. namespace,
  5365. slotScopeIds
  5366. );
  5367. traverseStaticChildren(n1, n2, true);
  5368. } else if (!optimized) {
  5369. patchChildren(
  5370. n1,
  5371. n2,
  5372. currentContainer,
  5373. currentAnchor,
  5374. parentComponent,
  5375. parentSuspense,
  5376. namespace,
  5377. slotScopeIds,
  5378. false
  5379. );
  5380. }
  5381. if (disabled) {
  5382. if (!wasDisabled) {
  5383. moveTeleport(
  5384. n2,
  5385. container,
  5386. mainAnchor,
  5387. internals,
  5388. 1
  5389. );
  5390. } else {
  5391. if (n2.props && n1.props && n2.props.to !== n1.props.to) {
  5392. n2.props.to = n1.props.to;
  5393. }
  5394. }
  5395. } else {
  5396. if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
  5397. const nextTarget = n2.target = resolveTarget(
  5398. n2.props,
  5399. querySelector
  5400. );
  5401. if (nextTarget) {
  5402. moveTeleport(
  5403. n2,
  5404. nextTarget,
  5405. null,
  5406. internals,
  5407. 0
  5408. );
  5409. }
  5410. } else if (wasDisabled) {
  5411. moveTeleport(
  5412. n2,
  5413. target,
  5414. targetAnchor,
  5415. internals,
  5416. 1
  5417. );
  5418. }
  5419. }
  5420. }
  5421. updateCssVars(n2);
  5422. },
  5423. remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
  5424. const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
  5425. if (target) {
  5426. hostRemove(targetAnchor);
  5427. }
  5428. doRemove && hostRemove(anchor);
  5429. if (shapeFlag & 16) {
  5430. const shouldRemove = doRemove || !isTeleportDisabled(props);
  5431. for (let i = 0; i < children.length; i++) {
  5432. const child = children[i];
  5433. unmount(
  5434. child,
  5435. parentComponent,
  5436. parentSuspense,
  5437. shouldRemove,
  5438. !!child.dynamicChildren
  5439. );
  5440. }
  5441. }
  5442. },
  5443. move: moveTeleport,
  5444. hydrate: hydrateTeleport
  5445. };
  5446. function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
  5447. if (moveType === 0) {
  5448. insert(vnode.targetAnchor, container, parentAnchor);
  5449. }
  5450. const { el, anchor, shapeFlag, children, props } = vnode;
  5451. const isReorder = moveType === 2;
  5452. if (isReorder) {
  5453. insert(el, container, parentAnchor);
  5454. }
  5455. if (!isReorder || isTeleportDisabled(props)) {
  5456. if (shapeFlag & 16) {
  5457. for (let i = 0; i < children.length; i++) {
  5458. move(
  5459. children[i],
  5460. container,
  5461. parentAnchor,
  5462. 2
  5463. );
  5464. }
  5465. }
  5466. }
  5467. if (isReorder) {
  5468. insert(anchor, container, parentAnchor);
  5469. }
  5470. }
  5471. function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
  5472. o: { nextSibling, parentNode, querySelector }
  5473. }, hydrateChildren) {
  5474. const target = vnode.target = resolveTarget(
  5475. vnode.props,
  5476. querySelector
  5477. );
  5478. if (target) {
  5479. const targetNode = target._lpa || target.firstChild;
  5480. if (vnode.shapeFlag & 16) {
  5481. if (isTeleportDisabled(vnode.props)) {
  5482. vnode.anchor = hydrateChildren(
  5483. nextSibling(node),
  5484. vnode,
  5485. parentNode(node),
  5486. parentComponent,
  5487. parentSuspense,
  5488. slotScopeIds,
  5489. optimized
  5490. );
  5491. vnode.targetAnchor = targetNode;
  5492. } else {
  5493. vnode.anchor = nextSibling(node);
  5494. let targetAnchor = targetNode;
  5495. while (targetAnchor) {
  5496. targetAnchor = nextSibling(targetAnchor);
  5497. if (targetAnchor && targetAnchor.nodeType === 8 && targetAnchor.data === "teleport anchor") {
  5498. vnode.targetAnchor = targetAnchor;
  5499. target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
  5500. break;
  5501. }
  5502. }
  5503. hydrateChildren(
  5504. targetNode,
  5505. vnode,
  5506. target,
  5507. parentComponent,
  5508. parentSuspense,
  5509. slotScopeIds,
  5510. optimized
  5511. );
  5512. }
  5513. }
  5514. updateCssVars(vnode);
  5515. }
  5516. return vnode.anchor && nextSibling(vnode.anchor);
  5517. }
  5518. const Teleport = TeleportImpl;
  5519. function updateCssVars(vnode) {
  5520. const ctx = vnode.ctx;
  5521. if (ctx && ctx.ut) {
  5522. let node = vnode.children[0].el;
  5523. while (node && node !== vnode.targetAnchor) {
  5524. if (node.nodeType === 1)
  5525. node.setAttribute("data-v-owner", ctx.uid);
  5526. node = node.nextSibling;
  5527. }
  5528. ctx.ut();
  5529. }
  5530. }
  5531. const Fragment = Symbol.for("v-fgt");
  5532. const Text = Symbol.for("v-txt");
  5533. const Comment = Symbol.for("v-cmt");
  5534. const Static = Symbol.for("v-stc");
  5535. const blockStack = [];
  5536. let currentBlock = null;
  5537. function openBlock(disableTracking = false) {
  5538. blockStack.push(currentBlock = disableTracking ? null : []);
  5539. }
  5540. function closeBlock() {
  5541. blockStack.pop();
  5542. currentBlock = blockStack[blockStack.length - 1] || null;
  5543. }
  5544. let isBlockTreeEnabled = 1;
  5545. function setBlockTracking(value) {
  5546. isBlockTreeEnabled += value;
  5547. }
  5548. function setupBlock(vnode) {
  5549. vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || shared.EMPTY_ARR : null;
  5550. closeBlock();
  5551. if (isBlockTreeEnabled > 0 && currentBlock) {
  5552. currentBlock.push(vnode);
  5553. }
  5554. return vnode;
  5555. }
  5556. function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
  5557. return setupBlock(
  5558. createBaseVNode(
  5559. type,
  5560. props,
  5561. children,
  5562. patchFlag,
  5563. dynamicProps,
  5564. shapeFlag,
  5565. true
  5566. )
  5567. );
  5568. }
  5569. function createBlock(type, props, children, patchFlag, dynamicProps) {
  5570. return setupBlock(
  5571. createVNode(
  5572. type,
  5573. props,
  5574. children,
  5575. patchFlag,
  5576. dynamicProps,
  5577. true
  5578. )
  5579. );
  5580. }
  5581. function isVNode(value) {
  5582. return value ? value.__v_isVNode === true : false;
  5583. }
  5584. function isSameVNodeType(n1, n2) {
  5585. return n1.type === n2.type && n1.key === n2.key;
  5586. }
  5587. function transformVNodeArgs(transformer) {
  5588. }
  5589. const normalizeKey = ({ key }) => key != null ? key : null;
  5590. const normalizeRef = ({
  5591. ref,
  5592. ref_key,
  5593. ref_for
  5594. }) => {
  5595. if (typeof ref === "number") {
  5596. ref = "" + ref;
  5597. }
  5598. return ref != null ? shared.isString(ref) || reactivity.isRef(ref) || shared.isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
  5599. };
  5600. function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
  5601. const vnode = {
  5602. __v_isVNode: true,
  5603. __v_skip: true,
  5604. type,
  5605. props,
  5606. key: props && normalizeKey(props),
  5607. ref: props && normalizeRef(props),
  5608. scopeId: currentScopeId,
  5609. slotScopeIds: null,
  5610. children,
  5611. component: null,
  5612. suspense: null,
  5613. ssContent: null,
  5614. ssFallback: null,
  5615. dirs: null,
  5616. transition: null,
  5617. el: null,
  5618. anchor: null,
  5619. target: null,
  5620. targetAnchor: null,
  5621. staticCount: 0,
  5622. shapeFlag,
  5623. patchFlag,
  5624. dynamicProps,
  5625. dynamicChildren: null,
  5626. appContext: null,
  5627. ctx: currentRenderingInstance
  5628. };
  5629. if (needFullChildrenNormalization) {
  5630. normalizeChildren(vnode, children);
  5631. if (shapeFlag & 128) {
  5632. type.normalize(vnode);
  5633. }
  5634. } else if (children) {
  5635. vnode.shapeFlag |= shared.isString(children) ? 8 : 16;
  5636. }
  5637. if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
  5638. !isBlockNode && // has current parent block
  5639. currentBlock && // presence of a patch flag indicates this node needs patching on updates.
  5640. // component nodes also should always be patched, because even if the
  5641. // component doesn't need to update, it needs to persist the instance on to
  5642. // the next vnode so that it can be properly unmounted later.
  5643. (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
  5644. // vnode should not be considered dynamic due to handler caching.
  5645. vnode.patchFlag !== 32) {
  5646. currentBlock.push(vnode);
  5647. }
  5648. return vnode;
  5649. }
  5650. const createVNode = _createVNode;
  5651. function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
  5652. if (!type || type === NULL_DYNAMIC_COMPONENT) {
  5653. type = Comment;
  5654. }
  5655. if (isVNode(type)) {
  5656. const cloned = cloneVNode(
  5657. type,
  5658. props,
  5659. true
  5660. /* mergeRef: true */
  5661. );
  5662. if (children) {
  5663. normalizeChildren(cloned, children);
  5664. }
  5665. if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
  5666. if (cloned.shapeFlag & 6) {
  5667. currentBlock[currentBlock.indexOf(type)] = cloned;
  5668. } else {
  5669. currentBlock.push(cloned);
  5670. }
  5671. }
  5672. cloned.patchFlag |= -2;
  5673. return cloned;
  5674. }
  5675. if (isClassComponent(type)) {
  5676. type = type.__vccOpts;
  5677. }
  5678. if (props) {
  5679. props = guardReactiveProps(props);
  5680. let { class: klass, style } = props;
  5681. if (klass && !shared.isString(klass)) {
  5682. props.class = shared.normalizeClass(klass);
  5683. }
  5684. if (shared.isObject(style)) {
  5685. if (reactivity.isProxy(style) && !shared.isArray(style)) {
  5686. style = shared.extend({}, style);
  5687. }
  5688. props.style = shared.normalizeStyle(style);
  5689. }
  5690. }
  5691. const shapeFlag = shared.isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : shared.isObject(type) ? 4 : shared.isFunction(type) ? 2 : 0;
  5692. return createBaseVNode(
  5693. type,
  5694. props,
  5695. children,
  5696. patchFlag,
  5697. dynamicProps,
  5698. shapeFlag,
  5699. isBlockNode,
  5700. true
  5701. );
  5702. }
  5703. function guardReactiveProps(props) {
  5704. if (!props)
  5705. return null;
  5706. return reactivity.isProxy(props) || isInternalObject(props) ? shared.extend({}, props) : props;
  5707. }
  5708. function cloneVNode(vnode, extraProps, mergeRef = false) {
  5709. const { props, ref, patchFlag, children } = vnode;
  5710. const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
  5711. const cloned = {
  5712. __v_isVNode: true,
  5713. __v_skip: true,
  5714. type: vnode.type,
  5715. props: mergedProps,
  5716. key: mergedProps && normalizeKey(mergedProps),
  5717. ref: extraProps && extraProps.ref ? (
  5718. // #2078 in the case of <component :is="vnode" ref="extra"/>
  5719. // if the vnode itself already has a ref, cloneVNode will need to merge
  5720. // the refs so the single vnode can be set on multiple refs
  5721. mergeRef && ref ? shared.isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps)
  5722. ) : ref,
  5723. scopeId: vnode.scopeId,
  5724. slotScopeIds: vnode.slotScopeIds,
  5725. children: children,
  5726. target: vnode.target,
  5727. targetAnchor: vnode.targetAnchor,
  5728. staticCount: vnode.staticCount,
  5729. shapeFlag: vnode.shapeFlag,
  5730. // if the vnode is cloned with extra props, we can no longer assume its
  5731. // existing patch flag to be reliable and need to add the FULL_PROPS flag.
  5732. // note: preserve flag for fragments since they use the flag for children
  5733. // fast paths only.
  5734. patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
  5735. dynamicProps: vnode.dynamicProps,
  5736. dynamicChildren: vnode.dynamicChildren,
  5737. appContext: vnode.appContext,
  5738. dirs: vnode.dirs,
  5739. transition: vnode.transition,
  5740. // These should technically only be non-null on mounted VNodes. However,
  5741. // they *should* be copied for kept-alive vnodes. So we just always copy
  5742. // them since them being non-null during a mount doesn't affect the logic as
  5743. // they will simply be overwritten.
  5744. component: vnode.component,
  5745. suspense: vnode.suspense,
  5746. ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
  5747. ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
  5748. el: vnode.el,
  5749. anchor: vnode.anchor,
  5750. ctx: vnode.ctx,
  5751. ce: vnode.ce
  5752. };
  5753. return cloned;
  5754. }
  5755. function createTextVNode(text = " ", flag = 0) {
  5756. return createVNode(Text, null, text, flag);
  5757. }
  5758. function createStaticVNode(content, numberOfNodes) {
  5759. const vnode = createVNode(Static, null, content);
  5760. vnode.staticCount = numberOfNodes;
  5761. return vnode;
  5762. }
  5763. function createCommentVNode(text = "", asBlock = false) {
  5764. return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
  5765. }
  5766. function normalizeVNode(child) {
  5767. if (child == null || typeof child === "boolean") {
  5768. return createVNode(Comment);
  5769. } else if (shared.isArray(child)) {
  5770. return createVNode(
  5771. Fragment,
  5772. null,
  5773. // #3666, avoid reference pollution when reusing vnode
  5774. child.slice()
  5775. );
  5776. } else if (typeof child === "object") {
  5777. return cloneIfMounted(child);
  5778. } else {
  5779. return createVNode(Text, null, String(child));
  5780. }
  5781. }
  5782. function cloneIfMounted(child) {
  5783. return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
  5784. }
  5785. function normalizeChildren(vnode, children) {
  5786. let type = 0;
  5787. const { shapeFlag } = vnode;
  5788. if (children == null) {
  5789. children = null;
  5790. } else if (shared.isArray(children)) {
  5791. type = 16;
  5792. } else if (typeof children === "object") {
  5793. if (shapeFlag & (1 | 64)) {
  5794. const slot = children.default;
  5795. if (slot) {
  5796. slot._c && (slot._d = false);
  5797. normalizeChildren(vnode, slot());
  5798. slot._c && (slot._d = true);
  5799. }
  5800. return;
  5801. } else {
  5802. type = 32;
  5803. const slotFlag = children._;
  5804. if (!slotFlag && !isInternalObject(children)) {
  5805. children._ctx = currentRenderingInstance;
  5806. } else if (slotFlag === 3 && currentRenderingInstance) {
  5807. if (currentRenderingInstance.slots._ === 1) {
  5808. children._ = 1;
  5809. } else {
  5810. children._ = 2;
  5811. vnode.patchFlag |= 1024;
  5812. }
  5813. }
  5814. }
  5815. } else if (shared.isFunction(children)) {
  5816. children = { default: children, _ctx: currentRenderingInstance };
  5817. type = 32;
  5818. } else {
  5819. children = String(children);
  5820. if (shapeFlag & 64) {
  5821. type = 16;
  5822. children = [createTextVNode(children)];
  5823. } else {
  5824. type = 8;
  5825. }
  5826. }
  5827. vnode.children = children;
  5828. vnode.shapeFlag |= type;
  5829. }
  5830. function mergeProps(...args) {
  5831. const ret = {};
  5832. for (let i = 0; i < args.length; i++) {
  5833. const toMerge = args[i];
  5834. for (const key in toMerge) {
  5835. if (key === "class") {
  5836. if (ret.class !== toMerge.class) {
  5837. ret.class = shared.normalizeClass([ret.class, toMerge.class]);
  5838. }
  5839. } else if (key === "style") {
  5840. ret.style = shared.normalizeStyle([ret.style, toMerge.style]);
  5841. } else if (shared.isOn(key)) {
  5842. const existing = ret[key];
  5843. const incoming = toMerge[key];
  5844. if (incoming && existing !== incoming && !(shared.isArray(existing) && existing.includes(incoming))) {
  5845. ret[key] = existing ? [].concat(existing, incoming) : incoming;
  5846. }
  5847. } else if (key !== "") {
  5848. ret[key] = toMerge[key];
  5849. }
  5850. }
  5851. }
  5852. return ret;
  5853. }
  5854. function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
  5855. callWithAsyncErrorHandling(hook, instance, 7, [
  5856. vnode,
  5857. prevVNode
  5858. ]);
  5859. }
  5860. const emptyAppContext = createAppContext();
  5861. let uid = 0;
  5862. function createComponentInstance(vnode, parent, suspense) {
  5863. const type = vnode.type;
  5864. const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  5865. const instance = {
  5866. uid: uid++,
  5867. vnode,
  5868. type,
  5869. parent,
  5870. appContext,
  5871. root: null,
  5872. // to be immediately set
  5873. next: null,
  5874. subTree: null,
  5875. // will be set synchronously right after creation
  5876. effect: null,
  5877. update: null,
  5878. // will be set synchronously right after creation
  5879. scope: new reactivity.EffectScope(
  5880. true
  5881. /* detached */
  5882. ),
  5883. render: null,
  5884. proxy: null,
  5885. exposed: null,
  5886. exposeProxy: null,
  5887. withProxy: null,
  5888. provides: parent ? parent.provides : Object.create(appContext.provides),
  5889. accessCache: null,
  5890. renderCache: [],
  5891. // local resolved assets
  5892. components: null,
  5893. directives: null,
  5894. // resolved props and emits options
  5895. propsOptions: normalizePropsOptions(type, appContext),
  5896. emitsOptions: normalizeEmitsOptions(type, appContext),
  5897. // emit
  5898. emit: null,
  5899. // to be set immediately
  5900. emitted: null,
  5901. // props default value
  5902. propsDefaults: shared.EMPTY_OBJ,
  5903. // inheritAttrs
  5904. inheritAttrs: type.inheritAttrs,
  5905. // state
  5906. ctx: shared.EMPTY_OBJ,
  5907. data: shared.EMPTY_OBJ,
  5908. props: shared.EMPTY_OBJ,
  5909. attrs: shared.EMPTY_OBJ,
  5910. slots: shared.EMPTY_OBJ,
  5911. refs: shared.EMPTY_OBJ,
  5912. setupState: shared.EMPTY_OBJ,
  5913. setupContext: null,
  5914. attrsProxy: null,
  5915. slotsProxy: null,
  5916. // suspense related
  5917. suspense,
  5918. suspenseId: suspense ? suspense.pendingId : 0,
  5919. asyncDep: null,
  5920. asyncResolved: false,
  5921. // lifecycle hooks
  5922. // not using enums here because it results in computed properties
  5923. isMounted: false,
  5924. isUnmounted: false,
  5925. isDeactivated: false,
  5926. bc: null,
  5927. c: null,
  5928. bm: null,
  5929. m: null,
  5930. bu: null,
  5931. u: null,
  5932. um: null,
  5933. bum: null,
  5934. da: null,
  5935. a: null,
  5936. rtg: null,
  5937. rtc: null,
  5938. ec: null,
  5939. sp: null
  5940. };
  5941. {
  5942. instance.ctx = { _: instance };
  5943. }
  5944. instance.root = parent ? parent.root : instance;
  5945. instance.emit = emit.bind(null, instance);
  5946. if (vnode.ce) {
  5947. vnode.ce(instance);
  5948. }
  5949. return instance;
  5950. }
  5951. let currentInstance = null;
  5952. const getCurrentInstance = () => currentInstance || currentRenderingInstance;
  5953. let internalSetCurrentInstance;
  5954. let setInSSRSetupState;
  5955. {
  5956. const g = shared.getGlobalThis();
  5957. const registerGlobalSetter = (key, setter) => {
  5958. let setters;
  5959. if (!(setters = g[key]))
  5960. setters = g[key] = [];
  5961. setters.push(setter);
  5962. return (v) => {
  5963. if (setters.length > 1)
  5964. setters.forEach((set) => set(v));
  5965. else
  5966. setters[0](v);
  5967. };
  5968. };
  5969. internalSetCurrentInstance = registerGlobalSetter(
  5970. `__VUE_INSTANCE_SETTERS__`,
  5971. (v) => currentInstance = v
  5972. );
  5973. setInSSRSetupState = registerGlobalSetter(
  5974. `__VUE_SSR_SETTERS__`,
  5975. (v) => isInSSRComponentSetup = v
  5976. );
  5977. }
  5978. const setCurrentInstance = (instance) => {
  5979. const prev = currentInstance;
  5980. internalSetCurrentInstance(instance);
  5981. instance.scope.on();
  5982. return () => {
  5983. instance.scope.off();
  5984. internalSetCurrentInstance(prev);
  5985. };
  5986. };
  5987. const unsetCurrentInstance = () => {
  5988. currentInstance && currentInstance.scope.off();
  5989. internalSetCurrentInstance(null);
  5990. };
  5991. function isStatefulComponent(instance) {
  5992. return instance.vnode.shapeFlag & 4;
  5993. }
  5994. let isInSSRComponentSetup = false;
  5995. function setupComponent(instance, isSSR = false) {
  5996. isSSR && setInSSRSetupState(isSSR);
  5997. const { props, children } = instance.vnode;
  5998. const isStateful = isStatefulComponent(instance);
  5999. initProps(instance, props, isStateful, isSSR);
  6000. initSlots(instance, children);
  6001. const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  6002. isSSR && setInSSRSetupState(false);
  6003. return setupResult;
  6004. }
  6005. function setupStatefulComponent(instance, isSSR) {
  6006. const Component = instance.type;
  6007. instance.accessCache = /* @__PURE__ */ Object.create(null);
  6008. instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
  6009. const { setup } = Component;
  6010. if (setup) {
  6011. const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
  6012. const reset = setCurrentInstance(instance);
  6013. reactivity.pauseTracking();
  6014. const setupResult = callWithErrorHandling(
  6015. setup,
  6016. instance,
  6017. 0,
  6018. [
  6019. instance.props,
  6020. setupContext
  6021. ]
  6022. );
  6023. reactivity.resetTracking();
  6024. reset();
  6025. if (shared.isPromise(setupResult)) {
  6026. setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
  6027. if (isSSR) {
  6028. return setupResult.then((resolvedResult) => {
  6029. handleSetupResult(instance, resolvedResult, isSSR);
  6030. }).catch((e) => {
  6031. handleError(e, instance, 0);
  6032. });
  6033. } else {
  6034. instance.asyncDep = setupResult;
  6035. }
  6036. } else {
  6037. handleSetupResult(instance, setupResult, isSSR);
  6038. }
  6039. } else {
  6040. finishComponentSetup(instance, isSSR);
  6041. }
  6042. }
  6043. function handleSetupResult(instance, setupResult, isSSR) {
  6044. if (shared.isFunction(setupResult)) {
  6045. if (instance.type.__ssrInlineRender) {
  6046. instance.ssrRender = setupResult;
  6047. } else {
  6048. instance.render = setupResult;
  6049. }
  6050. } else if (shared.isObject(setupResult)) {
  6051. instance.setupState = reactivity.proxyRefs(setupResult);
  6052. } else ;
  6053. finishComponentSetup(instance, isSSR);
  6054. }
  6055. let compile;
  6056. let installWithProxy;
  6057. function registerRuntimeCompiler(_compile) {
  6058. compile = _compile;
  6059. installWithProxy = (i) => {
  6060. if (i.render._rc) {
  6061. i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
  6062. }
  6063. };
  6064. }
  6065. const isRuntimeOnly = () => !compile;
  6066. function finishComponentSetup(instance, isSSR, skipOptions) {
  6067. const Component = instance.type;
  6068. if (!instance.render) {
  6069. if (!isSSR && compile && !Component.render) {
  6070. const template = Component.template || resolveMergedOptions(instance).template;
  6071. if (template) {
  6072. const { isCustomElement, compilerOptions } = instance.appContext.config;
  6073. const { delimiters, compilerOptions: componentCompilerOptions } = Component;
  6074. const finalCompilerOptions = shared.extend(
  6075. shared.extend(
  6076. {
  6077. isCustomElement,
  6078. delimiters
  6079. },
  6080. compilerOptions
  6081. ),
  6082. componentCompilerOptions
  6083. );
  6084. Component.render = compile(template, finalCompilerOptions);
  6085. }
  6086. }
  6087. instance.render = Component.render || shared.NOOP;
  6088. if (installWithProxy) {
  6089. installWithProxy(instance);
  6090. }
  6091. }
  6092. {
  6093. const reset = setCurrentInstance(instance);
  6094. reactivity.pauseTracking();
  6095. try {
  6096. applyOptions(instance);
  6097. } finally {
  6098. reactivity.resetTracking();
  6099. reset();
  6100. }
  6101. }
  6102. }
  6103. const attrsProxyHandlers = {
  6104. get(target, key) {
  6105. reactivity.track(target, "get", "");
  6106. return target[key];
  6107. }
  6108. };
  6109. function createSetupContext(instance) {
  6110. const expose = (exposed) => {
  6111. instance.exposed = exposed || {};
  6112. };
  6113. {
  6114. return {
  6115. attrs: new Proxy(instance.attrs, attrsProxyHandlers),
  6116. slots: instance.slots,
  6117. emit: instance.emit,
  6118. expose
  6119. };
  6120. }
  6121. }
  6122. function getExposeProxy(instance) {
  6123. if (instance.exposed) {
  6124. return instance.exposeProxy || (instance.exposeProxy = new Proxy(reactivity.proxyRefs(reactivity.markRaw(instance.exposed)), {
  6125. get(target, key) {
  6126. if (key in target) {
  6127. return target[key];
  6128. } else if (key in publicPropertiesMap) {
  6129. return publicPropertiesMap[key](instance);
  6130. }
  6131. },
  6132. has(target, key) {
  6133. return key in target || key in publicPropertiesMap;
  6134. }
  6135. }));
  6136. }
  6137. }
  6138. function getComponentName(Component, includeInferred = true) {
  6139. return shared.isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
  6140. }
  6141. function isClassComponent(value) {
  6142. return shared.isFunction(value) && "__vccOpts" in value;
  6143. }
  6144. const computed = (getterOrOptions, debugOptions) => {
  6145. const c = reactivity.computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
  6146. return c;
  6147. };
  6148. function useModel(props, name, options = shared.EMPTY_OBJ) {
  6149. const i = getCurrentInstance();
  6150. const camelizedName = shared.camelize(name);
  6151. const hyphenatedName = shared.hyphenate(name);
  6152. const res = reactivity.customRef((track, trigger) => {
  6153. let localValue;
  6154. watchSyncEffect(() => {
  6155. const propValue = props[name];
  6156. if (shared.hasChanged(localValue, propValue)) {
  6157. localValue = propValue;
  6158. trigger();
  6159. }
  6160. });
  6161. return {
  6162. get() {
  6163. track();
  6164. return options.get ? options.get(localValue) : localValue;
  6165. },
  6166. set(value) {
  6167. const rawProps = i.vnode.props;
  6168. if (!(rawProps && // check if parent has passed v-model
  6169. (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && shared.hasChanged(value, localValue)) {
  6170. localValue = value;
  6171. trigger();
  6172. }
  6173. i.emit(`update:${name}`, options.set ? options.set(value) : value);
  6174. }
  6175. };
  6176. });
  6177. const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
  6178. res[Symbol.iterator] = () => {
  6179. let i2 = 0;
  6180. return {
  6181. next() {
  6182. if (i2 < 2) {
  6183. return { value: i2++ ? props[modifierKey] || {} : res, done: false };
  6184. } else {
  6185. return { done: true };
  6186. }
  6187. }
  6188. };
  6189. };
  6190. return res;
  6191. }
  6192. function h(type, propsOrChildren, children) {
  6193. const l = arguments.length;
  6194. if (l === 2) {
  6195. if (shared.isObject(propsOrChildren) && !shared.isArray(propsOrChildren)) {
  6196. if (isVNode(propsOrChildren)) {
  6197. return createVNode(type, null, [propsOrChildren]);
  6198. }
  6199. return createVNode(type, propsOrChildren);
  6200. } else {
  6201. return createVNode(type, null, propsOrChildren);
  6202. }
  6203. } else {
  6204. if (l > 3) {
  6205. children = Array.prototype.slice.call(arguments, 2);
  6206. } else if (l === 3 && isVNode(children)) {
  6207. children = [children];
  6208. }
  6209. return createVNode(type, propsOrChildren, children);
  6210. }
  6211. }
  6212. function initCustomFormatter() {
  6213. {
  6214. return;
  6215. }
  6216. }
  6217. function withMemo(memo, render, cache, index) {
  6218. const cached = cache[index];
  6219. if (cached && isMemoSame(cached, memo)) {
  6220. return cached;
  6221. }
  6222. const ret = render();
  6223. ret.memo = memo.slice();
  6224. return cache[index] = ret;
  6225. }
  6226. function isMemoSame(cached, memo) {
  6227. const prev = cached.memo;
  6228. if (prev.length != memo.length) {
  6229. return false;
  6230. }
  6231. for (let i = 0; i < prev.length; i++) {
  6232. if (shared.hasChanged(prev[i], memo[i])) {
  6233. return false;
  6234. }
  6235. }
  6236. if (isBlockTreeEnabled > 0 && currentBlock) {
  6237. currentBlock.push(cached);
  6238. }
  6239. return true;
  6240. }
  6241. const version = "3.4.25";
  6242. const warn$1 = shared.NOOP;
  6243. const ErrorTypeStrings = ErrorTypeStrings$1 ;
  6244. const devtools = void 0;
  6245. const setDevtoolsHook = shared.NOOP;
  6246. const _ssrUtils = {
  6247. createComponentInstance,
  6248. setupComponent,
  6249. renderComponentRoot,
  6250. setCurrentRenderingInstance,
  6251. isVNode: isVNode,
  6252. normalizeVNode
  6253. };
  6254. const ssrUtils = _ssrUtils ;
  6255. const resolveFilter = null;
  6256. const compatUtils = null;
  6257. const DeprecationTypes = null;
  6258. exports.EffectScope = reactivity.EffectScope;
  6259. exports.ReactiveEffect = reactivity.ReactiveEffect;
  6260. exports.TrackOpTypes = reactivity.TrackOpTypes;
  6261. exports.TriggerOpTypes = reactivity.TriggerOpTypes;
  6262. exports.customRef = reactivity.customRef;
  6263. exports.effect = reactivity.effect;
  6264. exports.effectScope = reactivity.effectScope;
  6265. exports.getCurrentScope = reactivity.getCurrentScope;
  6266. exports.isProxy = reactivity.isProxy;
  6267. exports.isReactive = reactivity.isReactive;
  6268. exports.isReadonly = reactivity.isReadonly;
  6269. exports.isRef = reactivity.isRef;
  6270. exports.isShallow = reactivity.isShallow;
  6271. exports.markRaw = reactivity.markRaw;
  6272. exports.onScopeDispose = reactivity.onScopeDispose;
  6273. exports.proxyRefs = reactivity.proxyRefs;
  6274. exports.reactive = reactivity.reactive;
  6275. exports.readonly = reactivity.readonly;
  6276. exports.ref = reactivity.ref;
  6277. exports.shallowReactive = reactivity.shallowReactive;
  6278. exports.shallowReadonly = reactivity.shallowReadonly;
  6279. exports.shallowRef = reactivity.shallowRef;
  6280. exports.stop = reactivity.stop;
  6281. exports.toRaw = reactivity.toRaw;
  6282. exports.toRef = reactivity.toRef;
  6283. exports.toRefs = reactivity.toRefs;
  6284. exports.toValue = reactivity.toValue;
  6285. exports.triggerRef = reactivity.triggerRef;
  6286. exports.unref = reactivity.unref;
  6287. exports.camelize = shared.camelize;
  6288. exports.capitalize = shared.capitalize;
  6289. exports.normalizeClass = shared.normalizeClass;
  6290. exports.normalizeProps = shared.normalizeProps;
  6291. exports.normalizeStyle = shared.normalizeStyle;
  6292. exports.toDisplayString = shared.toDisplayString;
  6293. exports.toHandlerKey = shared.toHandlerKey;
  6294. exports.BaseTransition = BaseTransition;
  6295. exports.BaseTransitionPropsValidators = BaseTransitionPropsValidators;
  6296. exports.Comment = Comment;
  6297. exports.DeprecationTypes = DeprecationTypes;
  6298. exports.ErrorCodes = ErrorCodes;
  6299. exports.ErrorTypeStrings = ErrorTypeStrings;
  6300. exports.Fragment = Fragment;
  6301. exports.KeepAlive = KeepAlive;
  6302. exports.Static = Static;
  6303. exports.Suspense = Suspense;
  6304. exports.Teleport = Teleport;
  6305. exports.Text = Text;
  6306. exports.assertNumber = assertNumber;
  6307. exports.callWithAsyncErrorHandling = callWithAsyncErrorHandling;
  6308. exports.callWithErrorHandling = callWithErrorHandling;
  6309. exports.cloneVNode = cloneVNode;
  6310. exports.compatUtils = compatUtils;
  6311. exports.computed = computed;
  6312. exports.createBlock = createBlock;
  6313. exports.createCommentVNode = createCommentVNode;
  6314. exports.createElementBlock = createElementBlock;
  6315. exports.createElementVNode = createBaseVNode;
  6316. exports.createHydrationRenderer = createHydrationRenderer;
  6317. exports.createPropsRestProxy = createPropsRestProxy;
  6318. exports.createRenderer = createRenderer;
  6319. exports.createSlots = createSlots;
  6320. exports.createStaticVNode = createStaticVNode;
  6321. exports.createTextVNode = createTextVNode;
  6322. exports.createVNode = createVNode;
  6323. exports.defineAsyncComponent = defineAsyncComponent;
  6324. exports.defineComponent = defineComponent;
  6325. exports.defineEmits = defineEmits;
  6326. exports.defineExpose = defineExpose;
  6327. exports.defineModel = defineModel;
  6328. exports.defineOptions = defineOptions;
  6329. exports.defineProps = defineProps;
  6330. exports.defineSlots = defineSlots;
  6331. exports.devtools = devtools;
  6332. exports.getCurrentInstance = getCurrentInstance;
  6333. exports.getTransitionRawChildren = getTransitionRawChildren;
  6334. exports.guardReactiveProps = guardReactiveProps;
  6335. exports.h = h;
  6336. exports.handleError = handleError;
  6337. exports.hasInjectionContext = hasInjectionContext;
  6338. exports.initCustomFormatter = initCustomFormatter;
  6339. exports.inject = inject;
  6340. exports.isMemoSame = isMemoSame;
  6341. exports.isRuntimeOnly = isRuntimeOnly;
  6342. exports.isVNode = isVNode;
  6343. exports.mergeDefaults = mergeDefaults;
  6344. exports.mergeModels = mergeModels;
  6345. exports.mergeProps = mergeProps;
  6346. exports.nextTick = nextTick;
  6347. exports.onActivated = onActivated;
  6348. exports.onBeforeMount = onBeforeMount;
  6349. exports.onBeforeUnmount = onBeforeUnmount;
  6350. exports.onBeforeUpdate = onBeforeUpdate;
  6351. exports.onDeactivated = onDeactivated;
  6352. exports.onErrorCaptured = onErrorCaptured;
  6353. exports.onMounted = onMounted;
  6354. exports.onRenderTracked = onRenderTracked;
  6355. exports.onRenderTriggered = onRenderTriggered;
  6356. exports.onServerPrefetch = onServerPrefetch;
  6357. exports.onUnmounted = onUnmounted;
  6358. exports.onUpdated = onUpdated;
  6359. exports.openBlock = openBlock;
  6360. exports.popScopeId = popScopeId;
  6361. exports.provide = provide;
  6362. exports.pushScopeId = pushScopeId;
  6363. exports.queuePostFlushCb = queuePostFlushCb;
  6364. exports.registerRuntimeCompiler = registerRuntimeCompiler;
  6365. exports.renderList = renderList;
  6366. exports.renderSlot = renderSlot;
  6367. exports.resolveComponent = resolveComponent;
  6368. exports.resolveDirective = resolveDirective;
  6369. exports.resolveDynamicComponent = resolveDynamicComponent;
  6370. exports.resolveFilter = resolveFilter;
  6371. exports.resolveTransitionHooks = resolveTransitionHooks;
  6372. exports.setBlockTracking = setBlockTracking;
  6373. exports.setDevtoolsHook = setDevtoolsHook;
  6374. exports.setTransitionHooks = setTransitionHooks;
  6375. exports.ssrContextKey = ssrContextKey;
  6376. exports.ssrUtils = ssrUtils;
  6377. exports.toHandlers = toHandlers;
  6378. exports.transformVNodeArgs = transformVNodeArgs;
  6379. exports.useAttrs = useAttrs;
  6380. exports.useModel = useModel;
  6381. exports.useSSRContext = useSSRContext;
  6382. exports.useSlots = useSlots;
  6383. exports.useTransitionState = useTransitionState;
  6384. exports.version = version;
  6385. exports.warn = warn$1;
  6386. exports.watch = watch;
  6387. exports.watchEffect = watchEffect;
  6388. exports.watchPostEffect = watchPostEffect;
  6389. exports.watchSyncEffect = watchSyncEffect;
  6390. exports.withAsyncContext = withAsyncContext;
  6391. exports.withCtx = withCtx;
  6392. exports.withDefaults = withDefaults;
  6393. exports.withDirectives = withDirectives;
  6394. exports.withMemo = withMemo;
  6395. exports.withScopeId = withScopeId;