runtime-core.cjs.js 257 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754
  1. /**
  2. * @vue/runtime-core v3.5.38
  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. const stack = [];
  11. function pushWarningContext(vnode) {
  12. stack.push(vnode);
  13. }
  14. function popWarningContext() {
  15. stack.pop();
  16. }
  17. let isWarning = false;
  18. function warn$1(msg, ...args) {
  19. if (isWarning) return;
  20. isWarning = true;
  21. reactivity.pauseTracking();
  22. const instance = stack.length ? stack[stack.length - 1].component : null;
  23. const appWarnHandler = instance && instance.appContext.config.warnHandler;
  24. const trace = getComponentTrace();
  25. if (appWarnHandler) {
  26. callWithErrorHandling(
  27. appWarnHandler,
  28. instance,
  29. 11,
  30. [
  31. // eslint-disable-next-line no-restricted-syntax
  32. msg + args.map((a) => {
  33. var _a, _b;
  34. return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
  35. }).join(""),
  36. instance && instance.proxy,
  37. trace.map(
  38. ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
  39. ).join("\n"),
  40. trace
  41. ]
  42. );
  43. } else {
  44. const warnArgs = [`[Vue warn]: ${msg}`, ...args];
  45. if (trace.length && // avoid spamming console during tests
  46. true) {
  47. warnArgs.push(`
  48. `, ...formatTrace(trace));
  49. }
  50. console.warn(...warnArgs);
  51. }
  52. reactivity.resetTracking();
  53. isWarning = false;
  54. }
  55. function getComponentTrace() {
  56. let currentVNode = stack[stack.length - 1];
  57. if (!currentVNode) {
  58. return [];
  59. }
  60. const normalizedStack = [];
  61. while (currentVNode) {
  62. const last = normalizedStack[0];
  63. if (last && last.vnode === currentVNode) {
  64. last.recurseCount++;
  65. } else {
  66. normalizedStack.push({
  67. vnode: currentVNode,
  68. recurseCount: 0
  69. });
  70. }
  71. const parentInstance = currentVNode.component && currentVNode.component.parent;
  72. currentVNode = parentInstance && parentInstance.vnode;
  73. }
  74. return normalizedStack;
  75. }
  76. function formatTrace(trace) {
  77. const logs = [];
  78. trace.forEach((entry, i) => {
  79. logs.push(...i === 0 ? [] : [`
  80. `], ...formatTraceEntry(entry));
  81. });
  82. return logs;
  83. }
  84. function formatTraceEntry({ vnode, recurseCount }) {
  85. const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
  86. const isRoot = vnode.component ? vnode.component.parent == null : false;
  87. const open = ` at <${formatComponentName(
  88. vnode.component,
  89. vnode.type,
  90. isRoot
  91. )}`;
  92. const close = `>` + postfix;
  93. return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
  94. }
  95. function formatProps(props) {
  96. const res = [];
  97. const keys = Object.keys(props);
  98. keys.slice(0, 3).forEach((key) => {
  99. res.push(...formatProp(key, props[key]));
  100. });
  101. if (keys.length > 3) {
  102. res.push(` ...`);
  103. }
  104. return res;
  105. }
  106. function formatProp(key, value, raw) {
  107. if (shared.isString(value)) {
  108. value = JSON.stringify(value);
  109. return raw ? value : [`${key}=${value}`];
  110. } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
  111. return raw ? value : [`${key}=${value}`];
  112. } else if (reactivity.isRef(value)) {
  113. value = formatProp(key, reactivity.toRaw(value.value), true);
  114. return raw ? value : [`${key}=Ref<`, value, `>`];
  115. } else if (shared.isFunction(value)) {
  116. return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
  117. } else {
  118. value = reactivity.toRaw(value);
  119. return raw ? value : [`${key}=`, value];
  120. }
  121. }
  122. function assertNumber(val, type) {
  123. if (val === void 0) {
  124. return;
  125. } else if (typeof val !== "number") {
  126. warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`);
  127. } else if (isNaN(val)) {
  128. warn$1(`${type} is NaN - the duration expression might be incorrect.`);
  129. }
  130. }
  131. const ErrorCodes = {
  132. "SETUP_FUNCTION": 0,
  133. "0": "SETUP_FUNCTION",
  134. "RENDER_FUNCTION": 1,
  135. "1": "RENDER_FUNCTION",
  136. "NATIVE_EVENT_HANDLER": 5,
  137. "5": "NATIVE_EVENT_HANDLER",
  138. "COMPONENT_EVENT_HANDLER": 6,
  139. "6": "COMPONENT_EVENT_HANDLER",
  140. "VNODE_HOOK": 7,
  141. "7": "VNODE_HOOK",
  142. "DIRECTIVE_HOOK": 8,
  143. "8": "DIRECTIVE_HOOK",
  144. "TRANSITION_HOOK": 9,
  145. "9": "TRANSITION_HOOK",
  146. "APP_ERROR_HANDLER": 10,
  147. "10": "APP_ERROR_HANDLER",
  148. "APP_WARN_HANDLER": 11,
  149. "11": "APP_WARN_HANDLER",
  150. "FUNCTION_REF": 12,
  151. "12": "FUNCTION_REF",
  152. "ASYNC_COMPONENT_LOADER": 13,
  153. "13": "ASYNC_COMPONENT_LOADER",
  154. "SCHEDULER": 14,
  155. "14": "SCHEDULER",
  156. "COMPONENT_UPDATE": 15,
  157. "15": "COMPONENT_UPDATE",
  158. "APP_UNMOUNT_CLEANUP": 16,
  159. "16": "APP_UNMOUNT_CLEANUP"
  160. };
  161. const ErrorTypeStrings$1 = {
  162. ["sp"]: "serverPrefetch hook",
  163. ["bc"]: "beforeCreate hook",
  164. ["c"]: "created hook",
  165. ["bm"]: "beforeMount hook",
  166. ["m"]: "mounted hook",
  167. ["bu"]: "beforeUpdate hook",
  168. ["u"]: "updated",
  169. ["bum"]: "beforeUnmount hook",
  170. ["um"]: "unmounted hook",
  171. ["a"]: "activated hook",
  172. ["da"]: "deactivated hook",
  173. ["ec"]: "errorCaptured hook",
  174. ["rtc"]: "renderTracked hook",
  175. ["rtg"]: "renderTriggered hook",
  176. [0]: "setup function",
  177. [1]: "render function",
  178. [2]: "watcher getter",
  179. [3]: "watcher callback",
  180. [4]: "watcher cleanup function",
  181. [5]: "native event handler",
  182. [6]: "component event handler",
  183. [7]: "vnode hook",
  184. [8]: "directive hook",
  185. [9]: "transition hook",
  186. [10]: "app errorHandler",
  187. [11]: "app warnHandler",
  188. [12]: "ref function",
  189. [13]: "async component loader",
  190. [14]: "scheduler flush",
  191. [15]: "component update",
  192. [16]: "app unmount cleanup function"
  193. };
  194. function callWithErrorHandling(fn, instance, type, args) {
  195. try {
  196. return args ? fn(...args) : fn();
  197. } catch (err) {
  198. handleError(err, instance, type);
  199. }
  200. }
  201. function callWithAsyncErrorHandling(fn, instance, type, args) {
  202. if (shared.isFunction(fn)) {
  203. const res = callWithErrorHandling(fn, instance, type, args);
  204. if (res && shared.isPromise(res)) {
  205. res.catch((err) => {
  206. handleError(err, instance, type);
  207. });
  208. }
  209. return res;
  210. }
  211. if (shared.isArray(fn)) {
  212. const values = [];
  213. for (let i = 0; i < fn.length; i++) {
  214. values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
  215. }
  216. return values;
  217. } else {
  218. warn$1(
  219. `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`
  220. );
  221. }
  222. }
  223. function handleError(err, instance, type, throwInDev = true) {
  224. const contextVNode = instance ? instance.vnode : null;
  225. const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || shared.EMPTY_OBJ;
  226. if (instance) {
  227. let cur = instance.parent;
  228. const exposedInstance = instance.proxy;
  229. const errorInfo = ErrorTypeStrings$1[type] ;
  230. while (cur) {
  231. const errorCapturedHooks = cur.ec;
  232. if (errorCapturedHooks) {
  233. for (let i = 0; i < errorCapturedHooks.length; i++) {
  234. if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
  235. return;
  236. }
  237. }
  238. }
  239. cur = cur.parent;
  240. }
  241. if (errorHandler) {
  242. reactivity.pauseTracking();
  243. callWithErrorHandling(errorHandler, null, 10, [
  244. err,
  245. exposedInstance,
  246. errorInfo
  247. ]);
  248. reactivity.resetTracking();
  249. return;
  250. }
  251. }
  252. logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
  253. }
  254. function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {
  255. {
  256. const info = ErrorTypeStrings$1[type];
  257. if (contextVNode) {
  258. pushWarningContext(contextVNode);
  259. }
  260. warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
  261. if (contextVNode) {
  262. popWarningContext();
  263. }
  264. if (throwInDev) {
  265. throw err;
  266. } else {
  267. console.error(err);
  268. }
  269. }
  270. }
  271. const queue = [];
  272. let flushIndex = -1;
  273. const pendingPostFlushCbs = [];
  274. let activePostFlushCbs = null;
  275. let postFlushIndex = 0;
  276. const resolvedPromise = /* @__PURE__ */ Promise.resolve();
  277. let currentFlushPromise = null;
  278. const RECURSION_LIMIT = 100;
  279. function nextTick(fn) {
  280. const p = currentFlushPromise || resolvedPromise;
  281. return fn ? p.then(this ? fn.bind(this) : fn) : p;
  282. }
  283. function findInsertionIndex(id) {
  284. let start = flushIndex + 1;
  285. let end = queue.length;
  286. while (start < end) {
  287. const middle = start + end >>> 1;
  288. const middleJob = queue[middle];
  289. const middleJobId = getId(middleJob);
  290. if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
  291. start = middle + 1;
  292. } else {
  293. end = middle;
  294. }
  295. }
  296. return start;
  297. }
  298. function queueJob(job) {
  299. if (!(job.flags & 1)) {
  300. const jobId = getId(job);
  301. const lastJob = queue[queue.length - 1];
  302. if (!lastJob || // fast path when the job id is larger than the tail
  303. !(job.flags & 2) && jobId >= getId(lastJob)) {
  304. queue.push(job);
  305. } else {
  306. queue.splice(findInsertionIndex(jobId), 0, job);
  307. }
  308. job.flags |= 1;
  309. queueFlush();
  310. }
  311. }
  312. function queueFlush() {
  313. if (!currentFlushPromise) {
  314. currentFlushPromise = resolvedPromise.then(flushJobs);
  315. }
  316. }
  317. function queuePostFlushCb(cb) {
  318. if (!shared.isArray(cb)) {
  319. if (activePostFlushCbs && cb.id === -1) {
  320. activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
  321. } else if (!(cb.flags & 1)) {
  322. pendingPostFlushCbs.push(cb);
  323. cb.flags |= 1;
  324. }
  325. } else {
  326. pendingPostFlushCbs.push(...cb);
  327. }
  328. queueFlush();
  329. }
  330. function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
  331. {
  332. seen = seen || /* @__PURE__ */ new Map();
  333. }
  334. for (; i < queue.length; i++) {
  335. const cb = queue[i];
  336. if (cb && cb.flags & 2) {
  337. if (instance && cb.id !== instance.uid) {
  338. continue;
  339. }
  340. if (checkRecursiveUpdates(seen, cb)) {
  341. continue;
  342. }
  343. queue.splice(i, 1);
  344. i--;
  345. if (cb.flags & 4) {
  346. cb.flags &= -2;
  347. }
  348. cb();
  349. if (!(cb.flags & 4)) {
  350. cb.flags &= -2;
  351. }
  352. }
  353. }
  354. }
  355. function flushPostFlushCbs(seen) {
  356. if (pendingPostFlushCbs.length) {
  357. const deduped = [...new Set(pendingPostFlushCbs)].sort(
  358. (a, b) => getId(a) - getId(b)
  359. );
  360. pendingPostFlushCbs.length = 0;
  361. if (activePostFlushCbs) {
  362. activePostFlushCbs.push(...deduped);
  363. return;
  364. }
  365. activePostFlushCbs = deduped;
  366. {
  367. seen = seen || /* @__PURE__ */ new Map();
  368. }
  369. for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
  370. const cb = activePostFlushCbs[postFlushIndex];
  371. if (checkRecursiveUpdates(seen, cb)) {
  372. continue;
  373. }
  374. if (cb.flags & 4) {
  375. cb.flags &= -2;
  376. }
  377. if (!(cb.flags & 8)) cb();
  378. cb.flags &= -2;
  379. }
  380. activePostFlushCbs = null;
  381. postFlushIndex = 0;
  382. }
  383. }
  384. const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
  385. function flushJobs(seen) {
  386. {
  387. seen = seen || /* @__PURE__ */ new Map();
  388. }
  389. const check = (job) => checkRecursiveUpdates(seen, job) ;
  390. try {
  391. for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
  392. const job = queue[flushIndex];
  393. if (job && !(job.flags & 8)) {
  394. if (check(job)) {
  395. continue;
  396. }
  397. if (job.flags & 4) {
  398. job.flags &= ~1;
  399. }
  400. callWithErrorHandling(
  401. job,
  402. job.i,
  403. job.i ? 15 : 14
  404. );
  405. if (!(job.flags & 4)) {
  406. job.flags &= ~1;
  407. }
  408. }
  409. }
  410. } finally {
  411. for (; flushIndex < queue.length; flushIndex++) {
  412. const job = queue[flushIndex];
  413. if (job) {
  414. job.flags &= -2;
  415. }
  416. }
  417. flushIndex = -1;
  418. queue.length = 0;
  419. flushPostFlushCbs(seen);
  420. currentFlushPromise = null;
  421. if (queue.length || pendingPostFlushCbs.length) {
  422. flushJobs(seen);
  423. }
  424. }
  425. }
  426. function checkRecursiveUpdates(seen, fn) {
  427. const count = seen.get(fn) || 0;
  428. if (count > RECURSION_LIMIT) {
  429. const instance = fn.i;
  430. const componentName = instance && getComponentName(instance.type);
  431. handleError(
  432. `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
  433. null,
  434. 10
  435. );
  436. return true;
  437. }
  438. seen.set(fn, count + 1);
  439. return false;
  440. }
  441. let isHmrUpdating = false;
  442. const setHmrUpdating = (v) => {
  443. try {
  444. return isHmrUpdating;
  445. } finally {
  446. isHmrUpdating = v;
  447. }
  448. };
  449. const hmrDirtyComponents = /* @__PURE__ */ new Map();
  450. {
  451. shared.getGlobalThis().__VUE_HMR_RUNTIME__ = {
  452. createRecord: tryWrap(createRecord),
  453. rerender: tryWrap(rerender),
  454. reload: tryWrap(reload)
  455. };
  456. }
  457. const map = /* @__PURE__ */ new Map();
  458. function registerHMR(instance) {
  459. const id = instance.type.__hmrId;
  460. let record = map.get(id);
  461. if (!record) {
  462. createRecord(id, instance.type);
  463. record = map.get(id);
  464. }
  465. record.instances.add(instance);
  466. }
  467. function unregisterHMR(instance) {
  468. map.get(instance.type.__hmrId).instances.delete(instance);
  469. }
  470. function createRecord(id, initialDef) {
  471. if (map.has(id)) {
  472. return false;
  473. }
  474. map.set(id, {
  475. initialDef: normalizeClassComponent(initialDef),
  476. instances: /* @__PURE__ */ new Set()
  477. });
  478. return true;
  479. }
  480. function normalizeClassComponent(component) {
  481. return isClassComponent(component) ? component.__vccOpts : component;
  482. }
  483. function rerender(id, newRender) {
  484. const record = map.get(id);
  485. if (!record) {
  486. return;
  487. }
  488. record.initialDef.render = newRender;
  489. [...record.instances].forEach((instance) => {
  490. if (newRender) {
  491. instance.render = newRender;
  492. normalizeClassComponent(instance.type).render = newRender;
  493. }
  494. instance.renderCache = [];
  495. isHmrUpdating = true;
  496. if (!(instance.job.flags & 8)) {
  497. instance.update();
  498. }
  499. isHmrUpdating = false;
  500. });
  501. }
  502. function reload(id, newComp) {
  503. const record = map.get(id);
  504. if (!record) return;
  505. newComp = normalizeClassComponent(newComp);
  506. updateComponentDef(record.initialDef, newComp);
  507. const instances = [...record.instances];
  508. for (let i = 0; i < instances.length; i++) {
  509. const instance = instances[i];
  510. const oldComp = normalizeClassComponent(instance.type);
  511. let dirtyInstances = hmrDirtyComponents.get(oldComp);
  512. if (!dirtyInstances) {
  513. if (oldComp !== record.initialDef) {
  514. updateComponentDef(oldComp, newComp);
  515. }
  516. hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
  517. }
  518. dirtyInstances.add(instance);
  519. instance.appContext.propsCache.delete(instance.type);
  520. instance.appContext.emitsCache.delete(instance.type);
  521. instance.appContext.optionsCache.delete(instance.type);
  522. if (instance.ceReload) {
  523. dirtyInstances.add(instance);
  524. instance.ceReload(newComp.styles);
  525. dirtyInstances.delete(instance);
  526. } else if (instance.parent) {
  527. queueJob(() => {
  528. if (!(instance.job.flags & 8)) {
  529. isHmrUpdating = true;
  530. instance.parent.update();
  531. isHmrUpdating = false;
  532. dirtyInstances.delete(instance);
  533. }
  534. });
  535. } else if (instance.appContext.reload) {
  536. instance.appContext.reload();
  537. } else if (typeof window !== "undefined") {
  538. window.location.reload();
  539. } else {
  540. console.warn(
  541. "[HMR] Root or manually mounted instance modified. Full reload required."
  542. );
  543. }
  544. if (instance.root.ce && instance !== instance.root) {
  545. instance.root.ce._removeChildStyle(oldComp);
  546. }
  547. }
  548. queuePostFlushCb(() => {
  549. hmrDirtyComponents.clear();
  550. });
  551. }
  552. function updateComponentDef(oldComp, newComp) {
  553. shared.extend(oldComp, newComp);
  554. for (const key in oldComp) {
  555. if (key !== "__file" && !(key in newComp)) {
  556. delete oldComp[key];
  557. }
  558. }
  559. }
  560. function tryWrap(fn) {
  561. return (id, arg) => {
  562. try {
  563. return fn(id, arg);
  564. } catch (e) {
  565. console.error(e);
  566. console.warn(
  567. `[HMR] Something went wrong during Vue component hot-reload. Full reload required.`
  568. );
  569. }
  570. };
  571. }
  572. let devtools$1;
  573. let buffer = [];
  574. let devtoolsNotInstalled = false;
  575. function emit$1(event, ...args) {
  576. if (devtools$1) {
  577. devtools$1.emit(event, ...args);
  578. } else if (!devtoolsNotInstalled) {
  579. buffer.push({ event, args });
  580. }
  581. }
  582. function setDevtoolsHook$1(hook, target) {
  583. var _a, _b;
  584. devtools$1 = hook;
  585. if (devtools$1) {
  586. devtools$1.enabled = true;
  587. buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args));
  588. buffer = [];
  589. } else if (
  590. // handle late devtools injection - only do this if we are in an actual
  591. // browser environment to avoid the timer handle stalling test runner exit
  592. // (#4815)
  593. typeof window !== "undefined" && // some envs mock window but not fully
  594. window.HTMLElement && // also exclude jsdom
  595. // eslint-disable-next-line no-restricted-syntax
  596. !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))
  597. ) {
  598. const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
  599. replay.push((newHook) => {
  600. setDevtoolsHook$1(newHook, target);
  601. });
  602. setTimeout(() => {
  603. if (!devtools$1) {
  604. target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
  605. devtoolsNotInstalled = true;
  606. buffer = [];
  607. }
  608. }, 3e3);
  609. } else {
  610. devtoolsNotInstalled = true;
  611. buffer = [];
  612. }
  613. }
  614. function devtoolsInitApp(app, version) {
  615. emit$1("app:init" /* APP_INIT */, app, version, {
  616. Fragment,
  617. Text,
  618. Comment,
  619. Static
  620. });
  621. }
  622. function devtoolsUnmountApp(app) {
  623. emit$1("app:unmount" /* APP_UNMOUNT */, app);
  624. }
  625. const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook("component:added" /* COMPONENT_ADDED */);
  626. const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */);
  627. const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
  628. "component:removed" /* COMPONENT_REMOVED */
  629. );
  630. const devtoolsComponentRemoved = (component) => {
  631. if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered
  632. !devtools$1.cleanupBuffer(component)) {
  633. _devtoolsComponentRemoved(component);
  634. }
  635. };
  636. // @__NO_SIDE_EFFECTS__
  637. function createDevtoolsComponentHook(hook) {
  638. return (component) => {
  639. emit$1(
  640. hook,
  641. component.appContext.app,
  642. component.uid,
  643. component.parent ? component.parent.uid : void 0,
  644. component
  645. );
  646. };
  647. }
  648. const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:start" /* PERFORMANCE_START */);
  649. const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:end" /* PERFORMANCE_END */);
  650. function createDevtoolsPerformanceHook(hook) {
  651. return (component, type, time) => {
  652. emit$1(hook, component.appContext.app, component.uid, component, type, time);
  653. };
  654. }
  655. function devtoolsComponentEmit(component, event, params) {
  656. emit$1(
  657. "component:emit" /* COMPONENT_EMIT */,
  658. component.appContext.app,
  659. component,
  660. event,
  661. params
  662. );
  663. }
  664. let currentRenderingInstance = null;
  665. let currentScopeId = null;
  666. function setCurrentRenderingInstance(instance) {
  667. const prev = currentRenderingInstance;
  668. currentRenderingInstance = instance;
  669. currentScopeId = instance && instance.type.__scopeId || null;
  670. return prev;
  671. }
  672. function pushScopeId(id) {
  673. currentScopeId = id;
  674. }
  675. function popScopeId() {
  676. currentScopeId = null;
  677. }
  678. const withScopeId = (_id) => withCtx;
  679. function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
  680. if (!ctx) return fn;
  681. if (fn._n) {
  682. return fn;
  683. }
  684. const renderFnWithContext = (...args) => {
  685. if (renderFnWithContext._d) {
  686. setBlockTracking(-1);
  687. }
  688. const prevInstance = setCurrentRenderingInstance(ctx);
  689. let res;
  690. try {
  691. res = fn(...args);
  692. } finally {
  693. setCurrentRenderingInstance(prevInstance);
  694. if (renderFnWithContext._d) {
  695. setBlockTracking(1);
  696. }
  697. }
  698. {
  699. devtoolsComponentUpdated(ctx);
  700. }
  701. return res;
  702. };
  703. renderFnWithContext._n = true;
  704. renderFnWithContext._c = true;
  705. renderFnWithContext._d = true;
  706. return renderFnWithContext;
  707. }
  708. function validateDirectiveName(name) {
  709. if (shared.isBuiltInDirective(name)) {
  710. warn$1("Do not use built-in directive ids as custom directive id: " + name);
  711. }
  712. }
  713. function withDirectives(vnode, directives) {
  714. if (currentRenderingInstance === null) {
  715. warn$1(`withDirectives can only be used inside render functions.`);
  716. return vnode;
  717. }
  718. const instance = getComponentPublicInstance(currentRenderingInstance);
  719. const bindings = vnode.dirs || (vnode.dirs = []);
  720. for (let i = 0; i < directives.length; i++) {
  721. let [dir, value, arg, modifiers = shared.EMPTY_OBJ] = directives[i];
  722. if (dir) {
  723. if (shared.isFunction(dir)) {
  724. dir = {
  725. mounted: dir,
  726. updated: dir
  727. };
  728. }
  729. if (dir.deep) {
  730. reactivity.traverse(value);
  731. }
  732. bindings.push({
  733. dir,
  734. instance,
  735. value,
  736. oldValue: void 0,
  737. arg,
  738. modifiers
  739. });
  740. }
  741. }
  742. return vnode;
  743. }
  744. function invokeDirectiveHook(vnode, prevVNode, instance, name) {
  745. const bindings = vnode.dirs;
  746. const oldBindings = prevVNode && prevVNode.dirs;
  747. for (let i = 0; i < bindings.length; i++) {
  748. const binding = bindings[i];
  749. if (oldBindings) {
  750. binding.oldValue = oldBindings[i].value;
  751. }
  752. let hook = binding.dir[name];
  753. if (hook) {
  754. reactivity.pauseTracking();
  755. callWithAsyncErrorHandling(hook, instance, 8, [
  756. vnode.el,
  757. binding,
  758. vnode,
  759. prevVNode
  760. ]);
  761. reactivity.resetTracking();
  762. }
  763. }
  764. }
  765. function provide(key, value) {
  766. {
  767. if (!currentInstance || currentInstance.isMounted) {
  768. warn$1(`provide() can only be used inside setup().`);
  769. }
  770. }
  771. if (currentInstance) {
  772. let provides = currentInstance.provides;
  773. const parentProvides = currentInstance.parent && currentInstance.parent.provides;
  774. if (parentProvides === provides) {
  775. provides = currentInstance.provides = Object.create(parentProvides);
  776. }
  777. provides[key] = value;
  778. }
  779. }
  780. function inject(key, defaultValue, treatDefaultAsFactory = false) {
  781. const instance = getCurrentInstance();
  782. if (instance || currentApp) {
  783. let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
  784. if (provides && key in provides) {
  785. return provides[key];
  786. } else if (arguments.length > 1) {
  787. return treatDefaultAsFactory && shared.isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
  788. } else {
  789. warn$1(`injection "${String(key)}" not found.`);
  790. }
  791. } else {
  792. warn$1(`inject() can only be used inside setup() or functional components.`);
  793. }
  794. }
  795. function hasInjectionContext() {
  796. return !!(getCurrentInstance() || currentApp);
  797. }
  798. const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
  799. const useSSRContext = () => {
  800. {
  801. const ctx = inject(ssrContextKey);
  802. if (!ctx) {
  803. warn$1(
  804. `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
  805. );
  806. }
  807. return ctx;
  808. }
  809. };
  810. function watchEffect(effect, options) {
  811. return doWatch(effect, null, options);
  812. }
  813. function watchPostEffect(effect, options) {
  814. return doWatch(
  815. effect,
  816. null,
  817. shared.extend({}, options, { flush: "post" })
  818. );
  819. }
  820. function watchSyncEffect(effect, options) {
  821. return doWatch(
  822. effect,
  823. null,
  824. shared.extend({}, options, { flush: "sync" })
  825. );
  826. }
  827. function watch(source, cb, options) {
  828. if (!shared.isFunction(cb)) {
  829. warn$1(
  830. `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
  831. );
  832. }
  833. return doWatch(source, cb, options);
  834. }
  835. function doWatch(source, cb, options = shared.EMPTY_OBJ) {
  836. const { immediate, deep, flush, once } = options;
  837. if (!cb) {
  838. if (immediate !== void 0) {
  839. warn$1(
  840. `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
  841. );
  842. }
  843. if (deep !== void 0) {
  844. warn$1(
  845. `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
  846. );
  847. }
  848. if (once !== void 0) {
  849. warn$1(
  850. `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
  851. );
  852. }
  853. }
  854. const baseWatchOptions = shared.extend({}, options);
  855. baseWatchOptions.onWarn = warn$1;
  856. const runsImmediately = cb && immediate || !cb && flush !== "post";
  857. let ssrCleanup;
  858. if (isInSSRComponentSetup) {
  859. if (flush === "sync") {
  860. const ctx = useSSRContext();
  861. ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
  862. } else if (!runsImmediately) {
  863. const watchStopHandle = () => {
  864. };
  865. watchStopHandle.stop = shared.NOOP;
  866. watchStopHandle.resume = shared.NOOP;
  867. watchStopHandle.pause = shared.NOOP;
  868. return watchStopHandle;
  869. }
  870. }
  871. const instance = currentInstance;
  872. baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
  873. let isPre = false;
  874. if (flush === "post") {
  875. baseWatchOptions.scheduler = (job) => {
  876. queuePostRenderEffect(job, instance && instance.suspense);
  877. };
  878. } else if (flush !== "sync") {
  879. isPre = true;
  880. baseWatchOptions.scheduler = (job, isFirstRun) => {
  881. if (isFirstRun) {
  882. job();
  883. } else {
  884. queueJob(job);
  885. }
  886. };
  887. }
  888. baseWatchOptions.augmentJob = (job) => {
  889. if (cb) {
  890. job.flags |= 4;
  891. }
  892. if (isPre) {
  893. job.flags |= 2;
  894. if (instance) {
  895. job.id = instance.uid;
  896. job.i = instance;
  897. }
  898. }
  899. };
  900. const watchHandle = reactivity.watch(source, cb, baseWatchOptions);
  901. if (isInSSRComponentSetup) {
  902. if (ssrCleanup) {
  903. ssrCleanup.push(watchHandle);
  904. } else if (runsImmediately) {
  905. watchHandle();
  906. }
  907. }
  908. return watchHandle;
  909. }
  910. function instanceWatch(source, value, options) {
  911. const publicThis = this.proxy;
  912. const getter = shared.isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  913. let cb;
  914. if (shared.isFunction(value)) {
  915. cb = value;
  916. } else {
  917. cb = value.handler;
  918. options = value;
  919. }
  920. const reset = setCurrentInstance(this);
  921. const res = doWatch(getter, cb.bind(publicThis), options);
  922. reset();
  923. return res;
  924. }
  925. function createPathGetter(ctx, path) {
  926. const segments = path.split(".");
  927. return () => {
  928. let cur = ctx;
  929. for (let i = 0; i < segments.length && cur; i++) {
  930. cur = cur[segments[i]];
  931. }
  932. return cur;
  933. };
  934. }
  935. const pendingMounts = /* @__PURE__ */ new WeakMap();
  936. const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
  937. const isTeleport = (type) => type.__isTeleport;
  938. const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
  939. const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
  940. const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
  941. const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
  942. const resolveTarget = (props, select) => {
  943. const targetSelector = props && props.to;
  944. if (shared.isString(targetSelector)) {
  945. if (!select) {
  946. warn$1(
  947. `Current renderer does not support string target for Teleports. (missing querySelector renderer option)`
  948. );
  949. return null;
  950. } else {
  951. const target = select(targetSelector);
  952. if (!target && !isTeleportDisabled(props)) {
  953. warn$1(
  954. `Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`
  955. );
  956. }
  957. return target;
  958. }
  959. } else {
  960. if (!targetSelector && !isTeleportDisabled(props)) {
  961. warn$1(`Invalid Teleport target: ${targetSelector}`);
  962. }
  963. return targetSelector;
  964. }
  965. };
  966. const TeleportImpl = {
  967. name: "Teleport",
  968. __isTeleport: true,
  969. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
  970. const {
  971. mc: mountChildren,
  972. pc: patchChildren,
  973. pbc: patchBlockChildren,
  974. o: { insert, querySelector, createText, createComment, parentNode }
  975. } = internals;
  976. const disabled = isTeleportDisabled(n2.props);
  977. let { dynamicChildren } = n2;
  978. if (isHmrUpdating) {
  979. optimized = false;
  980. dynamicChildren = null;
  981. }
  982. const mount = (vnode, container2, anchor2) => {
  983. if (vnode.shapeFlag & 16) {
  984. mountChildren(
  985. vnode.children,
  986. container2,
  987. anchor2,
  988. parentComponent,
  989. parentSuspense,
  990. namespace,
  991. slotScopeIds,
  992. optimized
  993. );
  994. }
  995. };
  996. const mountToTarget = (vnode = n2) => {
  997. const disabled2 = isTeleportDisabled(vnode.props);
  998. const target = vnode.target = resolveTarget(vnode.props, querySelector);
  999. const targetAnchor = prepareAnchor(target, vnode, createText, insert);
  1000. if (target) {
  1001. if (namespace !== "svg" && isTargetSVG(target)) {
  1002. namespace = "svg";
  1003. } else if (namespace !== "mathml" && isTargetMathML(target)) {
  1004. namespace = "mathml";
  1005. }
  1006. if (parentComponent && parentComponent.isCE) {
  1007. (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
  1008. }
  1009. if (!disabled2) {
  1010. mount(vnode, target, targetAnchor);
  1011. updateCssVars(vnode, false);
  1012. }
  1013. } else if (!disabled2) {
  1014. warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
  1015. }
  1016. };
  1017. const queuePendingMount = (vnode) => {
  1018. const mountJob = () => {
  1019. if (pendingMounts.get(vnode) !== mountJob) return;
  1020. pendingMounts.delete(vnode);
  1021. if (isTeleportDisabled(vnode.props)) {
  1022. const mountContainer = parentNode(vnode.el) || container;
  1023. mount(vnode, mountContainer, vnode.anchor);
  1024. updateCssVars(vnode, true);
  1025. }
  1026. mountToTarget(vnode);
  1027. };
  1028. pendingMounts.set(vnode, mountJob);
  1029. queuePostRenderEffect(mountJob, parentSuspense);
  1030. };
  1031. if (n1 == null) {
  1032. const placeholder = n2.el = createComment("teleport start") ;
  1033. const mainAnchor = n2.anchor = createComment("teleport end") ;
  1034. insert(placeholder, container, anchor);
  1035. insert(mainAnchor, container, anchor);
  1036. if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
  1037. queuePendingMount(n2);
  1038. return;
  1039. }
  1040. if (disabled) {
  1041. mount(n2, container, mainAnchor);
  1042. updateCssVars(n2, true);
  1043. }
  1044. mountToTarget();
  1045. } else {
  1046. n2.el = n1.el;
  1047. const mainAnchor = n2.anchor = n1.anchor;
  1048. const pendingMount = pendingMounts.get(n1);
  1049. if (pendingMount) {
  1050. pendingMount.flags |= 8;
  1051. pendingMounts.delete(n1);
  1052. queuePendingMount(n2);
  1053. return;
  1054. }
  1055. n2.targetStart = n1.targetStart;
  1056. const target = n2.target = n1.target;
  1057. const targetAnchor = n2.targetAnchor = n1.targetAnchor;
  1058. const wasDisabled = isTeleportDisabled(n1.props);
  1059. const currentContainer = wasDisabled ? container : target;
  1060. const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
  1061. if (namespace === "svg" || isTargetSVG(target)) {
  1062. namespace = "svg";
  1063. } else if (namespace === "mathml" || isTargetMathML(target)) {
  1064. namespace = "mathml";
  1065. }
  1066. if (dynamicChildren) {
  1067. patchBlockChildren(
  1068. n1.dynamicChildren,
  1069. dynamicChildren,
  1070. currentContainer,
  1071. parentComponent,
  1072. parentSuspense,
  1073. namespace,
  1074. slotScopeIds
  1075. );
  1076. traverseStaticChildren(n1, n2, false);
  1077. } else if (!optimized) {
  1078. patchChildren(
  1079. n1,
  1080. n2,
  1081. currentContainer,
  1082. currentAnchor,
  1083. parentComponent,
  1084. parentSuspense,
  1085. namespace,
  1086. slotScopeIds,
  1087. false
  1088. );
  1089. }
  1090. if (disabled) {
  1091. if (!wasDisabled) {
  1092. moveTeleport(
  1093. n2,
  1094. container,
  1095. mainAnchor,
  1096. internals,
  1097. 1
  1098. );
  1099. } else {
  1100. if (n2.props && n1.props && n2.props.to !== n1.props.to) {
  1101. n2.props.to = n1.props.to;
  1102. }
  1103. }
  1104. } else {
  1105. if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
  1106. const nextTarget = n2.target = resolveTarget(
  1107. n2.props,
  1108. querySelector
  1109. );
  1110. if (nextTarget) {
  1111. moveTeleport(
  1112. n2,
  1113. nextTarget,
  1114. null,
  1115. internals,
  1116. 0
  1117. );
  1118. } else {
  1119. warn$1(
  1120. "Invalid Teleport target on update:",
  1121. target,
  1122. `(${typeof target})`
  1123. );
  1124. }
  1125. } else if (wasDisabled) {
  1126. moveTeleport(
  1127. n2,
  1128. target,
  1129. targetAnchor,
  1130. internals,
  1131. 1
  1132. );
  1133. }
  1134. }
  1135. updateCssVars(n2, disabled);
  1136. }
  1137. },
  1138. remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
  1139. const {
  1140. shapeFlag,
  1141. children,
  1142. anchor,
  1143. targetStart,
  1144. targetAnchor,
  1145. target,
  1146. props
  1147. } = vnode;
  1148. const shouldRemove = doRemove || !isTeleportDisabled(props);
  1149. const pendingMount = pendingMounts.get(vnode);
  1150. if (pendingMount) {
  1151. pendingMount.flags |= 8;
  1152. pendingMounts.delete(vnode);
  1153. }
  1154. if (target) {
  1155. hostRemove(targetStart);
  1156. hostRemove(targetAnchor);
  1157. }
  1158. doRemove && hostRemove(anchor);
  1159. if (!pendingMount && shapeFlag & 16) {
  1160. for (let i = 0; i < children.length; i++) {
  1161. const child = children[i];
  1162. unmount(
  1163. child,
  1164. parentComponent,
  1165. parentSuspense,
  1166. shouldRemove,
  1167. !!child.dynamicChildren
  1168. );
  1169. }
  1170. }
  1171. },
  1172. move: moveTeleport,
  1173. hydrate: hydrateTeleport
  1174. };
  1175. function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
  1176. if (moveType === 0) {
  1177. insert(vnode.targetAnchor, container, parentAnchor);
  1178. }
  1179. const { el, anchor, shapeFlag, children, props } = vnode;
  1180. const isReorder = moveType === 2;
  1181. if (isReorder) {
  1182. insert(el, container, parentAnchor);
  1183. }
  1184. if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
  1185. if (shapeFlag & 16) {
  1186. for (let i = 0; i < children.length; i++) {
  1187. move(
  1188. children[i],
  1189. container,
  1190. parentAnchor,
  1191. 2
  1192. );
  1193. }
  1194. }
  1195. }
  1196. if (isReorder) {
  1197. insert(anchor, container, parentAnchor);
  1198. }
  1199. }
  1200. function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
  1201. o: { nextSibling, parentNode, querySelector, insert, createText }
  1202. }, hydrateChildren) {
  1203. function hydrateAnchor(target2, targetNode) {
  1204. let targetAnchor = targetNode;
  1205. while (targetAnchor) {
  1206. if (targetAnchor && targetAnchor.nodeType === 8) {
  1207. if (targetAnchor.data === "teleport start anchor") {
  1208. vnode.targetStart = targetAnchor;
  1209. } else if (targetAnchor.data === "teleport anchor") {
  1210. vnode.targetAnchor = targetAnchor;
  1211. target2._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
  1212. break;
  1213. }
  1214. }
  1215. targetAnchor = nextSibling(targetAnchor);
  1216. }
  1217. }
  1218. function hydrateDisabledTeleport(node2, vnode2) {
  1219. vnode2.anchor = hydrateChildren(
  1220. nextSibling(node2),
  1221. vnode2,
  1222. parentNode(node2),
  1223. parentComponent,
  1224. parentSuspense,
  1225. slotScopeIds,
  1226. optimized
  1227. );
  1228. }
  1229. const target = vnode.target = resolveTarget(
  1230. vnode.props,
  1231. querySelector
  1232. );
  1233. const disabled = isTeleportDisabled(vnode.props);
  1234. if (target) {
  1235. const targetNode = target._lpa || target.firstChild;
  1236. if (vnode.shapeFlag & 16) {
  1237. if (disabled) {
  1238. hydrateDisabledTeleport(node, vnode);
  1239. hydrateAnchor(target, targetNode);
  1240. if (!vnode.targetAnchor) {
  1241. prepareAnchor(
  1242. target,
  1243. vnode,
  1244. createText,
  1245. insert,
  1246. // if target is the same as the main view, insert anchors before current node
  1247. // to avoid hydrating mismatch
  1248. parentNode(node) === target ? node : null
  1249. );
  1250. }
  1251. } else {
  1252. vnode.anchor = nextSibling(node);
  1253. hydrateAnchor(target, targetNode);
  1254. if (!vnode.targetAnchor) {
  1255. prepareAnchor(target, vnode, createText, insert);
  1256. }
  1257. hydrateChildren(
  1258. targetNode && nextSibling(targetNode),
  1259. vnode,
  1260. target,
  1261. parentComponent,
  1262. parentSuspense,
  1263. slotScopeIds,
  1264. optimized
  1265. );
  1266. }
  1267. }
  1268. updateCssVars(vnode, disabled);
  1269. } else if (disabled) {
  1270. if (vnode.shapeFlag & 16) {
  1271. hydrateDisabledTeleport(node, vnode);
  1272. vnode.targetStart = node;
  1273. vnode.targetAnchor = nextSibling(node);
  1274. }
  1275. }
  1276. return vnode.anchor && nextSibling(vnode.anchor);
  1277. }
  1278. const Teleport = TeleportImpl;
  1279. function updateCssVars(vnode, isDisabled) {
  1280. const ctx = vnode.ctx;
  1281. if (ctx && ctx.ut) {
  1282. let node, anchor;
  1283. if (isDisabled) {
  1284. node = vnode.el;
  1285. anchor = vnode.anchor;
  1286. } else {
  1287. node = vnode.targetStart;
  1288. anchor = vnode.targetAnchor;
  1289. }
  1290. while (node && node !== anchor) {
  1291. if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
  1292. node = node.nextSibling;
  1293. }
  1294. ctx.ut();
  1295. }
  1296. }
  1297. function prepareAnchor(target, vnode, createText, insert, anchor = null) {
  1298. const targetStart = vnode.targetStart = createText("");
  1299. const targetAnchor = vnode.targetAnchor = createText("");
  1300. targetStart[TeleportEndKey] = targetAnchor;
  1301. if (target) {
  1302. insert(targetStart, target, anchor);
  1303. insert(targetAnchor, target, anchor);
  1304. }
  1305. return targetAnchor;
  1306. }
  1307. const leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb");
  1308. const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
  1309. function useTransitionState() {
  1310. const state = {
  1311. isMounted: false,
  1312. isLeaving: false,
  1313. isUnmounting: false,
  1314. leavingVNodes: /* @__PURE__ */ new Map()
  1315. };
  1316. onMounted(() => {
  1317. state.isMounted = true;
  1318. });
  1319. onBeforeUnmount(() => {
  1320. state.isUnmounting = true;
  1321. });
  1322. return state;
  1323. }
  1324. const TransitionHookValidator = [Function, Array];
  1325. const BaseTransitionPropsValidators = {
  1326. mode: String,
  1327. appear: Boolean,
  1328. persisted: Boolean,
  1329. // enter
  1330. onBeforeEnter: TransitionHookValidator,
  1331. onEnter: TransitionHookValidator,
  1332. onAfterEnter: TransitionHookValidator,
  1333. onEnterCancelled: TransitionHookValidator,
  1334. // leave
  1335. onBeforeLeave: TransitionHookValidator,
  1336. onLeave: TransitionHookValidator,
  1337. onAfterLeave: TransitionHookValidator,
  1338. onLeaveCancelled: TransitionHookValidator,
  1339. // appear
  1340. onBeforeAppear: TransitionHookValidator,
  1341. onAppear: TransitionHookValidator,
  1342. onAfterAppear: TransitionHookValidator,
  1343. onAppearCancelled: TransitionHookValidator
  1344. };
  1345. const recursiveGetSubtree = (instance) => {
  1346. const subTree = instance.subTree;
  1347. return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
  1348. };
  1349. const BaseTransitionImpl = {
  1350. name: `BaseTransition`,
  1351. props: BaseTransitionPropsValidators,
  1352. setup(props, { slots }) {
  1353. const instance = getCurrentInstance();
  1354. const state = useTransitionState();
  1355. return () => {
  1356. const children = slots.default && getTransitionRawChildren(slots.default(), true);
  1357. const child = children && children.length ? findNonCommentChild(children) : (
  1358. // Keep explicit default-slot conditionals on the same transition path
  1359. // as regular v-if branches, which render a comment placeholder.
  1360. instance.subTree ? createCommentVNode() : void 0
  1361. );
  1362. if (!child) {
  1363. return;
  1364. }
  1365. const rawProps = reactivity.toRaw(props);
  1366. const { mode } = rawProps;
  1367. if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
  1368. warn$1(`invalid <transition> mode: ${mode}`);
  1369. }
  1370. if (state.isLeaving) {
  1371. return emptyPlaceholder(child);
  1372. }
  1373. const innerChild = getInnerChild$1(child);
  1374. if (!innerChild) {
  1375. return emptyPlaceholder(child);
  1376. }
  1377. let enterHooks = resolveTransitionHooks(
  1378. innerChild,
  1379. rawProps,
  1380. state,
  1381. instance,
  1382. // #11061, ensure enterHooks is fresh after clone
  1383. (hooks) => enterHooks = hooks
  1384. );
  1385. if (innerChild.type !== Comment) {
  1386. setTransitionHooks(innerChild, enterHooks);
  1387. }
  1388. let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
  1389. if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
  1390. let leavingHooks = resolveTransitionHooks(
  1391. oldInnerChild,
  1392. rawProps,
  1393. state,
  1394. instance
  1395. );
  1396. setTransitionHooks(oldInnerChild, leavingHooks);
  1397. if (mode === "out-in" && innerChild.type !== Comment) {
  1398. state.isLeaving = true;
  1399. leavingHooks.afterLeave = () => {
  1400. state.isLeaving = false;
  1401. if (!(instance.job.flags & 8)) {
  1402. instance.update();
  1403. }
  1404. delete leavingHooks.afterLeave;
  1405. oldInnerChild = void 0;
  1406. };
  1407. return emptyPlaceholder(child);
  1408. } else if (mode === "in-out" && innerChild.type !== Comment) {
  1409. leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
  1410. const leavingVNodesCache = getLeavingNodesForType(
  1411. state,
  1412. oldInnerChild
  1413. );
  1414. leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
  1415. el[leaveCbKey] = () => {
  1416. earlyRemove();
  1417. el[leaveCbKey] = void 0;
  1418. delete enterHooks.delayedLeave;
  1419. oldInnerChild = void 0;
  1420. };
  1421. enterHooks.delayedLeave = () => {
  1422. delayedLeave();
  1423. delete enterHooks.delayedLeave;
  1424. oldInnerChild = void 0;
  1425. };
  1426. };
  1427. } else {
  1428. oldInnerChild = void 0;
  1429. }
  1430. } else if (oldInnerChild) {
  1431. oldInnerChild = void 0;
  1432. }
  1433. return child;
  1434. };
  1435. }
  1436. };
  1437. function findNonCommentChild(children) {
  1438. let child = children[0];
  1439. if (children.length > 1) {
  1440. let hasFound = false;
  1441. for (const c of children) {
  1442. if (c.type !== Comment) {
  1443. if (hasFound) {
  1444. warn$1(
  1445. "<transition> can only be used on a single element or component. Use <transition-group> for lists."
  1446. );
  1447. break;
  1448. }
  1449. child = c;
  1450. hasFound = true;
  1451. }
  1452. }
  1453. }
  1454. return child;
  1455. }
  1456. const BaseTransition = BaseTransitionImpl;
  1457. function getLeavingNodesForType(state, vnode) {
  1458. const { leavingVNodes } = state;
  1459. let leavingVNodesCache = leavingVNodes.get(vnode.type);
  1460. if (!leavingVNodesCache) {
  1461. leavingVNodesCache = /* @__PURE__ */ Object.create(null);
  1462. leavingVNodes.set(vnode.type, leavingVNodesCache);
  1463. }
  1464. return leavingVNodesCache;
  1465. }
  1466. function resolveTransitionHooks(vnode, props, state, instance, postClone) {
  1467. const {
  1468. appear,
  1469. mode,
  1470. persisted = false,
  1471. onBeforeEnter,
  1472. onEnter,
  1473. onAfterEnter,
  1474. onEnterCancelled,
  1475. onBeforeLeave,
  1476. onLeave,
  1477. onAfterLeave,
  1478. onLeaveCancelled,
  1479. onBeforeAppear,
  1480. onAppear,
  1481. onAfterAppear,
  1482. onAppearCancelled
  1483. } = props;
  1484. const key = String(vnode.key);
  1485. const leavingVNodesCache = getLeavingNodesForType(state, vnode);
  1486. const callHook = (hook, args) => {
  1487. hook && callWithAsyncErrorHandling(
  1488. hook,
  1489. instance,
  1490. 9,
  1491. args
  1492. );
  1493. };
  1494. const callAsyncHook = (hook, args) => {
  1495. const done = args[1];
  1496. callHook(hook, args);
  1497. if (shared.isArray(hook)) {
  1498. if (hook.every((hook2) => hook2.length <= 1)) done();
  1499. } else if (hook.length <= 1) {
  1500. done();
  1501. }
  1502. };
  1503. const hooks = {
  1504. mode,
  1505. persisted,
  1506. beforeEnter(el) {
  1507. let hook = onBeforeEnter;
  1508. if (!state.isMounted) {
  1509. if (appear) {
  1510. hook = onBeforeAppear || onBeforeEnter;
  1511. } else {
  1512. return;
  1513. }
  1514. }
  1515. if (el[leaveCbKey]) {
  1516. el[leaveCbKey](
  1517. true
  1518. /* cancelled */
  1519. );
  1520. }
  1521. const leavingVNode = leavingVNodesCache[key];
  1522. if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
  1523. leavingVNode.el[leaveCbKey]();
  1524. }
  1525. callHook(hook, [el]);
  1526. },
  1527. enter(el) {
  1528. if (!isHmrUpdating && leavingVNodesCache[key] === vnode) return;
  1529. let hook = onEnter;
  1530. let afterHook = onAfterEnter;
  1531. let cancelHook = onEnterCancelled;
  1532. if (!state.isMounted) {
  1533. if (appear) {
  1534. hook = onAppear || onEnter;
  1535. afterHook = onAfterAppear || onAfterEnter;
  1536. cancelHook = onAppearCancelled || onEnterCancelled;
  1537. } else {
  1538. return;
  1539. }
  1540. }
  1541. let called = false;
  1542. el[enterCbKey] = (cancelled) => {
  1543. if (called) return;
  1544. called = true;
  1545. if (cancelled) {
  1546. callHook(cancelHook, [el]);
  1547. } else {
  1548. callHook(afterHook, [el]);
  1549. }
  1550. if (hooks.delayedLeave) {
  1551. hooks.delayedLeave();
  1552. }
  1553. el[enterCbKey] = void 0;
  1554. };
  1555. const done = el[enterCbKey].bind(null, false);
  1556. if (hook) {
  1557. callAsyncHook(hook, [el, done]);
  1558. } else {
  1559. done();
  1560. }
  1561. },
  1562. leave(el, remove) {
  1563. const key2 = String(vnode.key);
  1564. if (el[enterCbKey]) {
  1565. el[enterCbKey](
  1566. true
  1567. /* cancelled */
  1568. );
  1569. }
  1570. if (state.isUnmounting) {
  1571. return remove();
  1572. }
  1573. callHook(onBeforeLeave, [el]);
  1574. let called = false;
  1575. el[leaveCbKey] = (cancelled) => {
  1576. if (called) return;
  1577. called = true;
  1578. remove();
  1579. if (cancelled) {
  1580. callHook(onLeaveCancelled, [el]);
  1581. } else {
  1582. callHook(onAfterLeave, [el]);
  1583. }
  1584. el[leaveCbKey] = void 0;
  1585. if (leavingVNodesCache[key2] === vnode) {
  1586. delete leavingVNodesCache[key2];
  1587. }
  1588. };
  1589. const done = el[leaveCbKey].bind(null, false);
  1590. leavingVNodesCache[key2] = vnode;
  1591. if (onLeave) {
  1592. callAsyncHook(onLeave, [el, done]);
  1593. } else {
  1594. done();
  1595. }
  1596. },
  1597. clone(vnode2) {
  1598. const hooks2 = resolveTransitionHooks(
  1599. vnode2,
  1600. props,
  1601. state,
  1602. instance,
  1603. postClone
  1604. );
  1605. if (postClone) postClone(hooks2);
  1606. return hooks2;
  1607. }
  1608. };
  1609. return hooks;
  1610. }
  1611. function emptyPlaceholder(vnode) {
  1612. if (isKeepAlive(vnode)) {
  1613. vnode = cloneVNode(vnode);
  1614. vnode.children = null;
  1615. return vnode;
  1616. }
  1617. }
  1618. function getInnerChild$1(vnode) {
  1619. if (!isKeepAlive(vnode)) {
  1620. if (isTeleport(vnode.type) && vnode.children) {
  1621. return findNonCommentChild(vnode.children);
  1622. }
  1623. return vnode;
  1624. }
  1625. if (vnode.component) {
  1626. return vnode.component.subTree;
  1627. }
  1628. const { shapeFlag, children } = vnode;
  1629. if (children) {
  1630. if (shapeFlag & 16) {
  1631. return children[0];
  1632. }
  1633. if (shapeFlag & 32 && shared.isFunction(children.default)) {
  1634. return children.default();
  1635. }
  1636. }
  1637. }
  1638. function setTransitionHooks(vnode, hooks) {
  1639. if (vnode.shapeFlag & 6 && vnode.component) {
  1640. vnode.transition = hooks;
  1641. setTransitionHooks(vnode.component.subTree, hooks);
  1642. } else if (vnode.shapeFlag & 128) {
  1643. vnode.ssContent.transition = hooks.clone(vnode.ssContent);
  1644. vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
  1645. } else {
  1646. vnode.transition = hooks;
  1647. }
  1648. }
  1649. function getTransitionRawChildren(children, keepComment = false, parentKey) {
  1650. let ret = [];
  1651. let keyedFragmentCount = 0;
  1652. for (let i = 0; i < children.length; i++) {
  1653. let child = children[i];
  1654. const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);
  1655. if (child.type === Fragment) {
  1656. if (child.patchFlag & 128) keyedFragmentCount++;
  1657. ret = ret.concat(
  1658. getTransitionRawChildren(child.children, keepComment, key)
  1659. );
  1660. } else if (keepComment || child.type !== Comment) {
  1661. ret.push(key != null ? cloneVNode(child, { key }) : child);
  1662. }
  1663. }
  1664. if (keyedFragmentCount > 1) {
  1665. for (let i = 0; i < ret.length; i++) {
  1666. ret[i].patchFlag = -2;
  1667. }
  1668. }
  1669. return ret;
  1670. }
  1671. // @__NO_SIDE_EFFECTS__
  1672. function defineComponent(options, extraOptions) {
  1673. return shared.isFunction(options) ? (
  1674. // #8236: extend call and options.name access are considered side-effects
  1675. // by Rollup, so we have to wrap it in a pure-annotated IIFE.
  1676. /* @__PURE__ */ (() => shared.extend({ name: options.name }, extraOptions, { setup: options }))()
  1677. ) : options;
  1678. }
  1679. function useId() {
  1680. const i = getCurrentInstance();
  1681. if (i) {
  1682. return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
  1683. } else {
  1684. warn$1(
  1685. `useId() is called when there is no active component instance to be associated with.`
  1686. );
  1687. }
  1688. return "";
  1689. }
  1690. function markAsyncBoundary(instance) {
  1691. instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
  1692. }
  1693. const knownTemplateRefs = /* @__PURE__ */ new WeakSet();
  1694. function useTemplateRef(key) {
  1695. const i = getCurrentInstance();
  1696. const r = reactivity.shallowRef(null);
  1697. if (i) {
  1698. const refs = i.refs === shared.EMPTY_OBJ ? i.refs = {} : i.refs;
  1699. if (isTemplateRefKey(refs, key)) {
  1700. warn$1(`useTemplateRef('${key}') already exists.`);
  1701. } else {
  1702. Object.defineProperty(refs, key, {
  1703. enumerable: true,
  1704. get: () => r.value,
  1705. set: (val) => r.value = val
  1706. });
  1707. }
  1708. } else {
  1709. warn$1(
  1710. `useTemplateRef() is called when there is no active component instance to be associated with.`
  1711. );
  1712. }
  1713. const ret = reactivity.readonly(r) ;
  1714. {
  1715. knownTemplateRefs.add(ret);
  1716. }
  1717. return ret;
  1718. }
  1719. function isTemplateRefKey(refs, key) {
  1720. let desc;
  1721. return !!((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable);
  1722. }
  1723. const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
  1724. function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
  1725. if (shared.isArray(rawRef)) {
  1726. rawRef.forEach(
  1727. (r, i) => setRef(
  1728. r,
  1729. oldRawRef && (shared.isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
  1730. parentSuspense,
  1731. vnode,
  1732. isUnmount
  1733. )
  1734. );
  1735. return;
  1736. }
  1737. if (isAsyncWrapper(vnode) && !isUnmount) {
  1738. if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
  1739. setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
  1740. }
  1741. return;
  1742. }
  1743. const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
  1744. const value = isUnmount ? null : refValue;
  1745. const { i: owner, r: ref } = rawRef;
  1746. if (!owner) {
  1747. warn$1(
  1748. `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`
  1749. );
  1750. return;
  1751. }
  1752. const oldRef = oldRawRef && oldRawRef.r;
  1753. const refs = owner.refs === shared.EMPTY_OBJ ? owner.refs = {} : owner.refs;
  1754. const setupState = owner.setupState;
  1755. const rawSetupState = reactivity.toRaw(setupState);
  1756. const canSetSetupRef = setupState === shared.EMPTY_OBJ ? shared.NO : (key) => {
  1757. {
  1758. if (shared.hasOwn(rawSetupState, key) && !reactivity.isRef(rawSetupState[key])) {
  1759. warn$1(
  1760. `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
  1761. );
  1762. }
  1763. if (knownTemplateRefs.has(rawSetupState[key])) {
  1764. return false;
  1765. }
  1766. }
  1767. if (isTemplateRefKey(refs, key)) {
  1768. return false;
  1769. }
  1770. return shared.hasOwn(rawSetupState, key);
  1771. };
  1772. const canSetRef = (ref2, key) => {
  1773. if (knownTemplateRefs.has(ref2)) {
  1774. return false;
  1775. }
  1776. if (key && isTemplateRefKey(refs, key)) {
  1777. return false;
  1778. }
  1779. return true;
  1780. };
  1781. if (oldRef != null && oldRef !== ref) {
  1782. invalidatePendingSetRef(oldRawRef);
  1783. if (shared.isString(oldRef)) {
  1784. refs[oldRef] = null;
  1785. if (canSetSetupRef(oldRef)) {
  1786. setupState[oldRef] = null;
  1787. }
  1788. } else if (reactivity.isRef(oldRef)) {
  1789. const oldRawRefAtom = oldRawRef;
  1790. if (canSetRef(oldRef, oldRawRefAtom.k)) {
  1791. oldRef.value = null;
  1792. }
  1793. if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
  1794. }
  1795. }
  1796. if (shared.isFunction(ref)) {
  1797. callWithErrorHandling(ref, owner, 12, [value, refs]);
  1798. } else {
  1799. const _isString = shared.isString(ref);
  1800. const _isRef = reactivity.isRef(ref);
  1801. if (_isString || _isRef) {
  1802. const doSet = () => {
  1803. if (rawRef.f) {
  1804. const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
  1805. if (isUnmount) {
  1806. shared.isArray(existing) && shared.remove(existing, refValue);
  1807. } else {
  1808. if (!shared.isArray(existing)) {
  1809. if (_isString) {
  1810. refs[ref] = [refValue];
  1811. if (canSetSetupRef(ref)) {
  1812. setupState[ref] = refs[ref];
  1813. }
  1814. } else {
  1815. const newVal = [refValue];
  1816. if (canSetRef(ref, rawRef.k)) {
  1817. ref.value = newVal;
  1818. }
  1819. if (rawRef.k) refs[rawRef.k] = newVal;
  1820. }
  1821. } else if (!existing.includes(refValue)) {
  1822. existing.push(refValue);
  1823. }
  1824. }
  1825. } else if (_isString) {
  1826. refs[ref] = value;
  1827. if (canSetSetupRef(ref)) {
  1828. setupState[ref] = value;
  1829. }
  1830. } else if (_isRef) {
  1831. if (canSetRef(ref, rawRef.k)) {
  1832. ref.value = value;
  1833. }
  1834. if (rawRef.k) refs[rawRef.k] = value;
  1835. } else {
  1836. warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
  1837. }
  1838. };
  1839. if (value) {
  1840. const job = () => {
  1841. doSet();
  1842. pendingSetRefMap.delete(rawRef);
  1843. };
  1844. job.id = -1;
  1845. pendingSetRefMap.set(rawRef, job);
  1846. queuePostRenderEffect(job, parentSuspense);
  1847. } else {
  1848. invalidatePendingSetRef(rawRef);
  1849. doSet();
  1850. }
  1851. } else {
  1852. warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
  1853. }
  1854. }
  1855. }
  1856. function invalidatePendingSetRef(rawRef) {
  1857. const pendingSetRef = pendingSetRefMap.get(rawRef);
  1858. if (pendingSetRef) {
  1859. pendingSetRef.flags |= 8;
  1860. pendingSetRefMap.delete(rawRef);
  1861. }
  1862. }
  1863. let hasLoggedMismatchError = false;
  1864. const logMismatchError = () => {
  1865. if (hasLoggedMismatchError) {
  1866. return;
  1867. }
  1868. console.error("Hydration completed but contains mismatches.");
  1869. hasLoggedMismatchError = true;
  1870. };
  1871. const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
  1872. const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
  1873. const getContainerType = (container) => {
  1874. if (container.nodeType !== 1) return void 0;
  1875. if (isSVGContainer(container)) return "svg";
  1876. if (isMathMLContainer(container)) return "mathml";
  1877. return void 0;
  1878. };
  1879. const isComment = (node) => node.nodeType === 8;
  1880. function createHydrationFunctions(rendererInternals) {
  1881. const {
  1882. mt: mountComponent,
  1883. p: patch,
  1884. o: {
  1885. patchProp,
  1886. createText,
  1887. nextSibling,
  1888. parentNode,
  1889. remove,
  1890. insert,
  1891. createComment
  1892. }
  1893. } = rendererInternals;
  1894. const hydrate = (vnode, container) => {
  1895. if (!container.hasChildNodes()) {
  1896. warn$1(
  1897. `Attempting to hydrate existing markup but container is empty. Performing full mount instead.`
  1898. );
  1899. patch(null, vnode, container);
  1900. flushPostFlushCbs();
  1901. container._vnode = vnode;
  1902. return;
  1903. }
  1904. hydrateNode(container.firstChild, vnode, null, null, null);
  1905. flushPostFlushCbs();
  1906. container._vnode = vnode;
  1907. };
  1908. const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
  1909. optimized = optimized || !!vnode.dynamicChildren;
  1910. const isFragmentStart = isComment(node) && node.data === "[";
  1911. const onMismatch = () => handleMismatch(
  1912. node,
  1913. vnode,
  1914. parentComponent,
  1915. parentSuspense,
  1916. slotScopeIds,
  1917. isFragmentStart
  1918. );
  1919. const { type, ref, shapeFlag, patchFlag } = vnode;
  1920. let domType = node.nodeType;
  1921. vnode.el = node;
  1922. {
  1923. shared.def(node, "__vnode", vnode, true);
  1924. shared.def(node, "__vueParentComponent", parentComponent, true);
  1925. }
  1926. if (patchFlag === -2) {
  1927. optimized = false;
  1928. vnode.dynamicChildren = null;
  1929. }
  1930. let nextNode = null;
  1931. switch (type) {
  1932. case Text:
  1933. if (domType !== 3) {
  1934. if (vnode.children === "") {
  1935. insert(vnode.el = createText(""), parentNode(node), node);
  1936. nextNode = node;
  1937. } else {
  1938. nextNode = onMismatch();
  1939. }
  1940. } else {
  1941. if (node.data !== vnode.children) {
  1942. warn$1(
  1943. `Hydration text mismatch in`,
  1944. node.parentNode,
  1945. `
  1946. - rendered on server: ${JSON.stringify(
  1947. node.data
  1948. )}
  1949. - expected on client: ${JSON.stringify(vnode.children)}`
  1950. );
  1951. logMismatchError();
  1952. node.data = vnode.children;
  1953. }
  1954. nextNode = nextSibling(node);
  1955. }
  1956. break;
  1957. case Comment:
  1958. if (isTemplateNode(node)) {
  1959. nextNode = nextSibling(node);
  1960. replaceNode(
  1961. vnode.el = node.content.firstChild,
  1962. node,
  1963. parentComponent
  1964. );
  1965. } else if (domType !== 8 || isFragmentStart) {
  1966. nextNode = onMismatch();
  1967. } else {
  1968. nextNode = nextSibling(node);
  1969. }
  1970. break;
  1971. case Static:
  1972. if (isFragmentStart) {
  1973. node = nextSibling(node);
  1974. domType = node.nodeType;
  1975. }
  1976. if (domType === 1 || domType === 3) {
  1977. nextNode = node;
  1978. const needToAdoptContent = !vnode.children.length;
  1979. for (let i = 0; i < vnode.staticCount; i++) {
  1980. if (needToAdoptContent)
  1981. vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data;
  1982. if (i === vnode.staticCount - 1) {
  1983. vnode.anchor = nextNode;
  1984. }
  1985. nextNode = nextSibling(nextNode);
  1986. }
  1987. return isFragmentStart ? nextSibling(nextNode) : nextNode;
  1988. } else {
  1989. onMismatch();
  1990. }
  1991. break;
  1992. case Fragment:
  1993. if (!isFragmentStart) {
  1994. nextNode = onMismatch();
  1995. } else {
  1996. nextNode = hydrateFragment(
  1997. node,
  1998. vnode,
  1999. parentComponent,
  2000. parentSuspense,
  2001. slotScopeIds,
  2002. optimized
  2003. );
  2004. }
  2005. break;
  2006. default:
  2007. if (shapeFlag & 1) {
  2008. if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
  2009. nextNode = onMismatch();
  2010. } else {
  2011. nextNode = hydrateElement(
  2012. node,
  2013. vnode,
  2014. parentComponent,
  2015. parentSuspense,
  2016. slotScopeIds,
  2017. optimized
  2018. );
  2019. }
  2020. } else if (shapeFlag & 6) {
  2021. vnode.slotScopeIds = slotScopeIds;
  2022. const container = parentNode(node);
  2023. if (isFragmentStart) {
  2024. nextNode = locateClosingAnchor(node);
  2025. } else if (isComment(node) && node.data === "teleport start") {
  2026. nextNode = locateClosingAnchor(node, node.data, "teleport end");
  2027. } else {
  2028. nextNode = nextSibling(node);
  2029. }
  2030. mountComponent(
  2031. vnode,
  2032. container,
  2033. null,
  2034. parentComponent,
  2035. parentSuspense,
  2036. getContainerType(container),
  2037. optimized
  2038. );
  2039. if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
  2040. let subTree;
  2041. if (isFragmentStart) {
  2042. subTree = createVNode(Fragment);
  2043. subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
  2044. } else {
  2045. subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
  2046. }
  2047. subTree.el = node;
  2048. vnode.component.subTree = subTree;
  2049. }
  2050. } else if (shapeFlag & 64) {
  2051. if (domType !== 8) {
  2052. nextNode = onMismatch();
  2053. } else {
  2054. nextNode = vnode.type.hydrate(
  2055. node,
  2056. vnode,
  2057. parentComponent,
  2058. parentSuspense,
  2059. slotScopeIds,
  2060. optimized,
  2061. rendererInternals,
  2062. hydrateChildren
  2063. );
  2064. }
  2065. } else if (shapeFlag & 128) {
  2066. nextNode = vnode.type.hydrate(
  2067. node,
  2068. vnode,
  2069. parentComponent,
  2070. parentSuspense,
  2071. getContainerType(parentNode(node)),
  2072. slotScopeIds,
  2073. optimized,
  2074. rendererInternals,
  2075. hydrateNode
  2076. );
  2077. } else {
  2078. warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
  2079. }
  2080. }
  2081. if (ref != null) {
  2082. setRef(ref, null, parentSuspense, vnode);
  2083. }
  2084. return nextNode;
  2085. };
  2086. const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  2087. optimized = optimized || !!vnode.dynamicChildren;
  2088. const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
  2089. const forcePatch = type === "input" || type === "option";
  2090. {
  2091. if (dirs) {
  2092. invokeDirectiveHook(vnode, null, parentComponent, "created");
  2093. }
  2094. let needCallTransitionHooks = false;
  2095. if (isTemplateNode(el)) {
  2096. needCallTransitionHooks = needTransition(
  2097. null,
  2098. // no need check parentSuspense in hydration
  2099. transition
  2100. ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
  2101. const content = el.content.firstChild;
  2102. if (needCallTransitionHooks) {
  2103. const cls = content.getAttribute("class");
  2104. if (cls) content.$cls = cls;
  2105. transition.beforeEnter(content);
  2106. }
  2107. replaceNode(content, el, parentComponent);
  2108. vnode.el = el = content;
  2109. }
  2110. if (shapeFlag & 16 && // skip if element has innerHTML / textContent
  2111. !(props && (props.innerHTML || props.textContent))) {
  2112. let next = hydrateChildren(
  2113. el.firstChild,
  2114. vnode,
  2115. el,
  2116. parentComponent,
  2117. parentSuspense,
  2118. slotScopeIds,
  2119. optimized
  2120. );
  2121. if (next && !isMismatchAllowed(el, 1 /* CHILDREN */)) {
  2122. warn$1(
  2123. `Hydration children mismatch on`,
  2124. el,
  2125. `
  2126. Server rendered element contains more child nodes than client vdom.`
  2127. );
  2128. logMismatchError();
  2129. }
  2130. while (next) {
  2131. const cur = next;
  2132. next = next.nextSibling;
  2133. remove(cur);
  2134. }
  2135. } else if (shapeFlag & 8) {
  2136. let clientText = vnode.children;
  2137. if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
  2138. clientText = clientText.slice(1);
  2139. }
  2140. const { textContent } = el;
  2141. if (textContent !== clientText && // innerHTML normalize \r\n or \r into a single \n in the DOM
  2142. textContent !== clientText.replace(/\r\n|\r/g, "\n")) {
  2143. if (!isMismatchAllowed(el, 0 /* TEXT */)) {
  2144. warn$1(
  2145. `Hydration text content mismatch on`,
  2146. el,
  2147. `
  2148. - rendered on server: ${textContent}
  2149. - expected on client: ${clientText}`
  2150. );
  2151. logMismatchError();
  2152. }
  2153. el.textContent = vnode.children;
  2154. }
  2155. }
  2156. if (props) {
  2157. {
  2158. const isCustomElement = el.tagName.includes("-");
  2159. for (const key in props) {
  2160. if (// #11189 skip if this node has directives that have created hooks
  2161. // as it could have mutated the DOM in any possible way
  2162. !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
  2163. logMismatchError();
  2164. }
  2165. if (forcePatch && (key.endsWith("value") || key === "indeterminate") || shared.isOn(key) && !shared.isReservedProp(key) || // force hydrate v-bind with .prop modifiers
  2166. key[0] === "." || isCustomElement && !shared.isReservedProp(key)) {
  2167. patchProp(el, key, null, props[key], void 0, parentComponent);
  2168. }
  2169. }
  2170. }
  2171. }
  2172. let vnodeHooks;
  2173. if (vnodeHooks = props && props.onVnodeBeforeMount) {
  2174. invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  2175. }
  2176. if (dirs) {
  2177. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  2178. }
  2179. if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
  2180. queueEffectWithSuspense(() => {
  2181. vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  2182. needCallTransitionHooks && transition.enter(el);
  2183. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  2184. }, parentSuspense);
  2185. }
  2186. }
  2187. return el.nextSibling;
  2188. };
  2189. const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  2190. optimized = optimized || !!parentVNode.dynamicChildren;
  2191. const children = parentVNode.children;
  2192. const l = children.length;
  2193. let hasCheckedMismatch = false;
  2194. for (let i = 0; i < l; i++) {
  2195. const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
  2196. const isText = vnode.type === Text;
  2197. if (node) {
  2198. if (isText && !optimized) {
  2199. if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
  2200. insert(
  2201. createText(
  2202. node.data.slice(vnode.children.length)
  2203. ),
  2204. container,
  2205. nextSibling(node)
  2206. );
  2207. node.data = vnode.children;
  2208. }
  2209. }
  2210. node = hydrateNode(
  2211. node,
  2212. vnode,
  2213. parentComponent,
  2214. parentSuspense,
  2215. slotScopeIds,
  2216. optimized
  2217. );
  2218. } else if (isText && !vnode.children) {
  2219. insert(vnode.el = createText(""), container);
  2220. } else {
  2221. if (!hasCheckedMismatch) {
  2222. hasCheckedMismatch = true;
  2223. if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
  2224. warn$1(
  2225. `Hydration children mismatch on`,
  2226. container,
  2227. `
  2228. Server rendered element contains fewer child nodes than client vdom.`
  2229. );
  2230. logMismatchError();
  2231. }
  2232. }
  2233. patch(
  2234. null,
  2235. vnode,
  2236. container,
  2237. null,
  2238. parentComponent,
  2239. parentSuspense,
  2240. getContainerType(container),
  2241. slotScopeIds
  2242. );
  2243. }
  2244. }
  2245. return node;
  2246. };
  2247. const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  2248. const { slotScopeIds: fragmentSlotScopeIds } = vnode;
  2249. if (fragmentSlotScopeIds) {
  2250. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  2251. }
  2252. const container = parentNode(node);
  2253. const next = hydrateChildren(
  2254. nextSibling(node),
  2255. vnode,
  2256. container,
  2257. parentComponent,
  2258. parentSuspense,
  2259. slotScopeIds,
  2260. optimized
  2261. );
  2262. if (next && isComment(next) && next.data === "]") {
  2263. return nextSibling(vnode.anchor = next);
  2264. } else {
  2265. logMismatchError();
  2266. insert(vnode.anchor = createComment(`]`), container, next);
  2267. return next;
  2268. }
  2269. };
  2270. const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
  2271. if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) {
  2272. warn$1(
  2273. `Hydration node mismatch:
  2274. - rendered on server:`,
  2275. node,
  2276. node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
  2277. `
  2278. - expected on client:`,
  2279. vnode.type
  2280. );
  2281. logMismatchError();
  2282. }
  2283. vnode.el = null;
  2284. if (isFragment) {
  2285. const end = locateClosingAnchor(node);
  2286. while (true) {
  2287. const next2 = nextSibling(node);
  2288. if (next2 && next2 !== end) {
  2289. remove(next2);
  2290. } else {
  2291. break;
  2292. }
  2293. }
  2294. }
  2295. const next = nextSibling(node);
  2296. const container = parentNode(node);
  2297. remove(node);
  2298. patch(
  2299. null,
  2300. vnode,
  2301. container,
  2302. next,
  2303. parentComponent,
  2304. parentSuspense,
  2305. getContainerType(container),
  2306. slotScopeIds
  2307. );
  2308. if (parentComponent) {
  2309. parentComponent.vnode.el = vnode.el;
  2310. updateHOCHostEl(parentComponent, vnode.el);
  2311. }
  2312. return next;
  2313. };
  2314. const locateClosingAnchor = (node, open = "[", close = "]") => {
  2315. let match = 0;
  2316. while (node) {
  2317. node = nextSibling(node);
  2318. if (node && isComment(node)) {
  2319. if (node.data === open) match++;
  2320. if (node.data === close) {
  2321. if (match === 0) {
  2322. return nextSibling(node);
  2323. } else {
  2324. match--;
  2325. }
  2326. }
  2327. }
  2328. }
  2329. return node;
  2330. };
  2331. const replaceNode = (newNode, oldNode, parentComponent) => {
  2332. const parentNode2 = oldNode.parentNode;
  2333. if (parentNode2) {
  2334. parentNode2.replaceChild(newNode, oldNode);
  2335. }
  2336. let parent = parentComponent;
  2337. while (parent) {
  2338. if (parent.vnode.el === oldNode) {
  2339. parent.vnode.el = parent.subTree.el = newNode;
  2340. }
  2341. parent = parent.parent;
  2342. }
  2343. };
  2344. const isTemplateNode = (node) => {
  2345. return node.nodeType === 1 && node.tagName === "TEMPLATE";
  2346. };
  2347. return [hydrate, hydrateNode];
  2348. }
  2349. function propHasMismatch(el, key, clientValue, vnode, instance) {
  2350. let mismatchType;
  2351. let mismatchKey;
  2352. let actual;
  2353. let expected;
  2354. if (key === "class") {
  2355. if (el.$cls) {
  2356. actual = el.$cls;
  2357. delete el.$cls;
  2358. } else {
  2359. actual = el.getAttribute("class");
  2360. }
  2361. expected = shared.normalizeClass(clientValue);
  2362. if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
  2363. mismatchType = 2 /* CLASS */;
  2364. mismatchKey = `class`;
  2365. }
  2366. } else if (key === "style") {
  2367. actual = el.getAttribute("style") || "";
  2368. expected = shared.isString(clientValue) ? clientValue : shared.stringifyStyle(shared.normalizeStyle(clientValue));
  2369. const actualMap = toStyleMap(actual);
  2370. const expectedMap = toStyleMap(expected);
  2371. if (vnode.dirs) {
  2372. for (const { dir, value } of vnode.dirs) {
  2373. if (dir.name === "show" && !value) {
  2374. expectedMap.set("display", "none");
  2375. }
  2376. }
  2377. }
  2378. if (instance) {
  2379. resolveCssVars(instance, vnode, expectedMap);
  2380. }
  2381. if (!isMapEqual(actualMap, expectedMap)) {
  2382. mismatchType = 3 /* STYLE */;
  2383. mismatchKey = "style";
  2384. }
  2385. } else if (el instanceof SVGElement && shared.isKnownSvgAttr(key) || el instanceof HTMLElement && (shared.isBooleanAttr(key) || shared.isKnownHtmlAttr(key))) {
  2386. if (shared.isBooleanAttr(key)) {
  2387. actual = el.hasAttribute(key);
  2388. expected = shared.includeBooleanAttr(clientValue);
  2389. } else if (clientValue == null) {
  2390. actual = el.hasAttribute(key);
  2391. expected = false;
  2392. } else {
  2393. if (el.hasAttribute(key)) {
  2394. actual = el.getAttribute(key);
  2395. } else if (key === "value" && el.tagName === "TEXTAREA") {
  2396. actual = el.value;
  2397. } else {
  2398. actual = false;
  2399. }
  2400. expected = shared.isRenderableAttrValue(clientValue) ? String(clientValue) : false;
  2401. }
  2402. if (actual !== expected) {
  2403. mismatchType = 4 /* ATTRIBUTE */;
  2404. mismatchKey = key;
  2405. }
  2406. }
  2407. if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) {
  2408. const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
  2409. const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`;
  2410. const postSegment = `
  2411. - rendered on server: ${format(actual)}
  2412. - expected on client: ${format(expected)}
  2413. Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
  2414. You should fix the source of the mismatch.`;
  2415. {
  2416. warn$1(preSegment, el, postSegment);
  2417. }
  2418. return true;
  2419. }
  2420. return false;
  2421. }
  2422. function toClassSet(str) {
  2423. return new Set(str.trim().split(/\s+/));
  2424. }
  2425. function isSetEqual(a, b) {
  2426. if (a.size !== b.size) {
  2427. return false;
  2428. }
  2429. for (const s of a) {
  2430. if (!b.has(s)) {
  2431. return false;
  2432. }
  2433. }
  2434. return true;
  2435. }
  2436. function toStyleMap(str) {
  2437. const styleMap = /* @__PURE__ */ new Map();
  2438. for (const item of str.split(";")) {
  2439. let [key, value] = item.split(":");
  2440. key = key.trim();
  2441. value = value && value.trim();
  2442. if (key && value) {
  2443. styleMap.set(key, value);
  2444. }
  2445. }
  2446. return styleMap;
  2447. }
  2448. function isMapEqual(a, b) {
  2449. if (a.size !== b.size) {
  2450. return false;
  2451. }
  2452. for (const [key, value] of a) {
  2453. if (value !== b.get(key)) {
  2454. return false;
  2455. }
  2456. }
  2457. return true;
  2458. }
  2459. function resolveCssVars(instance, vnode, expectedMap) {
  2460. const root = instance.subTree;
  2461. if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
  2462. const cssVars = instance.getCssVars();
  2463. for (const key in cssVars) {
  2464. const value = shared.normalizeCssVarValue(cssVars[key]);
  2465. expectedMap.set(`--${shared.getEscapedCssVarName(key, false)}`, value);
  2466. }
  2467. }
  2468. if (vnode === root && instance.parent) {
  2469. resolveCssVars(instance.parent, instance.vnode, expectedMap);
  2470. }
  2471. }
  2472. const allowMismatchAttr = "data-allow-mismatch";
  2473. const MismatchTypeString = {
  2474. [0 /* TEXT */]: "text",
  2475. [1 /* CHILDREN */]: "children",
  2476. [2 /* CLASS */]: "class",
  2477. [3 /* STYLE */]: "style",
  2478. [4 /* ATTRIBUTE */]: "attribute"
  2479. };
  2480. function isMismatchAllowed(el, allowedType) {
  2481. if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) {
  2482. while (el && !el.hasAttribute(allowMismatchAttr)) {
  2483. el = el.parentElement;
  2484. }
  2485. }
  2486. const allowedAttr = el && el.getAttribute(allowMismatchAttr);
  2487. if (allowedAttr == null) {
  2488. return false;
  2489. } else if (allowedAttr === "") {
  2490. return true;
  2491. } else {
  2492. const list = allowedAttr.split(",");
  2493. if (allowedType === 0 /* TEXT */ && list.includes("children")) {
  2494. return true;
  2495. }
  2496. return list.includes(MismatchTypeString[allowedType]);
  2497. }
  2498. }
  2499. const requestIdleCallback = shared.getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
  2500. const cancelIdleCallback = shared.getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
  2501. const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
  2502. const id = requestIdleCallback(hydrate, { timeout });
  2503. return () => cancelIdleCallback(id);
  2504. };
  2505. function elementIsVisibleInViewport(el) {
  2506. const { top, left, bottom, right } = el.getBoundingClientRect();
  2507. const { innerHeight, innerWidth } = window;
  2508. return (top > 0 && top < innerHeight || bottom > 0 && bottom < innerHeight) && (left > 0 && left < innerWidth || right > 0 && right < innerWidth);
  2509. }
  2510. const hydrateOnVisible = (opts) => (hydrate, forEach) => {
  2511. const ob = new IntersectionObserver((entries) => {
  2512. for (const e of entries) {
  2513. if (!e.isIntersecting) continue;
  2514. ob.disconnect();
  2515. hydrate();
  2516. break;
  2517. }
  2518. }, opts);
  2519. forEach((el) => {
  2520. if (!(el instanceof Element)) return;
  2521. if (elementIsVisibleInViewport(el)) {
  2522. hydrate();
  2523. ob.disconnect();
  2524. return false;
  2525. }
  2526. ob.observe(el);
  2527. });
  2528. return () => ob.disconnect();
  2529. };
  2530. const hydrateOnMediaQuery = (query) => (hydrate) => {
  2531. if (query) {
  2532. const mql = matchMedia(query);
  2533. if (mql.matches) {
  2534. hydrate();
  2535. } else {
  2536. mql.addEventListener("change", hydrate, { once: true });
  2537. return () => mql.removeEventListener("change", hydrate);
  2538. }
  2539. }
  2540. };
  2541. const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
  2542. if (shared.isString(interactions)) interactions = [interactions];
  2543. let hasHydrated = false;
  2544. const doHydrate = (e) => {
  2545. if (!hasHydrated) {
  2546. hasHydrated = true;
  2547. teardown();
  2548. hydrate();
  2549. e.target.dispatchEvent(new e.constructor(e.type, e));
  2550. }
  2551. };
  2552. const teardown = () => {
  2553. forEach((el) => {
  2554. for (const i of interactions) {
  2555. el.removeEventListener(i, doHydrate);
  2556. }
  2557. });
  2558. };
  2559. forEach((el) => {
  2560. for (const i of interactions) {
  2561. el.addEventListener(i, doHydrate, { once: true });
  2562. }
  2563. });
  2564. return teardown;
  2565. };
  2566. function forEachElement(node, cb) {
  2567. if (isComment(node) && node.data === "[") {
  2568. let depth = 1;
  2569. let next = node.nextSibling;
  2570. while (next) {
  2571. if (next.nodeType === 1) {
  2572. const result = cb(next);
  2573. if (result === false) {
  2574. break;
  2575. }
  2576. } else if (isComment(next)) {
  2577. if (next.data === "]") {
  2578. if (--depth === 0) break;
  2579. } else if (next.data === "[") {
  2580. depth++;
  2581. }
  2582. }
  2583. next = next.nextSibling;
  2584. }
  2585. } else {
  2586. cb(node);
  2587. }
  2588. }
  2589. const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
  2590. // @__NO_SIDE_EFFECTS__
  2591. function defineAsyncComponent(source) {
  2592. if (shared.isFunction(source)) {
  2593. source = { loader: source };
  2594. }
  2595. const {
  2596. loader,
  2597. loadingComponent,
  2598. errorComponent,
  2599. delay = 200,
  2600. hydrate: hydrateStrategy,
  2601. timeout,
  2602. // undefined = never times out
  2603. suspensible = true,
  2604. onError: userOnError
  2605. } = source;
  2606. let pendingRequest = null;
  2607. let resolvedComp;
  2608. let retries = 0;
  2609. const retry = () => {
  2610. retries++;
  2611. pendingRequest = null;
  2612. return load();
  2613. };
  2614. const load = () => {
  2615. let thisRequest;
  2616. return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
  2617. err = err instanceof Error ? err : new Error(String(err));
  2618. if (userOnError) {
  2619. return new Promise((resolve, reject) => {
  2620. const userRetry = () => resolve(retry());
  2621. const userFail = () => reject(err);
  2622. userOnError(err, userRetry, userFail, retries + 1);
  2623. });
  2624. } else {
  2625. throw err;
  2626. }
  2627. }).then((comp) => {
  2628. if (thisRequest !== pendingRequest && pendingRequest) {
  2629. return pendingRequest;
  2630. }
  2631. if (!comp) {
  2632. warn$1(
  2633. `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
  2634. );
  2635. }
  2636. if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
  2637. comp = comp.default;
  2638. }
  2639. if (comp && !shared.isObject(comp) && !shared.isFunction(comp)) {
  2640. throw new Error(`Invalid async component load result: ${comp}`);
  2641. }
  2642. resolvedComp = comp;
  2643. return comp;
  2644. }));
  2645. };
  2646. return defineComponent({
  2647. name: "AsyncComponentWrapper",
  2648. __asyncLoader: load,
  2649. __asyncHydrate(el, instance, hydrate) {
  2650. let patched = false;
  2651. (instance.bu || (instance.bu = [])).push(() => patched = true);
  2652. const performHydrate = () => {
  2653. if (patched) {
  2654. {
  2655. warn$1(
  2656. `Skipping lazy hydration for component '${getComponentName(resolvedComp) || resolvedComp.__file}': it was updated before lazy hydration performed.`
  2657. );
  2658. }
  2659. return;
  2660. }
  2661. hydrate();
  2662. };
  2663. const doHydrate = hydrateStrategy ? () => {
  2664. const teardown = hydrateStrategy(
  2665. performHydrate,
  2666. (cb) => forEachElement(el, cb)
  2667. );
  2668. if (teardown) {
  2669. (instance.bum || (instance.bum = [])).push(teardown);
  2670. }
  2671. } : performHydrate;
  2672. if (resolvedComp) {
  2673. doHydrate();
  2674. } else {
  2675. load().then(() => !instance.isUnmounted && doHydrate());
  2676. }
  2677. },
  2678. get __asyncResolved() {
  2679. return resolvedComp;
  2680. },
  2681. setup() {
  2682. const instance = currentInstance;
  2683. markAsyncBoundary(instance);
  2684. if (resolvedComp) {
  2685. return () => createInnerComp(resolvedComp, instance);
  2686. }
  2687. const onError = (err) => {
  2688. pendingRequest = null;
  2689. handleError(
  2690. err,
  2691. instance,
  2692. 13,
  2693. !errorComponent
  2694. );
  2695. };
  2696. if (suspensible && instance.suspense || isInSSRComponentSetup) {
  2697. return load().then((comp) => {
  2698. return () => createInnerComp(comp, instance);
  2699. }).catch((err) => {
  2700. onError(err);
  2701. return () => errorComponent ? createVNode(errorComponent, {
  2702. error: err
  2703. }) : null;
  2704. });
  2705. }
  2706. const loaded = reactivity.ref(false);
  2707. const error = reactivity.ref();
  2708. const delayed = reactivity.ref(!!delay);
  2709. let timeoutTimer;
  2710. let delayTimer;
  2711. onUnmounted(() => {
  2712. if (timeoutTimer != null) clearTimeout(timeoutTimer);
  2713. if (delayTimer != null) clearTimeout(delayTimer);
  2714. });
  2715. if (delay) {
  2716. delayTimer = setTimeout(() => {
  2717. if (instance.isUnmounted) return;
  2718. delayed.value = false;
  2719. }, delay);
  2720. }
  2721. if (timeout != null) {
  2722. timeoutTimer = setTimeout(() => {
  2723. if (instance.isUnmounted) return;
  2724. if (!loaded.value && !error.value) {
  2725. const err = new Error(
  2726. `Async component timed out after ${timeout}ms.`
  2727. );
  2728. onError(err);
  2729. error.value = err;
  2730. }
  2731. }, timeout);
  2732. }
  2733. load().then(() => {
  2734. if (instance.isUnmounted) return;
  2735. loaded.value = true;
  2736. if (instance.parent && isKeepAlive(instance.parent.vnode)) {
  2737. instance.parent.update();
  2738. }
  2739. }).catch((err) => {
  2740. if (instance.isUnmounted) {
  2741. pendingRequest = null;
  2742. return;
  2743. }
  2744. onError(err);
  2745. error.value = err;
  2746. });
  2747. return () => {
  2748. if (loaded.value && resolvedComp) {
  2749. return createInnerComp(resolvedComp, instance);
  2750. } else if (error.value && errorComponent) {
  2751. return createVNode(errorComponent, {
  2752. error: error.value
  2753. });
  2754. } else if (loadingComponent && !delayed.value) {
  2755. return createInnerComp(
  2756. loadingComponent,
  2757. instance
  2758. );
  2759. }
  2760. };
  2761. }
  2762. });
  2763. }
  2764. function createInnerComp(comp, parent) {
  2765. const { ref: ref2, props, children, ce } = parent.vnode;
  2766. const vnode = createVNode(comp, props, children);
  2767. vnode.ref = ref2;
  2768. vnode.ce = ce;
  2769. delete parent.vnode.ce;
  2770. return vnode;
  2771. }
  2772. const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
  2773. const KeepAliveImpl = {
  2774. name: `KeepAlive`,
  2775. // Marker for special handling inside the renderer. We are not using a ===
  2776. // check directly on KeepAlive in the renderer, because importing it directly
  2777. // would prevent it from being tree-shaken.
  2778. __isKeepAlive: true,
  2779. props: {
  2780. include: [String, RegExp, Array],
  2781. exclude: [String, RegExp, Array],
  2782. max: [String, Number]
  2783. },
  2784. setup(props, { slots }) {
  2785. const instance = getCurrentInstance();
  2786. const sharedContext = instance.ctx;
  2787. if (!sharedContext.renderer) {
  2788. return () => {
  2789. const children = slots.default && slots.default();
  2790. return children && children.length === 1 ? children[0] : children;
  2791. };
  2792. }
  2793. const cache = /* @__PURE__ */ new Map();
  2794. const keys = /* @__PURE__ */ new Set();
  2795. let current = null;
  2796. {
  2797. instance.__v_cache = cache;
  2798. }
  2799. const parentSuspense = instance.suspense;
  2800. const {
  2801. renderer: {
  2802. p: patch,
  2803. m: move,
  2804. um: _unmount,
  2805. o: { createElement }
  2806. }
  2807. } = sharedContext;
  2808. const storageContainer = createElement("div");
  2809. sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
  2810. const instance2 = vnode.component;
  2811. move(vnode, container, anchor, 0, parentSuspense);
  2812. patch(
  2813. instance2.vnode,
  2814. vnode,
  2815. container,
  2816. anchor,
  2817. instance2,
  2818. parentSuspense,
  2819. namespace,
  2820. vnode.slotScopeIds,
  2821. optimized
  2822. );
  2823. queuePostRenderEffect(() => {
  2824. instance2.isDeactivated = false;
  2825. if (instance2.a) {
  2826. shared.invokeArrayFns(instance2.a);
  2827. }
  2828. const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
  2829. if (vnodeHook) {
  2830. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  2831. }
  2832. }, parentSuspense);
  2833. {
  2834. devtoolsComponentAdded(instance2);
  2835. }
  2836. };
  2837. sharedContext.deactivate = (vnode) => {
  2838. const instance2 = vnode.component;
  2839. invalidateMount(instance2.m);
  2840. invalidateMount(instance2.a);
  2841. move(vnode, storageContainer, null, 1, parentSuspense);
  2842. queuePostRenderEffect(() => {
  2843. if (instance2.da) {
  2844. shared.invokeArrayFns(instance2.da);
  2845. }
  2846. const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
  2847. if (vnodeHook) {
  2848. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  2849. }
  2850. instance2.isDeactivated = true;
  2851. }, parentSuspense);
  2852. {
  2853. devtoolsComponentAdded(instance2);
  2854. }
  2855. };
  2856. function unmount(vnode) {
  2857. resetShapeFlag(vnode);
  2858. _unmount(vnode, instance, parentSuspense, true);
  2859. }
  2860. function pruneCache(filter) {
  2861. cache.forEach((vnode, key) => {
  2862. const name = getComponentName(
  2863. isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : vnode.type
  2864. );
  2865. if (name && !filter(name)) {
  2866. pruneCacheEntry(key);
  2867. }
  2868. });
  2869. }
  2870. function pruneCacheEntry(key) {
  2871. const cached = cache.get(key);
  2872. if (cached && (!current || !isSameVNodeType(cached, current))) {
  2873. unmount(cached);
  2874. } else if (current) {
  2875. resetShapeFlag(current);
  2876. }
  2877. cache.delete(key);
  2878. keys.delete(key);
  2879. }
  2880. watch(
  2881. () => [props.include, props.exclude],
  2882. ([include, exclude]) => {
  2883. include && pruneCache((name) => matches(include, name));
  2884. exclude && pruneCache((name) => !matches(exclude, name));
  2885. },
  2886. // prune post-render after `current` has been updated
  2887. { flush: "post", deep: true }
  2888. );
  2889. let pendingCacheKey = null;
  2890. const cacheSubtree = () => {
  2891. if (pendingCacheKey != null) {
  2892. if (isSuspense(instance.subTree.type)) {
  2893. queuePostRenderEffect(() => {
  2894. cache.set(pendingCacheKey, getInnerChild(instance.subTree));
  2895. }, instance.subTree.suspense);
  2896. } else {
  2897. cache.set(pendingCacheKey, getInnerChild(instance.subTree));
  2898. }
  2899. }
  2900. };
  2901. onMounted(cacheSubtree);
  2902. onUpdated(cacheSubtree);
  2903. onBeforeUnmount(() => {
  2904. cache.forEach((cached) => {
  2905. const { subTree, suspense } = instance;
  2906. const vnode = getInnerChild(subTree);
  2907. if (cached.type === vnode.type && cached.key === vnode.key) {
  2908. resetShapeFlag(vnode);
  2909. const da = vnode.component.da;
  2910. da && queuePostRenderEffect(da, suspense);
  2911. return;
  2912. }
  2913. unmount(cached);
  2914. });
  2915. });
  2916. return () => {
  2917. pendingCacheKey = null;
  2918. if (!slots.default) {
  2919. return current = null;
  2920. }
  2921. const children = slots.default();
  2922. const rawVNode = children[0];
  2923. if (children.length > 1) {
  2924. {
  2925. warn$1(`KeepAlive should contain exactly one component child.`);
  2926. }
  2927. current = null;
  2928. return children;
  2929. } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
  2930. current = null;
  2931. return rawVNode;
  2932. }
  2933. let vnode = getInnerChild(rawVNode);
  2934. if (vnode.type === Comment) {
  2935. current = null;
  2936. return vnode;
  2937. }
  2938. const comp = vnode.type;
  2939. const name = getComponentName(
  2940. isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
  2941. );
  2942. const { include, exclude, max } = props;
  2943. if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
  2944. vnode.shapeFlag &= -257;
  2945. current = vnode;
  2946. return rawVNode;
  2947. }
  2948. const key = vnode.key == null ? comp : vnode.key;
  2949. const cachedVNode = cache.get(key);
  2950. if (vnode.el) {
  2951. vnode = cloneVNode(vnode);
  2952. if (rawVNode.shapeFlag & 128) {
  2953. rawVNode.ssContent = vnode;
  2954. }
  2955. }
  2956. pendingCacheKey = key;
  2957. if (cachedVNode) {
  2958. vnode.el = cachedVNode.el;
  2959. vnode.component = cachedVNode.component;
  2960. if (vnode.transition) {
  2961. setTransitionHooks(vnode, vnode.transition);
  2962. }
  2963. vnode.shapeFlag |= 512;
  2964. keys.delete(key);
  2965. keys.add(key);
  2966. } else {
  2967. keys.add(key);
  2968. if (max && keys.size > parseInt(max, 10)) {
  2969. pruneCacheEntry(keys.values().next().value);
  2970. }
  2971. }
  2972. vnode.shapeFlag |= 256;
  2973. current = vnode;
  2974. return isSuspense(rawVNode.type) ? rawVNode : vnode;
  2975. };
  2976. }
  2977. };
  2978. const KeepAlive = KeepAliveImpl;
  2979. function matches(pattern, name) {
  2980. if (shared.isArray(pattern)) {
  2981. return pattern.some((p) => matches(p, name));
  2982. } else if (shared.isString(pattern)) {
  2983. return pattern.split(",").includes(name);
  2984. } else if (shared.isRegExp(pattern)) {
  2985. pattern.lastIndex = 0;
  2986. return pattern.test(name);
  2987. }
  2988. return false;
  2989. }
  2990. function onActivated(hook, target) {
  2991. registerKeepAliveHook(hook, "a", target);
  2992. }
  2993. function onDeactivated(hook, target) {
  2994. registerKeepAliveHook(hook, "da", target);
  2995. }
  2996. function registerKeepAliveHook(hook, type, target = currentInstance) {
  2997. const wrappedHook = hook.__wdc || (hook.__wdc = () => {
  2998. let current = target;
  2999. while (current) {
  3000. if (current.isDeactivated) {
  3001. return;
  3002. }
  3003. current = current.parent;
  3004. }
  3005. return hook();
  3006. });
  3007. injectHook(type, wrappedHook, target);
  3008. if (target) {
  3009. let current = target.parent;
  3010. while (current && current.parent) {
  3011. if (isKeepAlive(current.parent.vnode)) {
  3012. injectToKeepAliveRoot(wrappedHook, type, target, current);
  3013. }
  3014. current = current.parent;
  3015. }
  3016. }
  3017. }
  3018. function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  3019. const injected = injectHook(
  3020. type,
  3021. hook,
  3022. keepAliveRoot,
  3023. true
  3024. /* prepend */
  3025. );
  3026. onUnmounted(() => {
  3027. shared.remove(keepAliveRoot[type], injected);
  3028. }, target);
  3029. }
  3030. function resetShapeFlag(vnode) {
  3031. vnode.shapeFlag &= -257;
  3032. vnode.shapeFlag &= -513;
  3033. }
  3034. function getInnerChild(vnode) {
  3035. return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
  3036. }
  3037. function injectHook(type, hook, target = currentInstance, prepend = false) {
  3038. if (target) {
  3039. const hooks = target[type] || (target[type] = []);
  3040. const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
  3041. reactivity.pauseTracking();
  3042. const reset = setCurrentInstance(target);
  3043. const res = callWithAsyncErrorHandling(hook, target, type, args);
  3044. reset();
  3045. reactivity.resetTracking();
  3046. return res;
  3047. });
  3048. if (prepend) {
  3049. hooks.unshift(wrappedHook);
  3050. } else {
  3051. hooks.push(wrappedHook);
  3052. }
  3053. return wrappedHook;
  3054. } else {
  3055. const apiName = shared.toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
  3056. warn$1(
  3057. `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` )
  3058. );
  3059. }
  3060. }
  3061. const createHook = (lifecycle) => (hook, target = currentInstance) => {
  3062. if (!isInSSRComponentSetup || lifecycle === "sp") {
  3063. injectHook(lifecycle, (...args) => hook(...args), target);
  3064. }
  3065. };
  3066. const onBeforeMount = createHook("bm");
  3067. const onMounted = createHook("m");
  3068. const onBeforeUpdate = createHook(
  3069. "bu"
  3070. );
  3071. const onUpdated = createHook("u");
  3072. const onBeforeUnmount = createHook(
  3073. "bum"
  3074. );
  3075. const onUnmounted = createHook("um");
  3076. const onServerPrefetch = createHook(
  3077. "sp"
  3078. );
  3079. const onRenderTriggered = createHook("rtg");
  3080. const onRenderTracked = createHook("rtc");
  3081. function onErrorCaptured(hook, target = currentInstance) {
  3082. injectHook("ec", hook, target);
  3083. }
  3084. const COMPONENTS = "components";
  3085. const DIRECTIVES = "directives";
  3086. function resolveComponent(name, maybeSelfReference) {
  3087. return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
  3088. }
  3089. const NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc");
  3090. function resolveDynamicComponent(component) {
  3091. if (shared.isString(component)) {
  3092. return resolveAsset(COMPONENTS, component, false) || component;
  3093. } else {
  3094. return component || NULL_DYNAMIC_COMPONENT;
  3095. }
  3096. }
  3097. function resolveDirective(name) {
  3098. return resolveAsset(DIRECTIVES, name);
  3099. }
  3100. function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
  3101. const instance = currentRenderingInstance || currentInstance;
  3102. if (instance) {
  3103. const Component = instance.type;
  3104. if (type === COMPONENTS) {
  3105. const selfName = getComponentName(
  3106. Component,
  3107. false
  3108. );
  3109. if (selfName && (selfName === name || selfName === shared.camelize(name) || selfName === shared.capitalize(shared.camelize(name)))) {
  3110. return Component;
  3111. }
  3112. }
  3113. const res = (
  3114. // local registration
  3115. // check instance[type] first which is resolved for options API
  3116. resolve(instance[type] || Component[type], name) || // global registration
  3117. resolve(instance.appContext[type], name)
  3118. );
  3119. if (!res && maybeSelfReference) {
  3120. return Component;
  3121. }
  3122. if (warnMissing && !res) {
  3123. const extra = type === COMPONENTS ? `
  3124. If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
  3125. warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
  3126. }
  3127. return res;
  3128. } else {
  3129. warn$1(
  3130. `resolve${shared.capitalize(type.slice(0, -1))} can only be used in render() or setup().`
  3131. );
  3132. }
  3133. }
  3134. function resolve(registry, name) {
  3135. return registry && (registry[name] || registry[shared.camelize(name)] || registry[shared.capitalize(shared.camelize(name))]);
  3136. }
  3137. function renderList(source, renderItem, cache, index) {
  3138. let ret;
  3139. const cached = cache && cache[index];
  3140. const sourceIsArray = shared.isArray(source);
  3141. if (sourceIsArray || shared.isString(source)) {
  3142. const sourceIsReactiveArray = sourceIsArray && reactivity.isReactive(source);
  3143. let needsWrap = false;
  3144. let isReadonlySource = false;
  3145. if (sourceIsReactiveArray) {
  3146. needsWrap = !reactivity.isShallow(source);
  3147. isReadonlySource = reactivity.isReadonly(source);
  3148. source = reactivity.shallowReadArray(source);
  3149. }
  3150. ret = new Array(source.length);
  3151. for (let i = 0, l = source.length; i < l; i++) {
  3152. ret[i] = renderItem(
  3153. needsWrap ? isReadonlySource ? reactivity.toReadonly(reactivity.toReactive(source[i])) : reactivity.toReactive(source[i]) : source[i],
  3154. i,
  3155. void 0,
  3156. cached && cached[i]
  3157. );
  3158. }
  3159. } else if (typeof source === "number") {
  3160. if (!Number.isInteger(source) || source < 0) {
  3161. warn$1(
  3162. `The v-for range expects a positive integer value but got ${source}.`
  3163. );
  3164. ret = [];
  3165. } else {
  3166. ret = new Array(source);
  3167. for (let i = 0; i < source; i++) {
  3168. ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
  3169. }
  3170. }
  3171. } else if (shared.isObject(source)) {
  3172. if (source[Symbol.iterator]) {
  3173. ret = Array.from(
  3174. source,
  3175. (item, i) => renderItem(item, i, void 0, cached && cached[i])
  3176. );
  3177. } else {
  3178. const keys = Object.keys(source);
  3179. ret = new Array(keys.length);
  3180. for (let i = 0, l = keys.length; i < l; i++) {
  3181. const key = keys[i];
  3182. ret[i] = renderItem(source[key], key, i, cached && cached[i]);
  3183. }
  3184. }
  3185. } else {
  3186. ret = [];
  3187. }
  3188. if (cache) {
  3189. cache[index] = ret;
  3190. }
  3191. return ret;
  3192. }
  3193. function createSlots(slots, dynamicSlots) {
  3194. for (let i = 0; i < dynamicSlots.length; i++) {
  3195. const slot = dynamicSlots[i];
  3196. if (shared.isArray(slot)) {
  3197. for (let j = 0; j < slot.length; j++) {
  3198. slots[slot[j].name] = slot[j].fn;
  3199. }
  3200. } else if (slot) {
  3201. slots[slot.name] = slot.key ? (...args) => {
  3202. const res = slot.fn(...args);
  3203. if (res) res.key = slot.key;
  3204. return res;
  3205. } : slot.fn;
  3206. }
  3207. }
  3208. return slots;
  3209. }
  3210. function renderSlot(slots, name, props = {}, fallback, noSlotted) {
  3211. if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
  3212. const hasProps = Object.keys(props).length > 0;
  3213. if (name !== "default") props.name = name;
  3214. return openBlock(), createBlock(
  3215. Fragment,
  3216. null,
  3217. [createVNode("slot", props, fallback && fallback())],
  3218. hasProps ? -2 : 64
  3219. );
  3220. }
  3221. let slot = slots[name];
  3222. if (slot && slot.length > 1) {
  3223. warn$1(
  3224. `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.`
  3225. );
  3226. slot = () => [];
  3227. }
  3228. if (slot && slot._c) {
  3229. slot._d = false;
  3230. }
  3231. openBlock();
  3232. const validSlotContent = slot && ensureValidVNode(slot(props));
  3233. const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
  3234. // key attached in the `createSlots` helper, respect that
  3235. validSlotContent && validSlotContent.key;
  3236. const rendered = createBlock(
  3237. Fragment,
  3238. {
  3239. key: (slotKey && !shared.isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
  3240. (!validSlotContent && fallback ? "_fb" : "")
  3241. },
  3242. validSlotContent || (fallback ? fallback() : []),
  3243. validSlotContent && slots._ === 1 ? 64 : -2
  3244. );
  3245. if (!noSlotted && rendered.scopeId) {
  3246. rendered.slotScopeIds = [rendered.scopeId + "-s"];
  3247. }
  3248. if (slot && slot._c) {
  3249. slot._d = true;
  3250. }
  3251. return rendered;
  3252. }
  3253. function ensureValidVNode(vnodes) {
  3254. return vnodes.some((child) => {
  3255. if (!isVNode(child)) return true;
  3256. if (child.type === Comment) return false;
  3257. if (child.type === Fragment && !ensureValidVNode(child.children))
  3258. return false;
  3259. return true;
  3260. }) ? vnodes : null;
  3261. }
  3262. function toHandlers(obj, preserveCaseIfNecessary) {
  3263. const ret = {};
  3264. if (!shared.isObject(obj)) {
  3265. warn$1(`v-on with no argument expects an object value.`);
  3266. return ret;
  3267. }
  3268. for (const key in obj) {
  3269. ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : shared.toHandlerKey(key)] = obj[key];
  3270. }
  3271. return ret;
  3272. }
  3273. const getPublicInstance = (i) => {
  3274. if (!i) return null;
  3275. if (isStatefulComponent(i)) return getComponentPublicInstance(i);
  3276. return getPublicInstance(i.parent);
  3277. };
  3278. const publicPropertiesMap = (
  3279. // Move PURE marker to new line to workaround compiler discarding it
  3280. // due to type annotation
  3281. /* @__PURE__ */ shared.extend(/* @__PURE__ */ Object.create(null), {
  3282. $: (i) => i,
  3283. $el: (i) => i.vnode.el,
  3284. $data: (i) => i.data,
  3285. $props: (i) => reactivity.shallowReadonly(i.props) ,
  3286. $attrs: (i) => reactivity.shallowReadonly(i.attrs) ,
  3287. $slots: (i) => reactivity.shallowReadonly(i.slots) ,
  3288. $refs: (i) => reactivity.shallowReadonly(i.refs) ,
  3289. $parent: (i) => getPublicInstance(i.parent),
  3290. $root: (i) => getPublicInstance(i.root),
  3291. $host: (i) => i.ce,
  3292. $emit: (i) => i.emit,
  3293. $options: (i) => resolveMergedOptions(i) ,
  3294. $forceUpdate: (i) => i.f || (i.f = () => {
  3295. queueJob(i.update);
  3296. }),
  3297. $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
  3298. $watch: (i) => instanceWatch.bind(i)
  3299. })
  3300. );
  3301. const isReservedPrefix = (key) => key === "_" || key === "$";
  3302. const hasSetupBinding = (state, key) => state !== shared.EMPTY_OBJ && !state.__isScriptSetup && shared.hasOwn(state, key);
  3303. const PublicInstanceProxyHandlers = {
  3304. get({ _: instance }, key) {
  3305. if (key === "__v_skip") {
  3306. return true;
  3307. }
  3308. const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
  3309. if (key === "__isVue") {
  3310. return true;
  3311. }
  3312. if (key[0] !== "$") {
  3313. const n = accessCache[key];
  3314. if (n !== void 0) {
  3315. switch (n) {
  3316. case 1 /* SETUP */:
  3317. return setupState[key];
  3318. case 2 /* DATA */:
  3319. return data[key];
  3320. case 4 /* CONTEXT */:
  3321. return ctx[key];
  3322. case 3 /* PROPS */:
  3323. return props[key];
  3324. }
  3325. } else if (hasSetupBinding(setupState, key)) {
  3326. accessCache[key] = 1 /* SETUP */;
  3327. return setupState[key];
  3328. } else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) {
  3329. accessCache[key] = 2 /* DATA */;
  3330. return data[key];
  3331. } else if (shared.hasOwn(props, key)) {
  3332. accessCache[key] = 3 /* PROPS */;
  3333. return props[key];
  3334. } else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) {
  3335. accessCache[key] = 4 /* CONTEXT */;
  3336. return ctx[key];
  3337. } else if (shouldCacheAccess) {
  3338. accessCache[key] = 0 /* OTHER */;
  3339. }
  3340. }
  3341. const publicGetter = publicPropertiesMap[key];
  3342. let cssModule, globalProperties;
  3343. if (publicGetter) {
  3344. if (key === "$attrs") {
  3345. reactivity.track(instance.attrs, "get", "");
  3346. markAttrsAccessed();
  3347. } else if (key === "$slots") {
  3348. reactivity.track(instance, "get", key);
  3349. }
  3350. return publicGetter(instance);
  3351. } else if (
  3352. // css module (injected by vue-loader)
  3353. (cssModule = type.__cssModules) && (cssModule = cssModule[key])
  3354. ) {
  3355. return cssModule;
  3356. } else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) {
  3357. accessCache[key] = 4 /* CONTEXT */;
  3358. return ctx[key];
  3359. } else if (
  3360. // global properties
  3361. globalProperties = appContext.config.globalProperties, shared.hasOwn(globalProperties, key)
  3362. ) {
  3363. {
  3364. return globalProperties[key];
  3365. }
  3366. } else if (currentRenderingInstance && (!shared.isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading
  3367. // to infinite warning loop
  3368. key.indexOf("__v") !== 0)) {
  3369. if (data !== shared.EMPTY_OBJ && isReservedPrefix(key[0]) && shared.hasOwn(data, key)) {
  3370. warn$1(
  3371. `Property ${JSON.stringify(
  3372. key
  3373. )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
  3374. );
  3375. } else if (instance === currentRenderingInstance) {
  3376. warn$1(
  3377. `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`
  3378. );
  3379. }
  3380. }
  3381. },
  3382. set({ _: instance }, key, value) {
  3383. const { data, setupState, ctx } = instance;
  3384. if (hasSetupBinding(setupState, key)) {
  3385. setupState[key] = value;
  3386. return true;
  3387. } else if (setupState.__isScriptSetup && shared.hasOwn(setupState, key)) {
  3388. warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
  3389. return false;
  3390. } else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) {
  3391. data[key] = value;
  3392. return true;
  3393. } else if (shared.hasOwn(instance.props, key)) {
  3394. warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
  3395. return false;
  3396. }
  3397. if (key[0] === "$" && key.slice(1) in instance) {
  3398. warn$1(
  3399. `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`
  3400. );
  3401. return false;
  3402. } else {
  3403. if (key in instance.appContext.config.globalProperties) {
  3404. Object.defineProperty(ctx, key, {
  3405. enumerable: true,
  3406. configurable: true,
  3407. value
  3408. });
  3409. } else {
  3410. ctx[key] = value;
  3411. }
  3412. }
  3413. return true;
  3414. },
  3415. has({
  3416. _: { data, setupState, accessCache, ctx, appContext, props, type }
  3417. }, key) {
  3418. let cssModules;
  3419. return !!(accessCache[key] || data !== shared.EMPTY_OBJ && key[0] !== "$" && shared.hasOwn(data, key) || hasSetupBinding(setupState, key) || shared.hasOwn(props, key) || shared.hasOwn(ctx, key) || shared.hasOwn(publicPropertiesMap, key) || shared.hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
  3420. },
  3421. defineProperty(target, key, descriptor) {
  3422. if (descriptor.get != null) {
  3423. target._.accessCache[key] = 0;
  3424. } else if (shared.hasOwn(descriptor, "value")) {
  3425. this.set(target, key, descriptor.value, null);
  3426. }
  3427. return Reflect.defineProperty(target, key, descriptor);
  3428. }
  3429. };
  3430. {
  3431. PublicInstanceProxyHandlers.ownKeys = (target) => {
  3432. warn$1(
  3433. `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`
  3434. );
  3435. return Reflect.ownKeys(target);
  3436. };
  3437. }
  3438. const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ shared.extend({}, PublicInstanceProxyHandlers, {
  3439. get(target, key) {
  3440. if (key === Symbol.unscopables) {
  3441. return;
  3442. }
  3443. return PublicInstanceProxyHandlers.get(target, key, target);
  3444. },
  3445. has(_, key) {
  3446. const has = key[0] !== "_" && !shared.isGloballyAllowed(key);
  3447. if (!has && PublicInstanceProxyHandlers.has(_, key)) {
  3448. warn$1(
  3449. `Property ${JSON.stringify(
  3450. key
  3451. )} should not start with _ which is a reserved prefix for Vue internals.`
  3452. );
  3453. }
  3454. return has;
  3455. }
  3456. });
  3457. function createDevRenderContext(instance) {
  3458. const target = {};
  3459. Object.defineProperty(target, `_`, {
  3460. configurable: true,
  3461. enumerable: false,
  3462. get: () => instance
  3463. });
  3464. Object.keys(publicPropertiesMap).forEach((key) => {
  3465. Object.defineProperty(target, key, {
  3466. configurable: true,
  3467. enumerable: false,
  3468. get: () => publicPropertiesMap[key](instance),
  3469. // intercepted by the proxy so no need for implementation,
  3470. // but needed to prevent set errors
  3471. set: shared.NOOP
  3472. });
  3473. });
  3474. return target;
  3475. }
  3476. function exposePropsOnRenderContext(instance) {
  3477. const {
  3478. ctx,
  3479. propsOptions: [propsOptions]
  3480. } = instance;
  3481. if (propsOptions) {
  3482. Object.keys(propsOptions).forEach((key) => {
  3483. Object.defineProperty(ctx, key, {
  3484. enumerable: true,
  3485. configurable: true,
  3486. get: () => instance.props[key],
  3487. set: shared.NOOP
  3488. });
  3489. });
  3490. }
  3491. }
  3492. function exposeSetupStateOnRenderContext(instance) {
  3493. const { ctx, setupState } = instance;
  3494. Object.keys(reactivity.toRaw(setupState)).forEach((key) => {
  3495. if (!setupState.__isScriptSetup) {
  3496. if (isReservedPrefix(key[0])) {
  3497. warn$1(
  3498. `setup() return property ${JSON.stringify(
  3499. key
  3500. )} should not start with "$" or "_" which are reserved prefixes for Vue internals.`
  3501. );
  3502. return;
  3503. }
  3504. Object.defineProperty(ctx, key, {
  3505. enumerable: true,
  3506. configurable: true,
  3507. get: () => setupState[key],
  3508. set: shared.NOOP
  3509. });
  3510. }
  3511. });
  3512. }
  3513. const warnRuntimeUsage = (method) => warn$1(
  3514. `${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.`
  3515. );
  3516. function defineProps() {
  3517. {
  3518. warnRuntimeUsage(`defineProps`);
  3519. }
  3520. return null;
  3521. }
  3522. function defineEmits() {
  3523. {
  3524. warnRuntimeUsage(`defineEmits`);
  3525. }
  3526. return null;
  3527. }
  3528. function defineExpose(exposed) {
  3529. {
  3530. warnRuntimeUsage(`defineExpose`);
  3531. }
  3532. }
  3533. function defineOptions(options) {
  3534. {
  3535. warnRuntimeUsage(`defineOptions`);
  3536. }
  3537. }
  3538. function defineSlots() {
  3539. {
  3540. warnRuntimeUsage(`defineSlots`);
  3541. }
  3542. return null;
  3543. }
  3544. function defineModel() {
  3545. {
  3546. warnRuntimeUsage("defineModel");
  3547. }
  3548. }
  3549. function withDefaults(props, defaults) {
  3550. {
  3551. warnRuntimeUsage(`withDefaults`);
  3552. }
  3553. return null;
  3554. }
  3555. function useSlots() {
  3556. return getContext("useSlots").slots;
  3557. }
  3558. function useAttrs() {
  3559. return getContext("useAttrs").attrs;
  3560. }
  3561. function getContext(calledFunctionName) {
  3562. const i = getCurrentInstance();
  3563. if (!i) {
  3564. warn$1(`${calledFunctionName}() called without active instance.`);
  3565. }
  3566. return i.setupContext || (i.setupContext = createSetupContext(i));
  3567. }
  3568. function normalizePropsOrEmits(props) {
  3569. return shared.isArray(props) ? props.reduce(
  3570. (normalized, p) => (normalized[p] = null, normalized),
  3571. {}
  3572. ) : props;
  3573. }
  3574. function mergeDefaults(raw, defaults) {
  3575. const props = normalizePropsOrEmits(raw);
  3576. for (const key in defaults) {
  3577. if (key.startsWith("__skip")) continue;
  3578. let opt = props[key];
  3579. if (opt) {
  3580. if (shared.isArray(opt) || shared.isFunction(opt)) {
  3581. opt = props[key] = { type: opt, default: defaults[key] };
  3582. } else {
  3583. opt.default = defaults[key];
  3584. }
  3585. } else if (opt === null) {
  3586. opt = props[key] = { default: defaults[key] };
  3587. } else {
  3588. warn$1(`props default key "${key}" has no corresponding declaration.`);
  3589. }
  3590. if (opt && defaults[`__skip_${key}`]) {
  3591. opt.skipFactory = true;
  3592. }
  3593. }
  3594. return props;
  3595. }
  3596. function mergeModels(a, b) {
  3597. if (!a || !b) return a || b;
  3598. if (shared.isArray(a) && shared.isArray(b)) return a.concat(b);
  3599. return shared.extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
  3600. }
  3601. function createPropsRestProxy(props, excludedKeys) {
  3602. const ret = {};
  3603. for (const key in props) {
  3604. if (!excludedKeys.includes(key)) {
  3605. Object.defineProperty(ret, key, {
  3606. enumerable: true,
  3607. get: () => props[key]
  3608. });
  3609. }
  3610. }
  3611. return ret;
  3612. }
  3613. function withAsyncContext(getAwaitable) {
  3614. const ctx = getCurrentInstance();
  3615. const inSSRSetup = isInSSRComponentSetup;
  3616. if (!ctx) {
  3617. warn$1(
  3618. `withAsyncContext called without active current instance. This is likely a bug.`
  3619. );
  3620. }
  3621. let awaitable = getAwaitable();
  3622. unsetCurrentInstance();
  3623. if (inSSRSetup) {
  3624. setInSSRSetupState(false);
  3625. }
  3626. const restore = () => {
  3627. setCurrentInstance(ctx);
  3628. if (inSSRSetup) {
  3629. setInSSRSetupState(true);
  3630. }
  3631. };
  3632. const cleanup = () => {
  3633. if (getCurrentInstance() !== ctx) ctx.scope.off();
  3634. unsetCurrentInstance();
  3635. if (inSSRSetup) {
  3636. setInSSRSetupState(false);
  3637. }
  3638. };
  3639. if (shared.isPromise(awaitable)) {
  3640. awaitable = awaitable.catch((e) => {
  3641. restore();
  3642. Promise.resolve().then(() => Promise.resolve().then(cleanup));
  3643. throw e;
  3644. });
  3645. }
  3646. return [
  3647. awaitable,
  3648. () => {
  3649. restore();
  3650. Promise.resolve().then(cleanup);
  3651. }
  3652. ];
  3653. }
  3654. function createDuplicateChecker() {
  3655. const cache = /* @__PURE__ */ Object.create(null);
  3656. return (type, key) => {
  3657. if (cache[key]) {
  3658. warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`);
  3659. } else {
  3660. cache[key] = type;
  3661. }
  3662. };
  3663. }
  3664. let shouldCacheAccess = true;
  3665. function applyOptions(instance) {
  3666. const options = resolveMergedOptions(instance);
  3667. const publicThis = instance.proxy;
  3668. const ctx = instance.ctx;
  3669. shouldCacheAccess = false;
  3670. if (options.beforeCreate) {
  3671. callHook(options.beforeCreate, instance, "bc");
  3672. }
  3673. const {
  3674. // state
  3675. data: dataOptions,
  3676. computed: computedOptions,
  3677. methods,
  3678. watch: watchOptions,
  3679. provide: provideOptions,
  3680. inject: injectOptions,
  3681. // lifecycle
  3682. created,
  3683. beforeMount,
  3684. mounted,
  3685. beforeUpdate,
  3686. updated,
  3687. activated,
  3688. deactivated,
  3689. beforeDestroy,
  3690. beforeUnmount,
  3691. destroyed,
  3692. unmounted,
  3693. render,
  3694. renderTracked,
  3695. renderTriggered,
  3696. errorCaptured,
  3697. serverPrefetch,
  3698. // public API
  3699. expose,
  3700. inheritAttrs,
  3701. // assets
  3702. components,
  3703. directives,
  3704. filters
  3705. } = options;
  3706. const checkDuplicateProperties = createDuplicateChecker() ;
  3707. {
  3708. const [propsOptions] = instance.propsOptions;
  3709. if (propsOptions) {
  3710. for (const key in propsOptions) {
  3711. checkDuplicateProperties("Props" /* PROPS */, key);
  3712. }
  3713. }
  3714. }
  3715. if (injectOptions) {
  3716. resolveInjections(injectOptions, ctx, checkDuplicateProperties);
  3717. }
  3718. if (methods) {
  3719. for (const key in methods) {
  3720. const methodHandler = methods[key];
  3721. if (shared.isFunction(methodHandler)) {
  3722. {
  3723. Object.defineProperty(ctx, key, {
  3724. value: methodHandler.bind(publicThis),
  3725. configurable: true,
  3726. enumerable: true,
  3727. writable: true
  3728. });
  3729. }
  3730. {
  3731. checkDuplicateProperties("Methods" /* METHODS */, key);
  3732. }
  3733. } else {
  3734. warn$1(
  3735. `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`
  3736. );
  3737. }
  3738. }
  3739. }
  3740. if (dataOptions) {
  3741. if (!shared.isFunction(dataOptions)) {
  3742. warn$1(
  3743. `The data option must be a function. Plain object usage is no longer supported.`
  3744. );
  3745. }
  3746. const data = dataOptions.call(publicThis, publicThis);
  3747. if (shared.isPromise(data)) {
  3748. warn$1(
  3749. `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`
  3750. );
  3751. }
  3752. if (!shared.isObject(data)) {
  3753. warn$1(`data() should return an object.`);
  3754. } else {
  3755. instance.data = reactivity.reactive(data);
  3756. {
  3757. for (const key in data) {
  3758. checkDuplicateProperties("Data" /* DATA */, key);
  3759. if (!isReservedPrefix(key[0])) {
  3760. Object.defineProperty(ctx, key, {
  3761. configurable: true,
  3762. enumerable: true,
  3763. get: () => data[key],
  3764. set: shared.NOOP
  3765. });
  3766. }
  3767. }
  3768. }
  3769. }
  3770. }
  3771. shouldCacheAccess = true;
  3772. if (computedOptions) {
  3773. for (const key in computedOptions) {
  3774. const opt = computedOptions[key];
  3775. const get = shared.isFunction(opt) ? opt.bind(publicThis, publicThis) : shared.isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : shared.NOOP;
  3776. if (get === shared.NOOP) {
  3777. warn$1(`Computed property "${key}" has no getter.`);
  3778. }
  3779. const set = !shared.isFunction(opt) && shared.isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
  3780. warn$1(
  3781. `Write operation failed: computed property "${key}" is readonly.`
  3782. );
  3783. } ;
  3784. const c = computed({
  3785. get,
  3786. set
  3787. });
  3788. Object.defineProperty(ctx, key, {
  3789. enumerable: true,
  3790. configurable: true,
  3791. get: () => c.value,
  3792. set: (v) => c.value = v
  3793. });
  3794. {
  3795. checkDuplicateProperties("Computed" /* COMPUTED */, key);
  3796. }
  3797. }
  3798. }
  3799. if (watchOptions) {
  3800. for (const key in watchOptions) {
  3801. createWatcher(watchOptions[key], ctx, publicThis, key);
  3802. }
  3803. }
  3804. if (provideOptions) {
  3805. const provides = shared.isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
  3806. Reflect.ownKeys(provides).forEach((key) => {
  3807. provide(key, provides[key]);
  3808. });
  3809. }
  3810. if (created) {
  3811. callHook(created, instance, "c");
  3812. }
  3813. function registerLifecycleHook(register, hook) {
  3814. if (shared.isArray(hook)) {
  3815. hook.forEach((_hook) => register(_hook.bind(publicThis)));
  3816. } else if (hook) {
  3817. register(hook.bind(publicThis));
  3818. }
  3819. }
  3820. registerLifecycleHook(onBeforeMount, beforeMount);
  3821. registerLifecycleHook(onMounted, mounted);
  3822. registerLifecycleHook(onBeforeUpdate, beforeUpdate);
  3823. registerLifecycleHook(onUpdated, updated);
  3824. registerLifecycleHook(onActivated, activated);
  3825. registerLifecycleHook(onDeactivated, deactivated);
  3826. registerLifecycleHook(onErrorCaptured, errorCaptured);
  3827. registerLifecycleHook(onRenderTracked, renderTracked);
  3828. registerLifecycleHook(onRenderTriggered, renderTriggered);
  3829. registerLifecycleHook(onBeforeUnmount, beforeUnmount);
  3830. registerLifecycleHook(onUnmounted, unmounted);
  3831. registerLifecycleHook(onServerPrefetch, serverPrefetch);
  3832. if (shared.isArray(expose)) {
  3833. if (expose.length) {
  3834. const exposed = instance.exposed || (instance.exposed = {});
  3835. expose.forEach((key) => {
  3836. Object.defineProperty(exposed, key, {
  3837. get: () => publicThis[key],
  3838. set: (val) => publicThis[key] = val,
  3839. enumerable: true
  3840. });
  3841. });
  3842. } else if (!instance.exposed) {
  3843. instance.exposed = {};
  3844. }
  3845. }
  3846. if (render && instance.render === shared.NOOP) {
  3847. instance.render = render;
  3848. }
  3849. if (inheritAttrs != null) {
  3850. instance.inheritAttrs = inheritAttrs;
  3851. }
  3852. if (components) instance.components = components;
  3853. if (directives) instance.directives = directives;
  3854. if (serverPrefetch) {
  3855. markAsyncBoundary(instance);
  3856. }
  3857. }
  3858. function resolveInjections(injectOptions, ctx, checkDuplicateProperties = shared.NOOP) {
  3859. if (shared.isArray(injectOptions)) {
  3860. injectOptions = normalizeInject(injectOptions);
  3861. }
  3862. for (const key in injectOptions) {
  3863. const opt = injectOptions[key];
  3864. let injected;
  3865. if (shared.isObject(opt)) {
  3866. if ("default" in opt) {
  3867. injected = inject(
  3868. opt.from || key,
  3869. opt.default,
  3870. true
  3871. );
  3872. } else {
  3873. injected = inject(opt.from || key);
  3874. }
  3875. } else {
  3876. injected = inject(opt);
  3877. }
  3878. if (reactivity.isRef(injected)) {
  3879. Object.defineProperty(ctx, key, {
  3880. enumerable: true,
  3881. configurable: true,
  3882. get: () => injected.value,
  3883. set: (v) => injected.value = v
  3884. });
  3885. } else {
  3886. ctx[key] = injected;
  3887. }
  3888. {
  3889. checkDuplicateProperties("Inject" /* INJECT */, key);
  3890. }
  3891. }
  3892. }
  3893. function callHook(hook, instance, type) {
  3894. callWithAsyncErrorHandling(
  3895. shared.isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy),
  3896. instance,
  3897. type
  3898. );
  3899. }
  3900. function createWatcher(raw, ctx, publicThis, key) {
  3901. let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  3902. if (shared.isString(raw)) {
  3903. const handler = ctx[raw];
  3904. if (shared.isFunction(handler)) {
  3905. {
  3906. watch(getter, handler);
  3907. }
  3908. } else {
  3909. warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
  3910. }
  3911. } else if (shared.isFunction(raw)) {
  3912. {
  3913. watch(getter, raw.bind(publicThis));
  3914. }
  3915. } else if (shared.isObject(raw)) {
  3916. if (shared.isArray(raw)) {
  3917. raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
  3918. } else {
  3919. const handler = shared.isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
  3920. if (shared.isFunction(handler)) {
  3921. watch(getter, handler, raw);
  3922. } else {
  3923. warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
  3924. }
  3925. }
  3926. } else {
  3927. warn$1(`Invalid watch option: "${key}"`, raw);
  3928. }
  3929. }
  3930. function resolveMergedOptions(instance) {
  3931. const base = instance.type;
  3932. const { mixins, extends: extendsOptions } = base;
  3933. const {
  3934. mixins: globalMixins,
  3935. optionsCache: cache,
  3936. config: { optionMergeStrategies }
  3937. } = instance.appContext;
  3938. const cached = cache.get(base);
  3939. let resolved;
  3940. if (cached) {
  3941. resolved = cached;
  3942. } else if (!globalMixins.length && !mixins && !extendsOptions) {
  3943. {
  3944. resolved = base;
  3945. }
  3946. } else {
  3947. resolved = {};
  3948. if (globalMixins.length) {
  3949. globalMixins.forEach(
  3950. (m) => mergeOptions(resolved, m, optionMergeStrategies, true)
  3951. );
  3952. }
  3953. mergeOptions(resolved, base, optionMergeStrategies);
  3954. }
  3955. if (shared.isObject(base)) {
  3956. cache.set(base, resolved);
  3957. }
  3958. return resolved;
  3959. }
  3960. function mergeOptions(to, from, strats, asMixin = false) {
  3961. const { mixins, extends: extendsOptions } = from;
  3962. if (extendsOptions) {
  3963. mergeOptions(to, extendsOptions, strats, true);
  3964. }
  3965. if (mixins) {
  3966. mixins.forEach(
  3967. (m) => mergeOptions(to, m, strats, true)
  3968. );
  3969. }
  3970. for (const key in from) {
  3971. if (asMixin && key === "expose") {
  3972. warn$1(
  3973. `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`
  3974. );
  3975. } else {
  3976. const strat = internalOptionMergeStrats[key] || strats && strats[key];
  3977. to[key] = strat ? strat(to[key], from[key]) : from[key];
  3978. }
  3979. }
  3980. return to;
  3981. }
  3982. const internalOptionMergeStrats = {
  3983. data: mergeDataFn,
  3984. props: mergeEmitsOrPropsOptions,
  3985. emits: mergeEmitsOrPropsOptions,
  3986. // objects
  3987. methods: mergeObjectOptions,
  3988. computed: mergeObjectOptions,
  3989. // lifecycle
  3990. beforeCreate: mergeAsArray,
  3991. created: mergeAsArray,
  3992. beforeMount: mergeAsArray,
  3993. mounted: mergeAsArray,
  3994. beforeUpdate: mergeAsArray,
  3995. updated: mergeAsArray,
  3996. beforeDestroy: mergeAsArray,
  3997. beforeUnmount: mergeAsArray,
  3998. destroyed: mergeAsArray,
  3999. unmounted: mergeAsArray,
  4000. activated: mergeAsArray,
  4001. deactivated: mergeAsArray,
  4002. errorCaptured: mergeAsArray,
  4003. serverPrefetch: mergeAsArray,
  4004. // assets
  4005. components: mergeObjectOptions,
  4006. directives: mergeObjectOptions,
  4007. // watch
  4008. watch: mergeWatchOptions,
  4009. // provide / inject
  4010. provide: mergeDataFn,
  4011. inject: mergeInject
  4012. };
  4013. function mergeDataFn(to, from) {
  4014. if (!from) {
  4015. return to;
  4016. }
  4017. if (!to) {
  4018. return from;
  4019. }
  4020. return function mergedDataFn() {
  4021. return (shared.extend)(
  4022. shared.isFunction(to) ? to.call(this, this) : to,
  4023. shared.isFunction(from) ? from.call(this, this) : from
  4024. );
  4025. };
  4026. }
  4027. function mergeInject(to, from) {
  4028. return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
  4029. }
  4030. function normalizeInject(raw) {
  4031. if (shared.isArray(raw)) {
  4032. const res = {};
  4033. for (let i = 0; i < raw.length; i++) {
  4034. res[raw[i]] = raw[i];
  4035. }
  4036. return res;
  4037. }
  4038. return raw;
  4039. }
  4040. function mergeAsArray(to, from) {
  4041. return to ? [...new Set([].concat(to, from))] : from;
  4042. }
  4043. function mergeObjectOptions(to, from) {
  4044. return to ? shared.extend(/* @__PURE__ */ Object.create(null), to, from) : from;
  4045. }
  4046. function mergeEmitsOrPropsOptions(to, from) {
  4047. if (to) {
  4048. if (shared.isArray(to) && shared.isArray(from)) {
  4049. return [.../* @__PURE__ */ new Set([...to, ...from])];
  4050. }
  4051. return shared.extend(
  4052. /* @__PURE__ */ Object.create(null),
  4053. normalizePropsOrEmits(to),
  4054. normalizePropsOrEmits(from != null ? from : {})
  4055. );
  4056. } else {
  4057. return from;
  4058. }
  4059. }
  4060. function mergeWatchOptions(to, from) {
  4061. if (!to) return from;
  4062. if (!from) return to;
  4063. const merged = shared.extend(/* @__PURE__ */ Object.create(null), to);
  4064. for (const key in from) {
  4065. merged[key] = mergeAsArray(to[key], from[key]);
  4066. }
  4067. return merged;
  4068. }
  4069. function createAppContext() {
  4070. return {
  4071. app: null,
  4072. config: {
  4073. isNativeTag: shared.NO,
  4074. performance: false,
  4075. globalProperties: {},
  4076. optionMergeStrategies: {},
  4077. errorHandler: void 0,
  4078. warnHandler: void 0,
  4079. compilerOptions: {}
  4080. },
  4081. mixins: [],
  4082. components: {},
  4083. directives: {},
  4084. provides: /* @__PURE__ */ Object.create(null),
  4085. optionsCache: /* @__PURE__ */ new WeakMap(),
  4086. propsCache: /* @__PURE__ */ new WeakMap(),
  4087. emitsCache: /* @__PURE__ */ new WeakMap()
  4088. };
  4089. }
  4090. let uid$1 = 0;
  4091. function createAppAPI(render, hydrate) {
  4092. return function createApp(rootComponent, rootProps = null) {
  4093. if (!shared.isFunction(rootComponent)) {
  4094. rootComponent = shared.extend({}, rootComponent);
  4095. }
  4096. if (rootProps != null && !shared.isObject(rootProps)) {
  4097. warn$1(`root props passed to app.mount() must be an object.`);
  4098. rootProps = null;
  4099. }
  4100. const context = createAppContext();
  4101. const installedPlugins = /* @__PURE__ */ new WeakSet();
  4102. const pluginCleanupFns = [];
  4103. let isMounted = false;
  4104. const app = context.app = {
  4105. _uid: uid$1++,
  4106. _component: rootComponent,
  4107. _props: rootProps,
  4108. _container: null,
  4109. _context: context,
  4110. _instance: null,
  4111. version,
  4112. get config() {
  4113. return context.config;
  4114. },
  4115. set config(v) {
  4116. {
  4117. warn$1(
  4118. `app.config cannot be replaced. Modify individual options instead.`
  4119. );
  4120. }
  4121. },
  4122. use(plugin, ...options) {
  4123. if (installedPlugins.has(plugin)) {
  4124. warn$1(`Plugin has already been applied to target app.`);
  4125. } else if (plugin && shared.isFunction(plugin.install)) {
  4126. installedPlugins.add(plugin);
  4127. plugin.install(app, ...options);
  4128. } else if (shared.isFunction(plugin)) {
  4129. installedPlugins.add(plugin);
  4130. plugin(app, ...options);
  4131. } else {
  4132. warn$1(
  4133. `A plugin must either be a function or an object with an "install" function.`
  4134. );
  4135. }
  4136. return app;
  4137. },
  4138. mixin(mixin) {
  4139. {
  4140. if (!context.mixins.includes(mixin)) {
  4141. context.mixins.push(mixin);
  4142. } else {
  4143. warn$1(
  4144. "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
  4145. );
  4146. }
  4147. }
  4148. return app;
  4149. },
  4150. component(name, component) {
  4151. {
  4152. validateComponentName(name, context.config);
  4153. }
  4154. if (!component) {
  4155. return context.components[name];
  4156. }
  4157. if (context.components[name]) {
  4158. warn$1(`Component "${name}" has already been registered in target app.`);
  4159. }
  4160. context.components[name] = component;
  4161. return app;
  4162. },
  4163. directive(name, directive) {
  4164. {
  4165. validateDirectiveName(name);
  4166. }
  4167. if (!directive) {
  4168. return context.directives[name];
  4169. }
  4170. if (context.directives[name]) {
  4171. warn$1(`Directive "${name}" has already been registered in target app.`);
  4172. }
  4173. context.directives[name] = directive;
  4174. return app;
  4175. },
  4176. mount(rootContainer, isHydrate, namespace) {
  4177. if (!isMounted) {
  4178. if (rootContainer.__vue_app__) {
  4179. warn$1(
  4180. `There is already an app instance mounted on the host container.
  4181. If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
  4182. );
  4183. }
  4184. const vnode = app._ceVNode || createVNode(rootComponent, rootProps);
  4185. vnode.appContext = context;
  4186. if (namespace === true) {
  4187. namespace = "svg";
  4188. } else if (namespace === false) {
  4189. namespace = void 0;
  4190. }
  4191. {
  4192. context.reload = () => {
  4193. const cloned = cloneVNode(vnode);
  4194. cloned.el = null;
  4195. render(cloned, rootContainer, namespace);
  4196. };
  4197. }
  4198. if (isHydrate && hydrate) {
  4199. hydrate(vnode, rootContainer);
  4200. } else {
  4201. render(vnode, rootContainer, namespace);
  4202. }
  4203. isMounted = true;
  4204. app._container = rootContainer;
  4205. rootContainer.__vue_app__ = app;
  4206. {
  4207. app._instance = vnode.component;
  4208. devtoolsInitApp(app, version);
  4209. }
  4210. return getComponentPublicInstance(vnode.component);
  4211. } else {
  4212. warn$1(
  4213. `App has already been mounted.
  4214. If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\``
  4215. );
  4216. }
  4217. },
  4218. onUnmount(cleanupFn) {
  4219. if (typeof cleanupFn !== "function") {
  4220. warn$1(
  4221. `Expected function as first argument to app.onUnmount(), but got ${typeof cleanupFn}`
  4222. );
  4223. }
  4224. pluginCleanupFns.push(cleanupFn);
  4225. },
  4226. unmount() {
  4227. if (isMounted) {
  4228. callWithAsyncErrorHandling(
  4229. pluginCleanupFns,
  4230. app._instance,
  4231. 16
  4232. );
  4233. render(null, app._container);
  4234. {
  4235. app._instance = null;
  4236. devtoolsUnmountApp(app);
  4237. }
  4238. delete app._container.__vue_app__;
  4239. } else {
  4240. warn$1(`Cannot unmount an app that is not mounted.`);
  4241. }
  4242. },
  4243. provide(key, value) {
  4244. if (key in context.provides) {
  4245. if (shared.hasOwn(context.provides, key)) {
  4246. warn$1(
  4247. `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
  4248. );
  4249. } else {
  4250. warn$1(
  4251. `App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`
  4252. );
  4253. }
  4254. }
  4255. context.provides[key] = value;
  4256. return app;
  4257. },
  4258. runWithContext(fn) {
  4259. const lastApp = currentApp;
  4260. currentApp = app;
  4261. try {
  4262. return fn();
  4263. } finally {
  4264. currentApp = lastApp;
  4265. }
  4266. }
  4267. };
  4268. return app;
  4269. };
  4270. }
  4271. let currentApp = null;
  4272. function useModel(props, name, options = shared.EMPTY_OBJ) {
  4273. const i = getCurrentInstance();
  4274. if (!i) {
  4275. warn$1(`useModel() called without active instance.`);
  4276. return reactivity.ref();
  4277. }
  4278. const camelizedName = shared.camelize(name);
  4279. if (!i.propsOptions[0][camelizedName]) {
  4280. warn$1(`useModel() called with prop "${name}" which is not declared.`);
  4281. return reactivity.ref();
  4282. }
  4283. const hyphenatedName = shared.hyphenate(name);
  4284. const modifiers = getModelModifiers(props, camelizedName);
  4285. const res = reactivity.customRef((track, trigger) => {
  4286. let localValue;
  4287. let prevSetValue = shared.EMPTY_OBJ;
  4288. let prevEmittedValue;
  4289. watchSyncEffect(() => {
  4290. const propValue = props[camelizedName];
  4291. if (shared.hasChanged(localValue, propValue)) {
  4292. localValue = propValue;
  4293. trigger();
  4294. }
  4295. });
  4296. return {
  4297. get() {
  4298. track();
  4299. return options.get ? options.get(localValue) : localValue;
  4300. },
  4301. set(value) {
  4302. const emittedValue = options.set ? options.set(value) : value;
  4303. if (!shared.hasChanged(emittedValue, localValue) && !(prevSetValue !== shared.EMPTY_OBJ && shared.hasChanged(value, prevSetValue))) {
  4304. return;
  4305. }
  4306. const rawProps = i.vnode.props;
  4307. const hasVModel = !!(rawProps && // check if parent has passed v-model
  4308. (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps));
  4309. if (!hasVModel) {
  4310. localValue = value;
  4311. trigger();
  4312. }
  4313. i.emit(`update:${name}`, emittedValue);
  4314. if (shared.hasChanged(value, prevSetValue) && (shared.hasChanged(value, emittedValue) && !shared.hasChanged(emittedValue, prevEmittedValue) || // #13524: browsers differ in when they flush microtasks between
  4315. // event listeners. If a v-model listener emits an intermediate value
  4316. // and a following listener restores the model to its previous prop
  4317. // value before parent updates are flushed, the parent render can be
  4318. // deduped as having no prop change. Force a local update so DOM state
  4319. // such as an input's value is synchronized back to the current model.
  4320. hasVModel && prevSetValue !== shared.EMPTY_OBJ && !shared.hasChanged(emittedValue, localValue))) {
  4321. trigger();
  4322. }
  4323. prevSetValue = value;
  4324. prevEmittedValue = emittedValue;
  4325. }
  4326. };
  4327. });
  4328. res[Symbol.iterator] = () => {
  4329. let i2 = 0;
  4330. return {
  4331. next() {
  4332. if (i2 < 2) {
  4333. return { value: i2++ ? modifiers || shared.EMPTY_OBJ : res, done: false };
  4334. } else {
  4335. return { done: true };
  4336. }
  4337. }
  4338. };
  4339. };
  4340. return res;
  4341. }
  4342. const getModelModifiers = (props, modelName) => {
  4343. return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${shared.camelize(modelName)}Modifiers`] || props[`${shared.hyphenate(modelName)}Modifiers`];
  4344. };
  4345. function emit(instance, event, ...rawArgs) {
  4346. if (instance.isUnmounted) return;
  4347. const props = instance.vnode.props || shared.EMPTY_OBJ;
  4348. {
  4349. const {
  4350. emitsOptions,
  4351. propsOptions: [propsOptions]
  4352. } = instance;
  4353. if (emitsOptions) {
  4354. if (!(event in emitsOptions) && true) {
  4355. if (!propsOptions || !(shared.toHandlerKey(shared.camelize(event)) in propsOptions)) {
  4356. warn$1(
  4357. `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${shared.toHandlerKey(shared.camelize(event))}" prop.`
  4358. );
  4359. }
  4360. } else {
  4361. const validator = emitsOptions[event];
  4362. if (shared.isFunction(validator)) {
  4363. const isValid = validator(...rawArgs);
  4364. if (!isValid) {
  4365. warn$1(
  4366. `Invalid event arguments: event validation failed for event "${event}".`
  4367. );
  4368. }
  4369. }
  4370. }
  4371. }
  4372. }
  4373. let args = rawArgs;
  4374. const isModelListener = event.startsWith("update:");
  4375. const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
  4376. if (modifiers) {
  4377. if (modifiers.trim) {
  4378. args = rawArgs.map((a) => shared.isString(a) ? a.trim() : a);
  4379. }
  4380. if (modifiers.number) {
  4381. args = rawArgs.map(shared.looseToNumber);
  4382. }
  4383. }
  4384. {
  4385. devtoolsComponentEmit(instance, event, args);
  4386. }
  4387. {
  4388. const lowerCaseEvent = event.toLowerCase();
  4389. if (lowerCaseEvent !== event && props[shared.toHandlerKey(lowerCaseEvent)]) {
  4390. warn$1(
  4391. `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
  4392. instance,
  4393. instance.type
  4394. )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${shared.hyphenate(
  4395. event
  4396. )}" instead of "${event}".`
  4397. );
  4398. }
  4399. }
  4400. let handlerName;
  4401. let handler = props[handlerName = shared.toHandlerKey(event)] || // also try camelCase event handler (#2249)
  4402. props[handlerName = shared.toHandlerKey(shared.camelize(event))];
  4403. if (!handler && isModelListener) {
  4404. handler = props[handlerName = shared.toHandlerKey(shared.hyphenate(event))];
  4405. }
  4406. if (handler) {
  4407. callWithAsyncErrorHandling(
  4408. handler,
  4409. instance,
  4410. 6,
  4411. args
  4412. );
  4413. }
  4414. const onceHandler = props[handlerName + `Once`];
  4415. if (onceHandler) {
  4416. if (!instance.emitted) {
  4417. instance.emitted = {};
  4418. } else if (instance.emitted[handlerName]) {
  4419. return;
  4420. }
  4421. instance.emitted[handlerName] = true;
  4422. callWithAsyncErrorHandling(
  4423. onceHandler,
  4424. instance,
  4425. 6,
  4426. args
  4427. );
  4428. }
  4429. }
  4430. const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
  4431. function normalizeEmitsOptions(comp, appContext, asMixin = false) {
  4432. const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
  4433. const cached = cache.get(comp);
  4434. if (cached !== void 0) {
  4435. return cached;
  4436. }
  4437. const raw = comp.emits;
  4438. let normalized = {};
  4439. let hasExtends = false;
  4440. if (!shared.isFunction(comp)) {
  4441. const extendEmits = (raw2) => {
  4442. const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
  4443. if (normalizedFromExtend) {
  4444. hasExtends = true;
  4445. shared.extend(normalized, normalizedFromExtend);
  4446. }
  4447. };
  4448. if (!asMixin && appContext.mixins.length) {
  4449. appContext.mixins.forEach(extendEmits);
  4450. }
  4451. if (comp.extends) {
  4452. extendEmits(comp.extends);
  4453. }
  4454. if (comp.mixins) {
  4455. comp.mixins.forEach(extendEmits);
  4456. }
  4457. }
  4458. if (!raw && !hasExtends) {
  4459. if (shared.isObject(comp)) {
  4460. cache.set(comp, null);
  4461. }
  4462. return null;
  4463. }
  4464. if (shared.isArray(raw)) {
  4465. raw.forEach((key) => normalized[key] = null);
  4466. } else {
  4467. shared.extend(normalized, raw);
  4468. }
  4469. if (shared.isObject(comp)) {
  4470. cache.set(comp, normalized);
  4471. }
  4472. return normalized;
  4473. }
  4474. function isEmitListener(options, key) {
  4475. if (!options || !shared.isOn(key)) {
  4476. return false;
  4477. }
  4478. key = key.slice(2).replace(/Once$/, "");
  4479. return shared.hasOwn(options, key[0].toLowerCase() + key.slice(1)) || shared.hasOwn(options, shared.hyphenate(key)) || shared.hasOwn(options, key);
  4480. }
  4481. let accessedAttrs = false;
  4482. function markAttrsAccessed() {
  4483. accessedAttrs = true;
  4484. }
  4485. function renderComponentRoot(instance) {
  4486. const {
  4487. type: Component,
  4488. vnode,
  4489. proxy,
  4490. withProxy,
  4491. propsOptions: [propsOptions],
  4492. slots,
  4493. attrs,
  4494. emit,
  4495. render,
  4496. renderCache,
  4497. props,
  4498. data,
  4499. setupState,
  4500. ctx,
  4501. inheritAttrs
  4502. } = instance;
  4503. const prev = setCurrentRenderingInstance(instance);
  4504. let result;
  4505. let fallthroughAttrs;
  4506. {
  4507. accessedAttrs = false;
  4508. }
  4509. try {
  4510. if (vnode.shapeFlag & 4) {
  4511. const proxyToUse = withProxy || proxy;
  4512. const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
  4513. get(target, key, receiver) {
  4514. warn$1(
  4515. `Property '${String(
  4516. key
  4517. )}' was accessed via 'this'. Avoid using 'this' in templates.`
  4518. );
  4519. return Reflect.get(target, key, receiver);
  4520. }
  4521. }) : proxyToUse;
  4522. result = normalizeVNode(
  4523. render.call(
  4524. thisProxy,
  4525. proxyToUse,
  4526. renderCache,
  4527. true ? reactivity.shallowReadonly(props) : props,
  4528. setupState,
  4529. data,
  4530. ctx
  4531. )
  4532. );
  4533. fallthroughAttrs = attrs;
  4534. } else {
  4535. const render2 = Component;
  4536. if (attrs === props) {
  4537. markAttrsAccessed();
  4538. }
  4539. result = normalizeVNode(
  4540. render2.length > 1 ? render2(
  4541. true ? reactivity.shallowReadonly(props) : props,
  4542. true ? {
  4543. get attrs() {
  4544. markAttrsAccessed();
  4545. return reactivity.shallowReadonly(attrs);
  4546. },
  4547. slots,
  4548. emit
  4549. } : { attrs, slots, emit }
  4550. ) : render2(
  4551. true ? reactivity.shallowReadonly(props) : props,
  4552. null
  4553. )
  4554. );
  4555. fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
  4556. }
  4557. } catch (err) {
  4558. blockStack.length = 0;
  4559. handleError(err, instance, 1);
  4560. result = createVNode(Comment);
  4561. }
  4562. let root = result;
  4563. let setRoot = void 0;
  4564. if (result.patchFlag > 0 && result.patchFlag & 2048) {
  4565. [root, setRoot] = getChildRoot(result);
  4566. }
  4567. if (fallthroughAttrs && inheritAttrs !== false) {
  4568. const keys = Object.keys(fallthroughAttrs);
  4569. const { shapeFlag } = root;
  4570. if (keys.length) {
  4571. if (shapeFlag & (1 | 6)) {
  4572. if (propsOptions && keys.some(shared.isModelListener)) {
  4573. fallthroughAttrs = filterModelListeners(
  4574. fallthroughAttrs,
  4575. propsOptions
  4576. );
  4577. }
  4578. root = cloneVNode(root, fallthroughAttrs, false, true);
  4579. } else if (!accessedAttrs && root.type !== Comment) {
  4580. const allAttrs = Object.keys(attrs);
  4581. const eventAttrs = [];
  4582. const extraAttrs = [];
  4583. for (let i = 0, l = allAttrs.length; i < l; i++) {
  4584. const key = allAttrs[i];
  4585. if (shared.isOn(key)) {
  4586. if (!shared.isModelListener(key)) {
  4587. eventAttrs.push(key[2].toLowerCase() + key.slice(3));
  4588. }
  4589. } else {
  4590. extraAttrs.push(key);
  4591. }
  4592. }
  4593. if (extraAttrs.length) {
  4594. warn$1(
  4595. `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`
  4596. );
  4597. }
  4598. if (eventAttrs.length) {
  4599. warn$1(
  4600. `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`
  4601. );
  4602. }
  4603. }
  4604. }
  4605. }
  4606. if (vnode.dirs) {
  4607. if (!isElementRoot(root)) {
  4608. warn$1(
  4609. `Runtime directive used on component with non-element root node. The directives will not function as intended.`
  4610. );
  4611. }
  4612. root = cloneVNode(root, null, false, true);
  4613. root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
  4614. }
  4615. if (vnode.transition) {
  4616. if (!isElementRoot(root)) {
  4617. warn$1(
  4618. `Component inside <Transition> renders non-element root node that cannot be animated.`
  4619. );
  4620. }
  4621. setTransitionHooks(root, vnode.transition);
  4622. }
  4623. if (setRoot) {
  4624. setRoot(root);
  4625. } else {
  4626. result = root;
  4627. }
  4628. setCurrentRenderingInstance(prev);
  4629. return result;
  4630. }
  4631. const getChildRoot = (vnode) => {
  4632. const rawChildren = vnode.children;
  4633. const dynamicChildren = vnode.dynamicChildren;
  4634. const childRoot = filterSingleRoot(rawChildren, false);
  4635. if (!childRoot) {
  4636. return [vnode, void 0];
  4637. } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) {
  4638. return getChildRoot(childRoot);
  4639. }
  4640. const index = rawChildren.indexOf(childRoot);
  4641. const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
  4642. const setRoot = (updatedRoot) => {
  4643. rawChildren[index] = updatedRoot;
  4644. if (dynamicChildren) {
  4645. if (dynamicIndex > -1) {
  4646. dynamicChildren[dynamicIndex] = updatedRoot;
  4647. } else if (updatedRoot.patchFlag > 0) {
  4648. vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
  4649. }
  4650. }
  4651. };
  4652. return [normalizeVNode(childRoot), setRoot];
  4653. };
  4654. function filterSingleRoot(children, recurse = true) {
  4655. let singleRoot;
  4656. for (let i = 0; i < children.length; i++) {
  4657. const child = children[i];
  4658. if (isVNode(child)) {
  4659. if (child.type !== Comment || child.children === "v-if") {
  4660. if (singleRoot) {
  4661. return;
  4662. } else {
  4663. singleRoot = child;
  4664. if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) {
  4665. return filterSingleRoot(singleRoot.children);
  4666. }
  4667. }
  4668. }
  4669. } else {
  4670. return;
  4671. }
  4672. }
  4673. return singleRoot;
  4674. }
  4675. const getFunctionalFallthrough = (attrs) => {
  4676. let res;
  4677. for (const key in attrs) {
  4678. if (key === "class" || key === "style" || shared.isOn(key)) {
  4679. (res || (res = {}))[key] = attrs[key];
  4680. }
  4681. }
  4682. return res;
  4683. };
  4684. const filterModelListeners = (attrs, props) => {
  4685. const res = {};
  4686. for (const key in attrs) {
  4687. if (!shared.isModelListener(key) || !(key.slice(9) in props)) {
  4688. res[key] = attrs[key];
  4689. }
  4690. }
  4691. return res;
  4692. };
  4693. const isElementRoot = (vnode) => {
  4694. return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;
  4695. };
  4696. function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
  4697. const { props: prevProps, children: prevChildren, component } = prevVNode;
  4698. const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
  4699. const emits = component.emitsOptions;
  4700. if ((prevChildren || nextChildren) && isHmrUpdating) {
  4701. return true;
  4702. }
  4703. if (nextVNode.dirs || nextVNode.transition) {
  4704. return true;
  4705. }
  4706. if (optimized && patchFlag >= 0) {
  4707. if (patchFlag & 1024) {
  4708. return true;
  4709. }
  4710. if (patchFlag & 16) {
  4711. if (!prevProps) {
  4712. return !!nextProps;
  4713. }
  4714. return hasPropsChanged(prevProps, nextProps, emits);
  4715. } else if (patchFlag & 8) {
  4716. const dynamicProps = nextVNode.dynamicProps;
  4717. for (let i = 0; i < dynamicProps.length; i++) {
  4718. const key = dynamicProps[i];
  4719. if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emits, key)) {
  4720. return true;
  4721. }
  4722. }
  4723. }
  4724. } else {
  4725. if (prevChildren || nextChildren) {
  4726. if (!nextChildren || !nextChildren.$stable) {
  4727. return true;
  4728. }
  4729. }
  4730. if (prevProps === nextProps) {
  4731. return false;
  4732. }
  4733. if (!prevProps) {
  4734. return !!nextProps;
  4735. }
  4736. if (!nextProps) {
  4737. return true;
  4738. }
  4739. return hasPropsChanged(prevProps, nextProps, emits);
  4740. }
  4741. return false;
  4742. }
  4743. function hasPropsChanged(prevProps, nextProps, emitsOptions) {
  4744. const nextKeys = Object.keys(nextProps);
  4745. if (nextKeys.length !== Object.keys(prevProps).length) {
  4746. return true;
  4747. }
  4748. for (let i = 0; i < nextKeys.length; i++) {
  4749. const key = nextKeys[i];
  4750. if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
  4751. return true;
  4752. }
  4753. }
  4754. return false;
  4755. }
  4756. function hasPropValueChanged(nextProps, prevProps, key) {
  4757. const nextProp = nextProps[key];
  4758. const prevProp = prevProps[key];
  4759. if (key === "style" && shared.isObject(nextProp) && shared.isObject(prevProp)) {
  4760. return !shared.looseEqual(nextProp, prevProp);
  4761. }
  4762. return nextProp !== prevProp;
  4763. }
  4764. function updateHOCHostEl({ vnode, parent, suspense }, el) {
  4765. while (parent) {
  4766. const root = parent.subTree;
  4767. if (root.suspense && root.suspense.activeBranch === vnode) {
  4768. root.suspense.vnode.el = root.el = el;
  4769. vnode = root;
  4770. }
  4771. if (root === vnode) {
  4772. (vnode = parent.vnode).el = el;
  4773. parent = parent.parent;
  4774. } else {
  4775. break;
  4776. }
  4777. }
  4778. if (suspense && suspense.activeBranch === vnode) {
  4779. suspense.vnode.el = el;
  4780. }
  4781. }
  4782. const internalObjectProto = {};
  4783. const createInternalObject = () => Object.create(internalObjectProto);
  4784. const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
  4785. function initProps(instance, rawProps, isStateful, isSSR = false) {
  4786. const props = {};
  4787. const attrs = createInternalObject();
  4788. instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  4789. setFullProps(instance, rawProps, props, attrs);
  4790. for (const key in instance.propsOptions[0]) {
  4791. if (!(key in props)) {
  4792. props[key] = void 0;
  4793. }
  4794. }
  4795. {
  4796. validateProps(rawProps || {}, props, instance);
  4797. }
  4798. if (isStateful) {
  4799. instance.props = isSSR ? props : reactivity.shallowReactive(props);
  4800. } else {
  4801. if (!instance.type.props) {
  4802. instance.props = attrs;
  4803. } else {
  4804. instance.props = props;
  4805. }
  4806. }
  4807. instance.attrs = attrs;
  4808. }
  4809. function isInHmrContext(instance) {
  4810. while (instance) {
  4811. if (instance.type.__hmrId) return true;
  4812. instance = instance.parent;
  4813. }
  4814. }
  4815. function updateProps(instance, rawProps, rawPrevProps, optimized) {
  4816. const {
  4817. props,
  4818. attrs,
  4819. vnode: { patchFlag }
  4820. } = instance;
  4821. const rawCurrentProps = reactivity.toRaw(props);
  4822. const [options] = instance.propsOptions;
  4823. let hasAttrsChanged = false;
  4824. if (
  4825. // always force full diff in dev
  4826. // - #1942 if hmr is enabled with sfc component
  4827. // - vite#872 non-sfc component used by sfc component
  4828. !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
  4829. ) {
  4830. if (patchFlag & 8) {
  4831. const propsToUpdate = instance.vnode.dynamicProps;
  4832. for (let i = 0; i < propsToUpdate.length; i++) {
  4833. let key = propsToUpdate[i];
  4834. if (isEmitListener(instance.emitsOptions, key)) {
  4835. continue;
  4836. }
  4837. const value = rawProps[key];
  4838. if (options) {
  4839. if (shared.hasOwn(attrs, key)) {
  4840. if (value !== attrs[key]) {
  4841. attrs[key] = value;
  4842. hasAttrsChanged = true;
  4843. }
  4844. } else {
  4845. const camelizedKey = shared.camelize(key);
  4846. props[camelizedKey] = resolvePropValue(
  4847. options,
  4848. rawCurrentProps,
  4849. camelizedKey,
  4850. value,
  4851. instance,
  4852. false
  4853. );
  4854. }
  4855. } else {
  4856. if (value !== attrs[key]) {
  4857. attrs[key] = value;
  4858. hasAttrsChanged = true;
  4859. }
  4860. }
  4861. }
  4862. }
  4863. } else {
  4864. if (setFullProps(instance, rawProps, props, attrs)) {
  4865. hasAttrsChanged = true;
  4866. }
  4867. let kebabKey;
  4868. for (const key in rawCurrentProps) {
  4869. if (!rawProps || // for camelCase
  4870. !shared.hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
  4871. // and converted to camelCase (#955)
  4872. ((kebabKey = shared.hyphenate(key)) === key || !shared.hasOwn(rawProps, kebabKey))) {
  4873. if (options) {
  4874. if (rawPrevProps && // for camelCase
  4875. (rawPrevProps[key] !== void 0 || // for kebab-case
  4876. rawPrevProps[kebabKey] !== void 0)) {
  4877. props[key] = resolvePropValue(
  4878. options,
  4879. rawCurrentProps,
  4880. key,
  4881. void 0,
  4882. instance,
  4883. true
  4884. );
  4885. }
  4886. } else {
  4887. delete props[key];
  4888. }
  4889. }
  4890. }
  4891. if (attrs !== rawCurrentProps) {
  4892. for (const key in attrs) {
  4893. if (!rawProps || !shared.hasOwn(rawProps, key) && true) {
  4894. delete attrs[key];
  4895. hasAttrsChanged = true;
  4896. }
  4897. }
  4898. }
  4899. }
  4900. if (hasAttrsChanged) {
  4901. reactivity.trigger(instance.attrs, "set", "");
  4902. }
  4903. {
  4904. validateProps(rawProps || {}, props, instance);
  4905. }
  4906. }
  4907. function setFullProps(instance, rawProps, props, attrs) {
  4908. const [options, needCastKeys] = instance.propsOptions;
  4909. let hasAttrsChanged = false;
  4910. let rawCastValues;
  4911. if (rawProps) {
  4912. for (let key in rawProps) {
  4913. if (shared.isReservedProp(key)) {
  4914. continue;
  4915. }
  4916. const value = rawProps[key];
  4917. let camelKey;
  4918. if (options && shared.hasOwn(options, camelKey = shared.camelize(key))) {
  4919. if (!needCastKeys || !needCastKeys.includes(camelKey)) {
  4920. props[camelKey] = value;
  4921. } else {
  4922. (rawCastValues || (rawCastValues = {}))[camelKey] = value;
  4923. }
  4924. } else if (!isEmitListener(instance.emitsOptions, key)) {
  4925. if (!(key in attrs) || value !== attrs[key]) {
  4926. attrs[key] = value;
  4927. hasAttrsChanged = true;
  4928. }
  4929. }
  4930. }
  4931. }
  4932. if (needCastKeys) {
  4933. const rawCurrentProps = reactivity.toRaw(props);
  4934. const castValues = rawCastValues || shared.EMPTY_OBJ;
  4935. for (let i = 0; i < needCastKeys.length; i++) {
  4936. const key = needCastKeys[i];
  4937. props[key] = resolvePropValue(
  4938. options,
  4939. rawCurrentProps,
  4940. key,
  4941. castValues[key],
  4942. instance,
  4943. !shared.hasOwn(castValues, key)
  4944. );
  4945. }
  4946. }
  4947. return hasAttrsChanged;
  4948. }
  4949. function resolvePropValue(options, props, key, value, instance, isAbsent) {
  4950. const opt = options[key];
  4951. if (opt != null) {
  4952. const hasDefault = shared.hasOwn(opt, "default");
  4953. if (hasDefault && value === void 0) {
  4954. const defaultValue = opt.default;
  4955. if (opt.type !== Function && !opt.skipFactory && shared.isFunction(defaultValue)) {
  4956. const { propsDefaults } = instance;
  4957. if (key in propsDefaults) {
  4958. value = propsDefaults[key];
  4959. } else {
  4960. const reset = setCurrentInstance(instance);
  4961. value = propsDefaults[key] = defaultValue.call(
  4962. null,
  4963. props
  4964. );
  4965. reset();
  4966. }
  4967. } else {
  4968. value = defaultValue;
  4969. }
  4970. if (instance.ce) {
  4971. instance.ce._setProp(key, value);
  4972. }
  4973. }
  4974. if (opt[0 /* shouldCast */]) {
  4975. if (isAbsent && !hasDefault) {
  4976. value = false;
  4977. } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === shared.hyphenate(key))) {
  4978. value = true;
  4979. }
  4980. }
  4981. }
  4982. return value;
  4983. }
  4984. const mixinPropsCache = /* @__PURE__ */ new WeakMap();
  4985. function normalizePropsOptions(comp, appContext, asMixin = false) {
  4986. const cache = asMixin ? mixinPropsCache : appContext.propsCache;
  4987. const cached = cache.get(comp);
  4988. if (cached) {
  4989. return cached;
  4990. }
  4991. const raw = comp.props;
  4992. const normalized = {};
  4993. const needCastKeys = [];
  4994. let hasExtends = false;
  4995. if (!shared.isFunction(comp)) {
  4996. const extendProps = (raw2) => {
  4997. hasExtends = true;
  4998. const [props, keys] = normalizePropsOptions(raw2, appContext, true);
  4999. shared.extend(normalized, props);
  5000. if (keys) needCastKeys.push(...keys);
  5001. };
  5002. if (!asMixin && appContext.mixins.length) {
  5003. appContext.mixins.forEach(extendProps);
  5004. }
  5005. if (comp.extends) {
  5006. extendProps(comp.extends);
  5007. }
  5008. if (comp.mixins) {
  5009. comp.mixins.forEach(extendProps);
  5010. }
  5011. }
  5012. if (!raw && !hasExtends) {
  5013. if (shared.isObject(comp)) {
  5014. cache.set(comp, shared.EMPTY_ARR);
  5015. }
  5016. return shared.EMPTY_ARR;
  5017. }
  5018. if (shared.isArray(raw)) {
  5019. for (let i = 0; i < raw.length; i++) {
  5020. if (!shared.isString(raw[i])) {
  5021. warn$1(`props must be strings when using array syntax.`, raw[i]);
  5022. }
  5023. const normalizedKey = shared.camelize(raw[i]);
  5024. if (validatePropName(normalizedKey)) {
  5025. normalized[normalizedKey] = shared.EMPTY_OBJ;
  5026. }
  5027. }
  5028. } else if (raw) {
  5029. if (!shared.isObject(raw)) {
  5030. warn$1(`invalid props options`, raw);
  5031. }
  5032. for (const key in raw) {
  5033. const normalizedKey = shared.camelize(key);
  5034. if (validatePropName(normalizedKey)) {
  5035. const opt = raw[key];
  5036. const prop = normalized[normalizedKey] = shared.isArray(opt) || shared.isFunction(opt) ? { type: opt } : shared.extend({}, opt);
  5037. const propType = prop.type;
  5038. let shouldCast = false;
  5039. let shouldCastTrue = true;
  5040. if (shared.isArray(propType)) {
  5041. for (let index = 0; index < propType.length; ++index) {
  5042. const type = propType[index];
  5043. const typeName = shared.isFunction(type) && type.name;
  5044. if (typeName === "Boolean") {
  5045. shouldCast = true;
  5046. break;
  5047. } else if (typeName === "String") {
  5048. shouldCastTrue = false;
  5049. }
  5050. }
  5051. } else {
  5052. shouldCast = shared.isFunction(propType) && propType.name === "Boolean";
  5053. }
  5054. prop[0 /* shouldCast */] = shouldCast;
  5055. prop[1 /* shouldCastTrue */] = shouldCastTrue;
  5056. if (shouldCast || shared.hasOwn(prop, "default")) {
  5057. needCastKeys.push(normalizedKey);
  5058. }
  5059. }
  5060. }
  5061. }
  5062. const res = [normalized, needCastKeys];
  5063. if (shared.isObject(comp)) {
  5064. cache.set(comp, res);
  5065. }
  5066. return res;
  5067. }
  5068. function validatePropName(key) {
  5069. if (key[0] !== "$" && !shared.isReservedProp(key)) {
  5070. return true;
  5071. } else {
  5072. warn$1(`Invalid prop name: "${key}" is a reserved property.`);
  5073. }
  5074. return false;
  5075. }
  5076. function getType(ctor) {
  5077. if (ctor === null) {
  5078. return "null";
  5079. }
  5080. if (typeof ctor === "function") {
  5081. return ctor.name || "";
  5082. } else if (typeof ctor === "object") {
  5083. const name = ctor.constructor && ctor.constructor.name;
  5084. return name || "";
  5085. }
  5086. return "";
  5087. }
  5088. function validateProps(rawProps, props, instance) {
  5089. const resolvedValues = reactivity.toRaw(props);
  5090. const options = instance.propsOptions[0];
  5091. const camelizePropsKey = Object.keys(rawProps).map((key) => shared.camelize(key));
  5092. for (const key in options) {
  5093. let opt = options[key];
  5094. if (opt == null) continue;
  5095. validateProp(
  5096. key,
  5097. resolvedValues[key],
  5098. opt,
  5099. reactivity.shallowReadonly(resolvedValues) ,
  5100. !camelizePropsKey.includes(key)
  5101. );
  5102. }
  5103. }
  5104. function validateProp(name, value, prop, props, isAbsent) {
  5105. const { type, required, validator, skipCheck } = prop;
  5106. if (required && isAbsent) {
  5107. warn$1('Missing required prop: "' + name + '"');
  5108. return;
  5109. }
  5110. if (value == null && !required) {
  5111. return;
  5112. }
  5113. if (type != null && type !== true && !skipCheck) {
  5114. let isValid = false;
  5115. const types = shared.isArray(type) ? type : [type];
  5116. const expectedTypes = [];
  5117. for (let i = 0; i < types.length && !isValid; i++) {
  5118. const { valid, expectedType } = assertType(value, types[i]);
  5119. expectedTypes.push(expectedType || "");
  5120. isValid = valid;
  5121. }
  5122. if (!isValid) {
  5123. warn$1(getInvalidTypeMessage(name, value, expectedTypes));
  5124. return;
  5125. }
  5126. }
  5127. if (validator && !validator(value, props)) {
  5128. warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
  5129. }
  5130. }
  5131. const isSimpleType = /* @__PURE__ */ shared.makeMap(
  5132. "String,Number,Boolean,Function,Symbol,BigInt"
  5133. );
  5134. function assertType(value, type) {
  5135. let valid;
  5136. const expectedType = getType(type);
  5137. if (expectedType === "null") {
  5138. valid = value === null;
  5139. } else if (isSimpleType(expectedType)) {
  5140. const t = typeof value;
  5141. valid = t === expectedType.toLowerCase();
  5142. if (!valid && t === "object") {
  5143. valid = value instanceof type;
  5144. }
  5145. } else if (expectedType === "Object") {
  5146. valid = shared.isObject(value);
  5147. } else if (expectedType === "Array") {
  5148. valid = shared.isArray(value);
  5149. } else {
  5150. valid = value instanceof type;
  5151. }
  5152. return {
  5153. valid,
  5154. expectedType
  5155. };
  5156. }
  5157. function getInvalidTypeMessage(name, value, expectedTypes) {
  5158. if (expectedTypes.length === 0) {
  5159. return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
  5160. }
  5161. let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(shared.capitalize).join(" | ")}`;
  5162. const expectedType = expectedTypes[0];
  5163. const receivedType = shared.toRawType(value);
  5164. const expectedValue = styleValue(value, expectedType);
  5165. const receivedValue = styleValue(value, receivedType);
  5166. if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) {
  5167. message += ` with value ${expectedValue}`;
  5168. }
  5169. message += `, got ${receivedType} `;
  5170. if (isExplicable(receivedType)) {
  5171. message += `with value ${receivedValue}.`;
  5172. }
  5173. return message;
  5174. }
  5175. function styleValue(value, type) {
  5176. if (shared.isSymbol(value)) {
  5177. return value.toString();
  5178. } else if (type === "String") {
  5179. return `"${value}"`;
  5180. } else if (type === "Number") {
  5181. return `${Number(value)}`;
  5182. } else {
  5183. return `${value}`;
  5184. }
  5185. }
  5186. function isExplicable(type) {
  5187. const explicitTypes = ["string", "number", "boolean"];
  5188. return explicitTypes.some((elem) => type.toLowerCase() === elem);
  5189. }
  5190. function isCoercible(...args) {
  5191. return args.every((elem) => {
  5192. const value = elem.toLowerCase();
  5193. return value !== "boolean" && value !== "symbol";
  5194. });
  5195. }
  5196. const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
  5197. const normalizeSlotValue = (value) => shared.isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
  5198. const normalizeSlot = (key, rawSlot, ctx) => {
  5199. if (rawSlot._n) {
  5200. return rawSlot;
  5201. }
  5202. const normalized = withCtx((...args) => {
  5203. if (currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) {
  5204. warn$1(
  5205. `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`
  5206. );
  5207. }
  5208. return normalizeSlotValue(rawSlot(...args));
  5209. }, ctx);
  5210. normalized._c = false;
  5211. return normalized;
  5212. };
  5213. const normalizeObjectSlots = (rawSlots, slots, instance) => {
  5214. const ctx = rawSlots._ctx;
  5215. for (const key in rawSlots) {
  5216. if (isInternalKey(key)) continue;
  5217. const value = rawSlots[key];
  5218. if (shared.isFunction(value)) {
  5219. slots[key] = normalizeSlot(key, value, ctx);
  5220. } else if (value != null) {
  5221. {
  5222. warn$1(
  5223. `Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
  5224. );
  5225. }
  5226. const normalized = normalizeSlotValue(value);
  5227. slots[key] = () => normalized;
  5228. }
  5229. }
  5230. };
  5231. const normalizeVNodeSlots = (instance, children) => {
  5232. if (!isKeepAlive(instance.vnode) && true) {
  5233. warn$1(
  5234. `Non-function value encountered for default slot. Prefer function slots for better performance.`
  5235. );
  5236. }
  5237. const normalized = normalizeSlotValue(children);
  5238. instance.slots.default = () => normalized;
  5239. };
  5240. const assignSlots = (slots, children, optimized) => {
  5241. for (const key in children) {
  5242. if (optimized || !isInternalKey(key)) {
  5243. slots[key] = children[key];
  5244. }
  5245. }
  5246. };
  5247. const initSlots = (instance, children, optimized) => {
  5248. const slots = instance.slots = createInternalObject();
  5249. if (instance.vnode.shapeFlag & 32) {
  5250. const type = children._;
  5251. if (type) {
  5252. assignSlots(slots, children, optimized);
  5253. if (optimized) {
  5254. shared.def(slots, "_", type, true);
  5255. }
  5256. } else {
  5257. normalizeObjectSlots(children, slots);
  5258. }
  5259. } else if (children) {
  5260. normalizeVNodeSlots(instance, children);
  5261. }
  5262. };
  5263. const updateSlots = (instance, children, optimized) => {
  5264. const { vnode, slots } = instance;
  5265. let needDeletionCheck = true;
  5266. let deletionComparisonTarget = shared.EMPTY_OBJ;
  5267. if (vnode.shapeFlag & 32) {
  5268. const type = children._;
  5269. if (type) {
  5270. if (isHmrUpdating) {
  5271. assignSlots(slots, children, optimized);
  5272. reactivity.trigger(instance, "set", "$slots");
  5273. } else if (optimized && type === 1) {
  5274. needDeletionCheck = false;
  5275. } else {
  5276. assignSlots(slots, children, optimized);
  5277. }
  5278. } else {
  5279. needDeletionCheck = !children.$stable;
  5280. normalizeObjectSlots(children, slots);
  5281. }
  5282. deletionComparisonTarget = children;
  5283. } else if (children) {
  5284. normalizeVNodeSlots(instance, children);
  5285. deletionComparisonTarget = { default: 1 };
  5286. }
  5287. if (needDeletionCheck) {
  5288. for (const key in slots) {
  5289. if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
  5290. delete slots[key];
  5291. }
  5292. }
  5293. }
  5294. };
  5295. let supported;
  5296. let perf;
  5297. function startMeasure(instance, type) {
  5298. if (instance.appContext.config.performance && isSupported()) {
  5299. perf.mark(`vue-${type}-${instance.uid}`);
  5300. }
  5301. {
  5302. devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
  5303. }
  5304. }
  5305. function endMeasure(instance, type) {
  5306. if (instance.appContext.config.performance && isSupported()) {
  5307. const startTag = `vue-${type}-${instance.uid}`;
  5308. const endTag = startTag + `:end`;
  5309. const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
  5310. perf.mark(endTag);
  5311. perf.measure(measureName, startTag, endTag);
  5312. perf.clearMeasures(measureName);
  5313. perf.clearMarks(startTag);
  5314. perf.clearMarks(endTag);
  5315. }
  5316. {
  5317. devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
  5318. }
  5319. }
  5320. function isSupported() {
  5321. if (supported !== void 0) {
  5322. return supported;
  5323. }
  5324. if (typeof window !== "undefined" && window.performance) {
  5325. supported = true;
  5326. perf = window.performance;
  5327. } else {
  5328. supported = false;
  5329. }
  5330. return supported;
  5331. }
  5332. const queuePostRenderEffect = queueEffectWithSuspense ;
  5333. function createRenderer(options) {
  5334. return baseCreateRenderer(options);
  5335. }
  5336. function createHydrationRenderer(options) {
  5337. return baseCreateRenderer(options, createHydrationFunctions);
  5338. }
  5339. function baseCreateRenderer(options, createHydrationFns) {
  5340. const target = shared.getGlobalThis();
  5341. target.__VUE__ = true;
  5342. {
  5343. setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
  5344. }
  5345. const {
  5346. insert: hostInsert,
  5347. remove: hostRemove,
  5348. patchProp: hostPatchProp,
  5349. createElement: hostCreateElement,
  5350. createText: hostCreateText,
  5351. createComment: hostCreateComment,
  5352. setText: hostSetText,
  5353. setElementText: hostSetElementText,
  5354. parentNode: hostParentNode,
  5355. nextSibling: hostNextSibling,
  5356. setScopeId: hostSetScopeId = shared.NOOP,
  5357. insertStaticContent: hostInsertStaticContent
  5358. } = options;
  5359. const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
  5360. if (n1 === n2) {
  5361. return;
  5362. }
  5363. if (n1 && !isSameVNodeType(n1, n2)) {
  5364. anchor = getNextHostNode(n1);
  5365. unmount(n1, parentComponent, parentSuspense, true);
  5366. n1 = null;
  5367. }
  5368. if (n2.patchFlag === -2) {
  5369. optimized = false;
  5370. n2.dynamicChildren = null;
  5371. }
  5372. const { type, ref, shapeFlag } = n2;
  5373. switch (type) {
  5374. case Text:
  5375. processText(n1, n2, container, anchor);
  5376. break;
  5377. case Comment:
  5378. processCommentNode(n1, n2, container, anchor);
  5379. break;
  5380. case Static:
  5381. if (n1 == null) {
  5382. mountStaticNode(n2, container, anchor, namespace);
  5383. } else {
  5384. patchStaticNode(n1, n2, container, namespace);
  5385. }
  5386. break;
  5387. case Fragment:
  5388. processFragment(
  5389. n1,
  5390. n2,
  5391. container,
  5392. anchor,
  5393. parentComponent,
  5394. parentSuspense,
  5395. namespace,
  5396. slotScopeIds,
  5397. optimized
  5398. );
  5399. break;
  5400. default:
  5401. if (shapeFlag & 1) {
  5402. processElement(
  5403. n1,
  5404. n2,
  5405. container,
  5406. anchor,
  5407. parentComponent,
  5408. parentSuspense,
  5409. namespace,
  5410. slotScopeIds,
  5411. optimized
  5412. );
  5413. } else if (shapeFlag & 6) {
  5414. processComponent(
  5415. n1,
  5416. n2,
  5417. container,
  5418. anchor,
  5419. parentComponent,
  5420. parentSuspense,
  5421. namespace,
  5422. slotScopeIds,
  5423. optimized
  5424. );
  5425. } else if (shapeFlag & 64) {
  5426. type.process(
  5427. n1,
  5428. n2,
  5429. container,
  5430. anchor,
  5431. parentComponent,
  5432. parentSuspense,
  5433. namespace,
  5434. slotScopeIds,
  5435. optimized,
  5436. internals
  5437. );
  5438. } else if (shapeFlag & 128) {
  5439. type.process(
  5440. n1,
  5441. n2,
  5442. container,
  5443. anchor,
  5444. parentComponent,
  5445. parentSuspense,
  5446. namespace,
  5447. slotScopeIds,
  5448. optimized,
  5449. internals
  5450. );
  5451. } else {
  5452. warn$1("Invalid VNode type:", type, `(${typeof type})`);
  5453. }
  5454. }
  5455. if (ref != null && parentComponent) {
  5456. setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
  5457. } else if (ref == null && n1 && n1.ref != null) {
  5458. setRef(n1.ref, null, parentSuspense, n1, true);
  5459. }
  5460. };
  5461. const processText = (n1, n2, container, anchor) => {
  5462. if (n1 == null) {
  5463. hostInsert(
  5464. n2.el = hostCreateText(n2.children),
  5465. container,
  5466. anchor
  5467. );
  5468. } else {
  5469. const el = n2.el = n1.el;
  5470. if (n2.children !== n1.children) {
  5471. hostSetText(el, n2.children);
  5472. }
  5473. }
  5474. };
  5475. const processCommentNode = (n1, n2, container, anchor) => {
  5476. if (n1 == null) {
  5477. hostInsert(
  5478. n2.el = hostCreateComment(n2.children || ""),
  5479. container,
  5480. anchor
  5481. );
  5482. } else {
  5483. n2.el = n1.el;
  5484. }
  5485. };
  5486. const mountStaticNode = (n2, container, anchor, namespace) => {
  5487. [n2.el, n2.anchor] = hostInsertStaticContent(
  5488. n2.children,
  5489. container,
  5490. anchor,
  5491. namespace,
  5492. n2.el,
  5493. n2.anchor
  5494. );
  5495. };
  5496. const patchStaticNode = (n1, n2, container, namespace) => {
  5497. if (n2.children !== n1.children) {
  5498. const anchor = hostNextSibling(n1.anchor);
  5499. removeStaticNode(n1);
  5500. [n2.el, n2.anchor] = hostInsertStaticContent(
  5501. n2.children,
  5502. container,
  5503. anchor,
  5504. namespace
  5505. );
  5506. } else {
  5507. n2.el = n1.el;
  5508. n2.anchor = n1.anchor;
  5509. }
  5510. };
  5511. const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
  5512. let next;
  5513. while (el && el !== anchor) {
  5514. next = hostNextSibling(el);
  5515. hostInsert(el, container, nextSibling);
  5516. el = next;
  5517. }
  5518. hostInsert(anchor, container, nextSibling);
  5519. };
  5520. const removeStaticNode = ({ el, anchor }) => {
  5521. let next;
  5522. while (el && el !== anchor) {
  5523. next = hostNextSibling(el);
  5524. hostRemove(el);
  5525. el = next;
  5526. }
  5527. hostRemove(anchor);
  5528. };
  5529. const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  5530. if (n2.type === "svg") {
  5531. namespace = "svg";
  5532. } else if (n2.type === "math") {
  5533. namespace = "mathml";
  5534. }
  5535. if (n1 == null) {
  5536. mountElement(
  5537. n2,
  5538. container,
  5539. anchor,
  5540. parentComponent,
  5541. parentSuspense,
  5542. namespace,
  5543. slotScopeIds,
  5544. optimized
  5545. );
  5546. } else {
  5547. const customElement = n1.el && n1.el._isVueCE ? n1.el : null;
  5548. try {
  5549. if (customElement) {
  5550. customElement._beginPatch();
  5551. }
  5552. patchElement(
  5553. n1,
  5554. n2,
  5555. parentComponent,
  5556. parentSuspense,
  5557. namespace,
  5558. slotScopeIds,
  5559. optimized
  5560. );
  5561. } finally {
  5562. if (customElement) {
  5563. customElement._endPatch();
  5564. }
  5565. }
  5566. }
  5567. };
  5568. const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  5569. let el;
  5570. let vnodeHook;
  5571. const { props, shapeFlag, transition, dirs } = vnode;
  5572. el = vnode.el = hostCreateElement(
  5573. vnode.type,
  5574. namespace,
  5575. props && props.is,
  5576. props
  5577. );
  5578. if (shapeFlag & 8) {
  5579. hostSetElementText(el, vnode.children);
  5580. } else if (shapeFlag & 16) {
  5581. mountChildren(
  5582. vnode.children,
  5583. el,
  5584. null,
  5585. parentComponent,
  5586. parentSuspense,
  5587. resolveChildrenNamespace(vnode, namespace),
  5588. slotScopeIds,
  5589. optimized
  5590. );
  5591. }
  5592. if (dirs) {
  5593. invokeDirectiveHook(vnode, null, parentComponent, "created");
  5594. }
  5595. setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
  5596. if (props) {
  5597. for (const key in props) {
  5598. if (key !== "value" && !shared.isReservedProp(key)) {
  5599. hostPatchProp(el, key, null, props[key], namespace, parentComponent);
  5600. }
  5601. }
  5602. if ("value" in props) {
  5603. hostPatchProp(el, "value", null, props.value, namespace);
  5604. }
  5605. if (vnodeHook = props.onVnodeBeforeMount) {
  5606. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  5607. }
  5608. }
  5609. {
  5610. shared.def(el, "__vnode", vnode, true);
  5611. shared.def(el, "__vueParentComponent", parentComponent, true);
  5612. }
  5613. if (dirs) {
  5614. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  5615. }
  5616. const needCallTransitionHooks = needTransition(parentSuspense, transition);
  5617. if (needCallTransitionHooks) {
  5618. transition.beforeEnter(el);
  5619. }
  5620. hostInsert(el, container, anchor);
  5621. if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
  5622. const isHmr = isHmrUpdating;
  5623. queuePostRenderEffect(() => {
  5624. let prev;
  5625. prev = setHmrUpdating(isHmr);
  5626. try {
  5627. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  5628. needCallTransitionHooks && transition.enter(el);
  5629. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  5630. } finally {
  5631. setHmrUpdating(prev);
  5632. }
  5633. }, parentSuspense);
  5634. }
  5635. };
  5636. const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
  5637. if (scopeId) {
  5638. hostSetScopeId(el, scopeId);
  5639. }
  5640. if (slotScopeIds) {
  5641. for (let i = 0; i < slotScopeIds.length; i++) {
  5642. hostSetScopeId(el, slotScopeIds[i]);
  5643. }
  5644. }
  5645. if (parentComponent) {
  5646. let subTree = parentComponent.subTree;
  5647. if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
  5648. subTree = filterSingleRoot(subTree.children) || subTree;
  5649. }
  5650. if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
  5651. const parentVNode = parentComponent.vnode;
  5652. setScopeId(
  5653. el,
  5654. parentVNode,
  5655. parentVNode.scopeId,
  5656. parentVNode.slotScopeIds,
  5657. parentComponent.parent
  5658. );
  5659. }
  5660. }
  5661. };
  5662. const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
  5663. for (let i = start; i < children.length; i++) {
  5664. const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
  5665. patch(
  5666. null,
  5667. child,
  5668. container,
  5669. anchor,
  5670. parentComponent,
  5671. parentSuspense,
  5672. namespace,
  5673. slotScopeIds,
  5674. optimized
  5675. );
  5676. }
  5677. };
  5678. const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  5679. const el = n2.el = n1.el;
  5680. {
  5681. el.__vnode = n2;
  5682. }
  5683. let { patchFlag, dynamicChildren, dirs } = n2;
  5684. patchFlag |= n1.patchFlag & 16;
  5685. const oldProps = n1.props || shared.EMPTY_OBJ;
  5686. const newProps = n2.props || shared.EMPTY_OBJ;
  5687. let vnodeHook;
  5688. parentComponent && toggleRecurse(parentComponent, false);
  5689. if (vnodeHook = newProps.onVnodeBeforeUpdate) {
  5690. invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  5691. }
  5692. if (dirs) {
  5693. invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
  5694. }
  5695. parentComponent && toggleRecurse(parentComponent, true);
  5696. if (isHmrUpdating) {
  5697. patchFlag = 0;
  5698. optimized = false;
  5699. dynamicChildren = null;
  5700. }
  5701. if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
  5702. hostSetElementText(el, "");
  5703. }
  5704. if (dynamicChildren) {
  5705. patchBlockChildren(
  5706. n1.dynamicChildren,
  5707. dynamicChildren,
  5708. el,
  5709. parentComponent,
  5710. parentSuspense,
  5711. resolveChildrenNamespace(n2, namespace),
  5712. slotScopeIds
  5713. );
  5714. {
  5715. traverseStaticChildren(n1, n2);
  5716. }
  5717. } else if (!optimized) {
  5718. patchChildren(
  5719. n1,
  5720. n2,
  5721. el,
  5722. null,
  5723. parentComponent,
  5724. parentSuspense,
  5725. resolveChildrenNamespace(n2, namespace),
  5726. slotScopeIds,
  5727. false
  5728. );
  5729. }
  5730. if (patchFlag > 0) {
  5731. if (patchFlag & 16) {
  5732. patchProps(el, oldProps, newProps, parentComponent, namespace);
  5733. } else {
  5734. if (patchFlag & 2) {
  5735. if (oldProps.class !== newProps.class) {
  5736. hostPatchProp(el, "class", null, newProps.class, namespace);
  5737. }
  5738. }
  5739. if (patchFlag & 4) {
  5740. hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
  5741. }
  5742. if (patchFlag & 8) {
  5743. const propsToUpdate = n2.dynamicProps;
  5744. for (let i = 0; i < propsToUpdate.length; i++) {
  5745. const key = propsToUpdate[i];
  5746. const prev = oldProps[key];
  5747. const next = newProps[key];
  5748. if (next !== prev || key === "value") {
  5749. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  5750. }
  5751. }
  5752. }
  5753. }
  5754. if (patchFlag & 1) {
  5755. if (n1.children !== n2.children) {
  5756. hostSetElementText(el, n2.children);
  5757. }
  5758. }
  5759. } else if (!optimized && dynamicChildren == null) {
  5760. patchProps(el, oldProps, newProps, parentComponent, namespace);
  5761. }
  5762. if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
  5763. queuePostRenderEffect(() => {
  5764. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  5765. dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
  5766. }, parentSuspense);
  5767. }
  5768. };
  5769. const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
  5770. for (let i = 0; i < newChildren.length; i++) {
  5771. const oldVNode = oldChildren[i];
  5772. const newVNode = newChildren[i];
  5773. const container = (
  5774. // oldVNode may be an errored async setup() component inside Suspense
  5775. // which will not have a mounted element
  5776. oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
  5777. // of the Fragment itself so it can move its children.
  5778. (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
  5779. // which also requires the correct parent container
  5780. !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
  5781. oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
  5782. // In other cases, the parent container is not actually used so we
  5783. // just pass the block element here to avoid a DOM parentNode call.
  5784. fallbackContainer
  5785. )
  5786. );
  5787. patch(
  5788. oldVNode,
  5789. newVNode,
  5790. container,
  5791. null,
  5792. parentComponent,
  5793. parentSuspense,
  5794. namespace,
  5795. slotScopeIds,
  5796. true
  5797. );
  5798. }
  5799. };
  5800. const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
  5801. if (oldProps !== newProps) {
  5802. if (oldProps !== shared.EMPTY_OBJ) {
  5803. for (const key in oldProps) {
  5804. if (!shared.isReservedProp(key) && !(key in newProps)) {
  5805. hostPatchProp(
  5806. el,
  5807. key,
  5808. oldProps[key],
  5809. null,
  5810. namespace,
  5811. parentComponent
  5812. );
  5813. }
  5814. }
  5815. }
  5816. for (const key in newProps) {
  5817. if (shared.isReservedProp(key)) continue;
  5818. const next = newProps[key];
  5819. const prev = oldProps[key];
  5820. if (next !== prev && key !== "value") {
  5821. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  5822. }
  5823. }
  5824. if ("value" in newProps) {
  5825. hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
  5826. }
  5827. }
  5828. };
  5829. const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  5830. const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
  5831. const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
  5832. let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
  5833. if (
  5834. // #5523 dev root fragment may inherit directives
  5835. isHmrUpdating || patchFlag & 2048
  5836. ) {
  5837. patchFlag = 0;
  5838. optimized = false;
  5839. dynamicChildren = null;
  5840. }
  5841. if (fragmentSlotScopeIds) {
  5842. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  5843. }
  5844. if (n1 == null) {
  5845. hostInsert(fragmentStartAnchor, container, anchor);
  5846. hostInsert(fragmentEndAnchor, container, anchor);
  5847. mountChildren(
  5848. // #10007
  5849. // such fragment like `<></>` will be compiled into
  5850. // a fragment which doesn't have a children.
  5851. // In this case fallback to an empty array
  5852. n2.children || [],
  5853. container,
  5854. fragmentEndAnchor,
  5855. parentComponent,
  5856. parentSuspense,
  5857. namespace,
  5858. slotScopeIds,
  5859. optimized
  5860. );
  5861. } else {
  5862. if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
  5863. // of renderSlot() with no valid children
  5864. n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) {
  5865. patchBlockChildren(
  5866. n1.dynamicChildren,
  5867. dynamicChildren,
  5868. container,
  5869. parentComponent,
  5870. parentSuspense,
  5871. namespace,
  5872. slotScopeIds
  5873. );
  5874. {
  5875. traverseStaticChildren(n1, n2);
  5876. }
  5877. } else {
  5878. patchChildren(
  5879. n1,
  5880. n2,
  5881. container,
  5882. fragmentEndAnchor,
  5883. parentComponent,
  5884. parentSuspense,
  5885. namespace,
  5886. slotScopeIds,
  5887. optimized
  5888. );
  5889. }
  5890. }
  5891. };
  5892. const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  5893. n2.slotScopeIds = slotScopeIds;
  5894. if (n1 == null) {
  5895. if (n2.shapeFlag & 512) {
  5896. parentComponent.ctx.activate(
  5897. n2,
  5898. container,
  5899. anchor,
  5900. namespace,
  5901. optimized
  5902. );
  5903. } else {
  5904. mountComponent(
  5905. n2,
  5906. container,
  5907. anchor,
  5908. parentComponent,
  5909. parentSuspense,
  5910. namespace,
  5911. optimized
  5912. );
  5913. }
  5914. } else {
  5915. updateComponent(n1, n2, optimized);
  5916. }
  5917. };
  5918. const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
  5919. const instance = (initialVNode.component = createComponentInstance(
  5920. initialVNode,
  5921. parentComponent,
  5922. parentSuspense
  5923. ));
  5924. if (instance.type.__hmrId) {
  5925. registerHMR(instance);
  5926. }
  5927. {
  5928. pushWarningContext(initialVNode);
  5929. startMeasure(instance, `mount`);
  5930. }
  5931. if (isKeepAlive(initialVNode)) {
  5932. instance.ctx.renderer = internals;
  5933. }
  5934. {
  5935. {
  5936. startMeasure(instance, `init`);
  5937. }
  5938. setupComponent(instance, false, optimized);
  5939. {
  5940. endMeasure(instance, `init`);
  5941. }
  5942. }
  5943. if (isHmrUpdating) initialVNode.el = null;
  5944. if (instance.asyncDep) {
  5945. parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
  5946. if (!initialVNode.el) {
  5947. const placeholder = instance.subTree = createVNode(Comment);
  5948. processCommentNode(null, placeholder, container, anchor);
  5949. initialVNode.placeholder = placeholder.el;
  5950. }
  5951. } else {
  5952. setupRenderEffect(
  5953. instance,
  5954. initialVNode,
  5955. container,
  5956. anchor,
  5957. parentSuspense,
  5958. namespace,
  5959. optimized
  5960. );
  5961. }
  5962. {
  5963. popWarningContext();
  5964. endMeasure(instance, `mount`);
  5965. }
  5966. };
  5967. const updateComponent = (n1, n2, optimized) => {
  5968. const instance = n2.component = n1.component;
  5969. if (shouldUpdateComponent(n1, n2, optimized)) {
  5970. if (instance.asyncDep && !instance.asyncResolved) {
  5971. {
  5972. pushWarningContext(n2);
  5973. }
  5974. updateComponentPreRender(instance, n2, optimized);
  5975. {
  5976. popWarningContext();
  5977. }
  5978. return;
  5979. } else {
  5980. instance.next = n2;
  5981. instance.update();
  5982. }
  5983. } else {
  5984. n2.el = n1.el;
  5985. instance.vnode = n2;
  5986. }
  5987. };
  5988. const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
  5989. const componentUpdateFn = () => {
  5990. if (!instance.isMounted) {
  5991. let vnodeHook;
  5992. const { el, props } = initialVNode;
  5993. const { bm, m, parent, root, type } = instance;
  5994. const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
  5995. toggleRecurse(instance, false);
  5996. if (bm) {
  5997. shared.invokeArrayFns(bm);
  5998. }
  5999. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
  6000. invokeVNodeHook(vnodeHook, parent, initialVNode);
  6001. }
  6002. toggleRecurse(instance, true);
  6003. if (el && hydrateNode) {
  6004. const hydrateSubTree = () => {
  6005. {
  6006. startMeasure(instance, `render`);
  6007. }
  6008. instance.subTree = renderComponentRoot(instance);
  6009. {
  6010. endMeasure(instance, `render`);
  6011. }
  6012. {
  6013. startMeasure(instance, `hydrate`);
  6014. }
  6015. hydrateNode(
  6016. el,
  6017. instance.subTree,
  6018. instance,
  6019. parentSuspense,
  6020. null
  6021. );
  6022. {
  6023. endMeasure(instance, `hydrate`);
  6024. }
  6025. };
  6026. if (isAsyncWrapperVNode && type.__asyncHydrate) {
  6027. type.__asyncHydrate(
  6028. el,
  6029. instance,
  6030. hydrateSubTree
  6031. );
  6032. } else {
  6033. hydrateSubTree();
  6034. }
  6035. } else {
  6036. if (root.ce && root.ce._hasShadowRoot()) {
  6037. root.ce._injectChildStyle(
  6038. type,
  6039. instance.parent ? instance.parent.type : void 0
  6040. );
  6041. }
  6042. {
  6043. startMeasure(instance, `render`);
  6044. }
  6045. const subTree = instance.subTree = renderComponentRoot(instance);
  6046. {
  6047. endMeasure(instance, `render`);
  6048. }
  6049. {
  6050. startMeasure(instance, `patch`);
  6051. }
  6052. patch(
  6053. null,
  6054. subTree,
  6055. container,
  6056. anchor,
  6057. instance,
  6058. parentSuspense,
  6059. namespace
  6060. );
  6061. {
  6062. endMeasure(instance, `patch`);
  6063. }
  6064. initialVNode.el = subTree.el;
  6065. }
  6066. if (m) {
  6067. queuePostRenderEffect(m, parentSuspense);
  6068. }
  6069. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
  6070. const scopedInitialVNode = initialVNode;
  6071. queuePostRenderEffect(
  6072. () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
  6073. parentSuspense
  6074. );
  6075. }
  6076. if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
  6077. instance.a && queuePostRenderEffect(instance.a, parentSuspense);
  6078. }
  6079. instance.isMounted = true;
  6080. {
  6081. devtoolsComponentAdded(instance);
  6082. }
  6083. initialVNode = container = anchor = null;
  6084. } else {
  6085. let { next, bu, u, parent, vnode } = instance;
  6086. {
  6087. const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
  6088. if (nonHydratedAsyncRoot) {
  6089. if (next) {
  6090. next.el = vnode.el;
  6091. updateComponentPreRender(instance, next, optimized);
  6092. }
  6093. nonHydratedAsyncRoot.asyncDep.then(() => {
  6094. queuePostRenderEffect(() => {
  6095. if (!instance.isUnmounted) update();
  6096. }, parentSuspense);
  6097. });
  6098. return;
  6099. }
  6100. }
  6101. let originNext = next;
  6102. let vnodeHook;
  6103. {
  6104. pushWarningContext(next || instance.vnode);
  6105. }
  6106. toggleRecurse(instance, false);
  6107. if (next) {
  6108. next.el = vnode.el;
  6109. updateComponentPreRender(instance, next, optimized);
  6110. } else {
  6111. next = vnode;
  6112. }
  6113. if (bu) {
  6114. shared.invokeArrayFns(bu);
  6115. }
  6116. if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
  6117. invokeVNodeHook(vnodeHook, parent, next, vnode);
  6118. }
  6119. toggleRecurse(instance, true);
  6120. {
  6121. startMeasure(instance, `render`);
  6122. }
  6123. const nextTree = renderComponentRoot(instance);
  6124. {
  6125. endMeasure(instance, `render`);
  6126. }
  6127. const prevTree = instance.subTree;
  6128. instance.subTree = nextTree;
  6129. {
  6130. startMeasure(instance, `patch`);
  6131. }
  6132. patch(
  6133. prevTree,
  6134. nextTree,
  6135. // parent may have changed if it's in a teleport
  6136. hostParentNode(prevTree.el),
  6137. // anchor may have changed if it's in a fragment
  6138. getNextHostNode(prevTree),
  6139. instance,
  6140. parentSuspense,
  6141. namespace
  6142. );
  6143. {
  6144. endMeasure(instance, `patch`);
  6145. }
  6146. next.el = nextTree.el;
  6147. if (originNext === null) {
  6148. updateHOCHostEl(instance, nextTree.el);
  6149. }
  6150. if (u) {
  6151. queuePostRenderEffect(u, parentSuspense);
  6152. }
  6153. if (vnodeHook = next.props && next.props.onVnodeUpdated) {
  6154. queuePostRenderEffect(
  6155. () => invokeVNodeHook(vnodeHook, parent, next, vnode),
  6156. parentSuspense
  6157. );
  6158. }
  6159. {
  6160. devtoolsComponentUpdated(instance);
  6161. }
  6162. {
  6163. popWarningContext();
  6164. }
  6165. }
  6166. };
  6167. instance.scope.on();
  6168. const effect = instance.effect = new reactivity.ReactiveEffect(componentUpdateFn);
  6169. instance.scope.off();
  6170. const update = instance.update = effect.run.bind(effect);
  6171. const job = instance.job = effect.runIfDirty.bind(effect);
  6172. job.i = instance;
  6173. job.id = instance.uid;
  6174. effect.scheduler = () => queueJob(job);
  6175. toggleRecurse(instance, true);
  6176. {
  6177. effect.onTrack = instance.rtc ? (e) => shared.invokeArrayFns(instance.rtc, e) : void 0;
  6178. effect.onTrigger = instance.rtg ? (e) => shared.invokeArrayFns(instance.rtg, e) : void 0;
  6179. }
  6180. update();
  6181. };
  6182. const updateComponentPreRender = (instance, nextVNode, optimized) => {
  6183. nextVNode.component = instance;
  6184. const prevProps = instance.vnode.props;
  6185. instance.vnode = nextVNode;
  6186. instance.next = null;
  6187. updateProps(instance, nextVNode.props, prevProps, optimized);
  6188. updateSlots(instance, nextVNode.children, optimized);
  6189. reactivity.pauseTracking();
  6190. flushPreFlushCbs(instance);
  6191. reactivity.resetTracking();
  6192. };
  6193. const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
  6194. const c1 = n1 && n1.children;
  6195. const prevShapeFlag = n1 ? n1.shapeFlag : 0;
  6196. const c2 = n2.children;
  6197. const { patchFlag, shapeFlag } = n2;
  6198. if (patchFlag > 0) {
  6199. if (patchFlag & 128) {
  6200. patchKeyedChildren(
  6201. c1,
  6202. c2,
  6203. container,
  6204. anchor,
  6205. parentComponent,
  6206. parentSuspense,
  6207. namespace,
  6208. slotScopeIds,
  6209. optimized
  6210. );
  6211. return;
  6212. } else if (patchFlag & 256) {
  6213. patchUnkeyedChildren(
  6214. c1,
  6215. c2,
  6216. container,
  6217. anchor,
  6218. parentComponent,
  6219. parentSuspense,
  6220. namespace,
  6221. slotScopeIds,
  6222. optimized
  6223. );
  6224. return;
  6225. }
  6226. }
  6227. if (shapeFlag & 8) {
  6228. if (prevShapeFlag & 16) {
  6229. unmountChildren(c1, parentComponent, parentSuspense);
  6230. }
  6231. if (c2 !== c1) {
  6232. hostSetElementText(container, c2);
  6233. }
  6234. } else {
  6235. if (prevShapeFlag & 16) {
  6236. if (shapeFlag & 16) {
  6237. patchKeyedChildren(
  6238. c1,
  6239. c2,
  6240. container,
  6241. anchor,
  6242. parentComponent,
  6243. parentSuspense,
  6244. namespace,
  6245. slotScopeIds,
  6246. optimized
  6247. );
  6248. } else {
  6249. unmountChildren(c1, parentComponent, parentSuspense, true);
  6250. }
  6251. } else {
  6252. if (prevShapeFlag & 8) {
  6253. hostSetElementText(container, "");
  6254. }
  6255. if (shapeFlag & 16) {
  6256. mountChildren(
  6257. c2,
  6258. container,
  6259. anchor,
  6260. parentComponent,
  6261. parentSuspense,
  6262. namespace,
  6263. slotScopeIds,
  6264. optimized
  6265. );
  6266. }
  6267. }
  6268. }
  6269. };
  6270. const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  6271. c1 = c1 || shared.EMPTY_ARR;
  6272. c2 = c2 || shared.EMPTY_ARR;
  6273. const oldLength = c1.length;
  6274. const newLength = c2.length;
  6275. const commonLength = Math.min(oldLength, newLength);
  6276. let i;
  6277. for (i = 0; i < commonLength; i++) {
  6278. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  6279. patch(
  6280. c1[i],
  6281. nextChild,
  6282. container,
  6283. null,
  6284. parentComponent,
  6285. parentSuspense,
  6286. namespace,
  6287. slotScopeIds,
  6288. optimized
  6289. );
  6290. }
  6291. if (oldLength > newLength) {
  6292. unmountChildren(
  6293. c1,
  6294. parentComponent,
  6295. parentSuspense,
  6296. true,
  6297. false,
  6298. commonLength
  6299. );
  6300. } else {
  6301. mountChildren(
  6302. c2,
  6303. container,
  6304. anchor,
  6305. parentComponent,
  6306. parentSuspense,
  6307. namespace,
  6308. slotScopeIds,
  6309. optimized,
  6310. commonLength
  6311. );
  6312. }
  6313. };
  6314. const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  6315. let i = 0;
  6316. const l2 = c2.length;
  6317. let e1 = c1.length - 1;
  6318. let e2 = l2 - 1;
  6319. while (i <= e1 && i <= e2) {
  6320. const n1 = c1[i];
  6321. const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  6322. if (isSameVNodeType(n1, n2)) {
  6323. patch(
  6324. n1,
  6325. n2,
  6326. container,
  6327. null,
  6328. parentComponent,
  6329. parentSuspense,
  6330. namespace,
  6331. slotScopeIds,
  6332. optimized
  6333. );
  6334. } else {
  6335. break;
  6336. }
  6337. i++;
  6338. }
  6339. while (i <= e1 && i <= e2) {
  6340. const n1 = c1[e1];
  6341. const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
  6342. if (isSameVNodeType(n1, n2)) {
  6343. patch(
  6344. n1,
  6345. n2,
  6346. container,
  6347. null,
  6348. parentComponent,
  6349. parentSuspense,
  6350. namespace,
  6351. slotScopeIds,
  6352. optimized
  6353. );
  6354. } else {
  6355. break;
  6356. }
  6357. e1--;
  6358. e2--;
  6359. }
  6360. if (i > e1) {
  6361. if (i <= e2) {
  6362. const nextPos = e2 + 1;
  6363. const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
  6364. while (i <= e2) {
  6365. patch(
  6366. null,
  6367. c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
  6368. container,
  6369. anchor,
  6370. parentComponent,
  6371. parentSuspense,
  6372. namespace,
  6373. slotScopeIds,
  6374. optimized
  6375. );
  6376. i++;
  6377. }
  6378. }
  6379. } else if (i > e2) {
  6380. while (i <= e1) {
  6381. unmount(c1[i], parentComponent, parentSuspense, true);
  6382. i++;
  6383. }
  6384. } else {
  6385. const s1 = i;
  6386. const s2 = i;
  6387. const keyToNewIndexMap = /* @__PURE__ */ new Map();
  6388. for (i = s2; i <= e2; i++) {
  6389. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  6390. if (nextChild.key != null) {
  6391. if (keyToNewIndexMap.has(nextChild.key)) {
  6392. warn$1(
  6393. `Duplicate keys found during update:`,
  6394. JSON.stringify(nextChild.key),
  6395. `Make sure keys are unique.`
  6396. );
  6397. }
  6398. keyToNewIndexMap.set(nextChild.key, i);
  6399. }
  6400. }
  6401. let j;
  6402. let patched = 0;
  6403. const toBePatched = e2 - s2 + 1;
  6404. let moved = false;
  6405. let maxNewIndexSoFar = 0;
  6406. const newIndexToOldIndexMap = new Array(toBePatched);
  6407. for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0;
  6408. for (i = s1; i <= e1; i++) {
  6409. const prevChild = c1[i];
  6410. if (patched >= toBePatched) {
  6411. unmount(prevChild, parentComponent, parentSuspense, true);
  6412. continue;
  6413. }
  6414. let newIndex;
  6415. if (prevChild.key != null) {
  6416. newIndex = keyToNewIndexMap.get(prevChild.key);
  6417. } else {
  6418. for (j = s2; j <= e2; j++) {
  6419. if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
  6420. newIndex = j;
  6421. break;
  6422. }
  6423. }
  6424. }
  6425. if (newIndex === void 0) {
  6426. unmount(prevChild, parentComponent, parentSuspense, true);
  6427. } else {
  6428. newIndexToOldIndexMap[newIndex - s2] = i + 1;
  6429. if (newIndex >= maxNewIndexSoFar) {
  6430. maxNewIndexSoFar = newIndex;
  6431. } else {
  6432. moved = true;
  6433. }
  6434. patch(
  6435. prevChild,
  6436. c2[newIndex],
  6437. container,
  6438. null,
  6439. parentComponent,
  6440. parentSuspense,
  6441. namespace,
  6442. slotScopeIds,
  6443. optimized
  6444. );
  6445. patched++;
  6446. }
  6447. }
  6448. const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : shared.EMPTY_ARR;
  6449. j = increasingNewIndexSequence.length - 1;
  6450. for (i = toBePatched - 1; i >= 0; i--) {
  6451. const nextIndex = s2 + i;
  6452. const nextChild = c2[nextIndex];
  6453. const anchorVNode = c2[nextIndex + 1];
  6454. const anchor = nextIndex + 1 < l2 ? (
  6455. // #13559, #14173 fallback to el placeholder for unresolved async component
  6456. anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode)
  6457. ) : parentAnchor;
  6458. if (newIndexToOldIndexMap[i] === 0) {
  6459. patch(
  6460. null,
  6461. nextChild,
  6462. container,
  6463. anchor,
  6464. parentComponent,
  6465. parentSuspense,
  6466. namespace,
  6467. slotScopeIds,
  6468. optimized
  6469. );
  6470. } else if (moved) {
  6471. if (j < 0 || i !== increasingNewIndexSequence[j]) {
  6472. move(nextChild, container, anchor, 2);
  6473. } else {
  6474. j--;
  6475. }
  6476. }
  6477. }
  6478. }
  6479. };
  6480. const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
  6481. const { el, type, transition, children, shapeFlag } = vnode;
  6482. if (shapeFlag & 6) {
  6483. move(vnode.component.subTree, container, anchor, moveType);
  6484. return;
  6485. }
  6486. if (shapeFlag & 128) {
  6487. vnode.suspense.move(container, anchor, moveType);
  6488. return;
  6489. }
  6490. if (shapeFlag & 64) {
  6491. type.move(vnode, container, anchor, internals);
  6492. return;
  6493. }
  6494. if (type === Fragment) {
  6495. hostInsert(el, container, anchor);
  6496. for (let i = 0; i < children.length; i++) {
  6497. move(children[i], container, anchor, moveType);
  6498. }
  6499. hostInsert(vnode.anchor, container, anchor);
  6500. return;
  6501. }
  6502. if (type === Static) {
  6503. moveStaticNode(vnode, container, anchor);
  6504. return;
  6505. }
  6506. const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
  6507. if (needTransition2) {
  6508. if (moveType === 0) {
  6509. if (transition.persisted && !el[leaveCbKey]) {
  6510. hostInsert(el, container, anchor);
  6511. } else {
  6512. transition.beforeEnter(el);
  6513. hostInsert(el, container, anchor);
  6514. queuePostRenderEffect(() => transition.enter(el), parentSuspense);
  6515. }
  6516. } else {
  6517. const { leave, delayLeave, afterLeave } = transition;
  6518. const remove2 = () => {
  6519. if (vnode.ctx.isUnmounted) {
  6520. hostRemove(el);
  6521. } else {
  6522. hostInsert(el, container, anchor);
  6523. }
  6524. };
  6525. const performLeave = () => {
  6526. const wasLeaving = el._isLeaving || !!el[leaveCbKey];
  6527. if (el._isLeaving) {
  6528. el[leaveCbKey](
  6529. true
  6530. /* cancelled */
  6531. );
  6532. }
  6533. if (transition.persisted && !wasLeaving) {
  6534. remove2();
  6535. } else {
  6536. leave(el, () => {
  6537. remove2();
  6538. afterLeave && afterLeave();
  6539. });
  6540. }
  6541. };
  6542. if (delayLeave) {
  6543. delayLeave(el, remove2, performLeave);
  6544. } else {
  6545. performLeave();
  6546. }
  6547. }
  6548. } else {
  6549. hostInsert(el, container, anchor);
  6550. }
  6551. };
  6552. const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
  6553. const {
  6554. type,
  6555. props,
  6556. ref,
  6557. children,
  6558. dynamicChildren,
  6559. shapeFlag,
  6560. patchFlag,
  6561. dirs,
  6562. cacheIndex,
  6563. memo
  6564. } = vnode;
  6565. if (patchFlag === -2) {
  6566. optimized = false;
  6567. }
  6568. if (ref != null) {
  6569. reactivity.pauseTracking();
  6570. setRef(ref, null, parentSuspense, vnode, true);
  6571. reactivity.resetTracking();
  6572. }
  6573. if (cacheIndex != null) {
  6574. parentComponent.renderCache[cacheIndex] = void 0;
  6575. }
  6576. if (shapeFlag & 256) {
  6577. parentComponent.ctx.deactivate(vnode);
  6578. return;
  6579. }
  6580. const shouldInvokeDirs = shapeFlag & 1 && dirs;
  6581. const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
  6582. let vnodeHook;
  6583. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
  6584. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  6585. }
  6586. if (shapeFlag & 6) {
  6587. unmountComponent(vnode.component, parentSuspense, doRemove);
  6588. } else {
  6589. if (shapeFlag & 128) {
  6590. vnode.suspense.unmount(parentSuspense, doRemove);
  6591. return;
  6592. }
  6593. if (shouldInvokeDirs) {
  6594. invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
  6595. }
  6596. if (shapeFlag & 64) {
  6597. vnode.type.remove(
  6598. vnode,
  6599. parentComponent,
  6600. parentSuspense,
  6601. internals,
  6602. doRemove
  6603. );
  6604. } else if (dynamicChildren && // #5154
  6605. // when v-once is used inside a block, setBlockTracking(-1) marks the
  6606. // parent block with hasOnce: true
  6607. // so that it doesn't take the fast path during unmount - otherwise
  6608. // components nested in v-once are never unmounted.
  6609. !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments
  6610. (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
  6611. unmountChildren(
  6612. dynamicChildren,
  6613. parentComponent,
  6614. parentSuspense,
  6615. false,
  6616. true
  6617. );
  6618. } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
  6619. unmountChildren(children, parentComponent, parentSuspense);
  6620. }
  6621. if (doRemove) {
  6622. remove(vnode);
  6623. }
  6624. }
  6625. const shouldInvalidateMemo = memo != null && cacheIndex == null;
  6626. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) {
  6627. queuePostRenderEffect(() => {
  6628. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  6629. shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
  6630. if (shouldInvalidateMemo) {
  6631. vnode.el = null;
  6632. }
  6633. }, parentSuspense);
  6634. }
  6635. };
  6636. const remove = (vnode) => {
  6637. const { type, el, anchor, transition } = vnode;
  6638. if (type === Fragment) {
  6639. if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) {
  6640. vnode.children.forEach((child) => {
  6641. if (child.type === Comment) {
  6642. hostRemove(child.el);
  6643. } else {
  6644. remove(child);
  6645. }
  6646. });
  6647. } else {
  6648. removeFragment(el, anchor);
  6649. }
  6650. return;
  6651. }
  6652. if (type === Static) {
  6653. removeStaticNode(vnode);
  6654. return;
  6655. }
  6656. const performRemove = () => {
  6657. hostRemove(el);
  6658. if (transition && !transition.persisted && transition.afterLeave) {
  6659. transition.afterLeave();
  6660. }
  6661. };
  6662. if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
  6663. const { leave, delayLeave } = transition;
  6664. const performLeave = () => leave(el, performRemove);
  6665. if (delayLeave) {
  6666. delayLeave(vnode.el, performRemove, performLeave);
  6667. } else {
  6668. performLeave();
  6669. }
  6670. } else {
  6671. performRemove();
  6672. }
  6673. };
  6674. const removeFragment = (cur, end) => {
  6675. let next;
  6676. while (cur !== end) {
  6677. next = hostNextSibling(cur);
  6678. hostRemove(cur);
  6679. cur = next;
  6680. }
  6681. hostRemove(end);
  6682. };
  6683. const unmountComponent = (instance, parentSuspense, doRemove) => {
  6684. if (instance.type.__hmrId) {
  6685. unregisterHMR(instance);
  6686. }
  6687. const { bum, scope, job, subTree, um, m, a } = instance;
  6688. invalidateMount(m);
  6689. invalidateMount(a);
  6690. if (bum) {
  6691. shared.invokeArrayFns(bum);
  6692. }
  6693. scope.stop();
  6694. if (job) {
  6695. job.flags |= 8;
  6696. unmount(subTree, instance, parentSuspense, doRemove);
  6697. }
  6698. if (um) {
  6699. queuePostRenderEffect(um, parentSuspense);
  6700. }
  6701. queuePostRenderEffect(() => {
  6702. instance.isUnmounted = true;
  6703. }, parentSuspense);
  6704. {
  6705. devtoolsComponentRemoved(instance);
  6706. }
  6707. };
  6708. const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
  6709. for (let i = start; i < children.length; i++) {
  6710. unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
  6711. }
  6712. };
  6713. const getNextHostNode = (vnode) => {
  6714. if (vnode.shapeFlag & 6) {
  6715. return getNextHostNode(vnode.component.subTree);
  6716. }
  6717. if (vnode.shapeFlag & 128) {
  6718. return vnode.suspense.next();
  6719. }
  6720. const el = hostNextSibling(vnode.anchor || vnode.el);
  6721. const teleportEnd = el && el[TeleportEndKey];
  6722. return teleportEnd ? hostNextSibling(teleportEnd) : el;
  6723. };
  6724. let isFlushing = false;
  6725. const render = (vnode, container, namespace) => {
  6726. let instance;
  6727. if (vnode == null) {
  6728. if (container._vnode) {
  6729. unmount(container._vnode, null, null, true);
  6730. instance = container._vnode.component;
  6731. }
  6732. } else {
  6733. patch(
  6734. container._vnode || null,
  6735. vnode,
  6736. container,
  6737. null,
  6738. null,
  6739. null,
  6740. namespace
  6741. );
  6742. }
  6743. container._vnode = vnode;
  6744. if (!isFlushing) {
  6745. isFlushing = true;
  6746. flushPreFlushCbs(instance);
  6747. flushPostFlushCbs();
  6748. isFlushing = false;
  6749. }
  6750. };
  6751. const internals = {
  6752. p: patch,
  6753. um: unmount,
  6754. m: move,
  6755. r: remove,
  6756. mt: mountComponent,
  6757. mc: mountChildren,
  6758. pc: patchChildren,
  6759. pbc: patchBlockChildren,
  6760. n: getNextHostNode,
  6761. o: options
  6762. };
  6763. let hydrate;
  6764. let hydrateNode;
  6765. if (createHydrationFns) {
  6766. [hydrate, hydrateNode] = createHydrationFns(
  6767. internals
  6768. );
  6769. }
  6770. return {
  6771. render,
  6772. hydrate,
  6773. createApp: createAppAPI(render, hydrate)
  6774. };
  6775. }
  6776. function resolveChildrenNamespace({ type, props }, currentNamespace) {
  6777. return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
  6778. }
  6779. function toggleRecurse({ effect, job }, allowed) {
  6780. if (allowed) {
  6781. effect.flags |= 32;
  6782. job.flags |= 4;
  6783. } else {
  6784. effect.flags &= -33;
  6785. job.flags &= -5;
  6786. }
  6787. }
  6788. function needTransition(parentSuspense, transition) {
  6789. return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
  6790. }
  6791. function traverseStaticChildren(n1, n2, shallow = false) {
  6792. const ch1 = n1.children;
  6793. const ch2 = n2.children;
  6794. if (shared.isArray(ch1) && shared.isArray(ch2)) {
  6795. for (let i = 0; i < ch1.length; i++) {
  6796. const c1 = ch1[i];
  6797. let c2 = ch2[i];
  6798. if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
  6799. if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
  6800. c2 = ch2[i] = cloneIfMounted(ch2[i]);
  6801. c2.el = c1.el;
  6802. }
  6803. if (!shallow && c2.patchFlag !== -2)
  6804. traverseStaticChildren(c1, c2);
  6805. }
  6806. if (c2.type === Text) {
  6807. if (c2.patchFlag === -1) {
  6808. c2 = ch2[i] = cloneIfMounted(c2);
  6809. }
  6810. c2.el = c1.el;
  6811. }
  6812. if (c2.type === Comment && !c2.el) {
  6813. c2.el = c1.el;
  6814. }
  6815. {
  6816. c2.el && (c2.el.__vnode = c2);
  6817. }
  6818. }
  6819. }
  6820. }
  6821. function getSequence(arr) {
  6822. const p = arr.slice();
  6823. const result = [0];
  6824. let i, j, u, v, c;
  6825. const len = arr.length;
  6826. for (i = 0; i < len; i++) {
  6827. const arrI = arr[i];
  6828. if (arrI !== 0) {
  6829. j = result[result.length - 1];
  6830. if (arr[j] < arrI) {
  6831. p[i] = j;
  6832. result.push(i);
  6833. continue;
  6834. }
  6835. u = 0;
  6836. v = result.length - 1;
  6837. while (u < v) {
  6838. c = u + v >> 1;
  6839. if (arr[result[c]] < arrI) {
  6840. u = c + 1;
  6841. } else {
  6842. v = c;
  6843. }
  6844. }
  6845. if (arrI < arr[result[u]]) {
  6846. if (u > 0) {
  6847. p[i] = result[u - 1];
  6848. }
  6849. result[u] = i;
  6850. }
  6851. }
  6852. }
  6853. u = result.length;
  6854. v = result[u - 1];
  6855. while (u-- > 0) {
  6856. result[u] = v;
  6857. v = p[v];
  6858. }
  6859. return result;
  6860. }
  6861. function locateNonHydratedAsyncRoot(instance) {
  6862. const subComponent = instance.subTree.component;
  6863. if (subComponent) {
  6864. if (subComponent.asyncDep && !subComponent.asyncResolved) {
  6865. return subComponent;
  6866. } else {
  6867. return locateNonHydratedAsyncRoot(subComponent);
  6868. }
  6869. }
  6870. }
  6871. function invalidateMount(hooks) {
  6872. if (hooks) {
  6873. for (let i = 0; i < hooks.length; i++)
  6874. hooks[i].flags |= 8;
  6875. }
  6876. }
  6877. function resolveAsyncComponentPlaceholder(anchorVnode) {
  6878. if (anchorVnode.placeholder) {
  6879. return anchorVnode.placeholder;
  6880. }
  6881. const instance = anchorVnode.component;
  6882. if (instance) {
  6883. return resolveAsyncComponentPlaceholder(instance.subTree);
  6884. }
  6885. return null;
  6886. }
  6887. const isSuspense = (type) => type.__isSuspense;
  6888. let suspenseId = 0;
  6889. const SuspenseImpl = {
  6890. name: "Suspense",
  6891. // In order to make Suspense tree-shakable, we need to avoid importing it
  6892. // directly in the renderer. The renderer checks for the __isSuspense flag
  6893. // on a vnode's type and calls the `process` method, passing in renderer
  6894. // internals.
  6895. __isSuspense: true,
  6896. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
  6897. if (n1 == null) {
  6898. mountSuspense(
  6899. n2,
  6900. container,
  6901. anchor,
  6902. parentComponent,
  6903. parentSuspense,
  6904. namespace,
  6905. slotScopeIds,
  6906. optimized,
  6907. rendererInternals
  6908. );
  6909. } else {
  6910. if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
  6911. n2.suspense = n1.suspense;
  6912. n2.suspense.vnode = n2;
  6913. n2.el = n1.el;
  6914. return;
  6915. }
  6916. patchSuspense(
  6917. n1,
  6918. n2,
  6919. container,
  6920. anchor,
  6921. parentComponent,
  6922. namespace,
  6923. slotScopeIds,
  6924. optimized,
  6925. rendererInternals
  6926. );
  6927. }
  6928. },
  6929. hydrate: hydrateSuspense,
  6930. normalize: normalizeSuspenseChildren
  6931. };
  6932. const Suspense = SuspenseImpl ;
  6933. function triggerEvent(vnode, name) {
  6934. const eventListener = vnode.props && vnode.props[name];
  6935. if (shared.isFunction(eventListener)) {
  6936. eventListener();
  6937. }
  6938. }
  6939. function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
  6940. const {
  6941. p: patch,
  6942. o: { createElement }
  6943. } = rendererInternals;
  6944. const hiddenContainer = createElement("div");
  6945. const suspense = vnode.suspense = createSuspenseBoundary(
  6946. vnode,
  6947. parentSuspense,
  6948. parentComponent,
  6949. container,
  6950. hiddenContainer,
  6951. anchor,
  6952. namespace,
  6953. slotScopeIds,
  6954. optimized,
  6955. rendererInternals
  6956. );
  6957. patch(
  6958. null,
  6959. suspense.pendingBranch = vnode.ssContent,
  6960. hiddenContainer,
  6961. null,
  6962. parentComponent,
  6963. suspense,
  6964. namespace,
  6965. slotScopeIds
  6966. );
  6967. if (suspense.deps > 0) {
  6968. triggerEvent(vnode, "onPending");
  6969. triggerEvent(vnode, "onFallback");
  6970. patch(
  6971. null,
  6972. vnode.ssFallback,
  6973. container,
  6974. anchor,
  6975. parentComponent,
  6976. null,
  6977. // fallback tree will not have suspense context
  6978. namespace,
  6979. slotScopeIds
  6980. );
  6981. setActiveBranch(suspense, vnode.ssFallback);
  6982. } else {
  6983. suspense.resolve(false, true);
  6984. }
  6985. }
  6986. function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
  6987. const suspense = n2.suspense = n1.suspense;
  6988. suspense.vnode = n2;
  6989. n2.el = n1.el;
  6990. const newBranch = n2.ssContent;
  6991. const newFallback = n2.ssFallback;
  6992. const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
  6993. if (pendingBranch) {
  6994. suspense.pendingBranch = newBranch;
  6995. if (isSameVNodeType(pendingBranch, newBranch)) {
  6996. patch(
  6997. pendingBranch,
  6998. newBranch,
  6999. suspense.hiddenContainer,
  7000. null,
  7001. parentComponent,
  7002. suspense,
  7003. namespace,
  7004. slotScopeIds,
  7005. optimized
  7006. );
  7007. if (suspense.deps <= 0) {
  7008. suspense.resolve();
  7009. } else if (isInFallback) {
  7010. if (!isHydrating) {
  7011. patch(
  7012. activeBranch,
  7013. newFallback,
  7014. container,
  7015. anchor,
  7016. parentComponent,
  7017. null,
  7018. // fallback tree will not have suspense context
  7019. namespace,
  7020. slotScopeIds,
  7021. optimized
  7022. );
  7023. setActiveBranch(suspense, newFallback);
  7024. }
  7025. }
  7026. } else {
  7027. suspense.pendingId = suspenseId++;
  7028. if (isHydrating) {
  7029. suspense.isHydrating = false;
  7030. suspense.activeBranch = pendingBranch;
  7031. } else {
  7032. unmount(pendingBranch, parentComponent, suspense);
  7033. }
  7034. suspense.deps = 0;
  7035. suspense.effects.length = 0;
  7036. suspense.hiddenContainer = createElement("div");
  7037. if (isInFallback) {
  7038. patch(
  7039. null,
  7040. newBranch,
  7041. suspense.hiddenContainer,
  7042. null,
  7043. parentComponent,
  7044. suspense,
  7045. namespace,
  7046. slotScopeIds,
  7047. optimized
  7048. );
  7049. if (suspense.deps <= 0) {
  7050. suspense.resolve();
  7051. } else {
  7052. patch(
  7053. activeBranch,
  7054. newFallback,
  7055. container,
  7056. anchor,
  7057. parentComponent,
  7058. null,
  7059. // fallback tree will not have suspense context
  7060. namespace,
  7061. slotScopeIds,
  7062. optimized
  7063. );
  7064. setActiveBranch(suspense, newFallback);
  7065. }
  7066. } else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
  7067. patch(
  7068. activeBranch,
  7069. newBranch,
  7070. container,
  7071. anchor,
  7072. parentComponent,
  7073. suspense,
  7074. namespace,
  7075. slotScopeIds,
  7076. optimized
  7077. );
  7078. suspense.resolve(true);
  7079. } else {
  7080. patch(
  7081. null,
  7082. newBranch,
  7083. suspense.hiddenContainer,
  7084. null,
  7085. parentComponent,
  7086. suspense,
  7087. namespace,
  7088. slotScopeIds,
  7089. optimized
  7090. );
  7091. if (suspense.deps <= 0) {
  7092. suspense.resolve();
  7093. }
  7094. }
  7095. }
  7096. } else {
  7097. if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
  7098. patch(
  7099. activeBranch,
  7100. newBranch,
  7101. container,
  7102. anchor,
  7103. parentComponent,
  7104. suspense,
  7105. namespace,
  7106. slotScopeIds,
  7107. optimized
  7108. );
  7109. setActiveBranch(suspense, newBranch);
  7110. } else {
  7111. triggerEvent(n2, "onPending");
  7112. suspense.pendingBranch = newBranch;
  7113. if (newBranch.shapeFlag & 512) {
  7114. suspense.pendingId = newBranch.component.suspenseId;
  7115. } else {
  7116. suspense.pendingId = suspenseId++;
  7117. }
  7118. patch(
  7119. null,
  7120. newBranch,
  7121. suspense.hiddenContainer,
  7122. null,
  7123. parentComponent,
  7124. suspense,
  7125. namespace,
  7126. slotScopeIds,
  7127. optimized
  7128. );
  7129. if (suspense.deps <= 0) {
  7130. suspense.resolve();
  7131. } else {
  7132. const { timeout, pendingId } = suspense;
  7133. if (timeout > 0) {
  7134. setTimeout(() => {
  7135. if (suspense.pendingId === pendingId) {
  7136. suspense.fallback(newFallback);
  7137. }
  7138. }, timeout);
  7139. } else if (timeout === 0) {
  7140. suspense.fallback(newFallback);
  7141. }
  7142. }
  7143. }
  7144. }
  7145. }
  7146. let hasWarned = false;
  7147. function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
  7148. if (!hasWarned) {
  7149. hasWarned = true;
  7150. console[console.info ? "info" : "log"](
  7151. `<Suspense> is an experimental feature and its API will likely change.`
  7152. );
  7153. }
  7154. const {
  7155. p: patch,
  7156. m: move,
  7157. um: unmount,
  7158. n: next,
  7159. o: { parentNode, remove }
  7160. } = rendererInternals;
  7161. let parentSuspenseId;
  7162. const isSuspensible = isVNodeSuspensible(vnode);
  7163. if (isSuspensible) {
  7164. if (parentSuspense && parentSuspense.pendingBranch) {
  7165. parentSuspenseId = parentSuspense.pendingId;
  7166. parentSuspense.deps++;
  7167. }
  7168. }
  7169. const timeout = vnode.props ? shared.toNumber(vnode.props.timeout) : void 0;
  7170. {
  7171. assertNumber(timeout, `Suspense timeout`);
  7172. }
  7173. const initialAnchor = anchor;
  7174. const suspense = {
  7175. vnode,
  7176. parent: parentSuspense,
  7177. parentComponent,
  7178. namespace,
  7179. container,
  7180. hiddenContainer,
  7181. deps: 0,
  7182. pendingId: suspenseId++,
  7183. timeout: typeof timeout === "number" ? timeout : -1,
  7184. activeBranch: null,
  7185. isFallbackMountPending: false,
  7186. pendingBranch: null,
  7187. isInFallback: !isHydrating,
  7188. isHydrating,
  7189. isUnmounted: false,
  7190. effects: [],
  7191. resolve(resume = false, sync = false) {
  7192. {
  7193. if (!resume && !suspense.pendingBranch) {
  7194. throw new Error(
  7195. `suspense.resolve() is called without a pending branch.`
  7196. );
  7197. }
  7198. if (suspense.isUnmounted) {
  7199. throw new Error(
  7200. `suspense.resolve() is called on an already unmounted suspense boundary.`
  7201. );
  7202. }
  7203. }
  7204. const {
  7205. vnode: vnode2,
  7206. activeBranch,
  7207. pendingBranch,
  7208. pendingId,
  7209. effects,
  7210. parentComponent: parentComponent2,
  7211. container: container2,
  7212. isInFallback
  7213. } = suspense;
  7214. let delayEnter = false;
  7215. if (suspense.isHydrating) {
  7216. suspense.isHydrating = false;
  7217. } else if (!resume) {
  7218. delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
  7219. let hasUpdatedAnchor = false;
  7220. if (delayEnter) {
  7221. activeBranch.transition.afterLeave = () => {
  7222. if (pendingId === suspense.pendingId) {
  7223. move(
  7224. pendingBranch,
  7225. container2,
  7226. anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor,
  7227. 0
  7228. );
  7229. queuePostFlushCb(effects);
  7230. if (isInFallback && vnode2.ssFallback) {
  7231. vnode2.ssFallback.el = null;
  7232. }
  7233. }
  7234. };
  7235. }
  7236. if (activeBranch && !suspense.isFallbackMountPending) {
  7237. if (parentNode(activeBranch.el) === container2) {
  7238. anchor = next(activeBranch);
  7239. hasUpdatedAnchor = true;
  7240. }
  7241. unmount(activeBranch, parentComponent2, suspense, true);
  7242. if (!delayEnter && isInFallback && vnode2.ssFallback) {
  7243. queuePostRenderEffect(() => vnode2.ssFallback.el = null, suspense);
  7244. }
  7245. }
  7246. if (!delayEnter) {
  7247. move(pendingBranch, container2, anchor, 0);
  7248. }
  7249. }
  7250. suspense.isFallbackMountPending = false;
  7251. setActiveBranch(suspense, pendingBranch);
  7252. suspense.pendingBranch = null;
  7253. suspense.isInFallback = false;
  7254. let parent = suspense.parent;
  7255. let hasUnresolvedAncestor = false;
  7256. while (parent) {
  7257. if (parent.pendingBranch) {
  7258. parent.effects.push(...effects);
  7259. hasUnresolvedAncestor = true;
  7260. break;
  7261. }
  7262. parent = parent.parent;
  7263. }
  7264. if (!hasUnresolvedAncestor && !delayEnter) {
  7265. queuePostFlushCb(effects);
  7266. }
  7267. suspense.effects = [];
  7268. if (isSuspensible) {
  7269. if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
  7270. parentSuspense.deps--;
  7271. if (parentSuspense.deps === 0 && !sync) {
  7272. parentSuspense.resolve();
  7273. }
  7274. }
  7275. }
  7276. triggerEvent(vnode2, "onResolve");
  7277. },
  7278. fallback(fallbackVNode) {
  7279. if (!suspense.pendingBranch) {
  7280. return;
  7281. }
  7282. const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
  7283. triggerEvent(vnode2, "onFallback");
  7284. const anchor2 = next(activeBranch);
  7285. const mountFallback = () => {
  7286. suspense.isFallbackMountPending = false;
  7287. if (!suspense.isInFallback) {
  7288. return;
  7289. }
  7290. patch(
  7291. null,
  7292. fallbackVNode,
  7293. container2,
  7294. anchor2,
  7295. parentComponent2,
  7296. null,
  7297. // fallback tree will not have suspense context
  7298. namespace2,
  7299. slotScopeIds,
  7300. optimized
  7301. );
  7302. setActiveBranch(suspense, fallbackVNode);
  7303. };
  7304. const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
  7305. if (delayEnter) {
  7306. suspense.isFallbackMountPending = true;
  7307. activeBranch.transition.afterLeave = mountFallback;
  7308. }
  7309. suspense.isInFallback = true;
  7310. unmount(
  7311. activeBranch,
  7312. parentComponent2,
  7313. null,
  7314. // no suspense so unmount hooks fire now
  7315. true
  7316. // shouldRemove
  7317. );
  7318. if (!delayEnter) {
  7319. mountFallback();
  7320. }
  7321. },
  7322. move(container2, anchor2, type) {
  7323. suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
  7324. suspense.container = container2;
  7325. },
  7326. next() {
  7327. return suspense.activeBranch && next(suspense.activeBranch);
  7328. },
  7329. registerDep(instance, setupRenderEffect, optimized2) {
  7330. const isInPendingSuspense = !!suspense.pendingBranch;
  7331. if (isInPendingSuspense) {
  7332. suspense.deps++;
  7333. }
  7334. const hydratedEl = instance.vnode.el;
  7335. instance.asyncDep.catch((err) => {
  7336. handleError(err, instance, 0);
  7337. }).then((asyncSetupResult) => {
  7338. if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
  7339. return;
  7340. }
  7341. unsetCurrentInstance();
  7342. instance.asyncResolved = true;
  7343. const { vnode: vnode2 } = instance;
  7344. {
  7345. pushWarningContext(vnode2);
  7346. }
  7347. handleSetupResult(instance, asyncSetupResult, false);
  7348. if (hydratedEl) {
  7349. vnode2.el = hydratedEl;
  7350. }
  7351. const placeholder = !hydratedEl && instance.subTree.el;
  7352. setupRenderEffect(
  7353. instance,
  7354. vnode2,
  7355. // component may have been moved before resolve.
  7356. // if this is not a hydration, instance.subTree will be the comment
  7357. // placeholder.
  7358. parentNode(hydratedEl || instance.subTree.el),
  7359. // anchor will not be used if this is hydration, so only need to
  7360. // consider the comment placeholder case.
  7361. hydratedEl ? null : next(instance.subTree),
  7362. suspense,
  7363. namespace,
  7364. optimized2
  7365. );
  7366. if (placeholder) {
  7367. vnode2.placeholder = null;
  7368. remove(placeholder);
  7369. }
  7370. updateHOCHostEl(instance, vnode2.el);
  7371. {
  7372. popWarningContext();
  7373. }
  7374. if (isInPendingSuspense && --suspense.deps === 0) {
  7375. suspense.resolve();
  7376. }
  7377. });
  7378. },
  7379. unmount(parentSuspense2, doRemove) {
  7380. suspense.isUnmounted = true;
  7381. if (suspense.activeBranch) {
  7382. unmount(
  7383. suspense.activeBranch,
  7384. parentComponent,
  7385. parentSuspense2,
  7386. doRemove
  7387. );
  7388. }
  7389. if (suspense.pendingBranch) {
  7390. unmount(
  7391. suspense.pendingBranch,
  7392. parentComponent,
  7393. parentSuspense2,
  7394. doRemove
  7395. );
  7396. }
  7397. }
  7398. };
  7399. return suspense;
  7400. }
  7401. function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
  7402. const suspense = vnode.suspense = createSuspenseBoundary(
  7403. vnode,
  7404. parentSuspense,
  7405. parentComponent,
  7406. node.parentNode,
  7407. // eslint-disable-next-line no-restricted-globals
  7408. document.createElement("div"),
  7409. null,
  7410. namespace,
  7411. slotScopeIds,
  7412. optimized,
  7413. rendererInternals,
  7414. true
  7415. );
  7416. const result = hydrateNode(
  7417. node,
  7418. suspense.pendingBranch = vnode.ssContent,
  7419. parentComponent,
  7420. suspense,
  7421. slotScopeIds,
  7422. optimized
  7423. );
  7424. if (suspense.deps === 0) {
  7425. suspense.resolve(false, true);
  7426. }
  7427. return result;
  7428. }
  7429. function normalizeSuspenseChildren(vnode) {
  7430. const { shapeFlag, children } = vnode;
  7431. const isSlotChildren = shapeFlag & 32;
  7432. vnode.ssContent = normalizeSuspenseSlot(
  7433. isSlotChildren ? children.default : children
  7434. );
  7435. vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment);
  7436. }
  7437. function normalizeSuspenseSlot(s) {
  7438. let block;
  7439. if (shared.isFunction(s)) {
  7440. const trackBlock = isBlockTreeEnabled && s._c;
  7441. if (trackBlock) {
  7442. s._d = false;
  7443. openBlock();
  7444. }
  7445. s = s();
  7446. if (trackBlock) {
  7447. s._d = true;
  7448. block = currentBlock;
  7449. closeBlock();
  7450. }
  7451. }
  7452. if (shared.isArray(s)) {
  7453. const singleChild = filterSingleRoot(s);
  7454. if (!singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) {
  7455. warn$1(`<Suspense> slots expect a single root node.`);
  7456. }
  7457. s = singleChild;
  7458. }
  7459. s = normalizeVNode(s);
  7460. if (block && !s.dynamicChildren) {
  7461. s.dynamicChildren = block.filter((c) => c !== s);
  7462. }
  7463. return s;
  7464. }
  7465. function queueEffectWithSuspense(fn, suspense) {
  7466. if (suspense && suspense.pendingBranch) {
  7467. if (shared.isArray(fn)) {
  7468. suspense.effects.push(...fn);
  7469. } else {
  7470. suspense.effects.push(fn);
  7471. }
  7472. } else {
  7473. queuePostFlushCb(fn);
  7474. }
  7475. }
  7476. function setActiveBranch(suspense, branch) {
  7477. suspense.activeBranch = branch;
  7478. const { vnode, parentComponent } = suspense;
  7479. let el = branch.el;
  7480. while (!el && branch.component) {
  7481. branch = branch.component.subTree;
  7482. el = branch.el;
  7483. }
  7484. vnode.el = el;
  7485. if (parentComponent && parentComponent.subTree === vnode) {
  7486. parentComponent.vnode.el = el;
  7487. updateHOCHostEl(parentComponent, el);
  7488. }
  7489. }
  7490. function isVNodeSuspensible(vnode) {
  7491. const suspensible = vnode.props && vnode.props.suspensible;
  7492. return suspensible != null && suspensible !== false;
  7493. }
  7494. const Fragment = /* @__PURE__ */ Symbol.for("v-fgt");
  7495. const Text = /* @__PURE__ */ Symbol.for("v-txt");
  7496. const Comment = /* @__PURE__ */ Symbol.for("v-cmt");
  7497. const Static = /* @__PURE__ */ Symbol.for("v-stc");
  7498. const blockStack = [];
  7499. let currentBlock = null;
  7500. function openBlock(disableTracking = false) {
  7501. blockStack.push(currentBlock = disableTracking ? null : []);
  7502. }
  7503. function closeBlock() {
  7504. blockStack.pop();
  7505. currentBlock = blockStack[blockStack.length - 1] || null;
  7506. }
  7507. let isBlockTreeEnabled = 1;
  7508. function setBlockTracking(value, inVOnce = false) {
  7509. isBlockTreeEnabled += value;
  7510. if (value < 0 && currentBlock && inVOnce) {
  7511. currentBlock.hasOnce = true;
  7512. }
  7513. }
  7514. function setupBlock(vnode) {
  7515. vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || shared.EMPTY_ARR : null;
  7516. closeBlock();
  7517. if (isBlockTreeEnabled > 0 && currentBlock) {
  7518. currentBlock.push(vnode);
  7519. }
  7520. return vnode;
  7521. }
  7522. function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
  7523. return setupBlock(
  7524. createBaseVNode(
  7525. type,
  7526. props,
  7527. children,
  7528. patchFlag,
  7529. dynamicProps,
  7530. shapeFlag,
  7531. true
  7532. )
  7533. );
  7534. }
  7535. function createBlock(type, props, children, patchFlag, dynamicProps) {
  7536. return setupBlock(
  7537. createVNode(
  7538. type,
  7539. props,
  7540. children,
  7541. patchFlag,
  7542. dynamicProps,
  7543. true
  7544. )
  7545. );
  7546. }
  7547. function isVNode(value) {
  7548. return value ? value.__v_isVNode === true : false;
  7549. }
  7550. function isSameVNodeType(n1, n2) {
  7551. if (n2.shapeFlag & 6 && n1.component) {
  7552. const dirtyInstances = hmrDirtyComponents.get(n2.type);
  7553. if (dirtyInstances && dirtyInstances.has(n1.component)) {
  7554. n1.shapeFlag &= -257;
  7555. n2.shapeFlag &= -513;
  7556. return false;
  7557. }
  7558. }
  7559. return n1.type === n2.type && n1.key === n2.key;
  7560. }
  7561. let vnodeArgsTransformer;
  7562. function transformVNodeArgs(transformer) {
  7563. vnodeArgsTransformer = transformer;
  7564. }
  7565. const createVNodeWithArgsTransform = (...args) => {
  7566. return _createVNode(
  7567. ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args
  7568. );
  7569. };
  7570. const normalizeKey = ({ key }) => key != null ? key : null;
  7571. const normalizeRef = ({
  7572. ref,
  7573. ref_key,
  7574. ref_for
  7575. }) => {
  7576. if (typeof ref === "number") {
  7577. ref = "" + ref;
  7578. }
  7579. return ref != null ? shared.isString(ref) || reactivity.isRef(ref) || shared.isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
  7580. };
  7581. function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
  7582. const vnode = {
  7583. __v_isVNode: true,
  7584. __v_skip: true,
  7585. type,
  7586. props,
  7587. key: props && normalizeKey(props),
  7588. ref: props && normalizeRef(props),
  7589. scopeId: currentScopeId,
  7590. slotScopeIds: null,
  7591. children,
  7592. component: null,
  7593. suspense: null,
  7594. ssContent: null,
  7595. ssFallback: null,
  7596. dirs: null,
  7597. transition: null,
  7598. el: null,
  7599. anchor: null,
  7600. target: null,
  7601. targetStart: null,
  7602. targetAnchor: null,
  7603. staticCount: 0,
  7604. shapeFlag,
  7605. patchFlag,
  7606. dynamicProps,
  7607. dynamicChildren: null,
  7608. appContext: null,
  7609. ctx: currentRenderingInstance
  7610. };
  7611. if (needFullChildrenNormalization) {
  7612. normalizeChildren(vnode, children);
  7613. if (shapeFlag & 128) {
  7614. type.normalize(vnode);
  7615. }
  7616. } else if (children) {
  7617. vnode.shapeFlag |= shared.isString(children) ? 8 : 16;
  7618. }
  7619. if (vnode.key !== vnode.key) {
  7620. warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
  7621. }
  7622. if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
  7623. !isBlockNode && // has current parent block
  7624. currentBlock && // presence of a patch flag indicates this node needs patching on updates.
  7625. // component nodes also should always be patched, because even if the
  7626. // component doesn't need to update, it needs to persist the instance on to
  7627. // the next vnode so that it can be properly unmounted later.
  7628. (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
  7629. // vnode should not be considered dynamic due to handler caching.
  7630. vnode.patchFlag !== 32) {
  7631. currentBlock.push(vnode);
  7632. }
  7633. return vnode;
  7634. }
  7635. const createVNode = createVNodeWithArgsTransform ;
  7636. function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
  7637. if (!type || type === NULL_DYNAMIC_COMPONENT) {
  7638. if (!type) {
  7639. warn$1(`Invalid vnode type when creating vnode: ${type}.`);
  7640. }
  7641. type = Comment;
  7642. }
  7643. if (isVNode(type)) {
  7644. const cloned = cloneVNode(
  7645. type,
  7646. props,
  7647. true
  7648. /* mergeRef: true */
  7649. );
  7650. if (children) {
  7651. normalizeChildren(cloned, children);
  7652. }
  7653. if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
  7654. if (cloned.shapeFlag & 6) {
  7655. currentBlock[currentBlock.indexOf(type)] = cloned;
  7656. } else {
  7657. currentBlock.push(cloned);
  7658. }
  7659. }
  7660. cloned.patchFlag = -2;
  7661. return cloned;
  7662. }
  7663. if (isClassComponent(type)) {
  7664. type = type.__vccOpts;
  7665. }
  7666. if (props) {
  7667. props = guardReactiveProps(props);
  7668. let { class: klass, style } = props;
  7669. if (klass && !shared.isString(klass)) {
  7670. props.class = shared.normalizeClass(klass);
  7671. }
  7672. if (shared.isObject(style)) {
  7673. if (reactivity.isProxy(style) && !shared.isArray(style)) {
  7674. style = shared.extend({}, style);
  7675. }
  7676. props.style = shared.normalizeStyle(style);
  7677. }
  7678. }
  7679. const shapeFlag = shared.isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : shared.isObject(type) ? 4 : shared.isFunction(type) ? 2 : 0;
  7680. if (shapeFlag & 4 && reactivity.isProxy(type)) {
  7681. type = reactivity.toRaw(type);
  7682. warn$1(
  7683. `Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`,
  7684. `
  7685. Component that was made reactive: `,
  7686. type
  7687. );
  7688. }
  7689. return createBaseVNode(
  7690. type,
  7691. props,
  7692. children,
  7693. patchFlag,
  7694. dynamicProps,
  7695. shapeFlag,
  7696. isBlockNode,
  7697. true
  7698. );
  7699. }
  7700. function guardReactiveProps(props) {
  7701. if (!props) return null;
  7702. return reactivity.isProxy(props) || isInternalObject(props) ? shared.extend({}, props) : props;
  7703. }
  7704. function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
  7705. const { props, ref, patchFlag, children, transition } = vnode;
  7706. const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
  7707. const cloned = {
  7708. __v_isVNode: true,
  7709. __v_skip: true,
  7710. type: vnode.type,
  7711. props: mergedProps,
  7712. key: mergedProps && normalizeKey(mergedProps),
  7713. ref: extraProps && extraProps.ref ? (
  7714. // #2078 in the case of <component :is="vnode" ref="extra"/>
  7715. // if the vnode itself already has a ref, cloneVNode will need to merge
  7716. // the refs so the single vnode can be set on multiple refs
  7717. mergeRef && ref ? shared.isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps)
  7718. ) : ref,
  7719. scopeId: vnode.scopeId,
  7720. slotScopeIds: vnode.slotScopeIds,
  7721. children: patchFlag === -1 && shared.isArray(children) ? children.map(deepCloneVNode) : children,
  7722. target: vnode.target,
  7723. targetStart: vnode.targetStart,
  7724. targetAnchor: vnode.targetAnchor,
  7725. staticCount: vnode.staticCount,
  7726. shapeFlag: vnode.shapeFlag,
  7727. // if the vnode is cloned with extra props, we can no longer assume its
  7728. // existing patch flag to be reliable and need to add the FULL_PROPS flag.
  7729. // note: preserve flag for fragments since they use the flag for children
  7730. // fast paths only.
  7731. patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
  7732. dynamicProps: vnode.dynamicProps,
  7733. dynamicChildren: vnode.dynamicChildren,
  7734. appContext: vnode.appContext,
  7735. dirs: vnode.dirs,
  7736. transition,
  7737. // These should technically only be non-null on mounted VNodes. However,
  7738. // they *should* be copied for kept-alive vnodes. So we just always copy
  7739. // them since them being non-null during a mount doesn't affect the logic as
  7740. // they will simply be overwritten.
  7741. component: vnode.component,
  7742. suspense: vnode.suspense,
  7743. ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
  7744. ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
  7745. placeholder: vnode.placeholder,
  7746. el: vnode.el,
  7747. anchor: vnode.anchor,
  7748. ctx: vnode.ctx,
  7749. ce: vnode.ce
  7750. };
  7751. if (transition && cloneTransition) {
  7752. setTransitionHooks(
  7753. cloned,
  7754. transition.clone(cloned)
  7755. );
  7756. }
  7757. return cloned;
  7758. }
  7759. function deepCloneVNode(vnode) {
  7760. const cloned = cloneVNode(vnode);
  7761. if (shared.isArray(vnode.children)) {
  7762. cloned.children = vnode.children.map(deepCloneVNode);
  7763. }
  7764. return cloned;
  7765. }
  7766. function createTextVNode(text = " ", flag = 0) {
  7767. return createVNode(Text, null, text, flag);
  7768. }
  7769. function createStaticVNode(content, numberOfNodes) {
  7770. const vnode = createVNode(Static, null, content);
  7771. vnode.staticCount = numberOfNodes;
  7772. return vnode;
  7773. }
  7774. function createCommentVNode(text = "", asBlock = false) {
  7775. return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
  7776. }
  7777. function normalizeVNode(child) {
  7778. if (child == null || typeof child === "boolean") {
  7779. return createVNode(Comment);
  7780. } else if (shared.isArray(child)) {
  7781. return createVNode(
  7782. Fragment,
  7783. null,
  7784. // #3666, avoid reference pollution when reusing vnode
  7785. child.slice()
  7786. );
  7787. } else if (isVNode(child)) {
  7788. return cloneIfMounted(child);
  7789. } else {
  7790. return createVNode(Text, null, String(child));
  7791. }
  7792. }
  7793. function cloneIfMounted(child) {
  7794. return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
  7795. }
  7796. function normalizeChildren(vnode, children) {
  7797. let type = 0;
  7798. const { shapeFlag } = vnode;
  7799. if (children == null) {
  7800. children = null;
  7801. } else if (shared.isArray(children)) {
  7802. type = 16;
  7803. } else if (typeof children === "object") {
  7804. if (shapeFlag & (1 | 64)) {
  7805. const slot = children.default;
  7806. if (slot) {
  7807. slot._c && (slot._d = false);
  7808. normalizeChildren(vnode, slot());
  7809. slot._c && (slot._d = true);
  7810. }
  7811. return;
  7812. } else {
  7813. type = 32;
  7814. const slotFlag = children._;
  7815. if (!slotFlag && !isInternalObject(children)) {
  7816. children._ctx = currentRenderingInstance;
  7817. } else if (slotFlag === 3 && currentRenderingInstance) {
  7818. if (currentRenderingInstance.slots._ === 1) {
  7819. children._ = 1;
  7820. } else {
  7821. children._ = 2;
  7822. vnode.patchFlag |= 1024;
  7823. }
  7824. }
  7825. }
  7826. } else if (shared.isFunction(children)) {
  7827. children = { default: children, _ctx: currentRenderingInstance };
  7828. type = 32;
  7829. } else {
  7830. children = String(children);
  7831. if (shapeFlag & 64) {
  7832. type = 16;
  7833. children = [createTextVNode(children)];
  7834. } else {
  7835. type = 8;
  7836. }
  7837. }
  7838. vnode.children = children;
  7839. vnode.shapeFlag |= type;
  7840. }
  7841. function mergeProps(...args) {
  7842. const ret = {};
  7843. for (let i = 0; i < args.length; i++) {
  7844. const toMerge = args[i];
  7845. for (const key in toMerge) {
  7846. if (key === "class") {
  7847. if (ret.class !== toMerge.class) {
  7848. ret.class = shared.normalizeClass([ret.class, toMerge.class]);
  7849. }
  7850. } else if (key === "style") {
  7851. ret.style = shared.normalizeStyle([ret.style, toMerge.style]);
  7852. } else if (shared.isOn(key)) {
  7853. const existing = ret[key];
  7854. const incoming = toMerge[key];
  7855. if (incoming && existing !== incoming && !(shared.isArray(existing) && existing.includes(incoming))) {
  7856. ret[key] = existing ? [].concat(existing, incoming) : incoming;
  7857. } else if (incoming == null && existing == null && // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain
  7858. // the model listener.
  7859. !shared.isModelListener(key)) {
  7860. ret[key] = incoming;
  7861. }
  7862. } else if (key !== "") {
  7863. ret[key] = toMerge[key];
  7864. }
  7865. }
  7866. }
  7867. return ret;
  7868. }
  7869. function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
  7870. callWithAsyncErrorHandling(hook, instance, 7, [
  7871. vnode,
  7872. prevVNode
  7873. ]);
  7874. }
  7875. const emptyAppContext = createAppContext();
  7876. let uid = 0;
  7877. function createComponentInstance(vnode, parent, suspense) {
  7878. const type = vnode.type;
  7879. const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  7880. const instance = {
  7881. uid: uid++,
  7882. vnode,
  7883. type,
  7884. parent,
  7885. appContext,
  7886. root: null,
  7887. // to be immediately set
  7888. next: null,
  7889. subTree: null,
  7890. // will be set synchronously right after creation
  7891. effect: null,
  7892. update: null,
  7893. // will be set synchronously right after creation
  7894. job: null,
  7895. scope: new reactivity.EffectScope(
  7896. true
  7897. /* detached */
  7898. ),
  7899. render: null,
  7900. proxy: null,
  7901. exposed: null,
  7902. exposeProxy: null,
  7903. withProxy: null,
  7904. provides: parent ? parent.provides : Object.create(appContext.provides),
  7905. ids: parent ? parent.ids : ["", 0, 0],
  7906. accessCache: null,
  7907. renderCache: [],
  7908. // local resolved assets
  7909. components: null,
  7910. directives: null,
  7911. // resolved props and emits options
  7912. propsOptions: normalizePropsOptions(type, appContext),
  7913. emitsOptions: normalizeEmitsOptions(type, appContext),
  7914. // emit
  7915. emit: null,
  7916. // to be set immediately
  7917. emitted: null,
  7918. // props default value
  7919. propsDefaults: shared.EMPTY_OBJ,
  7920. // inheritAttrs
  7921. inheritAttrs: type.inheritAttrs,
  7922. // state
  7923. ctx: shared.EMPTY_OBJ,
  7924. data: shared.EMPTY_OBJ,
  7925. props: shared.EMPTY_OBJ,
  7926. attrs: shared.EMPTY_OBJ,
  7927. slots: shared.EMPTY_OBJ,
  7928. refs: shared.EMPTY_OBJ,
  7929. setupState: shared.EMPTY_OBJ,
  7930. setupContext: null,
  7931. // suspense related
  7932. suspense,
  7933. suspenseId: suspense ? suspense.pendingId : 0,
  7934. asyncDep: null,
  7935. asyncResolved: false,
  7936. // lifecycle hooks
  7937. // not using enums here because it results in computed properties
  7938. isMounted: false,
  7939. isUnmounted: false,
  7940. isDeactivated: false,
  7941. bc: null,
  7942. c: null,
  7943. bm: null,
  7944. m: null,
  7945. bu: null,
  7946. u: null,
  7947. um: null,
  7948. bum: null,
  7949. da: null,
  7950. a: null,
  7951. rtg: null,
  7952. rtc: null,
  7953. ec: null,
  7954. sp: null
  7955. };
  7956. {
  7957. instance.ctx = createDevRenderContext(instance);
  7958. }
  7959. instance.root = parent ? parent.root : instance;
  7960. instance.emit = emit.bind(null, instance);
  7961. if (vnode.ce) {
  7962. vnode.ce(instance);
  7963. }
  7964. return instance;
  7965. }
  7966. let currentInstance = null;
  7967. const getCurrentInstance = () => currentInstance || currentRenderingInstance;
  7968. let internalSetCurrentInstance;
  7969. let setInSSRSetupState;
  7970. {
  7971. const g = shared.getGlobalThis();
  7972. const registerGlobalSetter = (key, setter) => {
  7973. let setters;
  7974. if (!(setters = g[key])) setters = g[key] = [];
  7975. setters.push(setter);
  7976. return (v) => {
  7977. if (setters.length > 1) setters.forEach((set) => set(v));
  7978. else setters[0](v);
  7979. };
  7980. };
  7981. internalSetCurrentInstance = registerGlobalSetter(
  7982. `__VUE_INSTANCE_SETTERS__`,
  7983. (v) => currentInstance = v
  7984. );
  7985. setInSSRSetupState = registerGlobalSetter(
  7986. `__VUE_SSR_SETTERS__`,
  7987. (v) => isInSSRComponentSetup = v
  7988. );
  7989. }
  7990. const setCurrentInstance = (instance) => {
  7991. const prev = currentInstance;
  7992. internalSetCurrentInstance(instance);
  7993. instance.scope.on();
  7994. return () => {
  7995. instance.scope.off();
  7996. internalSetCurrentInstance(prev);
  7997. };
  7998. };
  7999. const unsetCurrentInstance = () => {
  8000. currentInstance && currentInstance.scope.off();
  8001. internalSetCurrentInstance(null);
  8002. };
  8003. const isBuiltInTag = /* @__PURE__ */ shared.makeMap("slot,component");
  8004. function validateComponentName(name, { isNativeTag }) {
  8005. if (isBuiltInTag(name) || isNativeTag(name)) {
  8006. warn$1(
  8007. "Do not use built-in or reserved HTML elements as component id: " + name
  8008. );
  8009. }
  8010. }
  8011. function isStatefulComponent(instance) {
  8012. return instance.vnode.shapeFlag & 4;
  8013. }
  8014. let isInSSRComponentSetup = false;
  8015. function setupComponent(instance, isSSR = false, optimized = false) {
  8016. isSSR && setInSSRSetupState(isSSR);
  8017. const { props, children } = instance.vnode;
  8018. const isStateful = isStatefulComponent(instance);
  8019. initProps(instance, props, isStateful, isSSR);
  8020. initSlots(instance, children, optimized || isSSR);
  8021. const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  8022. isSSR && setInSSRSetupState(false);
  8023. return setupResult;
  8024. }
  8025. function setupStatefulComponent(instance, isSSR) {
  8026. const Component = instance.type;
  8027. {
  8028. if (Component.name) {
  8029. validateComponentName(Component.name, instance.appContext.config);
  8030. }
  8031. if (Component.components) {
  8032. const names = Object.keys(Component.components);
  8033. for (let i = 0; i < names.length; i++) {
  8034. validateComponentName(names[i], instance.appContext.config);
  8035. }
  8036. }
  8037. if (Component.directives) {
  8038. const names = Object.keys(Component.directives);
  8039. for (let i = 0; i < names.length; i++) {
  8040. validateDirectiveName(names[i]);
  8041. }
  8042. }
  8043. if (Component.compilerOptions && isRuntimeOnly()) {
  8044. warn$1(
  8045. `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`
  8046. );
  8047. }
  8048. }
  8049. instance.accessCache = /* @__PURE__ */ Object.create(null);
  8050. instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
  8051. {
  8052. exposePropsOnRenderContext(instance);
  8053. }
  8054. const { setup } = Component;
  8055. if (setup) {
  8056. reactivity.pauseTracking();
  8057. const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
  8058. const reset = setCurrentInstance(instance);
  8059. const setupResult = callWithErrorHandling(
  8060. setup,
  8061. instance,
  8062. 0,
  8063. [
  8064. reactivity.shallowReadonly(instance.props) ,
  8065. setupContext
  8066. ]
  8067. );
  8068. const isAsyncSetup = shared.isPromise(setupResult);
  8069. reactivity.resetTracking();
  8070. reset();
  8071. if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
  8072. markAsyncBoundary(instance);
  8073. }
  8074. if (isAsyncSetup) {
  8075. setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
  8076. if (isSSR) {
  8077. return setupResult.then((resolvedResult) => {
  8078. handleSetupResult(instance, resolvedResult, isSSR);
  8079. }).catch((e) => {
  8080. handleError(e, instance, 0);
  8081. });
  8082. } else {
  8083. instance.asyncDep = setupResult;
  8084. if (!instance.suspense) {
  8085. const name = formatComponentName(instance, Component);
  8086. warn$1(
  8087. `Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`
  8088. );
  8089. }
  8090. }
  8091. } else {
  8092. handleSetupResult(instance, setupResult, isSSR);
  8093. }
  8094. } else {
  8095. finishComponentSetup(instance, isSSR);
  8096. }
  8097. }
  8098. function handleSetupResult(instance, setupResult, isSSR) {
  8099. if (shared.isFunction(setupResult)) {
  8100. if (instance.type.__ssrInlineRender) {
  8101. instance.ssrRender = setupResult;
  8102. } else {
  8103. instance.render = setupResult;
  8104. }
  8105. } else if (shared.isObject(setupResult)) {
  8106. if (isVNode(setupResult)) {
  8107. warn$1(
  8108. `setup() should not return VNodes directly - return a render function instead.`
  8109. );
  8110. }
  8111. {
  8112. instance.devtoolsRawSetupState = setupResult;
  8113. }
  8114. instance.setupState = reactivity.proxyRefs(setupResult);
  8115. {
  8116. exposeSetupStateOnRenderContext(instance);
  8117. }
  8118. } else if (setupResult !== void 0) {
  8119. warn$1(
  8120. `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`
  8121. );
  8122. }
  8123. finishComponentSetup(instance, isSSR);
  8124. }
  8125. let compile;
  8126. let installWithProxy;
  8127. function registerRuntimeCompiler(_compile) {
  8128. compile = _compile;
  8129. installWithProxy = (i) => {
  8130. if (i.render._rc) {
  8131. i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
  8132. }
  8133. };
  8134. }
  8135. const isRuntimeOnly = () => !compile;
  8136. function finishComponentSetup(instance, isSSR, skipOptions) {
  8137. const Component = instance.type;
  8138. if (!instance.render) {
  8139. if (!isSSR && compile && !Component.render) {
  8140. const template = Component.template || resolveMergedOptions(instance).template;
  8141. if (template) {
  8142. {
  8143. startMeasure(instance, `compile`);
  8144. }
  8145. const { isCustomElement, compilerOptions } = instance.appContext.config;
  8146. const { delimiters, compilerOptions: componentCompilerOptions } = Component;
  8147. const finalCompilerOptions = shared.extend(
  8148. shared.extend(
  8149. {
  8150. isCustomElement,
  8151. delimiters
  8152. },
  8153. compilerOptions
  8154. ),
  8155. componentCompilerOptions
  8156. );
  8157. Component.render = compile(template, finalCompilerOptions);
  8158. {
  8159. endMeasure(instance, `compile`);
  8160. }
  8161. }
  8162. }
  8163. instance.render = Component.render || shared.NOOP;
  8164. if (installWithProxy) {
  8165. installWithProxy(instance);
  8166. }
  8167. }
  8168. {
  8169. const reset = setCurrentInstance(instance);
  8170. reactivity.pauseTracking();
  8171. try {
  8172. applyOptions(instance);
  8173. } finally {
  8174. reactivity.resetTracking();
  8175. reset();
  8176. }
  8177. }
  8178. if (!Component.render && instance.render === shared.NOOP && !isSSR) {
  8179. if (!compile && Component.template) {
  8180. warn$1(
  8181. `Component provided template option but runtime compilation is not supported in this build of Vue.` + (``)
  8182. );
  8183. } else {
  8184. warn$1(`Component is missing template or render function: `, Component);
  8185. }
  8186. }
  8187. }
  8188. const attrsProxyHandlers = {
  8189. get(target, key) {
  8190. markAttrsAccessed();
  8191. reactivity.track(target, "get", "");
  8192. return target[key];
  8193. },
  8194. set() {
  8195. warn$1(`setupContext.attrs is readonly.`);
  8196. return false;
  8197. },
  8198. deleteProperty() {
  8199. warn$1(`setupContext.attrs is readonly.`);
  8200. return false;
  8201. }
  8202. } ;
  8203. function getSlotsProxy(instance) {
  8204. return new Proxy(instance.slots, {
  8205. get(target, key) {
  8206. reactivity.track(instance, "get", "$slots");
  8207. return target[key];
  8208. }
  8209. });
  8210. }
  8211. function createSetupContext(instance) {
  8212. const expose = (exposed) => {
  8213. {
  8214. if (instance.exposed) {
  8215. warn$1(`expose() should be called only once per setup().`);
  8216. }
  8217. if (exposed != null) {
  8218. let exposedType = typeof exposed;
  8219. if (exposedType === "object") {
  8220. if (shared.isArray(exposed)) {
  8221. exposedType = "array";
  8222. } else if (reactivity.isRef(exposed)) {
  8223. exposedType = "ref";
  8224. }
  8225. }
  8226. if (exposedType !== "object") {
  8227. warn$1(
  8228. `expose() should be passed a plain object, received ${exposedType}.`
  8229. );
  8230. }
  8231. }
  8232. }
  8233. instance.exposed = exposed || {};
  8234. };
  8235. {
  8236. let attrsProxy;
  8237. let slotsProxy;
  8238. return Object.freeze({
  8239. get attrs() {
  8240. return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));
  8241. },
  8242. get slots() {
  8243. return slotsProxy || (slotsProxy = getSlotsProxy(instance));
  8244. },
  8245. get emit() {
  8246. return (event, ...args) => instance.emit(event, ...args);
  8247. },
  8248. expose
  8249. });
  8250. }
  8251. }
  8252. function getComponentPublicInstance(instance) {
  8253. if (instance.exposed) {
  8254. return instance.exposeProxy || (instance.exposeProxy = new Proxy(reactivity.proxyRefs(reactivity.markRaw(instance.exposed)), {
  8255. get(target, key) {
  8256. if (key in target) {
  8257. return target[key];
  8258. } else if (key in publicPropertiesMap) {
  8259. return publicPropertiesMap[key](instance);
  8260. }
  8261. },
  8262. has(target, key) {
  8263. return key in target || key in publicPropertiesMap;
  8264. }
  8265. }));
  8266. } else {
  8267. return instance.proxy;
  8268. }
  8269. }
  8270. const classifyRE = /(?:^|[-_])\w/g;
  8271. const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
  8272. function getComponentName(Component, includeInferred = true) {
  8273. return shared.isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
  8274. }
  8275. function formatComponentName(instance, Component, isRoot = false) {
  8276. let name = getComponentName(Component);
  8277. if (!name && Component.__file) {
  8278. const match = Component.__file.match(/([^/\\]+)\.\w+$/);
  8279. if (match) {
  8280. name = match[1];
  8281. }
  8282. }
  8283. if (!name && instance) {
  8284. const inferFromRegistry = (registry) => {
  8285. for (const key in registry) {
  8286. if (registry[key] === Component) {
  8287. return key;
  8288. }
  8289. }
  8290. };
  8291. name = inferFromRegistry(instance.components) || instance.parent && inferFromRegistry(
  8292. instance.parent.type.components
  8293. ) || inferFromRegistry(instance.appContext.components);
  8294. }
  8295. return name ? classify(name) : isRoot ? `App` : `Anonymous`;
  8296. }
  8297. function isClassComponent(value) {
  8298. return shared.isFunction(value) && "__vccOpts" in value;
  8299. }
  8300. const computed = (getterOrOptions, debugOptions) => {
  8301. const c = reactivity.computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
  8302. {
  8303. const i = getCurrentInstance();
  8304. if (i && i.appContext.config.warnRecursiveComputed) {
  8305. c._warnRecursive = true;
  8306. }
  8307. }
  8308. return c;
  8309. };
  8310. function h(type, propsOrChildren, children) {
  8311. try {
  8312. setBlockTracking(-1);
  8313. const l = arguments.length;
  8314. if (l === 2) {
  8315. if (shared.isObject(propsOrChildren) && !shared.isArray(propsOrChildren)) {
  8316. if (isVNode(propsOrChildren)) {
  8317. return createVNode(type, null, [propsOrChildren]);
  8318. }
  8319. return createVNode(type, propsOrChildren);
  8320. } else {
  8321. return createVNode(type, null, propsOrChildren);
  8322. }
  8323. } else {
  8324. if (l > 3) {
  8325. children = Array.prototype.slice.call(arguments, 2);
  8326. } else if (l === 3 && isVNode(children)) {
  8327. children = [children];
  8328. }
  8329. return createVNode(type, propsOrChildren, children);
  8330. }
  8331. } finally {
  8332. setBlockTracking(1);
  8333. }
  8334. }
  8335. function initCustomFormatter() {
  8336. if (typeof window === "undefined") {
  8337. return;
  8338. }
  8339. const vueStyle = { style: "color:#3ba776" };
  8340. const numberStyle = { style: "color:#1677ff" };
  8341. const stringStyle = { style: "color:#f5222d" };
  8342. const keywordStyle = { style: "color:#eb2f96" };
  8343. const formatter = {
  8344. __vue_custom_formatter: true,
  8345. header(obj) {
  8346. if (!shared.isObject(obj)) {
  8347. return null;
  8348. }
  8349. if (obj.__isVue) {
  8350. return ["div", vueStyle, `VueInstance`];
  8351. } else if (reactivity.isRef(obj)) {
  8352. reactivity.pauseTracking();
  8353. const value = obj.value;
  8354. reactivity.resetTracking();
  8355. return [
  8356. "div",
  8357. {},
  8358. ["span", vueStyle, genRefFlag(obj)],
  8359. "<",
  8360. formatValue(value),
  8361. `>`
  8362. ];
  8363. } else if (reactivity.isReactive(obj)) {
  8364. return [
  8365. "div",
  8366. {},
  8367. ["span", vueStyle, reactivity.isShallow(obj) ? "ShallowReactive" : "Reactive"],
  8368. "<",
  8369. formatValue(obj),
  8370. `>${reactivity.isReadonly(obj) ? ` (readonly)` : ``}`
  8371. ];
  8372. } else if (reactivity.isReadonly(obj)) {
  8373. return [
  8374. "div",
  8375. {},
  8376. ["span", vueStyle, reactivity.isShallow(obj) ? "ShallowReadonly" : "Readonly"],
  8377. "<",
  8378. formatValue(obj),
  8379. ">"
  8380. ];
  8381. }
  8382. return null;
  8383. },
  8384. hasBody(obj) {
  8385. return obj && obj.__isVue;
  8386. },
  8387. body(obj) {
  8388. if (obj && obj.__isVue) {
  8389. return [
  8390. "div",
  8391. {},
  8392. ...formatInstance(obj.$)
  8393. ];
  8394. }
  8395. }
  8396. };
  8397. function formatInstance(instance) {
  8398. const blocks = [];
  8399. if (instance.type.props && instance.props) {
  8400. blocks.push(createInstanceBlock("props", reactivity.toRaw(instance.props)));
  8401. }
  8402. if (instance.setupState !== shared.EMPTY_OBJ) {
  8403. blocks.push(createInstanceBlock("setup", instance.setupState));
  8404. }
  8405. if (instance.data !== shared.EMPTY_OBJ) {
  8406. blocks.push(createInstanceBlock("data", reactivity.toRaw(instance.data)));
  8407. }
  8408. const computed = extractKeys(instance, "computed");
  8409. if (computed) {
  8410. blocks.push(createInstanceBlock("computed", computed));
  8411. }
  8412. const injected = extractKeys(instance, "inject");
  8413. if (injected) {
  8414. blocks.push(createInstanceBlock("injected", injected));
  8415. }
  8416. blocks.push([
  8417. "div",
  8418. {},
  8419. [
  8420. "span",
  8421. {
  8422. style: keywordStyle.style + ";opacity:0.66"
  8423. },
  8424. "$ (internal): "
  8425. ],
  8426. ["object", { object: instance }]
  8427. ]);
  8428. return blocks;
  8429. }
  8430. function createInstanceBlock(type, target) {
  8431. target = shared.extend({}, target);
  8432. if (!Object.keys(target).length) {
  8433. return ["span", {}];
  8434. }
  8435. return [
  8436. "div",
  8437. { style: "line-height:1.25em;margin-bottom:0.6em" },
  8438. [
  8439. "div",
  8440. {
  8441. style: "color:#476582"
  8442. },
  8443. type
  8444. ],
  8445. [
  8446. "div",
  8447. {
  8448. style: "padding-left:1.25em"
  8449. },
  8450. ...Object.keys(target).map((key) => {
  8451. return [
  8452. "div",
  8453. {},
  8454. ["span", keywordStyle, key + ": "],
  8455. formatValue(target[key], false)
  8456. ];
  8457. })
  8458. ]
  8459. ];
  8460. }
  8461. function formatValue(v, asRaw = true) {
  8462. if (typeof v === "number") {
  8463. return ["span", numberStyle, v];
  8464. } else if (typeof v === "string") {
  8465. return ["span", stringStyle, JSON.stringify(v)];
  8466. } else if (typeof v === "boolean") {
  8467. return ["span", keywordStyle, v];
  8468. } else if (shared.isObject(v)) {
  8469. return ["object", { object: asRaw ? reactivity.toRaw(v) : v }];
  8470. } else {
  8471. return ["span", stringStyle, String(v)];
  8472. }
  8473. }
  8474. function extractKeys(instance, type) {
  8475. const Comp = instance.type;
  8476. if (shared.isFunction(Comp)) {
  8477. return;
  8478. }
  8479. const extracted = {};
  8480. for (const key in instance.ctx) {
  8481. if (isKeyOfType(Comp, key, type)) {
  8482. extracted[key] = instance.ctx[key];
  8483. }
  8484. }
  8485. return extracted;
  8486. }
  8487. function isKeyOfType(Comp, key, type) {
  8488. const opts = Comp[type];
  8489. if (shared.isArray(opts) && opts.includes(key) || shared.isObject(opts) && key in opts) {
  8490. return true;
  8491. }
  8492. if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {
  8493. return true;
  8494. }
  8495. if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) {
  8496. return true;
  8497. }
  8498. }
  8499. function genRefFlag(v) {
  8500. if (reactivity.isShallow(v)) {
  8501. return `ShallowRef`;
  8502. }
  8503. if (v.effect) {
  8504. return `ComputedRef`;
  8505. }
  8506. return `Ref`;
  8507. }
  8508. if (window.devtoolsFormatters) {
  8509. window.devtoolsFormatters.push(formatter);
  8510. } else {
  8511. window.devtoolsFormatters = [formatter];
  8512. }
  8513. }
  8514. function withMemo(memo, render, cache, index) {
  8515. const cached = cache[index];
  8516. if (cached && isMemoSame(cached, memo)) {
  8517. return cached;
  8518. }
  8519. const ret = render();
  8520. ret.memo = memo.slice();
  8521. ret.cacheIndex = index;
  8522. return cache[index] = ret;
  8523. }
  8524. function isMemoSame(cached, memo) {
  8525. const prev = cached.memo;
  8526. if (prev.length != memo.length) {
  8527. return false;
  8528. }
  8529. for (let i = 0; i < prev.length; i++) {
  8530. if (shared.hasChanged(prev[i], memo[i])) {
  8531. return false;
  8532. }
  8533. }
  8534. if (isBlockTreeEnabled > 0 && currentBlock) {
  8535. currentBlock.push(cached);
  8536. }
  8537. return true;
  8538. }
  8539. const version = "3.5.38";
  8540. const warn = warn$1 ;
  8541. const ErrorTypeStrings = ErrorTypeStrings$1 ;
  8542. const devtools = devtools$1 ;
  8543. const setDevtoolsHook = setDevtoolsHook$1 ;
  8544. const _ssrUtils = {
  8545. createComponentInstance,
  8546. setupComponent,
  8547. renderComponentRoot,
  8548. setCurrentRenderingInstance,
  8549. isVNode: isVNode,
  8550. normalizeVNode,
  8551. getComponentPublicInstance,
  8552. ensureValidVNode,
  8553. pushWarningContext,
  8554. popWarningContext
  8555. };
  8556. const ssrUtils = _ssrUtils ;
  8557. const resolveFilter = null;
  8558. const compatUtils = null;
  8559. const DeprecationTypes = null;
  8560. exports.EffectScope = reactivity.EffectScope;
  8561. exports.ReactiveEffect = reactivity.ReactiveEffect;
  8562. exports.TrackOpTypes = reactivity.TrackOpTypes;
  8563. exports.TriggerOpTypes = reactivity.TriggerOpTypes;
  8564. exports.customRef = reactivity.customRef;
  8565. exports.effect = reactivity.effect;
  8566. exports.effectScope = reactivity.effectScope;
  8567. exports.getCurrentScope = reactivity.getCurrentScope;
  8568. exports.getCurrentWatcher = reactivity.getCurrentWatcher;
  8569. exports.isProxy = reactivity.isProxy;
  8570. exports.isReactive = reactivity.isReactive;
  8571. exports.isReadonly = reactivity.isReadonly;
  8572. exports.isRef = reactivity.isRef;
  8573. exports.isShallow = reactivity.isShallow;
  8574. exports.markRaw = reactivity.markRaw;
  8575. exports.onScopeDispose = reactivity.onScopeDispose;
  8576. exports.onWatcherCleanup = reactivity.onWatcherCleanup;
  8577. exports.proxyRefs = reactivity.proxyRefs;
  8578. exports.reactive = reactivity.reactive;
  8579. exports.readonly = reactivity.readonly;
  8580. exports.ref = reactivity.ref;
  8581. exports.shallowReactive = reactivity.shallowReactive;
  8582. exports.shallowReadonly = reactivity.shallowReadonly;
  8583. exports.shallowRef = reactivity.shallowRef;
  8584. exports.stop = reactivity.stop;
  8585. exports.toRaw = reactivity.toRaw;
  8586. exports.toRef = reactivity.toRef;
  8587. exports.toRefs = reactivity.toRefs;
  8588. exports.toValue = reactivity.toValue;
  8589. exports.triggerRef = reactivity.triggerRef;
  8590. exports.unref = reactivity.unref;
  8591. exports.camelize = shared.camelize;
  8592. exports.capitalize = shared.capitalize;
  8593. exports.normalizeClass = shared.normalizeClass;
  8594. exports.normalizeProps = shared.normalizeProps;
  8595. exports.normalizeStyle = shared.normalizeStyle;
  8596. exports.toDisplayString = shared.toDisplayString;
  8597. exports.toHandlerKey = shared.toHandlerKey;
  8598. exports.BaseTransition = BaseTransition;
  8599. exports.BaseTransitionPropsValidators = BaseTransitionPropsValidators;
  8600. exports.Comment = Comment;
  8601. exports.DeprecationTypes = DeprecationTypes;
  8602. exports.ErrorCodes = ErrorCodes;
  8603. exports.ErrorTypeStrings = ErrorTypeStrings;
  8604. exports.Fragment = Fragment;
  8605. exports.KeepAlive = KeepAlive;
  8606. exports.Static = Static;
  8607. exports.Suspense = Suspense;
  8608. exports.Teleport = Teleport;
  8609. exports.Text = Text;
  8610. exports.assertNumber = assertNumber;
  8611. exports.callWithAsyncErrorHandling = callWithAsyncErrorHandling;
  8612. exports.callWithErrorHandling = callWithErrorHandling;
  8613. exports.cloneVNode = cloneVNode;
  8614. exports.compatUtils = compatUtils;
  8615. exports.computed = computed;
  8616. exports.createBlock = createBlock;
  8617. exports.createCommentVNode = createCommentVNode;
  8618. exports.createElementBlock = createElementBlock;
  8619. exports.createElementVNode = createBaseVNode;
  8620. exports.createHydrationRenderer = createHydrationRenderer;
  8621. exports.createPropsRestProxy = createPropsRestProxy;
  8622. exports.createRenderer = createRenderer;
  8623. exports.createSlots = createSlots;
  8624. exports.createStaticVNode = createStaticVNode;
  8625. exports.createTextVNode = createTextVNode;
  8626. exports.createVNode = createVNode;
  8627. exports.defineAsyncComponent = defineAsyncComponent;
  8628. exports.defineComponent = defineComponent;
  8629. exports.defineEmits = defineEmits;
  8630. exports.defineExpose = defineExpose;
  8631. exports.defineModel = defineModel;
  8632. exports.defineOptions = defineOptions;
  8633. exports.defineProps = defineProps;
  8634. exports.defineSlots = defineSlots;
  8635. exports.devtools = devtools;
  8636. exports.getCurrentInstance = getCurrentInstance;
  8637. exports.getTransitionRawChildren = getTransitionRawChildren;
  8638. exports.guardReactiveProps = guardReactiveProps;
  8639. exports.h = h;
  8640. exports.handleError = handleError;
  8641. exports.hasInjectionContext = hasInjectionContext;
  8642. exports.hydrateOnIdle = hydrateOnIdle;
  8643. exports.hydrateOnInteraction = hydrateOnInteraction;
  8644. exports.hydrateOnMediaQuery = hydrateOnMediaQuery;
  8645. exports.hydrateOnVisible = hydrateOnVisible;
  8646. exports.initCustomFormatter = initCustomFormatter;
  8647. exports.inject = inject;
  8648. exports.isMemoSame = isMemoSame;
  8649. exports.isRuntimeOnly = isRuntimeOnly;
  8650. exports.isVNode = isVNode;
  8651. exports.mergeDefaults = mergeDefaults;
  8652. exports.mergeModels = mergeModels;
  8653. exports.mergeProps = mergeProps;
  8654. exports.nextTick = nextTick;
  8655. exports.onActivated = onActivated;
  8656. exports.onBeforeMount = onBeforeMount;
  8657. exports.onBeforeUnmount = onBeforeUnmount;
  8658. exports.onBeforeUpdate = onBeforeUpdate;
  8659. exports.onDeactivated = onDeactivated;
  8660. exports.onErrorCaptured = onErrorCaptured;
  8661. exports.onMounted = onMounted;
  8662. exports.onRenderTracked = onRenderTracked;
  8663. exports.onRenderTriggered = onRenderTriggered;
  8664. exports.onServerPrefetch = onServerPrefetch;
  8665. exports.onUnmounted = onUnmounted;
  8666. exports.onUpdated = onUpdated;
  8667. exports.openBlock = openBlock;
  8668. exports.popScopeId = popScopeId;
  8669. exports.provide = provide;
  8670. exports.pushScopeId = pushScopeId;
  8671. exports.queuePostFlushCb = queuePostFlushCb;
  8672. exports.registerRuntimeCompiler = registerRuntimeCompiler;
  8673. exports.renderList = renderList;
  8674. exports.renderSlot = renderSlot;
  8675. exports.resolveComponent = resolveComponent;
  8676. exports.resolveDirective = resolveDirective;
  8677. exports.resolveDynamicComponent = resolveDynamicComponent;
  8678. exports.resolveFilter = resolveFilter;
  8679. exports.resolveTransitionHooks = resolveTransitionHooks;
  8680. exports.setBlockTracking = setBlockTracking;
  8681. exports.setDevtoolsHook = setDevtoolsHook;
  8682. exports.setTransitionHooks = setTransitionHooks;
  8683. exports.ssrContextKey = ssrContextKey;
  8684. exports.ssrUtils = ssrUtils;
  8685. exports.toHandlers = toHandlers;
  8686. exports.transformVNodeArgs = transformVNodeArgs;
  8687. exports.useAttrs = useAttrs;
  8688. exports.useId = useId;
  8689. exports.useModel = useModel;
  8690. exports.useSSRContext = useSSRContext;
  8691. exports.useSlots = useSlots;
  8692. exports.useTemplateRef = useTemplateRef;
  8693. exports.useTransitionState = useTransitionState;
  8694. exports.version = version;
  8695. exports.warn = warn;
  8696. exports.watch = watch;
  8697. exports.watchEffect = watchEffect;
  8698. exports.watchPostEffect = watchPostEffect;
  8699. exports.watchSyncEffect = watchSyncEffect;
  8700. exports.withAsyncContext = withAsyncContext;
  8701. exports.withCtx = withCtx;
  8702. exports.withDefaults = withDefaults;
  8703. exports.withDirectives = withDirectives;
  8704. exports.withMemo = withMemo;
  8705. exports.withScopeId = withScopeId;