runtime-core.esm-bundler.js 246 KB

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