runtime-core.cjs.js 248 KB

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