vue.runtime.esm-browser.js 360 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465
  1. /**
  2. * vue v3.5.18
  3. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  4. * @license MIT
  5. **/
  6. /*! #__NO_SIDE_EFFECTS__ */
  7. // @__NO_SIDE_EFFECTS__
  8. function makeMap(str) {
  9. const map = /* @__PURE__ */ Object.create(null);
  10. for (const key of str.split(",")) map[key] = 1;
  11. return (val) => val in map;
  12. }
  13. const EMPTY_OBJ = Object.freeze({}) ;
  14. const EMPTY_ARR = Object.freeze([]) ;
  15. const NOOP = () => {
  16. };
  17. const NO = () => false;
  18. const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
  19. (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
  20. const isModelListener = (key) => key.startsWith("onUpdate:");
  21. const extend = Object.assign;
  22. const remove = (arr, el) => {
  23. const i = arr.indexOf(el);
  24. if (i > -1) {
  25. arr.splice(i, 1);
  26. }
  27. };
  28. const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
  29. const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
  30. const isArray = Array.isArray;
  31. const isMap = (val) => toTypeString(val) === "[object Map]";
  32. const isSet = (val) => toTypeString(val) === "[object Set]";
  33. const isDate = (val) => toTypeString(val) === "[object Date]";
  34. const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
  35. const isFunction = (val) => typeof val === "function";
  36. const isString = (val) => typeof val === "string";
  37. const isSymbol = (val) => typeof val === "symbol";
  38. const isObject = (val) => val !== null && typeof val === "object";
  39. const isPromise = (val) => {
  40. return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
  41. };
  42. const objectToString = Object.prototype.toString;
  43. const toTypeString = (value) => objectToString.call(value);
  44. const toRawType = (value) => {
  45. return toTypeString(value).slice(8, -1);
  46. };
  47. const isPlainObject = (val) => toTypeString(val) === "[object Object]";
  48. const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
  49. const isReservedProp = /* @__PURE__ */ makeMap(
  50. // the leading comma is intentional so empty string "" is also included
  51. ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
  52. );
  53. const isBuiltInDirective = /* @__PURE__ */ makeMap(
  54. "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
  55. );
  56. const cacheStringFunction = (fn) => {
  57. const cache = /* @__PURE__ */ Object.create(null);
  58. return (str) => {
  59. const hit = cache[str];
  60. return hit || (cache[str] = fn(str));
  61. };
  62. };
  63. const camelizeRE = /-(\w)/g;
  64. const camelize = cacheStringFunction(
  65. (str) => {
  66. return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
  67. }
  68. );
  69. const hyphenateRE = /\B([A-Z])/g;
  70. const hyphenate = cacheStringFunction(
  71. (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
  72. );
  73. const capitalize = cacheStringFunction((str) => {
  74. return str.charAt(0).toUpperCase() + str.slice(1);
  75. });
  76. const toHandlerKey = cacheStringFunction(
  77. (str) => {
  78. const s = str ? `on${capitalize(str)}` : ``;
  79. return s;
  80. }
  81. );
  82. const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
  83. const invokeArrayFns = (fns, ...arg) => {
  84. for (let i = 0; i < fns.length; i++) {
  85. fns[i](...arg);
  86. }
  87. };
  88. const def = (obj, key, value, writable = false) => {
  89. Object.defineProperty(obj, key, {
  90. configurable: true,
  91. enumerable: false,
  92. writable,
  93. value
  94. });
  95. };
  96. const looseToNumber = (val) => {
  97. const n = parseFloat(val);
  98. return isNaN(n) ? val : n;
  99. };
  100. const toNumber = (val) => {
  101. const n = isString(val) ? Number(val) : NaN;
  102. return isNaN(n) ? val : n;
  103. };
  104. let _globalThis;
  105. const getGlobalThis = () => {
  106. return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
  107. };
  108. const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol";
  109. const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
  110. function normalizeStyle(value) {
  111. if (isArray(value)) {
  112. const res = {};
  113. for (let i = 0; i < value.length; i++) {
  114. const item = value[i];
  115. const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
  116. if (normalized) {
  117. for (const key in normalized) {
  118. res[key] = normalized[key];
  119. }
  120. }
  121. }
  122. return res;
  123. } else if (isString(value) || isObject(value)) {
  124. return value;
  125. }
  126. }
  127. const listDelimiterRE = /;(?![^(]*\))/g;
  128. const propertyDelimiterRE = /:([^]+)/;
  129. const styleCommentRE = /\/\*[^]*?\*\//g;
  130. function parseStringStyle(cssText) {
  131. const ret = {};
  132. cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
  133. if (item) {
  134. const tmp = item.split(propertyDelimiterRE);
  135. tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
  136. }
  137. });
  138. return ret;
  139. }
  140. function stringifyStyle(styles) {
  141. if (!styles) return "";
  142. if (isString(styles)) return styles;
  143. let ret = "";
  144. for (const key in styles) {
  145. const value = styles[key];
  146. if (isString(value) || typeof value === "number") {
  147. const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
  148. ret += `${normalizedKey}:${value};`;
  149. }
  150. }
  151. return ret;
  152. }
  153. function normalizeClass(value) {
  154. let res = "";
  155. if (isString(value)) {
  156. res = value;
  157. } else if (isArray(value)) {
  158. for (let i = 0; i < value.length; i++) {
  159. const normalized = normalizeClass(value[i]);
  160. if (normalized) {
  161. res += normalized + " ";
  162. }
  163. }
  164. } else if (isObject(value)) {
  165. for (const name in value) {
  166. if (value[name]) {
  167. res += name + " ";
  168. }
  169. }
  170. }
  171. return res.trim();
  172. }
  173. function normalizeProps(props) {
  174. if (!props) return null;
  175. let { class: klass, style } = props;
  176. if (klass && !isString(klass)) {
  177. props.class = normalizeClass(klass);
  178. }
  179. if (style) {
  180. props.style = normalizeStyle(style);
  181. }
  182. return props;
  183. }
  184. const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
  185. const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
  186. const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics";
  187. const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
  188. const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
  189. const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
  190. const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
  191. const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
  192. const isBooleanAttr = /* @__PURE__ */ makeMap(
  193. specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
  194. );
  195. function includeBooleanAttr(value) {
  196. return !!value || value === "";
  197. }
  198. const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
  199. `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`
  200. );
  201. const isKnownSvgAttr = /* @__PURE__ */ makeMap(
  202. `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`
  203. );
  204. function isRenderableAttrValue(value) {
  205. if (value == null) {
  206. return false;
  207. }
  208. const type = typeof value;
  209. return type === "string" || type === "number" || type === "boolean";
  210. }
  211. const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;
  212. function getEscapedCssVarName(key, doubleEscape) {
  213. return key.replace(
  214. cssVarNameEscapeSymbolsRE,
  215. (s) => `\\${s}`
  216. );
  217. }
  218. function looseCompareArrays(a, b) {
  219. if (a.length !== b.length) return false;
  220. let equal = true;
  221. for (let i = 0; equal && i < a.length; i++) {
  222. equal = looseEqual(a[i], b[i]);
  223. }
  224. return equal;
  225. }
  226. function looseEqual(a, b) {
  227. if (a === b) return true;
  228. let aValidType = isDate(a);
  229. let bValidType = isDate(b);
  230. if (aValidType || bValidType) {
  231. return aValidType && bValidType ? a.getTime() === b.getTime() : false;
  232. }
  233. aValidType = isSymbol(a);
  234. bValidType = isSymbol(b);
  235. if (aValidType || bValidType) {
  236. return a === b;
  237. }
  238. aValidType = isArray(a);
  239. bValidType = isArray(b);
  240. if (aValidType || bValidType) {
  241. return aValidType && bValidType ? looseCompareArrays(a, b) : false;
  242. }
  243. aValidType = isObject(a);
  244. bValidType = isObject(b);
  245. if (aValidType || bValidType) {
  246. if (!aValidType || !bValidType) {
  247. return false;
  248. }
  249. const aKeysCount = Object.keys(a).length;
  250. const bKeysCount = Object.keys(b).length;
  251. if (aKeysCount !== bKeysCount) {
  252. return false;
  253. }
  254. for (const key in a) {
  255. const aHasKey = a.hasOwnProperty(key);
  256. const bHasKey = b.hasOwnProperty(key);
  257. if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
  258. return false;
  259. }
  260. }
  261. }
  262. return String(a) === String(b);
  263. }
  264. function looseIndexOf(arr, val) {
  265. return arr.findIndex((item) => looseEqual(item, val));
  266. }
  267. const isRef$1 = (val) => {
  268. return !!(val && val["__v_isRef"] === true);
  269. };
  270. const toDisplayString = (val) => {
  271. return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);
  272. };
  273. const replacer = (_key, val) => {
  274. if (isRef$1(val)) {
  275. return replacer(_key, val.value);
  276. } else if (isMap(val)) {
  277. return {
  278. [`Map(${val.size})`]: [...val.entries()].reduce(
  279. (entries, [key, val2], i) => {
  280. entries[stringifySymbol(key, i) + " =>"] = val2;
  281. return entries;
  282. },
  283. {}
  284. )
  285. };
  286. } else if (isSet(val)) {
  287. return {
  288. [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
  289. };
  290. } else if (isSymbol(val)) {
  291. return stringifySymbol(val);
  292. } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
  293. return String(val);
  294. }
  295. return val;
  296. };
  297. const stringifySymbol = (v, i = "") => {
  298. var _a;
  299. return (
  300. // Symbol.description in es2019+ so we need to cast here to pass
  301. // the lib: es2016 check
  302. isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v
  303. );
  304. };
  305. function normalizeCssVarValue(value) {
  306. if (value == null) {
  307. return "initial";
  308. }
  309. if (typeof value === "string") {
  310. return value === "" ? " " : value;
  311. }
  312. if (typeof value !== "number" || !Number.isFinite(value)) {
  313. {
  314. console.warn(
  315. "[Vue warn] Invalid value used for CSS binding. Expected a string or a finite number but received:",
  316. value
  317. );
  318. }
  319. }
  320. return String(value);
  321. }
  322. function warn$2(msg, ...args) {
  323. console.warn(`[Vue warn] ${msg}`, ...args);
  324. }
  325. let activeEffectScope;
  326. class EffectScope {
  327. constructor(detached = false) {
  328. this.detached = detached;
  329. /**
  330. * @internal
  331. */
  332. this._active = true;
  333. /**
  334. * @internal track `on` calls, allow `on` call multiple times
  335. */
  336. this._on = 0;
  337. /**
  338. * @internal
  339. */
  340. this.effects = [];
  341. /**
  342. * @internal
  343. */
  344. this.cleanups = [];
  345. this._isPaused = false;
  346. this.parent = activeEffectScope;
  347. if (!detached && activeEffectScope) {
  348. this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
  349. this
  350. ) - 1;
  351. }
  352. }
  353. get active() {
  354. return this._active;
  355. }
  356. pause() {
  357. if (this._active) {
  358. this._isPaused = true;
  359. let i, l;
  360. if (this.scopes) {
  361. for (i = 0, l = this.scopes.length; i < l; i++) {
  362. this.scopes[i].pause();
  363. }
  364. }
  365. for (i = 0, l = this.effects.length; i < l; i++) {
  366. this.effects[i].pause();
  367. }
  368. }
  369. }
  370. /**
  371. * Resumes the effect scope, including all child scopes and effects.
  372. */
  373. resume() {
  374. if (this._active) {
  375. if (this._isPaused) {
  376. this._isPaused = false;
  377. let i, l;
  378. if (this.scopes) {
  379. for (i = 0, l = this.scopes.length; i < l; i++) {
  380. this.scopes[i].resume();
  381. }
  382. }
  383. for (i = 0, l = this.effects.length; i < l; i++) {
  384. this.effects[i].resume();
  385. }
  386. }
  387. }
  388. }
  389. run(fn) {
  390. if (this._active) {
  391. const currentEffectScope = activeEffectScope;
  392. try {
  393. activeEffectScope = this;
  394. return fn();
  395. } finally {
  396. activeEffectScope = currentEffectScope;
  397. }
  398. } else {
  399. warn$2(`cannot run an inactive effect scope.`);
  400. }
  401. }
  402. /**
  403. * This should only be called on non-detached scopes
  404. * @internal
  405. */
  406. on() {
  407. if (++this._on === 1) {
  408. this.prevScope = activeEffectScope;
  409. activeEffectScope = this;
  410. }
  411. }
  412. /**
  413. * This should only be called on non-detached scopes
  414. * @internal
  415. */
  416. off() {
  417. if (this._on > 0 && --this._on === 0) {
  418. activeEffectScope = this.prevScope;
  419. this.prevScope = void 0;
  420. }
  421. }
  422. stop(fromParent) {
  423. if (this._active) {
  424. this._active = false;
  425. let i, l;
  426. for (i = 0, l = this.effects.length; i < l; i++) {
  427. this.effects[i].stop();
  428. }
  429. this.effects.length = 0;
  430. for (i = 0, l = this.cleanups.length; i < l; i++) {
  431. this.cleanups[i]();
  432. }
  433. this.cleanups.length = 0;
  434. if (this.scopes) {
  435. for (i = 0, l = this.scopes.length; i < l; i++) {
  436. this.scopes[i].stop(true);
  437. }
  438. this.scopes.length = 0;
  439. }
  440. if (!this.detached && this.parent && !fromParent) {
  441. const last = this.parent.scopes.pop();
  442. if (last && last !== this) {
  443. this.parent.scopes[this.index] = last;
  444. last.index = this.index;
  445. }
  446. }
  447. this.parent = void 0;
  448. }
  449. }
  450. }
  451. function effectScope(detached) {
  452. return new EffectScope(detached);
  453. }
  454. function getCurrentScope() {
  455. return activeEffectScope;
  456. }
  457. function onScopeDispose(fn, failSilently = false) {
  458. if (activeEffectScope) {
  459. activeEffectScope.cleanups.push(fn);
  460. } else if (!failSilently) {
  461. warn$2(
  462. `onScopeDispose() is called when there is no active effect scope to be associated with.`
  463. );
  464. }
  465. }
  466. let activeSub;
  467. const pausedQueueEffects = /* @__PURE__ */ new WeakSet();
  468. class ReactiveEffect {
  469. constructor(fn) {
  470. this.fn = fn;
  471. /**
  472. * @internal
  473. */
  474. this.deps = void 0;
  475. /**
  476. * @internal
  477. */
  478. this.depsTail = void 0;
  479. /**
  480. * @internal
  481. */
  482. this.flags = 1 | 4;
  483. /**
  484. * @internal
  485. */
  486. this.next = void 0;
  487. /**
  488. * @internal
  489. */
  490. this.cleanup = void 0;
  491. this.scheduler = void 0;
  492. if (activeEffectScope && activeEffectScope.active) {
  493. activeEffectScope.effects.push(this);
  494. }
  495. }
  496. pause() {
  497. this.flags |= 64;
  498. }
  499. resume() {
  500. if (this.flags & 64) {
  501. this.flags &= -65;
  502. if (pausedQueueEffects.has(this)) {
  503. pausedQueueEffects.delete(this);
  504. this.trigger();
  505. }
  506. }
  507. }
  508. /**
  509. * @internal
  510. */
  511. notify() {
  512. if (this.flags & 2 && !(this.flags & 32)) {
  513. return;
  514. }
  515. if (!(this.flags & 8)) {
  516. batch(this);
  517. }
  518. }
  519. run() {
  520. if (!(this.flags & 1)) {
  521. return this.fn();
  522. }
  523. this.flags |= 2;
  524. cleanupEffect(this);
  525. prepareDeps(this);
  526. const prevEffect = activeSub;
  527. const prevShouldTrack = shouldTrack;
  528. activeSub = this;
  529. shouldTrack = true;
  530. try {
  531. return this.fn();
  532. } finally {
  533. if (activeSub !== this) {
  534. warn$2(
  535. "Active effect was not restored correctly - this is likely a Vue internal bug."
  536. );
  537. }
  538. cleanupDeps(this);
  539. activeSub = prevEffect;
  540. shouldTrack = prevShouldTrack;
  541. this.flags &= -3;
  542. }
  543. }
  544. stop() {
  545. if (this.flags & 1) {
  546. for (let link = this.deps; link; link = link.nextDep) {
  547. removeSub(link);
  548. }
  549. this.deps = this.depsTail = void 0;
  550. cleanupEffect(this);
  551. this.onStop && this.onStop();
  552. this.flags &= -2;
  553. }
  554. }
  555. trigger() {
  556. if (this.flags & 64) {
  557. pausedQueueEffects.add(this);
  558. } else if (this.scheduler) {
  559. this.scheduler();
  560. } else {
  561. this.runIfDirty();
  562. }
  563. }
  564. /**
  565. * @internal
  566. */
  567. runIfDirty() {
  568. if (isDirty(this)) {
  569. this.run();
  570. }
  571. }
  572. get dirty() {
  573. return isDirty(this);
  574. }
  575. }
  576. let batchDepth = 0;
  577. let batchedSub;
  578. let batchedComputed;
  579. function batch(sub, isComputed = false) {
  580. sub.flags |= 8;
  581. if (isComputed) {
  582. sub.next = batchedComputed;
  583. batchedComputed = sub;
  584. return;
  585. }
  586. sub.next = batchedSub;
  587. batchedSub = sub;
  588. }
  589. function startBatch() {
  590. batchDepth++;
  591. }
  592. function endBatch() {
  593. if (--batchDepth > 0) {
  594. return;
  595. }
  596. if (batchedComputed) {
  597. let e = batchedComputed;
  598. batchedComputed = void 0;
  599. while (e) {
  600. const next = e.next;
  601. e.next = void 0;
  602. e.flags &= -9;
  603. e = next;
  604. }
  605. }
  606. let error;
  607. while (batchedSub) {
  608. let e = batchedSub;
  609. batchedSub = void 0;
  610. while (e) {
  611. const next = e.next;
  612. e.next = void 0;
  613. e.flags &= -9;
  614. if (e.flags & 1) {
  615. try {
  616. ;
  617. e.trigger();
  618. } catch (err) {
  619. if (!error) error = err;
  620. }
  621. }
  622. e = next;
  623. }
  624. }
  625. if (error) throw error;
  626. }
  627. function prepareDeps(sub) {
  628. for (let link = sub.deps; link; link = link.nextDep) {
  629. link.version = -1;
  630. link.prevActiveLink = link.dep.activeLink;
  631. link.dep.activeLink = link;
  632. }
  633. }
  634. function cleanupDeps(sub) {
  635. let head;
  636. let tail = sub.depsTail;
  637. let link = tail;
  638. while (link) {
  639. const prev = link.prevDep;
  640. if (link.version === -1) {
  641. if (link === tail) tail = prev;
  642. removeSub(link);
  643. removeDep(link);
  644. } else {
  645. head = link;
  646. }
  647. link.dep.activeLink = link.prevActiveLink;
  648. link.prevActiveLink = void 0;
  649. link = prev;
  650. }
  651. sub.deps = head;
  652. sub.depsTail = tail;
  653. }
  654. function isDirty(sub) {
  655. for (let link = sub.deps; link; link = link.nextDep) {
  656. if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) {
  657. return true;
  658. }
  659. }
  660. if (sub._dirty) {
  661. return true;
  662. }
  663. return false;
  664. }
  665. function refreshComputed(computed) {
  666. if (computed.flags & 4 && !(computed.flags & 16)) {
  667. return;
  668. }
  669. computed.flags &= -17;
  670. if (computed.globalVersion === globalVersion) {
  671. return;
  672. }
  673. computed.globalVersion = globalVersion;
  674. if (!computed.isSSR && computed.flags & 128 && (!computed.deps && !computed._dirty || !isDirty(computed))) {
  675. return;
  676. }
  677. computed.flags |= 2;
  678. const dep = computed.dep;
  679. const prevSub = activeSub;
  680. const prevShouldTrack = shouldTrack;
  681. activeSub = computed;
  682. shouldTrack = true;
  683. try {
  684. prepareDeps(computed);
  685. const value = computed.fn(computed._value);
  686. if (dep.version === 0 || hasChanged(value, computed._value)) {
  687. computed.flags |= 128;
  688. computed._value = value;
  689. dep.version++;
  690. }
  691. } catch (err) {
  692. dep.version++;
  693. throw err;
  694. } finally {
  695. activeSub = prevSub;
  696. shouldTrack = prevShouldTrack;
  697. cleanupDeps(computed);
  698. computed.flags &= -3;
  699. }
  700. }
  701. function removeSub(link, soft = false) {
  702. const { dep, prevSub, nextSub } = link;
  703. if (prevSub) {
  704. prevSub.nextSub = nextSub;
  705. link.prevSub = void 0;
  706. }
  707. if (nextSub) {
  708. nextSub.prevSub = prevSub;
  709. link.nextSub = void 0;
  710. }
  711. if (dep.subsHead === link) {
  712. dep.subsHead = nextSub;
  713. }
  714. if (dep.subs === link) {
  715. dep.subs = prevSub;
  716. if (!prevSub && dep.computed) {
  717. dep.computed.flags &= -5;
  718. for (let l = dep.computed.deps; l; l = l.nextDep) {
  719. removeSub(l, true);
  720. }
  721. }
  722. }
  723. if (!soft && !--dep.sc && dep.map) {
  724. dep.map.delete(dep.key);
  725. }
  726. }
  727. function removeDep(link) {
  728. const { prevDep, nextDep } = link;
  729. if (prevDep) {
  730. prevDep.nextDep = nextDep;
  731. link.prevDep = void 0;
  732. }
  733. if (nextDep) {
  734. nextDep.prevDep = prevDep;
  735. link.nextDep = void 0;
  736. }
  737. }
  738. function effect(fn, options) {
  739. if (fn.effect instanceof ReactiveEffect) {
  740. fn = fn.effect.fn;
  741. }
  742. const e = new ReactiveEffect(fn);
  743. if (options) {
  744. extend(e, options);
  745. }
  746. try {
  747. e.run();
  748. } catch (err) {
  749. e.stop();
  750. throw err;
  751. }
  752. const runner = e.run.bind(e);
  753. runner.effect = e;
  754. return runner;
  755. }
  756. function stop(runner) {
  757. runner.effect.stop();
  758. }
  759. let shouldTrack = true;
  760. const trackStack = [];
  761. function pauseTracking() {
  762. trackStack.push(shouldTrack);
  763. shouldTrack = false;
  764. }
  765. function resetTracking() {
  766. const last = trackStack.pop();
  767. shouldTrack = last === void 0 ? true : last;
  768. }
  769. function cleanupEffect(e) {
  770. const { cleanup } = e;
  771. e.cleanup = void 0;
  772. if (cleanup) {
  773. const prevSub = activeSub;
  774. activeSub = void 0;
  775. try {
  776. cleanup();
  777. } finally {
  778. activeSub = prevSub;
  779. }
  780. }
  781. }
  782. let globalVersion = 0;
  783. class Link {
  784. constructor(sub, dep) {
  785. this.sub = sub;
  786. this.dep = dep;
  787. this.version = dep.version;
  788. this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
  789. }
  790. }
  791. class Dep {
  792. // TODO isolatedDeclarations "__v_skip"
  793. constructor(computed) {
  794. this.computed = computed;
  795. this.version = 0;
  796. /**
  797. * Link between this dep and the current active effect
  798. */
  799. this.activeLink = void 0;
  800. /**
  801. * Doubly linked list representing the subscribing effects (tail)
  802. */
  803. this.subs = void 0;
  804. /**
  805. * For object property deps cleanup
  806. */
  807. this.map = void 0;
  808. this.key = void 0;
  809. /**
  810. * Subscriber counter
  811. */
  812. this.sc = 0;
  813. /**
  814. * @internal
  815. */
  816. this.__v_skip = true;
  817. {
  818. this.subsHead = void 0;
  819. }
  820. }
  821. track(debugInfo) {
  822. if (!activeSub || !shouldTrack || activeSub === this.computed) {
  823. return;
  824. }
  825. let link = this.activeLink;
  826. if (link === void 0 || link.sub !== activeSub) {
  827. link = this.activeLink = new Link(activeSub, this);
  828. if (!activeSub.deps) {
  829. activeSub.deps = activeSub.depsTail = link;
  830. } else {
  831. link.prevDep = activeSub.depsTail;
  832. activeSub.depsTail.nextDep = link;
  833. activeSub.depsTail = link;
  834. }
  835. addSub(link);
  836. } else if (link.version === -1) {
  837. link.version = this.version;
  838. if (link.nextDep) {
  839. const next = link.nextDep;
  840. next.prevDep = link.prevDep;
  841. if (link.prevDep) {
  842. link.prevDep.nextDep = next;
  843. }
  844. link.prevDep = activeSub.depsTail;
  845. link.nextDep = void 0;
  846. activeSub.depsTail.nextDep = link;
  847. activeSub.depsTail = link;
  848. if (activeSub.deps === link) {
  849. activeSub.deps = next;
  850. }
  851. }
  852. }
  853. if (activeSub.onTrack) {
  854. activeSub.onTrack(
  855. extend(
  856. {
  857. effect: activeSub
  858. },
  859. debugInfo
  860. )
  861. );
  862. }
  863. return link;
  864. }
  865. trigger(debugInfo) {
  866. this.version++;
  867. globalVersion++;
  868. this.notify(debugInfo);
  869. }
  870. notify(debugInfo) {
  871. startBatch();
  872. try {
  873. if (true) {
  874. for (let head = this.subsHead; head; head = head.nextSub) {
  875. if (head.sub.onTrigger && !(head.sub.flags & 8)) {
  876. head.sub.onTrigger(
  877. extend(
  878. {
  879. effect: head.sub
  880. },
  881. debugInfo
  882. )
  883. );
  884. }
  885. }
  886. }
  887. for (let link = this.subs; link; link = link.prevSub) {
  888. if (link.sub.notify()) {
  889. ;
  890. link.sub.dep.notify();
  891. }
  892. }
  893. } finally {
  894. endBatch();
  895. }
  896. }
  897. }
  898. function addSub(link) {
  899. link.dep.sc++;
  900. if (link.sub.flags & 4) {
  901. const computed = link.dep.computed;
  902. if (computed && !link.dep.subs) {
  903. computed.flags |= 4 | 16;
  904. for (let l = computed.deps; l; l = l.nextDep) {
  905. addSub(l);
  906. }
  907. }
  908. const currentTail = link.dep.subs;
  909. if (currentTail !== link) {
  910. link.prevSub = currentTail;
  911. if (currentTail) currentTail.nextSub = link;
  912. }
  913. if (link.dep.subsHead === void 0) {
  914. link.dep.subsHead = link;
  915. }
  916. link.dep.subs = link;
  917. }
  918. }
  919. const targetMap = /* @__PURE__ */ new WeakMap();
  920. const ITERATE_KEY = Symbol(
  921. "Object iterate"
  922. );
  923. const MAP_KEY_ITERATE_KEY = Symbol(
  924. "Map keys iterate"
  925. );
  926. const ARRAY_ITERATE_KEY = Symbol(
  927. "Array iterate"
  928. );
  929. function track(target, type, key) {
  930. if (shouldTrack && activeSub) {
  931. let depsMap = targetMap.get(target);
  932. if (!depsMap) {
  933. targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
  934. }
  935. let dep = depsMap.get(key);
  936. if (!dep) {
  937. depsMap.set(key, dep = new Dep());
  938. dep.map = depsMap;
  939. dep.key = key;
  940. }
  941. {
  942. dep.track({
  943. target,
  944. type,
  945. key
  946. });
  947. }
  948. }
  949. }
  950. function trigger(target, type, key, newValue, oldValue, oldTarget) {
  951. const depsMap = targetMap.get(target);
  952. if (!depsMap) {
  953. globalVersion++;
  954. return;
  955. }
  956. const run = (dep) => {
  957. if (dep) {
  958. {
  959. dep.trigger({
  960. target,
  961. type,
  962. key,
  963. newValue,
  964. oldValue,
  965. oldTarget
  966. });
  967. }
  968. }
  969. };
  970. startBatch();
  971. if (type === "clear") {
  972. depsMap.forEach(run);
  973. } else {
  974. const targetIsArray = isArray(target);
  975. const isArrayIndex = targetIsArray && isIntegerKey(key);
  976. if (targetIsArray && key === "length") {
  977. const newLength = Number(newValue);
  978. depsMap.forEach((dep, key2) => {
  979. if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {
  980. run(dep);
  981. }
  982. });
  983. } else {
  984. if (key !== void 0 || depsMap.has(void 0)) {
  985. run(depsMap.get(key));
  986. }
  987. if (isArrayIndex) {
  988. run(depsMap.get(ARRAY_ITERATE_KEY));
  989. }
  990. switch (type) {
  991. case "add":
  992. if (!targetIsArray) {
  993. run(depsMap.get(ITERATE_KEY));
  994. if (isMap(target)) {
  995. run(depsMap.get(MAP_KEY_ITERATE_KEY));
  996. }
  997. } else if (isArrayIndex) {
  998. run(depsMap.get("length"));
  999. }
  1000. break;
  1001. case "delete":
  1002. if (!targetIsArray) {
  1003. run(depsMap.get(ITERATE_KEY));
  1004. if (isMap(target)) {
  1005. run(depsMap.get(MAP_KEY_ITERATE_KEY));
  1006. }
  1007. }
  1008. break;
  1009. case "set":
  1010. if (isMap(target)) {
  1011. run(depsMap.get(ITERATE_KEY));
  1012. }
  1013. break;
  1014. }
  1015. }
  1016. }
  1017. endBatch();
  1018. }
  1019. function getDepFromReactive(object, key) {
  1020. const depMap = targetMap.get(object);
  1021. return depMap && depMap.get(key);
  1022. }
  1023. function reactiveReadArray(array) {
  1024. const raw = toRaw(array);
  1025. if (raw === array) return raw;
  1026. track(raw, "iterate", ARRAY_ITERATE_KEY);
  1027. return isShallow(array) ? raw : raw.map(toReactive);
  1028. }
  1029. function shallowReadArray(arr) {
  1030. track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
  1031. return arr;
  1032. }
  1033. const arrayInstrumentations = {
  1034. __proto__: null,
  1035. [Symbol.iterator]() {
  1036. return iterator(this, Symbol.iterator, toReactive);
  1037. },
  1038. concat(...args) {
  1039. return reactiveReadArray(this).concat(
  1040. ...args.map((x) => isArray(x) ? reactiveReadArray(x) : x)
  1041. );
  1042. },
  1043. entries() {
  1044. return iterator(this, "entries", (value) => {
  1045. value[1] = toReactive(value[1]);
  1046. return value;
  1047. });
  1048. },
  1049. every(fn, thisArg) {
  1050. return apply(this, "every", fn, thisArg, void 0, arguments);
  1051. },
  1052. filter(fn, thisArg) {
  1053. return apply(this, "filter", fn, thisArg, (v) => v.map(toReactive), arguments);
  1054. },
  1055. find(fn, thisArg) {
  1056. return apply(this, "find", fn, thisArg, toReactive, arguments);
  1057. },
  1058. findIndex(fn, thisArg) {
  1059. return apply(this, "findIndex", fn, thisArg, void 0, arguments);
  1060. },
  1061. findLast(fn, thisArg) {
  1062. return apply(this, "findLast", fn, thisArg, toReactive, arguments);
  1063. },
  1064. findLastIndex(fn, thisArg) {
  1065. return apply(this, "findLastIndex", fn, thisArg, void 0, arguments);
  1066. },
  1067. // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
  1068. forEach(fn, thisArg) {
  1069. return apply(this, "forEach", fn, thisArg, void 0, arguments);
  1070. },
  1071. includes(...args) {
  1072. return searchProxy(this, "includes", args);
  1073. },
  1074. indexOf(...args) {
  1075. return searchProxy(this, "indexOf", args);
  1076. },
  1077. join(separator) {
  1078. return reactiveReadArray(this).join(separator);
  1079. },
  1080. // keys() iterator only reads `length`, no optimisation required
  1081. lastIndexOf(...args) {
  1082. return searchProxy(this, "lastIndexOf", args);
  1083. },
  1084. map(fn, thisArg) {
  1085. return apply(this, "map", fn, thisArg, void 0, arguments);
  1086. },
  1087. pop() {
  1088. return noTracking(this, "pop");
  1089. },
  1090. push(...args) {
  1091. return noTracking(this, "push", args);
  1092. },
  1093. reduce(fn, ...args) {
  1094. return reduce(this, "reduce", fn, args);
  1095. },
  1096. reduceRight(fn, ...args) {
  1097. return reduce(this, "reduceRight", fn, args);
  1098. },
  1099. shift() {
  1100. return noTracking(this, "shift");
  1101. },
  1102. // slice could use ARRAY_ITERATE but also seems to beg for range tracking
  1103. some(fn, thisArg) {
  1104. return apply(this, "some", fn, thisArg, void 0, arguments);
  1105. },
  1106. splice(...args) {
  1107. return noTracking(this, "splice", args);
  1108. },
  1109. toReversed() {
  1110. return reactiveReadArray(this).toReversed();
  1111. },
  1112. toSorted(comparer) {
  1113. return reactiveReadArray(this).toSorted(comparer);
  1114. },
  1115. toSpliced(...args) {
  1116. return reactiveReadArray(this).toSpliced(...args);
  1117. },
  1118. unshift(...args) {
  1119. return noTracking(this, "unshift", args);
  1120. },
  1121. values() {
  1122. return iterator(this, "values", toReactive);
  1123. }
  1124. };
  1125. function iterator(self, method, wrapValue) {
  1126. const arr = shallowReadArray(self);
  1127. const iter = arr[method]();
  1128. if (arr !== self && !isShallow(self)) {
  1129. iter._next = iter.next;
  1130. iter.next = () => {
  1131. const result = iter._next();
  1132. if (result.value) {
  1133. result.value = wrapValue(result.value);
  1134. }
  1135. return result;
  1136. };
  1137. }
  1138. return iter;
  1139. }
  1140. const arrayProto = Array.prototype;
  1141. function apply(self, method, fn, thisArg, wrappedRetFn, args) {
  1142. const arr = shallowReadArray(self);
  1143. const needsWrap = arr !== self && !isShallow(self);
  1144. const methodFn = arr[method];
  1145. if (methodFn !== arrayProto[method]) {
  1146. const result2 = methodFn.apply(self, args);
  1147. return needsWrap ? toReactive(result2) : result2;
  1148. }
  1149. let wrappedFn = fn;
  1150. if (arr !== self) {
  1151. if (needsWrap) {
  1152. wrappedFn = function(item, index) {
  1153. return fn.call(this, toReactive(item), index, self);
  1154. };
  1155. } else if (fn.length > 2) {
  1156. wrappedFn = function(item, index) {
  1157. return fn.call(this, item, index, self);
  1158. };
  1159. }
  1160. }
  1161. const result = methodFn.call(arr, wrappedFn, thisArg);
  1162. return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result;
  1163. }
  1164. function reduce(self, method, fn, args) {
  1165. const arr = shallowReadArray(self);
  1166. let wrappedFn = fn;
  1167. if (arr !== self) {
  1168. if (!isShallow(self)) {
  1169. wrappedFn = function(acc, item, index) {
  1170. return fn.call(this, acc, toReactive(item), index, self);
  1171. };
  1172. } else if (fn.length > 3) {
  1173. wrappedFn = function(acc, item, index) {
  1174. return fn.call(this, acc, item, index, self);
  1175. };
  1176. }
  1177. }
  1178. return arr[method](wrappedFn, ...args);
  1179. }
  1180. function searchProxy(self, method, args) {
  1181. const arr = toRaw(self);
  1182. track(arr, "iterate", ARRAY_ITERATE_KEY);
  1183. const res = arr[method](...args);
  1184. if ((res === -1 || res === false) && isProxy(args[0])) {
  1185. args[0] = toRaw(args[0]);
  1186. return arr[method](...args);
  1187. }
  1188. return res;
  1189. }
  1190. function noTracking(self, method, args = []) {
  1191. pauseTracking();
  1192. startBatch();
  1193. const res = toRaw(self)[method].apply(self, args);
  1194. endBatch();
  1195. resetTracking();
  1196. return res;
  1197. }
  1198. const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
  1199. const builtInSymbols = new Set(
  1200. /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
  1201. );
  1202. function hasOwnProperty(key) {
  1203. if (!isSymbol(key)) key = String(key);
  1204. const obj = toRaw(this);
  1205. track(obj, "has", key);
  1206. return obj.hasOwnProperty(key);
  1207. }
  1208. class BaseReactiveHandler {
  1209. constructor(_isReadonly = false, _isShallow = false) {
  1210. this._isReadonly = _isReadonly;
  1211. this._isShallow = _isShallow;
  1212. }
  1213. get(target, key, receiver) {
  1214. if (key === "__v_skip") return target["__v_skip"];
  1215. const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
  1216. if (key === "__v_isReactive") {
  1217. return !isReadonly2;
  1218. } else if (key === "__v_isReadonly") {
  1219. return isReadonly2;
  1220. } else if (key === "__v_isShallow") {
  1221. return isShallow2;
  1222. } else if (key === "__v_raw") {
  1223. if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
  1224. // this means the receiver is a user proxy of the reactive proxy
  1225. Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
  1226. return target;
  1227. }
  1228. return;
  1229. }
  1230. const targetIsArray = isArray(target);
  1231. if (!isReadonly2) {
  1232. let fn;
  1233. if (targetIsArray && (fn = arrayInstrumentations[key])) {
  1234. return fn;
  1235. }
  1236. if (key === "hasOwnProperty") {
  1237. return hasOwnProperty;
  1238. }
  1239. }
  1240. const res = Reflect.get(
  1241. target,
  1242. key,
  1243. // if this is a proxy wrapping a ref, return methods using the raw ref
  1244. // as receiver so that we don't have to call `toRaw` on the ref in all
  1245. // its class methods
  1246. isRef(target) ? target : receiver
  1247. );
  1248. if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
  1249. return res;
  1250. }
  1251. if (!isReadonly2) {
  1252. track(target, "get", key);
  1253. }
  1254. if (isShallow2) {
  1255. return res;
  1256. }
  1257. if (isRef(res)) {
  1258. return targetIsArray && isIntegerKey(key) ? res : res.value;
  1259. }
  1260. if (isObject(res)) {
  1261. return isReadonly2 ? readonly(res) : reactive(res);
  1262. }
  1263. return res;
  1264. }
  1265. }
  1266. class MutableReactiveHandler extends BaseReactiveHandler {
  1267. constructor(isShallow2 = false) {
  1268. super(false, isShallow2);
  1269. }
  1270. set(target, key, value, receiver) {
  1271. let oldValue = target[key];
  1272. if (!this._isShallow) {
  1273. const isOldValueReadonly = isReadonly(oldValue);
  1274. if (!isShallow(value) && !isReadonly(value)) {
  1275. oldValue = toRaw(oldValue);
  1276. value = toRaw(value);
  1277. }
  1278. if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
  1279. if (isOldValueReadonly) {
  1280. return false;
  1281. } else {
  1282. oldValue.value = value;
  1283. return true;
  1284. }
  1285. }
  1286. }
  1287. const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
  1288. const result = Reflect.set(
  1289. target,
  1290. key,
  1291. value,
  1292. isRef(target) ? target : receiver
  1293. );
  1294. if (target === toRaw(receiver)) {
  1295. if (!hadKey) {
  1296. trigger(target, "add", key, value);
  1297. } else if (hasChanged(value, oldValue)) {
  1298. trigger(target, "set", key, value, oldValue);
  1299. }
  1300. }
  1301. return result;
  1302. }
  1303. deleteProperty(target, key) {
  1304. const hadKey = hasOwn(target, key);
  1305. const oldValue = target[key];
  1306. const result = Reflect.deleteProperty(target, key);
  1307. if (result && hadKey) {
  1308. trigger(target, "delete", key, void 0, oldValue);
  1309. }
  1310. return result;
  1311. }
  1312. has(target, key) {
  1313. const result = Reflect.has(target, key);
  1314. if (!isSymbol(key) || !builtInSymbols.has(key)) {
  1315. track(target, "has", key);
  1316. }
  1317. return result;
  1318. }
  1319. ownKeys(target) {
  1320. track(
  1321. target,
  1322. "iterate",
  1323. isArray(target) ? "length" : ITERATE_KEY
  1324. );
  1325. return Reflect.ownKeys(target);
  1326. }
  1327. }
  1328. class ReadonlyReactiveHandler extends BaseReactiveHandler {
  1329. constructor(isShallow2 = false) {
  1330. super(true, isShallow2);
  1331. }
  1332. set(target, key) {
  1333. {
  1334. warn$2(
  1335. `Set operation on key "${String(key)}" failed: target is readonly.`,
  1336. target
  1337. );
  1338. }
  1339. return true;
  1340. }
  1341. deleteProperty(target, key) {
  1342. {
  1343. warn$2(
  1344. `Delete operation on key "${String(key)}" failed: target is readonly.`,
  1345. target
  1346. );
  1347. }
  1348. return true;
  1349. }
  1350. }
  1351. const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
  1352. const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
  1353. const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
  1354. const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
  1355. const toShallow = (value) => value;
  1356. const getProto = (v) => Reflect.getPrototypeOf(v);
  1357. function createIterableMethod(method, isReadonly2, isShallow2) {
  1358. return function(...args) {
  1359. const target = this["__v_raw"];
  1360. const rawTarget = toRaw(target);
  1361. const targetIsMap = isMap(rawTarget);
  1362. const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
  1363. const isKeyOnly = method === "keys" && targetIsMap;
  1364. const innerIterator = target[method](...args);
  1365. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  1366. !isReadonly2 && track(
  1367. rawTarget,
  1368. "iterate",
  1369. isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
  1370. );
  1371. return {
  1372. // iterator protocol
  1373. next() {
  1374. const { value, done } = innerIterator.next();
  1375. return done ? { value, done } : {
  1376. value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
  1377. done
  1378. };
  1379. },
  1380. // iterable protocol
  1381. [Symbol.iterator]() {
  1382. return this;
  1383. }
  1384. };
  1385. };
  1386. }
  1387. function createReadonlyMethod(type) {
  1388. return function(...args) {
  1389. {
  1390. const key = args[0] ? `on key "${args[0]}" ` : ``;
  1391. warn$2(
  1392. `${capitalize(type)} operation ${key}failed: target is readonly.`,
  1393. toRaw(this)
  1394. );
  1395. }
  1396. return type === "delete" ? false : type === "clear" ? void 0 : this;
  1397. };
  1398. }
  1399. function createInstrumentations(readonly, shallow) {
  1400. const instrumentations = {
  1401. get(key) {
  1402. const target = this["__v_raw"];
  1403. const rawTarget = toRaw(target);
  1404. const rawKey = toRaw(key);
  1405. if (!readonly) {
  1406. if (hasChanged(key, rawKey)) {
  1407. track(rawTarget, "get", key);
  1408. }
  1409. track(rawTarget, "get", rawKey);
  1410. }
  1411. const { has } = getProto(rawTarget);
  1412. const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
  1413. if (has.call(rawTarget, key)) {
  1414. return wrap(target.get(key));
  1415. } else if (has.call(rawTarget, rawKey)) {
  1416. return wrap(target.get(rawKey));
  1417. } else if (target !== rawTarget) {
  1418. target.get(key);
  1419. }
  1420. },
  1421. get size() {
  1422. const target = this["__v_raw"];
  1423. !readonly && track(toRaw(target), "iterate", ITERATE_KEY);
  1424. return Reflect.get(target, "size", target);
  1425. },
  1426. has(key) {
  1427. const target = this["__v_raw"];
  1428. const rawTarget = toRaw(target);
  1429. const rawKey = toRaw(key);
  1430. if (!readonly) {
  1431. if (hasChanged(key, rawKey)) {
  1432. track(rawTarget, "has", key);
  1433. }
  1434. track(rawTarget, "has", rawKey);
  1435. }
  1436. return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
  1437. },
  1438. forEach(callback, thisArg) {
  1439. const observed = this;
  1440. const target = observed["__v_raw"];
  1441. const rawTarget = toRaw(target);
  1442. const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
  1443. !readonly && track(rawTarget, "iterate", ITERATE_KEY);
  1444. return target.forEach((value, key) => {
  1445. return callback.call(thisArg, wrap(value), wrap(key), observed);
  1446. });
  1447. }
  1448. };
  1449. extend(
  1450. instrumentations,
  1451. readonly ? {
  1452. add: createReadonlyMethod("add"),
  1453. set: createReadonlyMethod("set"),
  1454. delete: createReadonlyMethod("delete"),
  1455. clear: createReadonlyMethod("clear")
  1456. } : {
  1457. add(value) {
  1458. if (!shallow && !isShallow(value) && !isReadonly(value)) {
  1459. value = toRaw(value);
  1460. }
  1461. const target = toRaw(this);
  1462. const proto = getProto(target);
  1463. const hadKey = proto.has.call(target, value);
  1464. if (!hadKey) {
  1465. target.add(value);
  1466. trigger(target, "add", value, value);
  1467. }
  1468. return this;
  1469. },
  1470. set(key, value) {
  1471. if (!shallow && !isShallow(value) && !isReadonly(value)) {
  1472. value = toRaw(value);
  1473. }
  1474. const target = toRaw(this);
  1475. const { has, get } = getProto(target);
  1476. let hadKey = has.call(target, key);
  1477. if (!hadKey) {
  1478. key = toRaw(key);
  1479. hadKey = has.call(target, key);
  1480. } else {
  1481. checkIdentityKeys(target, has, key);
  1482. }
  1483. const oldValue = get.call(target, key);
  1484. target.set(key, value);
  1485. if (!hadKey) {
  1486. trigger(target, "add", key, value);
  1487. } else if (hasChanged(value, oldValue)) {
  1488. trigger(target, "set", key, value, oldValue);
  1489. }
  1490. return this;
  1491. },
  1492. delete(key) {
  1493. const target = toRaw(this);
  1494. const { has, get } = getProto(target);
  1495. let hadKey = has.call(target, key);
  1496. if (!hadKey) {
  1497. key = toRaw(key);
  1498. hadKey = has.call(target, key);
  1499. } else {
  1500. checkIdentityKeys(target, has, key);
  1501. }
  1502. const oldValue = get ? get.call(target, key) : void 0;
  1503. const result = target.delete(key);
  1504. if (hadKey) {
  1505. trigger(target, "delete", key, void 0, oldValue);
  1506. }
  1507. return result;
  1508. },
  1509. clear() {
  1510. const target = toRaw(this);
  1511. const hadItems = target.size !== 0;
  1512. const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
  1513. const result = target.clear();
  1514. if (hadItems) {
  1515. trigger(
  1516. target,
  1517. "clear",
  1518. void 0,
  1519. void 0,
  1520. oldTarget
  1521. );
  1522. }
  1523. return result;
  1524. }
  1525. }
  1526. );
  1527. const iteratorMethods = [
  1528. "keys",
  1529. "values",
  1530. "entries",
  1531. Symbol.iterator
  1532. ];
  1533. iteratorMethods.forEach((method) => {
  1534. instrumentations[method] = createIterableMethod(method, readonly, shallow);
  1535. });
  1536. return instrumentations;
  1537. }
  1538. function createInstrumentationGetter(isReadonly2, shallow) {
  1539. const instrumentations = createInstrumentations(isReadonly2, shallow);
  1540. return (target, key, receiver) => {
  1541. if (key === "__v_isReactive") {
  1542. return !isReadonly2;
  1543. } else if (key === "__v_isReadonly") {
  1544. return isReadonly2;
  1545. } else if (key === "__v_raw") {
  1546. return target;
  1547. }
  1548. return Reflect.get(
  1549. hasOwn(instrumentations, key) && key in target ? instrumentations : target,
  1550. key,
  1551. receiver
  1552. );
  1553. };
  1554. }
  1555. const mutableCollectionHandlers = {
  1556. get: /* @__PURE__ */ createInstrumentationGetter(false, false)
  1557. };
  1558. const shallowCollectionHandlers = {
  1559. get: /* @__PURE__ */ createInstrumentationGetter(false, true)
  1560. };
  1561. const readonlyCollectionHandlers = {
  1562. get: /* @__PURE__ */ createInstrumentationGetter(true, false)
  1563. };
  1564. const shallowReadonlyCollectionHandlers = {
  1565. get: /* @__PURE__ */ createInstrumentationGetter(true, true)
  1566. };
  1567. function checkIdentityKeys(target, has, key) {
  1568. const rawKey = toRaw(key);
  1569. if (rawKey !== key && has.call(target, rawKey)) {
  1570. const type = toRawType(target);
  1571. warn$2(
  1572. `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
  1573. );
  1574. }
  1575. }
  1576. const reactiveMap = /* @__PURE__ */ new WeakMap();
  1577. const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
  1578. const readonlyMap = /* @__PURE__ */ new WeakMap();
  1579. const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
  1580. function targetTypeMap(rawType) {
  1581. switch (rawType) {
  1582. case "Object":
  1583. case "Array":
  1584. return 1 /* COMMON */;
  1585. case "Map":
  1586. case "Set":
  1587. case "WeakMap":
  1588. case "WeakSet":
  1589. return 2 /* COLLECTION */;
  1590. default:
  1591. return 0 /* INVALID */;
  1592. }
  1593. }
  1594. function getTargetType(value) {
  1595. return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
  1596. }
  1597. function reactive(target) {
  1598. if (isReadonly(target)) {
  1599. return target;
  1600. }
  1601. return createReactiveObject(
  1602. target,
  1603. false,
  1604. mutableHandlers,
  1605. mutableCollectionHandlers,
  1606. reactiveMap
  1607. );
  1608. }
  1609. function shallowReactive(target) {
  1610. return createReactiveObject(
  1611. target,
  1612. false,
  1613. shallowReactiveHandlers,
  1614. shallowCollectionHandlers,
  1615. shallowReactiveMap
  1616. );
  1617. }
  1618. function readonly(target) {
  1619. return createReactiveObject(
  1620. target,
  1621. true,
  1622. readonlyHandlers,
  1623. readonlyCollectionHandlers,
  1624. readonlyMap
  1625. );
  1626. }
  1627. function shallowReadonly(target) {
  1628. return createReactiveObject(
  1629. target,
  1630. true,
  1631. shallowReadonlyHandlers,
  1632. shallowReadonlyCollectionHandlers,
  1633. shallowReadonlyMap
  1634. );
  1635. }
  1636. function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
  1637. if (!isObject(target)) {
  1638. {
  1639. warn$2(
  1640. `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String(
  1641. target
  1642. )}`
  1643. );
  1644. }
  1645. return target;
  1646. }
  1647. if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
  1648. return target;
  1649. }
  1650. const targetType = getTargetType(target);
  1651. if (targetType === 0 /* INVALID */) {
  1652. return target;
  1653. }
  1654. const existingProxy = proxyMap.get(target);
  1655. if (existingProxy) {
  1656. return existingProxy;
  1657. }
  1658. const proxy = new Proxy(
  1659. target,
  1660. targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
  1661. );
  1662. proxyMap.set(target, proxy);
  1663. return proxy;
  1664. }
  1665. function isReactive(value) {
  1666. if (isReadonly(value)) {
  1667. return isReactive(value["__v_raw"]);
  1668. }
  1669. return !!(value && value["__v_isReactive"]);
  1670. }
  1671. function isReadonly(value) {
  1672. return !!(value && value["__v_isReadonly"]);
  1673. }
  1674. function isShallow(value) {
  1675. return !!(value && value["__v_isShallow"]);
  1676. }
  1677. function isProxy(value) {
  1678. return value ? !!value["__v_raw"] : false;
  1679. }
  1680. function toRaw(observed) {
  1681. const raw = observed && observed["__v_raw"];
  1682. return raw ? toRaw(raw) : observed;
  1683. }
  1684. function markRaw(value) {
  1685. if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
  1686. def(value, "__v_skip", true);
  1687. }
  1688. return value;
  1689. }
  1690. const toReactive = (value) => isObject(value) ? reactive(value) : value;
  1691. const toReadonly = (value) => isObject(value) ? readonly(value) : value;
  1692. function isRef(r) {
  1693. return r ? r["__v_isRef"] === true : false;
  1694. }
  1695. function ref(value) {
  1696. return createRef(value, false);
  1697. }
  1698. function shallowRef(value) {
  1699. return createRef(value, true);
  1700. }
  1701. function createRef(rawValue, shallow) {
  1702. if (isRef(rawValue)) {
  1703. return rawValue;
  1704. }
  1705. return new RefImpl(rawValue, shallow);
  1706. }
  1707. class RefImpl {
  1708. constructor(value, isShallow2) {
  1709. this.dep = new Dep();
  1710. this["__v_isRef"] = true;
  1711. this["__v_isShallow"] = false;
  1712. this._rawValue = isShallow2 ? value : toRaw(value);
  1713. this._value = isShallow2 ? value : toReactive(value);
  1714. this["__v_isShallow"] = isShallow2;
  1715. }
  1716. get value() {
  1717. {
  1718. this.dep.track({
  1719. target: this,
  1720. type: "get",
  1721. key: "value"
  1722. });
  1723. }
  1724. return this._value;
  1725. }
  1726. set value(newValue) {
  1727. const oldValue = this._rawValue;
  1728. const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue);
  1729. newValue = useDirectValue ? newValue : toRaw(newValue);
  1730. if (hasChanged(newValue, oldValue)) {
  1731. this._rawValue = newValue;
  1732. this._value = useDirectValue ? newValue : toReactive(newValue);
  1733. {
  1734. this.dep.trigger({
  1735. target: this,
  1736. type: "set",
  1737. key: "value",
  1738. newValue,
  1739. oldValue
  1740. });
  1741. }
  1742. }
  1743. }
  1744. }
  1745. function triggerRef(ref2) {
  1746. if (ref2.dep) {
  1747. {
  1748. ref2.dep.trigger({
  1749. target: ref2,
  1750. type: "set",
  1751. key: "value",
  1752. newValue: ref2._value
  1753. });
  1754. }
  1755. }
  1756. }
  1757. function unref(ref2) {
  1758. return isRef(ref2) ? ref2.value : ref2;
  1759. }
  1760. function toValue(source) {
  1761. return isFunction(source) ? source() : unref(source);
  1762. }
  1763. const shallowUnwrapHandlers = {
  1764. get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
  1765. set: (target, key, value, receiver) => {
  1766. const oldValue = target[key];
  1767. if (isRef(oldValue) && !isRef(value)) {
  1768. oldValue.value = value;
  1769. return true;
  1770. } else {
  1771. return Reflect.set(target, key, value, receiver);
  1772. }
  1773. }
  1774. };
  1775. function proxyRefs(objectWithRefs) {
  1776. return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
  1777. }
  1778. class CustomRefImpl {
  1779. constructor(factory) {
  1780. this["__v_isRef"] = true;
  1781. this._value = void 0;
  1782. const dep = this.dep = new Dep();
  1783. const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep));
  1784. this._get = get;
  1785. this._set = set;
  1786. }
  1787. get value() {
  1788. return this._value = this._get();
  1789. }
  1790. set value(newVal) {
  1791. this._set(newVal);
  1792. }
  1793. }
  1794. function customRef(factory) {
  1795. return new CustomRefImpl(factory);
  1796. }
  1797. function toRefs(object) {
  1798. if (!isProxy(object)) {
  1799. warn$2(`toRefs() expects a reactive object but received a plain one.`);
  1800. }
  1801. const ret = isArray(object) ? new Array(object.length) : {};
  1802. for (const key in object) {
  1803. ret[key] = propertyToRef(object, key);
  1804. }
  1805. return ret;
  1806. }
  1807. class ObjectRefImpl {
  1808. constructor(_object, _key, _defaultValue) {
  1809. this._object = _object;
  1810. this._key = _key;
  1811. this._defaultValue = _defaultValue;
  1812. this["__v_isRef"] = true;
  1813. this._value = void 0;
  1814. }
  1815. get value() {
  1816. const val = this._object[this._key];
  1817. return this._value = val === void 0 ? this._defaultValue : val;
  1818. }
  1819. set value(newVal) {
  1820. this._object[this._key] = newVal;
  1821. }
  1822. get dep() {
  1823. return getDepFromReactive(toRaw(this._object), this._key);
  1824. }
  1825. }
  1826. class GetterRefImpl {
  1827. constructor(_getter) {
  1828. this._getter = _getter;
  1829. this["__v_isRef"] = true;
  1830. this["__v_isReadonly"] = true;
  1831. this._value = void 0;
  1832. }
  1833. get value() {
  1834. return this._value = this._getter();
  1835. }
  1836. }
  1837. function toRef(source, key, defaultValue) {
  1838. if (isRef(source)) {
  1839. return source;
  1840. } else if (isFunction(source)) {
  1841. return new GetterRefImpl(source);
  1842. } else if (isObject(source) && arguments.length > 1) {
  1843. return propertyToRef(source, key, defaultValue);
  1844. } else {
  1845. return ref(source);
  1846. }
  1847. }
  1848. function propertyToRef(source, key, defaultValue) {
  1849. const val = source[key];
  1850. return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
  1851. }
  1852. class ComputedRefImpl {
  1853. constructor(fn, setter, isSSR) {
  1854. this.fn = fn;
  1855. this.setter = setter;
  1856. /**
  1857. * @internal
  1858. */
  1859. this._value = void 0;
  1860. /**
  1861. * @internal
  1862. */
  1863. this.dep = new Dep(this);
  1864. /**
  1865. * @internal
  1866. */
  1867. this.__v_isRef = true;
  1868. // TODO isolatedDeclarations "__v_isReadonly"
  1869. // A computed is also a subscriber that tracks other deps
  1870. /**
  1871. * @internal
  1872. */
  1873. this.deps = void 0;
  1874. /**
  1875. * @internal
  1876. */
  1877. this.depsTail = void 0;
  1878. /**
  1879. * @internal
  1880. */
  1881. this.flags = 16;
  1882. /**
  1883. * @internal
  1884. */
  1885. this.globalVersion = globalVersion - 1;
  1886. /**
  1887. * @internal
  1888. */
  1889. this.next = void 0;
  1890. // for backwards compat
  1891. this.effect = this;
  1892. this["__v_isReadonly"] = !setter;
  1893. this.isSSR = isSSR;
  1894. }
  1895. /**
  1896. * @internal
  1897. */
  1898. notify() {
  1899. this.flags |= 16;
  1900. if (!(this.flags & 8) && // avoid infinite self recursion
  1901. activeSub !== this) {
  1902. batch(this, true);
  1903. return true;
  1904. }
  1905. }
  1906. get value() {
  1907. const link = this.dep.track({
  1908. target: this,
  1909. type: "get",
  1910. key: "value"
  1911. }) ;
  1912. refreshComputed(this);
  1913. if (link) {
  1914. link.version = this.dep.version;
  1915. }
  1916. return this._value;
  1917. }
  1918. set value(newValue) {
  1919. if (this.setter) {
  1920. this.setter(newValue);
  1921. } else {
  1922. warn$2("Write operation failed: computed value is readonly");
  1923. }
  1924. }
  1925. }
  1926. function computed$1(getterOrOptions, debugOptions, isSSR = false) {
  1927. let getter;
  1928. let setter;
  1929. if (isFunction(getterOrOptions)) {
  1930. getter = getterOrOptions;
  1931. } else {
  1932. getter = getterOrOptions.get;
  1933. setter = getterOrOptions.set;
  1934. }
  1935. const cRef = new ComputedRefImpl(getter, setter, isSSR);
  1936. if (debugOptions && !isSSR) {
  1937. cRef.onTrack = debugOptions.onTrack;
  1938. cRef.onTrigger = debugOptions.onTrigger;
  1939. }
  1940. return cRef;
  1941. }
  1942. const TrackOpTypes = {
  1943. "GET": "get",
  1944. "HAS": "has",
  1945. "ITERATE": "iterate"
  1946. };
  1947. const TriggerOpTypes = {
  1948. "SET": "set",
  1949. "ADD": "add",
  1950. "DELETE": "delete",
  1951. "CLEAR": "clear"
  1952. };
  1953. const INITIAL_WATCHER_VALUE = {};
  1954. const cleanupMap = /* @__PURE__ */ new WeakMap();
  1955. let activeWatcher = void 0;
  1956. function getCurrentWatcher() {
  1957. return activeWatcher;
  1958. }
  1959. function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
  1960. if (owner) {
  1961. let cleanups = cleanupMap.get(owner);
  1962. if (!cleanups) cleanupMap.set(owner, cleanups = []);
  1963. cleanups.push(cleanupFn);
  1964. } else if (!failSilently) {
  1965. warn$2(
  1966. `onWatcherCleanup() was called when there was no active watcher to associate with.`
  1967. );
  1968. }
  1969. }
  1970. function watch$1(source, cb, options = EMPTY_OBJ) {
  1971. const { immediate, deep, once, scheduler, augmentJob, call } = options;
  1972. const warnInvalidSource = (s) => {
  1973. (options.onWarn || warn$2)(
  1974. `Invalid watch source: `,
  1975. s,
  1976. `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
  1977. );
  1978. };
  1979. const reactiveGetter = (source2) => {
  1980. if (deep) return source2;
  1981. if (isShallow(source2) || deep === false || deep === 0)
  1982. return traverse(source2, 1);
  1983. return traverse(source2);
  1984. };
  1985. let effect;
  1986. let getter;
  1987. let cleanup;
  1988. let boundCleanup;
  1989. let forceTrigger = false;
  1990. let isMultiSource = false;
  1991. if (isRef(source)) {
  1992. getter = () => source.value;
  1993. forceTrigger = isShallow(source);
  1994. } else if (isReactive(source)) {
  1995. getter = () => reactiveGetter(source);
  1996. forceTrigger = true;
  1997. } else if (isArray(source)) {
  1998. isMultiSource = true;
  1999. forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
  2000. getter = () => source.map((s) => {
  2001. if (isRef(s)) {
  2002. return s.value;
  2003. } else if (isReactive(s)) {
  2004. return reactiveGetter(s);
  2005. } else if (isFunction(s)) {
  2006. return call ? call(s, 2) : s();
  2007. } else {
  2008. warnInvalidSource(s);
  2009. }
  2010. });
  2011. } else if (isFunction(source)) {
  2012. if (cb) {
  2013. getter = call ? () => call(source, 2) : source;
  2014. } else {
  2015. getter = () => {
  2016. if (cleanup) {
  2017. pauseTracking();
  2018. try {
  2019. cleanup();
  2020. } finally {
  2021. resetTracking();
  2022. }
  2023. }
  2024. const currentEffect = activeWatcher;
  2025. activeWatcher = effect;
  2026. try {
  2027. return call ? call(source, 3, [boundCleanup]) : source(boundCleanup);
  2028. } finally {
  2029. activeWatcher = currentEffect;
  2030. }
  2031. };
  2032. }
  2033. } else {
  2034. getter = NOOP;
  2035. warnInvalidSource(source);
  2036. }
  2037. if (cb && deep) {
  2038. const baseGetter = getter;
  2039. const depth = deep === true ? Infinity : deep;
  2040. getter = () => traverse(baseGetter(), depth);
  2041. }
  2042. const scope = getCurrentScope();
  2043. const watchHandle = () => {
  2044. effect.stop();
  2045. if (scope && scope.active) {
  2046. remove(scope.effects, effect);
  2047. }
  2048. };
  2049. if (once && cb) {
  2050. const _cb = cb;
  2051. cb = (...args) => {
  2052. _cb(...args);
  2053. watchHandle();
  2054. };
  2055. }
  2056. let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
  2057. const job = (immediateFirstRun) => {
  2058. if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {
  2059. return;
  2060. }
  2061. if (cb) {
  2062. const newValue = effect.run();
  2063. if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
  2064. if (cleanup) {
  2065. cleanup();
  2066. }
  2067. const currentWatcher = activeWatcher;
  2068. activeWatcher = effect;
  2069. try {
  2070. const args = [
  2071. newValue,
  2072. // pass undefined as the old value when it's changed for the first time
  2073. oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
  2074. boundCleanup
  2075. ];
  2076. oldValue = newValue;
  2077. call ? call(cb, 3, args) : (
  2078. // @ts-expect-error
  2079. cb(...args)
  2080. );
  2081. } finally {
  2082. activeWatcher = currentWatcher;
  2083. }
  2084. }
  2085. } else {
  2086. effect.run();
  2087. }
  2088. };
  2089. if (augmentJob) {
  2090. augmentJob(job);
  2091. }
  2092. effect = new ReactiveEffect(getter);
  2093. effect.scheduler = scheduler ? () => scheduler(job, false) : job;
  2094. boundCleanup = (fn) => onWatcherCleanup(fn, false, effect);
  2095. cleanup = effect.onStop = () => {
  2096. const cleanups = cleanupMap.get(effect);
  2097. if (cleanups) {
  2098. if (call) {
  2099. call(cleanups, 4);
  2100. } else {
  2101. for (const cleanup2 of cleanups) cleanup2();
  2102. }
  2103. cleanupMap.delete(effect);
  2104. }
  2105. };
  2106. {
  2107. effect.onTrack = options.onTrack;
  2108. effect.onTrigger = options.onTrigger;
  2109. }
  2110. if (cb) {
  2111. if (immediate) {
  2112. job(true);
  2113. } else {
  2114. oldValue = effect.run();
  2115. }
  2116. } else if (scheduler) {
  2117. scheduler(job.bind(null, true), true);
  2118. } else {
  2119. effect.run();
  2120. }
  2121. watchHandle.pause = effect.pause.bind(effect);
  2122. watchHandle.resume = effect.resume.bind(effect);
  2123. watchHandle.stop = watchHandle;
  2124. return watchHandle;
  2125. }
  2126. function traverse(value, depth = Infinity, seen) {
  2127. if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
  2128. return value;
  2129. }
  2130. seen = seen || /* @__PURE__ */ new Set();
  2131. if (seen.has(value)) {
  2132. return value;
  2133. }
  2134. seen.add(value);
  2135. depth--;
  2136. if (isRef(value)) {
  2137. traverse(value.value, depth, seen);
  2138. } else if (isArray(value)) {
  2139. for (let i = 0; i < value.length; i++) {
  2140. traverse(value[i], depth, seen);
  2141. }
  2142. } else if (isSet(value) || isMap(value)) {
  2143. value.forEach((v) => {
  2144. traverse(v, depth, seen);
  2145. });
  2146. } else if (isPlainObject(value)) {
  2147. for (const key in value) {
  2148. traverse(value[key], depth, seen);
  2149. }
  2150. for (const key of Object.getOwnPropertySymbols(value)) {
  2151. if (Object.prototype.propertyIsEnumerable.call(value, key)) {
  2152. traverse(value[key], depth, seen);
  2153. }
  2154. }
  2155. }
  2156. return value;
  2157. }
  2158. const stack = [];
  2159. function pushWarningContext(vnode) {
  2160. stack.push(vnode);
  2161. }
  2162. function popWarningContext() {
  2163. stack.pop();
  2164. }
  2165. let isWarning = false;
  2166. function warn$1(msg, ...args) {
  2167. if (isWarning) return;
  2168. isWarning = true;
  2169. pauseTracking();
  2170. const instance = stack.length ? stack[stack.length - 1].component : null;
  2171. const appWarnHandler = instance && instance.appContext.config.warnHandler;
  2172. const trace = getComponentTrace();
  2173. if (appWarnHandler) {
  2174. callWithErrorHandling(
  2175. appWarnHandler,
  2176. instance,
  2177. 11,
  2178. [
  2179. // eslint-disable-next-line no-restricted-syntax
  2180. msg + args.map((a) => {
  2181. var _a, _b;
  2182. return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
  2183. }).join(""),
  2184. instance && instance.proxy,
  2185. trace.map(
  2186. ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
  2187. ).join("\n"),
  2188. trace
  2189. ]
  2190. );
  2191. } else {
  2192. const warnArgs = [`[Vue warn]: ${msg}`, ...args];
  2193. if (trace.length && // avoid spamming console during tests
  2194. true) {
  2195. warnArgs.push(`
  2196. `, ...formatTrace(trace));
  2197. }
  2198. console.warn(...warnArgs);
  2199. }
  2200. resetTracking();
  2201. isWarning = false;
  2202. }
  2203. function getComponentTrace() {
  2204. let currentVNode = stack[stack.length - 1];
  2205. if (!currentVNode) {
  2206. return [];
  2207. }
  2208. const normalizedStack = [];
  2209. while (currentVNode) {
  2210. const last = normalizedStack[0];
  2211. if (last && last.vnode === currentVNode) {
  2212. last.recurseCount++;
  2213. } else {
  2214. normalizedStack.push({
  2215. vnode: currentVNode,
  2216. recurseCount: 0
  2217. });
  2218. }
  2219. const parentInstance = currentVNode.component && currentVNode.component.parent;
  2220. currentVNode = parentInstance && parentInstance.vnode;
  2221. }
  2222. return normalizedStack;
  2223. }
  2224. function formatTrace(trace) {
  2225. const logs = [];
  2226. trace.forEach((entry, i) => {
  2227. logs.push(...i === 0 ? [] : [`
  2228. `], ...formatTraceEntry(entry));
  2229. });
  2230. return logs;
  2231. }
  2232. function formatTraceEntry({ vnode, recurseCount }) {
  2233. const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
  2234. const isRoot = vnode.component ? vnode.component.parent == null : false;
  2235. const open = ` at <${formatComponentName(
  2236. vnode.component,
  2237. vnode.type,
  2238. isRoot
  2239. )}`;
  2240. const close = `>` + postfix;
  2241. return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
  2242. }
  2243. function formatProps(props) {
  2244. const res = [];
  2245. const keys = Object.keys(props);
  2246. keys.slice(0, 3).forEach((key) => {
  2247. res.push(...formatProp(key, props[key]));
  2248. });
  2249. if (keys.length > 3) {
  2250. res.push(` ...`);
  2251. }
  2252. return res;
  2253. }
  2254. function formatProp(key, value, raw) {
  2255. if (isString(value)) {
  2256. value = JSON.stringify(value);
  2257. return raw ? value : [`${key}=${value}`];
  2258. } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
  2259. return raw ? value : [`${key}=${value}`];
  2260. } else if (isRef(value)) {
  2261. value = formatProp(key, toRaw(value.value), true);
  2262. return raw ? value : [`${key}=Ref<`, value, `>`];
  2263. } else if (isFunction(value)) {
  2264. return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
  2265. } else {
  2266. value = toRaw(value);
  2267. return raw ? value : [`${key}=`, value];
  2268. }
  2269. }
  2270. function assertNumber(val, type) {
  2271. if (val === void 0) {
  2272. return;
  2273. } else if (typeof val !== "number") {
  2274. warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`);
  2275. } else if (isNaN(val)) {
  2276. warn$1(`${type} is NaN - the duration expression might be incorrect.`);
  2277. }
  2278. }
  2279. const ErrorCodes = {
  2280. "SETUP_FUNCTION": 0,
  2281. "0": "SETUP_FUNCTION",
  2282. "RENDER_FUNCTION": 1,
  2283. "1": "RENDER_FUNCTION",
  2284. "NATIVE_EVENT_HANDLER": 5,
  2285. "5": "NATIVE_EVENT_HANDLER",
  2286. "COMPONENT_EVENT_HANDLER": 6,
  2287. "6": "COMPONENT_EVENT_HANDLER",
  2288. "VNODE_HOOK": 7,
  2289. "7": "VNODE_HOOK",
  2290. "DIRECTIVE_HOOK": 8,
  2291. "8": "DIRECTIVE_HOOK",
  2292. "TRANSITION_HOOK": 9,
  2293. "9": "TRANSITION_HOOK",
  2294. "APP_ERROR_HANDLER": 10,
  2295. "10": "APP_ERROR_HANDLER",
  2296. "APP_WARN_HANDLER": 11,
  2297. "11": "APP_WARN_HANDLER",
  2298. "FUNCTION_REF": 12,
  2299. "12": "FUNCTION_REF",
  2300. "ASYNC_COMPONENT_LOADER": 13,
  2301. "13": "ASYNC_COMPONENT_LOADER",
  2302. "SCHEDULER": 14,
  2303. "14": "SCHEDULER",
  2304. "COMPONENT_UPDATE": 15,
  2305. "15": "COMPONENT_UPDATE",
  2306. "APP_UNMOUNT_CLEANUP": 16,
  2307. "16": "APP_UNMOUNT_CLEANUP"
  2308. };
  2309. const ErrorTypeStrings$1 = {
  2310. ["sp"]: "serverPrefetch hook",
  2311. ["bc"]: "beforeCreate hook",
  2312. ["c"]: "created hook",
  2313. ["bm"]: "beforeMount hook",
  2314. ["m"]: "mounted hook",
  2315. ["bu"]: "beforeUpdate hook",
  2316. ["u"]: "updated",
  2317. ["bum"]: "beforeUnmount hook",
  2318. ["um"]: "unmounted hook",
  2319. ["a"]: "activated hook",
  2320. ["da"]: "deactivated hook",
  2321. ["ec"]: "errorCaptured hook",
  2322. ["rtc"]: "renderTracked hook",
  2323. ["rtg"]: "renderTriggered hook",
  2324. [0]: "setup function",
  2325. [1]: "render function",
  2326. [2]: "watcher getter",
  2327. [3]: "watcher callback",
  2328. [4]: "watcher cleanup function",
  2329. [5]: "native event handler",
  2330. [6]: "component event handler",
  2331. [7]: "vnode hook",
  2332. [8]: "directive hook",
  2333. [9]: "transition hook",
  2334. [10]: "app errorHandler",
  2335. [11]: "app warnHandler",
  2336. [12]: "ref function",
  2337. [13]: "async component loader",
  2338. [14]: "scheduler flush",
  2339. [15]: "component update",
  2340. [16]: "app unmount cleanup function"
  2341. };
  2342. function callWithErrorHandling(fn, instance, type, args) {
  2343. try {
  2344. return args ? fn(...args) : fn();
  2345. } catch (err) {
  2346. handleError(err, instance, type);
  2347. }
  2348. }
  2349. function callWithAsyncErrorHandling(fn, instance, type, args) {
  2350. if (isFunction(fn)) {
  2351. const res = callWithErrorHandling(fn, instance, type, args);
  2352. if (res && isPromise(res)) {
  2353. res.catch((err) => {
  2354. handleError(err, instance, type);
  2355. });
  2356. }
  2357. return res;
  2358. }
  2359. if (isArray(fn)) {
  2360. const values = [];
  2361. for (let i = 0; i < fn.length; i++) {
  2362. values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
  2363. }
  2364. return values;
  2365. } else {
  2366. warn$1(
  2367. `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`
  2368. );
  2369. }
  2370. }
  2371. function handleError(err, instance, type, throwInDev = true) {
  2372. const contextVNode = instance ? instance.vnode : null;
  2373. const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
  2374. if (instance) {
  2375. let cur = instance.parent;
  2376. const exposedInstance = instance.proxy;
  2377. const errorInfo = ErrorTypeStrings$1[type] ;
  2378. while (cur) {
  2379. const errorCapturedHooks = cur.ec;
  2380. if (errorCapturedHooks) {
  2381. for (let i = 0; i < errorCapturedHooks.length; i++) {
  2382. if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
  2383. return;
  2384. }
  2385. }
  2386. }
  2387. cur = cur.parent;
  2388. }
  2389. if (errorHandler) {
  2390. pauseTracking();
  2391. callWithErrorHandling(errorHandler, null, 10, [
  2392. err,
  2393. exposedInstance,
  2394. errorInfo
  2395. ]);
  2396. resetTracking();
  2397. return;
  2398. }
  2399. }
  2400. logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
  2401. }
  2402. function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {
  2403. {
  2404. const info = ErrorTypeStrings$1[type];
  2405. if (contextVNode) {
  2406. pushWarningContext(contextVNode);
  2407. }
  2408. warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
  2409. if (contextVNode) {
  2410. popWarningContext();
  2411. }
  2412. if (throwInDev) {
  2413. throw err;
  2414. } else {
  2415. console.error(err);
  2416. }
  2417. }
  2418. }
  2419. const queue = [];
  2420. let flushIndex = -1;
  2421. const pendingPostFlushCbs = [];
  2422. let activePostFlushCbs = null;
  2423. let postFlushIndex = 0;
  2424. const resolvedPromise = /* @__PURE__ */ Promise.resolve();
  2425. let currentFlushPromise = null;
  2426. const RECURSION_LIMIT = 100;
  2427. function nextTick(fn) {
  2428. const p = currentFlushPromise || resolvedPromise;
  2429. return fn ? p.then(this ? fn.bind(this) : fn) : p;
  2430. }
  2431. function findInsertionIndex(id) {
  2432. let start = flushIndex + 1;
  2433. let end = queue.length;
  2434. while (start < end) {
  2435. const middle = start + end >>> 1;
  2436. const middleJob = queue[middle];
  2437. const middleJobId = getId(middleJob);
  2438. if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
  2439. start = middle + 1;
  2440. } else {
  2441. end = middle;
  2442. }
  2443. }
  2444. return start;
  2445. }
  2446. function queueJob(job) {
  2447. if (!(job.flags & 1)) {
  2448. const jobId = getId(job);
  2449. const lastJob = queue[queue.length - 1];
  2450. if (!lastJob || // fast path when the job id is larger than the tail
  2451. !(job.flags & 2) && jobId >= getId(lastJob)) {
  2452. queue.push(job);
  2453. } else {
  2454. queue.splice(findInsertionIndex(jobId), 0, job);
  2455. }
  2456. job.flags |= 1;
  2457. queueFlush();
  2458. }
  2459. }
  2460. function queueFlush() {
  2461. if (!currentFlushPromise) {
  2462. currentFlushPromise = resolvedPromise.then(flushJobs);
  2463. }
  2464. }
  2465. function queuePostFlushCb(cb) {
  2466. if (!isArray(cb)) {
  2467. if (activePostFlushCbs && cb.id === -1) {
  2468. activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
  2469. } else if (!(cb.flags & 1)) {
  2470. pendingPostFlushCbs.push(cb);
  2471. cb.flags |= 1;
  2472. }
  2473. } else {
  2474. pendingPostFlushCbs.push(...cb);
  2475. }
  2476. queueFlush();
  2477. }
  2478. function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
  2479. {
  2480. seen = seen || /* @__PURE__ */ new Map();
  2481. }
  2482. for (; i < queue.length; i++) {
  2483. const cb = queue[i];
  2484. if (cb && cb.flags & 2) {
  2485. if (instance && cb.id !== instance.uid) {
  2486. continue;
  2487. }
  2488. if (checkRecursiveUpdates(seen, cb)) {
  2489. continue;
  2490. }
  2491. queue.splice(i, 1);
  2492. i--;
  2493. if (cb.flags & 4) {
  2494. cb.flags &= -2;
  2495. }
  2496. cb();
  2497. if (!(cb.flags & 4)) {
  2498. cb.flags &= -2;
  2499. }
  2500. }
  2501. }
  2502. }
  2503. function flushPostFlushCbs(seen) {
  2504. if (pendingPostFlushCbs.length) {
  2505. const deduped = [...new Set(pendingPostFlushCbs)].sort(
  2506. (a, b) => getId(a) - getId(b)
  2507. );
  2508. pendingPostFlushCbs.length = 0;
  2509. if (activePostFlushCbs) {
  2510. activePostFlushCbs.push(...deduped);
  2511. return;
  2512. }
  2513. activePostFlushCbs = deduped;
  2514. {
  2515. seen = seen || /* @__PURE__ */ new Map();
  2516. }
  2517. for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
  2518. const cb = activePostFlushCbs[postFlushIndex];
  2519. if (checkRecursiveUpdates(seen, cb)) {
  2520. continue;
  2521. }
  2522. if (cb.flags & 4) {
  2523. cb.flags &= -2;
  2524. }
  2525. if (!(cb.flags & 8)) cb();
  2526. cb.flags &= -2;
  2527. }
  2528. activePostFlushCbs = null;
  2529. postFlushIndex = 0;
  2530. }
  2531. }
  2532. const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
  2533. function flushJobs(seen) {
  2534. {
  2535. seen = seen || /* @__PURE__ */ new Map();
  2536. }
  2537. const check = (job) => checkRecursiveUpdates(seen, job) ;
  2538. try {
  2539. for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
  2540. const job = queue[flushIndex];
  2541. if (job && !(job.flags & 8)) {
  2542. if (check(job)) {
  2543. continue;
  2544. }
  2545. if (job.flags & 4) {
  2546. job.flags &= ~1;
  2547. }
  2548. callWithErrorHandling(
  2549. job,
  2550. job.i,
  2551. job.i ? 15 : 14
  2552. );
  2553. if (!(job.flags & 4)) {
  2554. job.flags &= ~1;
  2555. }
  2556. }
  2557. }
  2558. } finally {
  2559. for (; flushIndex < queue.length; flushIndex++) {
  2560. const job = queue[flushIndex];
  2561. if (job) {
  2562. job.flags &= -2;
  2563. }
  2564. }
  2565. flushIndex = -1;
  2566. queue.length = 0;
  2567. flushPostFlushCbs(seen);
  2568. currentFlushPromise = null;
  2569. if (queue.length || pendingPostFlushCbs.length) {
  2570. flushJobs(seen);
  2571. }
  2572. }
  2573. }
  2574. function checkRecursiveUpdates(seen, fn) {
  2575. const count = seen.get(fn) || 0;
  2576. if (count > RECURSION_LIMIT) {
  2577. const instance = fn.i;
  2578. const componentName = instance && getComponentName(instance.type);
  2579. handleError(
  2580. `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.`,
  2581. null,
  2582. 10
  2583. );
  2584. return true;
  2585. }
  2586. seen.set(fn, count + 1);
  2587. return false;
  2588. }
  2589. let isHmrUpdating = false;
  2590. const hmrDirtyComponents = /* @__PURE__ */ new Map();
  2591. {
  2592. getGlobalThis().__VUE_HMR_RUNTIME__ = {
  2593. createRecord: tryWrap(createRecord),
  2594. rerender: tryWrap(rerender),
  2595. reload: tryWrap(reload)
  2596. };
  2597. }
  2598. const map = /* @__PURE__ */ new Map();
  2599. function registerHMR(instance) {
  2600. const id = instance.type.__hmrId;
  2601. let record = map.get(id);
  2602. if (!record) {
  2603. createRecord(id, instance.type);
  2604. record = map.get(id);
  2605. }
  2606. record.instances.add(instance);
  2607. }
  2608. function unregisterHMR(instance) {
  2609. map.get(instance.type.__hmrId).instances.delete(instance);
  2610. }
  2611. function createRecord(id, initialDef) {
  2612. if (map.has(id)) {
  2613. return false;
  2614. }
  2615. map.set(id, {
  2616. initialDef: normalizeClassComponent(initialDef),
  2617. instances: /* @__PURE__ */ new Set()
  2618. });
  2619. return true;
  2620. }
  2621. function normalizeClassComponent(component) {
  2622. return isClassComponent(component) ? component.__vccOpts : component;
  2623. }
  2624. function rerender(id, newRender) {
  2625. const record = map.get(id);
  2626. if (!record) {
  2627. return;
  2628. }
  2629. record.initialDef.render = newRender;
  2630. [...record.instances].forEach((instance) => {
  2631. if (newRender) {
  2632. instance.render = newRender;
  2633. normalizeClassComponent(instance.type).render = newRender;
  2634. }
  2635. instance.renderCache = [];
  2636. isHmrUpdating = true;
  2637. instance.update();
  2638. isHmrUpdating = false;
  2639. });
  2640. }
  2641. function reload(id, newComp) {
  2642. const record = map.get(id);
  2643. if (!record) return;
  2644. newComp = normalizeClassComponent(newComp);
  2645. updateComponentDef(record.initialDef, newComp);
  2646. const instances = [...record.instances];
  2647. for (let i = 0; i < instances.length; i++) {
  2648. const instance = instances[i];
  2649. const oldComp = normalizeClassComponent(instance.type);
  2650. let dirtyInstances = hmrDirtyComponents.get(oldComp);
  2651. if (!dirtyInstances) {
  2652. if (oldComp !== record.initialDef) {
  2653. updateComponentDef(oldComp, newComp);
  2654. }
  2655. hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
  2656. }
  2657. dirtyInstances.add(instance);
  2658. instance.appContext.propsCache.delete(instance.type);
  2659. instance.appContext.emitsCache.delete(instance.type);
  2660. instance.appContext.optionsCache.delete(instance.type);
  2661. if (instance.ceReload) {
  2662. dirtyInstances.add(instance);
  2663. instance.ceReload(newComp.styles);
  2664. dirtyInstances.delete(instance);
  2665. } else if (instance.parent) {
  2666. queueJob(() => {
  2667. isHmrUpdating = true;
  2668. instance.parent.update();
  2669. isHmrUpdating = false;
  2670. dirtyInstances.delete(instance);
  2671. });
  2672. } else if (instance.appContext.reload) {
  2673. instance.appContext.reload();
  2674. } else if (typeof window !== "undefined") {
  2675. window.location.reload();
  2676. } else {
  2677. console.warn(
  2678. "[HMR] Root or manually mounted instance modified. Full reload required."
  2679. );
  2680. }
  2681. if (instance.root.ce && instance !== instance.root) {
  2682. instance.root.ce._removeChildStyle(oldComp);
  2683. }
  2684. }
  2685. queuePostFlushCb(() => {
  2686. hmrDirtyComponents.clear();
  2687. });
  2688. }
  2689. function updateComponentDef(oldComp, newComp) {
  2690. extend(oldComp, newComp);
  2691. for (const key in oldComp) {
  2692. if (key !== "__file" && !(key in newComp)) {
  2693. delete oldComp[key];
  2694. }
  2695. }
  2696. }
  2697. function tryWrap(fn) {
  2698. return (id, arg) => {
  2699. try {
  2700. return fn(id, arg);
  2701. } catch (e) {
  2702. console.error(e);
  2703. console.warn(
  2704. `[HMR] Something went wrong during Vue component hot-reload. Full reload required.`
  2705. );
  2706. }
  2707. };
  2708. }
  2709. let devtools$1;
  2710. let buffer = [];
  2711. let devtoolsNotInstalled = false;
  2712. function emit$1(event, ...args) {
  2713. if (devtools$1) {
  2714. devtools$1.emit(event, ...args);
  2715. } else if (!devtoolsNotInstalled) {
  2716. buffer.push({ event, args });
  2717. }
  2718. }
  2719. function setDevtoolsHook$1(hook, target) {
  2720. var _a, _b;
  2721. devtools$1 = hook;
  2722. if (devtools$1) {
  2723. devtools$1.enabled = true;
  2724. buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args));
  2725. buffer = [];
  2726. } else if (
  2727. // handle late devtools injection - only do this if we are in an actual
  2728. // browser environment to avoid the timer handle stalling test runner exit
  2729. // (#4815)
  2730. typeof window !== "undefined" && // some envs mock window but not fully
  2731. window.HTMLElement && // also exclude jsdom
  2732. // eslint-disable-next-line no-restricted-syntax
  2733. !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))
  2734. ) {
  2735. const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
  2736. replay.push((newHook) => {
  2737. setDevtoolsHook$1(newHook, target);
  2738. });
  2739. setTimeout(() => {
  2740. if (!devtools$1) {
  2741. target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
  2742. devtoolsNotInstalled = true;
  2743. buffer = [];
  2744. }
  2745. }, 3e3);
  2746. } else {
  2747. devtoolsNotInstalled = true;
  2748. buffer = [];
  2749. }
  2750. }
  2751. function devtoolsInitApp(app, version) {
  2752. emit$1("app:init" /* APP_INIT */, app, version, {
  2753. Fragment,
  2754. Text,
  2755. Comment,
  2756. Static
  2757. });
  2758. }
  2759. function devtoolsUnmountApp(app) {
  2760. emit$1("app:unmount" /* APP_UNMOUNT */, app);
  2761. }
  2762. const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook("component:added" /* COMPONENT_ADDED */);
  2763. const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */);
  2764. const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
  2765. "component:removed" /* COMPONENT_REMOVED */
  2766. );
  2767. const devtoolsComponentRemoved = (component) => {
  2768. if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered
  2769. !devtools$1.cleanupBuffer(component)) {
  2770. _devtoolsComponentRemoved(component);
  2771. }
  2772. };
  2773. /*! #__NO_SIDE_EFFECTS__ */
  2774. // @__NO_SIDE_EFFECTS__
  2775. function createDevtoolsComponentHook(hook) {
  2776. return (component) => {
  2777. emit$1(
  2778. hook,
  2779. component.appContext.app,
  2780. component.uid,
  2781. component.parent ? component.parent.uid : void 0,
  2782. component
  2783. );
  2784. };
  2785. }
  2786. const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:start" /* PERFORMANCE_START */);
  2787. const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:end" /* PERFORMANCE_END */);
  2788. function createDevtoolsPerformanceHook(hook) {
  2789. return (component, type, time) => {
  2790. emit$1(hook, component.appContext.app, component.uid, component, type, time);
  2791. };
  2792. }
  2793. function devtoolsComponentEmit(component, event, params) {
  2794. emit$1(
  2795. "component:emit" /* COMPONENT_EMIT */,
  2796. component.appContext.app,
  2797. component,
  2798. event,
  2799. params
  2800. );
  2801. }
  2802. let currentRenderingInstance = null;
  2803. let currentScopeId = null;
  2804. function setCurrentRenderingInstance(instance) {
  2805. const prev = currentRenderingInstance;
  2806. currentRenderingInstance = instance;
  2807. currentScopeId = instance && instance.type.__scopeId || null;
  2808. return prev;
  2809. }
  2810. function pushScopeId(id) {
  2811. currentScopeId = id;
  2812. }
  2813. function popScopeId() {
  2814. currentScopeId = null;
  2815. }
  2816. const withScopeId = (_id) => withCtx;
  2817. function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
  2818. if (!ctx) return fn;
  2819. if (fn._n) {
  2820. return fn;
  2821. }
  2822. const renderFnWithContext = (...args) => {
  2823. if (renderFnWithContext._d) {
  2824. setBlockTracking(-1);
  2825. }
  2826. const prevInstance = setCurrentRenderingInstance(ctx);
  2827. let res;
  2828. try {
  2829. res = fn(...args);
  2830. } finally {
  2831. setCurrentRenderingInstance(prevInstance);
  2832. if (renderFnWithContext._d) {
  2833. setBlockTracking(1);
  2834. }
  2835. }
  2836. {
  2837. devtoolsComponentUpdated(ctx);
  2838. }
  2839. return res;
  2840. };
  2841. renderFnWithContext._n = true;
  2842. renderFnWithContext._c = true;
  2843. renderFnWithContext._d = true;
  2844. return renderFnWithContext;
  2845. }
  2846. function validateDirectiveName(name) {
  2847. if (isBuiltInDirective(name)) {
  2848. warn$1("Do not use built-in directive ids as custom directive id: " + name);
  2849. }
  2850. }
  2851. function withDirectives(vnode, directives) {
  2852. if (currentRenderingInstance === null) {
  2853. warn$1(`withDirectives can only be used inside render functions.`);
  2854. return vnode;
  2855. }
  2856. const instance = getComponentPublicInstance(currentRenderingInstance);
  2857. const bindings = vnode.dirs || (vnode.dirs = []);
  2858. for (let i = 0; i < directives.length; i++) {
  2859. let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
  2860. if (dir) {
  2861. if (isFunction(dir)) {
  2862. dir = {
  2863. mounted: dir,
  2864. updated: dir
  2865. };
  2866. }
  2867. if (dir.deep) {
  2868. traverse(value);
  2869. }
  2870. bindings.push({
  2871. dir,
  2872. instance,
  2873. value,
  2874. oldValue: void 0,
  2875. arg,
  2876. modifiers
  2877. });
  2878. }
  2879. }
  2880. return vnode;
  2881. }
  2882. function invokeDirectiveHook(vnode, prevVNode, instance, name) {
  2883. const bindings = vnode.dirs;
  2884. const oldBindings = prevVNode && prevVNode.dirs;
  2885. for (let i = 0; i < bindings.length; i++) {
  2886. const binding = bindings[i];
  2887. if (oldBindings) {
  2888. binding.oldValue = oldBindings[i].value;
  2889. }
  2890. let hook = binding.dir[name];
  2891. if (hook) {
  2892. pauseTracking();
  2893. callWithAsyncErrorHandling(hook, instance, 8, [
  2894. vnode.el,
  2895. binding,
  2896. vnode,
  2897. prevVNode
  2898. ]);
  2899. resetTracking();
  2900. }
  2901. }
  2902. }
  2903. const TeleportEndKey = Symbol("_vte");
  2904. const isTeleport = (type) => type.__isTeleport;
  2905. const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
  2906. const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
  2907. const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
  2908. const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
  2909. const resolveTarget = (props, select) => {
  2910. const targetSelector = props && props.to;
  2911. if (isString(targetSelector)) {
  2912. if (!select) {
  2913. warn$1(
  2914. `Current renderer does not support string target for Teleports. (missing querySelector renderer option)`
  2915. );
  2916. return null;
  2917. } else {
  2918. const target = select(targetSelector);
  2919. if (!target && !isTeleportDisabled(props)) {
  2920. warn$1(
  2921. `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.`
  2922. );
  2923. }
  2924. return target;
  2925. }
  2926. } else {
  2927. if (!targetSelector && !isTeleportDisabled(props)) {
  2928. warn$1(`Invalid Teleport target: ${targetSelector}`);
  2929. }
  2930. return targetSelector;
  2931. }
  2932. };
  2933. const TeleportImpl = {
  2934. name: "Teleport",
  2935. __isTeleport: true,
  2936. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
  2937. const {
  2938. mc: mountChildren,
  2939. pc: patchChildren,
  2940. pbc: patchBlockChildren,
  2941. o: { insert, querySelector, createText, createComment }
  2942. } = internals;
  2943. const disabled = isTeleportDisabled(n2.props);
  2944. let { shapeFlag, children, dynamicChildren } = n2;
  2945. if (isHmrUpdating) {
  2946. optimized = false;
  2947. dynamicChildren = null;
  2948. }
  2949. if (n1 == null) {
  2950. const placeholder = n2.el = createComment("teleport start") ;
  2951. const mainAnchor = n2.anchor = createComment("teleport end") ;
  2952. insert(placeholder, container, anchor);
  2953. insert(mainAnchor, container, anchor);
  2954. const mount = (container2, anchor2) => {
  2955. if (shapeFlag & 16) {
  2956. if (parentComponent && parentComponent.isCE) {
  2957. parentComponent.ce._teleportTarget = container2;
  2958. }
  2959. mountChildren(
  2960. children,
  2961. container2,
  2962. anchor2,
  2963. parentComponent,
  2964. parentSuspense,
  2965. namespace,
  2966. slotScopeIds,
  2967. optimized
  2968. );
  2969. }
  2970. };
  2971. const mountToTarget = () => {
  2972. const target = n2.target = resolveTarget(n2.props, querySelector);
  2973. const targetAnchor = prepareAnchor(target, n2, createText, insert);
  2974. if (target) {
  2975. if (namespace !== "svg" && isTargetSVG(target)) {
  2976. namespace = "svg";
  2977. } else if (namespace !== "mathml" && isTargetMathML(target)) {
  2978. namespace = "mathml";
  2979. }
  2980. if (!disabled) {
  2981. mount(target, targetAnchor);
  2982. updateCssVars(n2, false);
  2983. }
  2984. } else if (!disabled) {
  2985. warn$1(
  2986. "Invalid Teleport target on mount:",
  2987. target,
  2988. `(${typeof target})`
  2989. );
  2990. }
  2991. };
  2992. if (disabled) {
  2993. mount(container, mainAnchor);
  2994. updateCssVars(n2, true);
  2995. }
  2996. if (isTeleportDeferred(n2.props)) {
  2997. n2.el.__isMounted = false;
  2998. queuePostRenderEffect(() => {
  2999. mountToTarget();
  3000. delete n2.el.__isMounted;
  3001. }, parentSuspense);
  3002. } else {
  3003. mountToTarget();
  3004. }
  3005. } else {
  3006. if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
  3007. queuePostRenderEffect(() => {
  3008. TeleportImpl.process(
  3009. n1,
  3010. n2,
  3011. container,
  3012. anchor,
  3013. parentComponent,
  3014. parentSuspense,
  3015. namespace,
  3016. slotScopeIds,
  3017. optimized,
  3018. internals
  3019. );
  3020. }, parentSuspense);
  3021. return;
  3022. }
  3023. n2.el = n1.el;
  3024. n2.targetStart = n1.targetStart;
  3025. const mainAnchor = n2.anchor = n1.anchor;
  3026. const target = n2.target = n1.target;
  3027. const targetAnchor = n2.targetAnchor = n1.targetAnchor;
  3028. const wasDisabled = isTeleportDisabled(n1.props);
  3029. const currentContainer = wasDisabled ? container : target;
  3030. const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
  3031. if (namespace === "svg" || isTargetSVG(target)) {
  3032. namespace = "svg";
  3033. } else if (namespace === "mathml" || isTargetMathML(target)) {
  3034. namespace = "mathml";
  3035. }
  3036. if (dynamicChildren) {
  3037. patchBlockChildren(
  3038. n1.dynamicChildren,
  3039. dynamicChildren,
  3040. currentContainer,
  3041. parentComponent,
  3042. parentSuspense,
  3043. namespace,
  3044. slotScopeIds
  3045. );
  3046. traverseStaticChildren(n1, n2, false);
  3047. } else if (!optimized) {
  3048. patchChildren(
  3049. n1,
  3050. n2,
  3051. currentContainer,
  3052. currentAnchor,
  3053. parentComponent,
  3054. parentSuspense,
  3055. namespace,
  3056. slotScopeIds,
  3057. false
  3058. );
  3059. }
  3060. if (disabled) {
  3061. if (!wasDisabled) {
  3062. moveTeleport(
  3063. n2,
  3064. container,
  3065. mainAnchor,
  3066. internals,
  3067. 1
  3068. );
  3069. } else {
  3070. if (n2.props && n1.props && n2.props.to !== n1.props.to) {
  3071. n2.props.to = n1.props.to;
  3072. }
  3073. }
  3074. } else {
  3075. if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
  3076. const nextTarget = n2.target = resolveTarget(
  3077. n2.props,
  3078. querySelector
  3079. );
  3080. if (nextTarget) {
  3081. moveTeleport(
  3082. n2,
  3083. nextTarget,
  3084. null,
  3085. internals,
  3086. 0
  3087. );
  3088. } else {
  3089. warn$1(
  3090. "Invalid Teleport target on update:",
  3091. target,
  3092. `(${typeof target})`
  3093. );
  3094. }
  3095. } else if (wasDisabled) {
  3096. moveTeleport(
  3097. n2,
  3098. target,
  3099. targetAnchor,
  3100. internals,
  3101. 1
  3102. );
  3103. }
  3104. }
  3105. updateCssVars(n2, disabled);
  3106. }
  3107. },
  3108. remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
  3109. const {
  3110. shapeFlag,
  3111. children,
  3112. anchor,
  3113. targetStart,
  3114. targetAnchor,
  3115. target,
  3116. props
  3117. } = vnode;
  3118. if (target) {
  3119. hostRemove(targetStart);
  3120. hostRemove(targetAnchor);
  3121. }
  3122. doRemove && hostRemove(anchor);
  3123. if (shapeFlag & 16) {
  3124. const shouldRemove = doRemove || !isTeleportDisabled(props);
  3125. for (let i = 0; i < children.length; i++) {
  3126. const child = children[i];
  3127. unmount(
  3128. child,
  3129. parentComponent,
  3130. parentSuspense,
  3131. shouldRemove,
  3132. !!child.dynamicChildren
  3133. );
  3134. }
  3135. }
  3136. },
  3137. move: moveTeleport,
  3138. hydrate: hydrateTeleport
  3139. };
  3140. function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
  3141. if (moveType === 0) {
  3142. insert(vnode.targetAnchor, container, parentAnchor);
  3143. }
  3144. const { el, anchor, shapeFlag, children, props } = vnode;
  3145. const isReorder = moveType === 2;
  3146. if (isReorder) {
  3147. insert(el, container, parentAnchor);
  3148. }
  3149. if (!isReorder || isTeleportDisabled(props)) {
  3150. if (shapeFlag & 16) {
  3151. for (let i = 0; i < children.length; i++) {
  3152. move(
  3153. children[i],
  3154. container,
  3155. parentAnchor,
  3156. 2
  3157. );
  3158. }
  3159. }
  3160. }
  3161. if (isReorder) {
  3162. insert(anchor, container, parentAnchor);
  3163. }
  3164. }
  3165. function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
  3166. o: { nextSibling, parentNode, querySelector, insert, createText }
  3167. }, hydrateChildren) {
  3168. const target = vnode.target = resolveTarget(
  3169. vnode.props,
  3170. querySelector
  3171. );
  3172. if (target) {
  3173. const disabled = isTeleportDisabled(vnode.props);
  3174. const targetNode = target._lpa || target.firstChild;
  3175. if (vnode.shapeFlag & 16) {
  3176. if (disabled) {
  3177. vnode.anchor = hydrateChildren(
  3178. nextSibling(node),
  3179. vnode,
  3180. parentNode(node),
  3181. parentComponent,
  3182. parentSuspense,
  3183. slotScopeIds,
  3184. optimized
  3185. );
  3186. vnode.targetStart = targetNode;
  3187. vnode.targetAnchor = targetNode && nextSibling(targetNode);
  3188. } else {
  3189. vnode.anchor = nextSibling(node);
  3190. let targetAnchor = targetNode;
  3191. while (targetAnchor) {
  3192. if (targetAnchor && targetAnchor.nodeType === 8) {
  3193. if (targetAnchor.data === "teleport start anchor") {
  3194. vnode.targetStart = targetAnchor;
  3195. } else if (targetAnchor.data === "teleport anchor") {
  3196. vnode.targetAnchor = targetAnchor;
  3197. target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
  3198. break;
  3199. }
  3200. }
  3201. targetAnchor = nextSibling(targetAnchor);
  3202. }
  3203. if (!vnode.targetAnchor) {
  3204. prepareAnchor(target, vnode, createText, insert);
  3205. }
  3206. hydrateChildren(
  3207. targetNode && nextSibling(targetNode),
  3208. vnode,
  3209. target,
  3210. parentComponent,
  3211. parentSuspense,
  3212. slotScopeIds,
  3213. optimized
  3214. );
  3215. }
  3216. }
  3217. updateCssVars(vnode, disabled);
  3218. }
  3219. return vnode.anchor && nextSibling(vnode.anchor);
  3220. }
  3221. const Teleport = TeleportImpl;
  3222. function updateCssVars(vnode, isDisabled) {
  3223. const ctx = vnode.ctx;
  3224. if (ctx && ctx.ut) {
  3225. let node, anchor;
  3226. if (isDisabled) {
  3227. node = vnode.el;
  3228. anchor = vnode.anchor;
  3229. } else {
  3230. node = vnode.targetStart;
  3231. anchor = vnode.targetAnchor;
  3232. }
  3233. while (node && node !== anchor) {
  3234. if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
  3235. node = node.nextSibling;
  3236. }
  3237. ctx.ut();
  3238. }
  3239. }
  3240. function prepareAnchor(target, vnode, createText, insert) {
  3241. const targetStart = vnode.targetStart = createText("");
  3242. const targetAnchor = vnode.targetAnchor = createText("");
  3243. targetStart[TeleportEndKey] = targetAnchor;
  3244. if (target) {
  3245. insert(targetStart, target);
  3246. insert(targetAnchor, target);
  3247. }
  3248. return targetAnchor;
  3249. }
  3250. const leaveCbKey = Symbol("_leaveCb");
  3251. const enterCbKey$1 = Symbol("_enterCb");
  3252. function useTransitionState() {
  3253. const state = {
  3254. isMounted: false,
  3255. isLeaving: false,
  3256. isUnmounting: false,
  3257. leavingVNodes: /* @__PURE__ */ new Map()
  3258. };
  3259. onMounted(() => {
  3260. state.isMounted = true;
  3261. });
  3262. onBeforeUnmount(() => {
  3263. state.isUnmounting = true;
  3264. });
  3265. return state;
  3266. }
  3267. const TransitionHookValidator = [Function, Array];
  3268. const BaseTransitionPropsValidators = {
  3269. mode: String,
  3270. appear: Boolean,
  3271. persisted: Boolean,
  3272. // enter
  3273. onBeforeEnter: TransitionHookValidator,
  3274. onEnter: TransitionHookValidator,
  3275. onAfterEnter: TransitionHookValidator,
  3276. onEnterCancelled: TransitionHookValidator,
  3277. // leave
  3278. onBeforeLeave: TransitionHookValidator,
  3279. onLeave: TransitionHookValidator,
  3280. onAfterLeave: TransitionHookValidator,
  3281. onLeaveCancelled: TransitionHookValidator,
  3282. // appear
  3283. onBeforeAppear: TransitionHookValidator,
  3284. onAppear: TransitionHookValidator,
  3285. onAfterAppear: TransitionHookValidator,
  3286. onAppearCancelled: TransitionHookValidator
  3287. };
  3288. const recursiveGetSubtree = (instance) => {
  3289. const subTree = instance.subTree;
  3290. return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
  3291. };
  3292. const BaseTransitionImpl = {
  3293. name: `BaseTransition`,
  3294. props: BaseTransitionPropsValidators,
  3295. setup(props, { slots }) {
  3296. const instance = getCurrentInstance();
  3297. const state = useTransitionState();
  3298. return () => {
  3299. const children = slots.default && getTransitionRawChildren(slots.default(), true);
  3300. if (!children || !children.length) {
  3301. return;
  3302. }
  3303. const child = findNonCommentChild(children);
  3304. const rawProps = toRaw(props);
  3305. const { mode } = rawProps;
  3306. if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
  3307. warn$1(`invalid <transition> mode: ${mode}`);
  3308. }
  3309. if (state.isLeaving) {
  3310. return emptyPlaceholder(child);
  3311. }
  3312. const innerChild = getInnerChild$1(child);
  3313. if (!innerChild) {
  3314. return emptyPlaceholder(child);
  3315. }
  3316. let enterHooks = resolveTransitionHooks(
  3317. innerChild,
  3318. rawProps,
  3319. state,
  3320. instance,
  3321. // #11061, ensure enterHooks is fresh after clone
  3322. (hooks) => enterHooks = hooks
  3323. );
  3324. if (innerChild.type !== Comment) {
  3325. setTransitionHooks(innerChild, enterHooks);
  3326. }
  3327. let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
  3328. if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
  3329. let leavingHooks = resolveTransitionHooks(
  3330. oldInnerChild,
  3331. rawProps,
  3332. state,
  3333. instance
  3334. );
  3335. setTransitionHooks(oldInnerChild, leavingHooks);
  3336. if (mode === "out-in" && innerChild.type !== Comment) {
  3337. state.isLeaving = true;
  3338. leavingHooks.afterLeave = () => {
  3339. state.isLeaving = false;
  3340. if (!(instance.job.flags & 8)) {
  3341. instance.update();
  3342. }
  3343. delete leavingHooks.afterLeave;
  3344. oldInnerChild = void 0;
  3345. };
  3346. return emptyPlaceholder(child);
  3347. } else if (mode === "in-out" && innerChild.type !== Comment) {
  3348. leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
  3349. const leavingVNodesCache = getLeavingNodesForType(
  3350. state,
  3351. oldInnerChild
  3352. );
  3353. leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
  3354. el[leaveCbKey] = () => {
  3355. earlyRemove();
  3356. el[leaveCbKey] = void 0;
  3357. delete enterHooks.delayedLeave;
  3358. oldInnerChild = void 0;
  3359. };
  3360. enterHooks.delayedLeave = () => {
  3361. delayedLeave();
  3362. delete enterHooks.delayedLeave;
  3363. oldInnerChild = void 0;
  3364. };
  3365. };
  3366. } else {
  3367. oldInnerChild = void 0;
  3368. }
  3369. } else if (oldInnerChild) {
  3370. oldInnerChild = void 0;
  3371. }
  3372. return child;
  3373. };
  3374. }
  3375. };
  3376. function findNonCommentChild(children) {
  3377. let child = children[0];
  3378. if (children.length > 1) {
  3379. let hasFound = false;
  3380. for (const c of children) {
  3381. if (c.type !== Comment) {
  3382. if (hasFound) {
  3383. warn$1(
  3384. "<transition> can only be used on a single element or component. Use <transition-group> for lists."
  3385. );
  3386. break;
  3387. }
  3388. child = c;
  3389. hasFound = true;
  3390. }
  3391. }
  3392. }
  3393. return child;
  3394. }
  3395. const BaseTransition = BaseTransitionImpl;
  3396. function getLeavingNodesForType(state, vnode) {
  3397. const { leavingVNodes } = state;
  3398. let leavingVNodesCache = leavingVNodes.get(vnode.type);
  3399. if (!leavingVNodesCache) {
  3400. leavingVNodesCache = /* @__PURE__ */ Object.create(null);
  3401. leavingVNodes.set(vnode.type, leavingVNodesCache);
  3402. }
  3403. return leavingVNodesCache;
  3404. }
  3405. function resolveTransitionHooks(vnode, props, state, instance, postClone) {
  3406. const {
  3407. appear,
  3408. mode,
  3409. persisted = false,
  3410. onBeforeEnter,
  3411. onEnter,
  3412. onAfterEnter,
  3413. onEnterCancelled,
  3414. onBeforeLeave,
  3415. onLeave,
  3416. onAfterLeave,
  3417. onLeaveCancelled,
  3418. onBeforeAppear,
  3419. onAppear,
  3420. onAfterAppear,
  3421. onAppearCancelled
  3422. } = props;
  3423. const key = String(vnode.key);
  3424. const leavingVNodesCache = getLeavingNodesForType(state, vnode);
  3425. const callHook = (hook, args) => {
  3426. hook && callWithAsyncErrorHandling(
  3427. hook,
  3428. instance,
  3429. 9,
  3430. args
  3431. );
  3432. };
  3433. const callAsyncHook = (hook, args) => {
  3434. const done = args[1];
  3435. callHook(hook, args);
  3436. if (isArray(hook)) {
  3437. if (hook.every((hook2) => hook2.length <= 1)) done();
  3438. } else if (hook.length <= 1) {
  3439. done();
  3440. }
  3441. };
  3442. const hooks = {
  3443. mode,
  3444. persisted,
  3445. beforeEnter(el) {
  3446. let hook = onBeforeEnter;
  3447. if (!state.isMounted) {
  3448. if (appear) {
  3449. hook = onBeforeAppear || onBeforeEnter;
  3450. } else {
  3451. return;
  3452. }
  3453. }
  3454. if (el[leaveCbKey]) {
  3455. el[leaveCbKey](
  3456. true
  3457. /* cancelled */
  3458. );
  3459. }
  3460. const leavingVNode = leavingVNodesCache[key];
  3461. if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
  3462. leavingVNode.el[leaveCbKey]();
  3463. }
  3464. callHook(hook, [el]);
  3465. },
  3466. enter(el) {
  3467. let hook = onEnter;
  3468. let afterHook = onAfterEnter;
  3469. let cancelHook = onEnterCancelled;
  3470. if (!state.isMounted) {
  3471. if (appear) {
  3472. hook = onAppear || onEnter;
  3473. afterHook = onAfterAppear || onAfterEnter;
  3474. cancelHook = onAppearCancelled || onEnterCancelled;
  3475. } else {
  3476. return;
  3477. }
  3478. }
  3479. let called = false;
  3480. const done = el[enterCbKey$1] = (cancelled) => {
  3481. if (called) return;
  3482. called = true;
  3483. if (cancelled) {
  3484. callHook(cancelHook, [el]);
  3485. } else {
  3486. callHook(afterHook, [el]);
  3487. }
  3488. if (hooks.delayedLeave) {
  3489. hooks.delayedLeave();
  3490. }
  3491. el[enterCbKey$1] = void 0;
  3492. };
  3493. if (hook) {
  3494. callAsyncHook(hook, [el, done]);
  3495. } else {
  3496. done();
  3497. }
  3498. },
  3499. leave(el, remove) {
  3500. const key2 = String(vnode.key);
  3501. if (el[enterCbKey$1]) {
  3502. el[enterCbKey$1](
  3503. true
  3504. /* cancelled */
  3505. );
  3506. }
  3507. if (state.isUnmounting) {
  3508. return remove();
  3509. }
  3510. callHook(onBeforeLeave, [el]);
  3511. let called = false;
  3512. const done = el[leaveCbKey] = (cancelled) => {
  3513. if (called) return;
  3514. called = true;
  3515. remove();
  3516. if (cancelled) {
  3517. callHook(onLeaveCancelled, [el]);
  3518. } else {
  3519. callHook(onAfterLeave, [el]);
  3520. }
  3521. el[leaveCbKey] = void 0;
  3522. if (leavingVNodesCache[key2] === vnode) {
  3523. delete leavingVNodesCache[key2];
  3524. }
  3525. };
  3526. leavingVNodesCache[key2] = vnode;
  3527. if (onLeave) {
  3528. callAsyncHook(onLeave, [el, done]);
  3529. } else {
  3530. done();
  3531. }
  3532. },
  3533. clone(vnode2) {
  3534. const hooks2 = resolveTransitionHooks(
  3535. vnode2,
  3536. props,
  3537. state,
  3538. instance,
  3539. postClone
  3540. );
  3541. if (postClone) postClone(hooks2);
  3542. return hooks2;
  3543. }
  3544. };
  3545. return hooks;
  3546. }
  3547. function emptyPlaceholder(vnode) {
  3548. if (isKeepAlive(vnode)) {
  3549. vnode = cloneVNode(vnode);
  3550. vnode.children = null;
  3551. return vnode;
  3552. }
  3553. }
  3554. function getInnerChild$1(vnode) {
  3555. if (!isKeepAlive(vnode)) {
  3556. if (isTeleport(vnode.type) && vnode.children) {
  3557. return findNonCommentChild(vnode.children);
  3558. }
  3559. return vnode;
  3560. }
  3561. if (vnode.component) {
  3562. return vnode.component.subTree;
  3563. }
  3564. const { shapeFlag, children } = vnode;
  3565. if (children) {
  3566. if (shapeFlag & 16) {
  3567. return children[0];
  3568. }
  3569. if (shapeFlag & 32 && isFunction(children.default)) {
  3570. return children.default();
  3571. }
  3572. }
  3573. }
  3574. function setTransitionHooks(vnode, hooks) {
  3575. if (vnode.shapeFlag & 6 && vnode.component) {
  3576. vnode.transition = hooks;
  3577. setTransitionHooks(vnode.component.subTree, hooks);
  3578. } else if (vnode.shapeFlag & 128) {
  3579. vnode.ssContent.transition = hooks.clone(vnode.ssContent);
  3580. vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
  3581. } else {
  3582. vnode.transition = hooks;
  3583. }
  3584. }
  3585. function getTransitionRawChildren(children, keepComment = false, parentKey) {
  3586. let ret = [];
  3587. let keyedFragmentCount = 0;
  3588. for (let i = 0; i < children.length; i++) {
  3589. let child = children[i];
  3590. const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);
  3591. if (child.type === Fragment) {
  3592. if (child.patchFlag & 128) keyedFragmentCount++;
  3593. ret = ret.concat(
  3594. getTransitionRawChildren(child.children, keepComment, key)
  3595. );
  3596. } else if (keepComment || child.type !== Comment) {
  3597. ret.push(key != null ? cloneVNode(child, { key }) : child);
  3598. }
  3599. }
  3600. if (keyedFragmentCount > 1) {
  3601. for (let i = 0; i < ret.length; i++) {
  3602. ret[i].patchFlag = -2;
  3603. }
  3604. }
  3605. return ret;
  3606. }
  3607. /*! #__NO_SIDE_EFFECTS__ */
  3608. // @__NO_SIDE_EFFECTS__
  3609. function defineComponent(options, extraOptions) {
  3610. return isFunction(options) ? (
  3611. // #8236: extend call and options.name access are considered side-effects
  3612. // by Rollup, so we have to wrap it in a pure-annotated IIFE.
  3613. /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
  3614. ) : options;
  3615. }
  3616. function useId() {
  3617. const i = getCurrentInstance();
  3618. if (i) {
  3619. return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
  3620. } else {
  3621. warn$1(
  3622. `useId() is called when there is no active component instance to be associated with.`
  3623. );
  3624. }
  3625. return "";
  3626. }
  3627. function markAsyncBoundary(instance) {
  3628. instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
  3629. }
  3630. const knownTemplateRefs = /* @__PURE__ */ new WeakSet();
  3631. function useTemplateRef(key) {
  3632. const i = getCurrentInstance();
  3633. const r = shallowRef(null);
  3634. if (i) {
  3635. const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
  3636. let desc;
  3637. if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {
  3638. warn$1(`useTemplateRef('${key}') already exists.`);
  3639. } else {
  3640. Object.defineProperty(refs, key, {
  3641. enumerable: true,
  3642. get: () => r.value,
  3643. set: (val) => r.value = val
  3644. });
  3645. }
  3646. } else {
  3647. warn$1(
  3648. `useTemplateRef() is called when there is no active component instance to be associated with.`
  3649. );
  3650. }
  3651. const ret = readonly(r) ;
  3652. {
  3653. knownTemplateRefs.add(ret);
  3654. }
  3655. return ret;
  3656. }
  3657. function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
  3658. if (isArray(rawRef)) {
  3659. rawRef.forEach(
  3660. (r, i) => setRef(
  3661. r,
  3662. oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
  3663. parentSuspense,
  3664. vnode,
  3665. isUnmount
  3666. )
  3667. );
  3668. return;
  3669. }
  3670. if (isAsyncWrapper(vnode) && !isUnmount) {
  3671. if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
  3672. setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
  3673. }
  3674. return;
  3675. }
  3676. const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
  3677. const value = isUnmount ? null : refValue;
  3678. const { i: owner, r: ref } = rawRef;
  3679. if (!owner) {
  3680. warn$1(
  3681. `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`
  3682. );
  3683. return;
  3684. }
  3685. const oldRef = oldRawRef && oldRawRef.r;
  3686. const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
  3687. const setupState = owner.setupState;
  3688. const rawSetupState = toRaw(setupState);
  3689. const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
  3690. {
  3691. if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
  3692. warn$1(
  3693. `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
  3694. );
  3695. }
  3696. if (knownTemplateRefs.has(rawSetupState[key])) {
  3697. return false;
  3698. }
  3699. }
  3700. return hasOwn(rawSetupState, key);
  3701. };
  3702. if (oldRef != null && oldRef !== ref) {
  3703. if (isString(oldRef)) {
  3704. refs[oldRef] = null;
  3705. if (canSetSetupRef(oldRef)) {
  3706. setupState[oldRef] = null;
  3707. }
  3708. } else if (isRef(oldRef)) {
  3709. oldRef.value = null;
  3710. }
  3711. }
  3712. if (isFunction(ref)) {
  3713. callWithErrorHandling(ref, owner, 12, [value, refs]);
  3714. } else {
  3715. const _isString = isString(ref);
  3716. const _isRef = isRef(ref);
  3717. if (_isString || _isRef) {
  3718. const doSet = () => {
  3719. if (rawRef.f) {
  3720. const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
  3721. if (isUnmount) {
  3722. isArray(existing) && remove(existing, refValue);
  3723. } else {
  3724. if (!isArray(existing)) {
  3725. if (_isString) {
  3726. refs[ref] = [refValue];
  3727. if (canSetSetupRef(ref)) {
  3728. setupState[ref] = refs[ref];
  3729. }
  3730. } else {
  3731. ref.value = [refValue];
  3732. if (rawRef.k) refs[rawRef.k] = ref.value;
  3733. }
  3734. } else if (!existing.includes(refValue)) {
  3735. existing.push(refValue);
  3736. }
  3737. }
  3738. } else if (_isString) {
  3739. refs[ref] = value;
  3740. if (canSetSetupRef(ref)) {
  3741. setupState[ref] = value;
  3742. }
  3743. } else if (_isRef) {
  3744. ref.value = value;
  3745. if (rawRef.k) refs[rawRef.k] = value;
  3746. } else {
  3747. warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
  3748. }
  3749. };
  3750. if (value) {
  3751. doSet.id = -1;
  3752. queuePostRenderEffect(doSet, parentSuspense);
  3753. } else {
  3754. doSet();
  3755. }
  3756. } else {
  3757. warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
  3758. }
  3759. }
  3760. }
  3761. let hasLoggedMismatchError = false;
  3762. const logMismatchError = () => {
  3763. if (hasLoggedMismatchError) {
  3764. return;
  3765. }
  3766. console.error("Hydration completed but contains mismatches.");
  3767. hasLoggedMismatchError = true;
  3768. };
  3769. const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
  3770. const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
  3771. const getContainerType = (container) => {
  3772. if (container.nodeType !== 1) return void 0;
  3773. if (isSVGContainer(container)) return "svg";
  3774. if (isMathMLContainer(container)) return "mathml";
  3775. return void 0;
  3776. };
  3777. const isComment = (node) => node.nodeType === 8;
  3778. function createHydrationFunctions(rendererInternals) {
  3779. const {
  3780. mt: mountComponent,
  3781. p: patch,
  3782. o: {
  3783. patchProp,
  3784. createText,
  3785. nextSibling,
  3786. parentNode,
  3787. remove,
  3788. insert,
  3789. createComment
  3790. }
  3791. } = rendererInternals;
  3792. const hydrate = (vnode, container) => {
  3793. if (!container.hasChildNodes()) {
  3794. warn$1(
  3795. `Attempting to hydrate existing markup but container is empty. Performing full mount instead.`
  3796. );
  3797. patch(null, vnode, container);
  3798. flushPostFlushCbs();
  3799. container._vnode = vnode;
  3800. return;
  3801. }
  3802. hydrateNode(container.firstChild, vnode, null, null, null);
  3803. flushPostFlushCbs();
  3804. container._vnode = vnode;
  3805. };
  3806. const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
  3807. optimized = optimized || !!vnode.dynamicChildren;
  3808. const isFragmentStart = isComment(node) && node.data === "[";
  3809. const onMismatch = () => handleMismatch(
  3810. node,
  3811. vnode,
  3812. parentComponent,
  3813. parentSuspense,
  3814. slotScopeIds,
  3815. isFragmentStart
  3816. );
  3817. const { type, ref, shapeFlag, patchFlag } = vnode;
  3818. let domType = node.nodeType;
  3819. vnode.el = node;
  3820. {
  3821. def(node, "__vnode", vnode, true);
  3822. def(node, "__vueParentComponent", parentComponent, true);
  3823. }
  3824. if (patchFlag === -2) {
  3825. optimized = false;
  3826. vnode.dynamicChildren = null;
  3827. }
  3828. let nextNode = null;
  3829. switch (type) {
  3830. case Text:
  3831. if (domType !== 3) {
  3832. if (vnode.children === "") {
  3833. insert(vnode.el = createText(""), parentNode(node), node);
  3834. nextNode = node;
  3835. } else {
  3836. nextNode = onMismatch();
  3837. }
  3838. } else {
  3839. if (node.data !== vnode.children) {
  3840. warn$1(
  3841. `Hydration text mismatch in`,
  3842. node.parentNode,
  3843. `
  3844. - rendered on server: ${JSON.stringify(
  3845. node.data
  3846. )}
  3847. - expected on client: ${JSON.stringify(vnode.children)}`
  3848. );
  3849. logMismatchError();
  3850. node.data = vnode.children;
  3851. }
  3852. nextNode = nextSibling(node);
  3853. }
  3854. break;
  3855. case Comment:
  3856. if (isTemplateNode(node)) {
  3857. nextNode = nextSibling(node);
  3858. replaceNode(
  3859. vnode.el = node.content.firstChild,
  3860. node,
  3861. parentComponent
  3862. );
  3863. } else if (domType !== 8 || isFragmentStart) {
  3864. nextNode = onMismatch();
  3865. } else {
  3866. nextNode = nextSibling(node);
  3867. }
  3868. break;
  3869. case Static:
  3870. if (isFragmentStart) {
  3871. node = nextSibling(node);
  3872. domType = node.nodeType;
  3873. }
  3874. if (domType === 1 || domType === 3) {
  3875. nextNode = node;
  3876. const needToAdoptContent = !vnode.children.length;
  3877. for (let i = 0; i < vnode.staticCount; i++) {
  3878. if (needToAdoptContent)
  3879. vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data;
  3880. if (i === vnode.staticCount - 1) {
  3881. vnode.anchor = nextNode;
  3882. }
  3883. nextNode = nextSibling(nextNode);
  3884. }
  3885. return isFragmentStart ? nextSibling(nextNode) : nextNode;
  3886. } else {
  3887. onMismatch();
  3888. }
  3889. break;
  3890. case Fragment:
  3891. if (!isFragmentStart) {
  3892. nextNode = onMismatch();
  3893. } else {
  3894. nextNode = hydrateFragment(
  3895. node,
  3896. vnode,
  3897. parentComponent,
  3898. parentSuspense,
  3899. slotScopeIds,
  3900. optimized
  3901. );
  3902. }
  3903. break;
  3904. default:
  3905. if (shapeFlag & 1) {
  3906. if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
  3907. nextNode = onMismatch();
  3908. } else {
  3909. nextNode = hydrateElement(
  3910. node,
  3911. vnode,
  3912. parentComponent,
  3913. parentSuspense,
  3914. slotScopeIds,
  3915. optimized
  3916. );
  3917. }
  3918. } else if (shapeFlag & 6) {
  3919. vnode.slotScopeIds = slotScopeIds;
  3920. const container = parentNode(node);
  3921. if (isFragmentStart) {
  3922. nextNode = locateClosingAnchor(node);
  3923. } else if (isComment(node) && node.data === "teleport start") {
  3924. nextNode = locateClosingAnchor(node, node.data, "teleport end");
  3925. } else {
  3926. nextNode = nextSibling(node);
  3927. }
  3928. mountComponent(
  3929. vnode,
  3930. container,
  3931. null,
  3932. parentComponent,
  3933. parentSuspense,
  3934. getContainerType(container),
  3935. optimized
  3936. );
  3937. if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
  3938. let subTree;
  3939. if (isFragmentStart) {
  3940. subTree = createVNode(Fragment);
  3941. subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
  3942. } else {
  3943. subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
  3944. }
  3945. subTree.el = node;
  3946. vnode.component.subTree = subTree;
  3947. }
  3948. } else if (shapeFlag & 64) {
  3949. if (domType !== 8) {
  3950. nextNode = onMismatch();
  3951. } else {
  3952. nextNode = vnode.type.hydrate(
  3953. node,
  3954. vnode,
  3955. parentComponent,
  3956. parentSuspense,
  3957. slotScopeIds,
  3958. optimized,
  3959. rendererInternals,
  3960. hydrateChildren
  3961. );
  3962. }
  3963. } else if (shapeFlag & 128) {
  3964. nextNode = vnode.type.hydrate(
  3965. node,
  3966. vnode,
  3967. parentComponent,
  3968. parentSuspense,
  3969. getContainerType(parentNode(node)),
  3970. slotScopeIds,
  3971. optimized,
  3972. rendererInternals,
  3973. hydrateNode
  3974. );
  3975. } else {
  3976. warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
  3977. }
  3978. }
  3979. if (ref != null) {
  3980. setRef(ref, null, parentSuspense, vnode);
  3981. }
  3982. return nextNode;
  3983. };
  3984. const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  3985. optimized = optimized || !!vnode.dynamicChildren;
  3986. const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
  3987. const forcePatch = type === "input" || type === "option";
  3988. {
  3989. if (dirs) {
  3990. invokeDirectiveHook(vnode, null, parentComponent, "created");
  3991. }
  3992. let needCallTransitionHooks = false;
  3993. if (isTemplateNode(el)) {
  3994. needCallTransitionHooks = needTransition(
  3995. null,
  3996. // no need check parentSuspense in hydration
  3997. transition
  3998. ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
  3999. const content = el.content.firstChild;
  4000. if (needCallTransitionHooks) {
  4001. const cls = content.getAttribute("class");
  4002. if (cls) content.$cls = cls;
  4003. transition.beforeEnter(content);
  4004. }
  4005. replaceNode(content, el, parentComponent);
  4006. vnode.el = el = content;
  4007. }
  4008. if (shapeFlag & 16 && // skip if element has innerHTML / textContent
  4009. !(props && (props.innerHTML || props.textContent))) {
  4010. let next = hydrateChildren(
  4011. el.firstChild,
  4012. vnode,
  4013. el,
  4014. parentComponent,
  4015. parentSuspense,
  4016. slotScopeIds,
  4017. optimized
  4018. );
  4019. let hasWarned = false;
  4020. while (next) {
  4021. if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
  4022. if (!hasWarned) {
  4023. warn$1(
  4024. `Hydration children mismatch on`,
  4025. el,
  4026. `
  4027. Server rendered element contains more child nodes than client vdom.`
  4028. );
  4029. hasWarned = true;
  4030. }
  4031. logMismatchError();
  4032. }
  4033. const cur = next;
  4034. next = next.nextSibling;
  4035. remove(cur);
  4036. }
  4037. } else if (shapeFlag & 8) {
  4038. let clientText = vnode.children;
  4039. if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
  4040. clientText = clientText.slice(1);
  4041. }
  4042. if (el.textContent !== clientText) {
  4043. if (!isMismatchAllowed(el, 0 /* TEXT */)) {
  4044. warn$1(
  4045. `Hydration text content mismatch on`,
  4046. el,
  4047. `
  4048. - rendered on server: ${el.textContent}
  4049. - expected on client: ${vnode.children}`
  4050. );
  4051. logMismatchError();
  4052. }
  4053. el.textContent = vnode.children;
  4054. }
  4055. }
  4056. if (props) {
  4057. {
  4058. const isCustomElement = el.tagName.includes("-");
  4059. for (const key in props) {
  4060. if (// #11189 skip if this node has directives that have created hooks
  4061. // as it could have mutated the DOM in any possible way
  4062. !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
  4063. logMismatchError();
  4064. }
  4065. if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
  4066. key[0] === "." || isCustomElement) {
  4067. patchProp(el, key, null, props[key], void 0, parentComponent);
  4068. }
  4069. }
  4070. }
  4071. }
  4072. let vnodeHooks;
  4073. if (vnodeHooks = props && props.onVnodeBeforeMount) {
  4074. invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  4075. }
  4076. if (dirs) {
  4077. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  4078. }
  4079. if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
  4080. queueEffectWithSuspense(() => {
  4081. vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  4082. needCallTransitionHooks && transition.enter(el);
  4083. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  4084. }, parentSuspense);
  4085. }
  4086. }
  4087. return el.nextSibling;
  4088. };
  4089. const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  4090. optimized = optimized || !!parentVNode.dynamicChildren;
  4091. const children = parentVNode.children;
  4092. const l = children.length;
  4093. let hasWarned = false;
  4094. for (let i = 0; i < l; i++) {
  4095. const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
  4096. const isText = vnode.type === Text;
  4097. if (node) {
  4098. if (isText && !optimized) {
  4099. if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
  4100. insert(
  4101. createText(
  4102. node.data.slice(vnode.children.length)
  4103. ),
  4104. container,
  4105. nextSibling(node)
  4106. );
  4107. node.data = vnode.children;
  4108. }
  4109. }
  4110. node = hydrateNode(
  4111. node,
  4112. vnode,
  4113. parentComponent,
  4114. parentSuspense,
  4115. slotScopeIds,
  4116. optimized
  4117. );
  4118. } else if (isText && !vnode.children) {
  4119. insert(vnode.el = createText(""), container);
  4120. } else {
  4121. if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
  4122. if (!hasWarned) {
  4123. warn$1(
  4124. `Hydration children mismatch on`,
  4125. container,
  4126. `
  4127. Server rendered element contains fewer child nodes than client vdom.`
  4128. );
  4129. hasWarned = true;
  4130. }
  4131. logMismatchError();
  4132. }
  4133. patch(
  4134. null,
  4135. vnode,
  4136. container,
  4137. null,
  4138. parentComponent,
  4139. parentSuspense,
  4140. getContainerType(container),
  4141. slotScopeIds
  4142. );
  4143. }
  4144. }
  4145. return node;
  4146. };
  4147. const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  4148. const { slotScopeIds: fragmentSlotScopeIds } = vnode;
  4149. if (fragmentSlotScopeIds) {
  4150. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  4151. }
  4152. const container = parentNode(node);
  4153. const next = hydrateChildren(
  4154. nextSibling(node),
  4155. vnode,
  4156. container,
  4157. parentComponent,
  4158. parentSuspense,
  4159. slotScopeIds,
  4160. optimized
  4161. );
  4162. if (next && isComment(next) && next.data === "]") {
  4163. return nextSibling(vnode.anchor = next);
  4164. } else {
  4165. logMismatchError();
  4166. insert(vnode.anchor = createComment(`]`), container, next);
  4167. return next;
  4168. }
  4169. };
  4170. const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
  4171. if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) {
  4172. warn$1(
  4173. `Hydration node mismatch:
  4174. - rendered on server:`,
  4175. node,
  4176. node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
  4177. `
  4178. - expected on client:`,
  4179. vnode.type
  4180. );
  4181. logMismatchError();
  4182. }
  4183. vnode.el = null;
  4184. if (isFragment) {
  4185. const end = locateClosingAnchor(node);
  4186. while (true) {
  4187. const next2 = nextSibling(node);
  4188. if (next2 && next2 !== end) {
  4189. remove(next2);
  4190. } else {
  4191. break;
  4192. }
  4193. }
  4194. }
  4195. const next = nextSibling(node);
  4196. const container = parentNode(node);
  4197. remove(node);
  4198. patch(
  4199. null,
  4200. vnode,
  4201. container,
  4202. next,
  4203. parentComponent,
  4204. parentSuspense,
  4205. getContainerType(container),
  4206. slotScopeIds
  4207. );
  4208. if (parentComponent) {
  4209. parentComponent.vnode.el = vnode.el;
  4210. updateHOCHostEl(parentComponent, vnode.el);
  4211. }
  4212. return next;
  4213. };
  4214. const locateClosingAnchor = (node, open = "[", close = "]") => {
  4215. let match = 0;
  4216. while (node) {
  4217. node = nextSibling(node);
  4218. if (node && isComment(node)) {
  4219. if (node.data === open) match++;
  4220. if (node.data === close) {
  4221. if (match === 0) {
  4222. return nextSibling(node);
  4223. } else {
  4224. match--;
  4225. }
  4226. }
  4227. }
  4228. }
  4229. return node;
  4230. };
  4231. const replaceNode = (newNode, oldNode, parentComponent) => {
  4232. const parentNode2 = oldNode.parentNode;
  4233. if (parentNode2) {
  4234. parentNode2.replaceChild(newNode, oldNode);
  4235. }
  4236. let parent = parentComponent;
  4237. while (parent) {
  4238. if (parent.vnode.el === oldNode) {
  4239. parent.vnode.el = parent.subTree.el = newNode;
  4240. }
  4241. parent = parent.parent;
  4242. }
  4243. };
  4244. const isTemplateNode = (node) => {
  4245. return node.nodeType === 1 && node.tagName === "TEMPLATE";
  4246. };
  4247. return [hydrate, hydrateNode];
  4248. }
  4249. function propHasMismatch(el, key, clientValue, vnode, instance) {
  4250. let mismatchType;
  4251. let mismatchKey;
  4252. let actual;
  4253. let expected;
  4254. if (key === "class") {
  4255. if (el.$cls) {
  4256. actual = el.$cls;
  4257. delete el.$cls;
  4258. } else {
  4259. actual = el.getAttribute("class");
  4260. }
  4261. expected = normalizeClass(clientValue);
  4262. if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
  4263. mismatchType = 2 /* CLASS */;
  4264. mismatchKey = `class`;
  4265. }
  4266. } else if (key === "style") {
  4267. actual = el.getAttribute("style") || "";
  4268. expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
  4269. const actualMap = toStyleMap(actual);
  4270. const expectedMap = toStyleMap(expected);
  4271. if (vnode.dirs) {
  4272. for (const { dir, value } of vnode.dirs) {
  4273. if (dir.name === "show" && !value) {
  4274. expectedMap.set("display", "none");
  4275. }
  4276. }
  4277. }
  4278. if (instance) {
  4279. resolveCssVars(instance, vnode, expectedMap);
  4280. }
  4281. if (!isMapEqual(actualMap, expectedMap)) {
  4282. mismatchType = 3 /* STYLE */;
  4283. mismatchKey = "style";
  4284. }
  4285. } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
  4286. if (isBooleanAttr(key)) {
  4287. actual = el.hasAttribute(key);
  4288. expected = includeBooleanAttr(clientValue);
  4289. } else if (clientValue == null) {
  4290. actual = el.hasAttribute(key);
  4291. expected = false;
  4292. } else {
  4293. if (el.hasAttribute(key)) {
  4294. actual = el.getAttribute(key);
  4295. } else if (key === "value" && el.tagName === "TEXTAREA") {
  4296. actual = el.value;
  4297. } else {
  4298. actual = false;
  4299. }
  4300. expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
  4301. }
  4302. if (actual !== expected) {
  4303. mismatchType = 4 /* ATTRIBUTE */;
  4304. mismatchKey = key;
  4305. }
  4306. }
  4307. if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) {
  4308. const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
  4309. const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`;
  4310. const postSegment = `
  4311. - rendered on server: ${format(actual)}
  4312. - expected on client: ${format(expected)}
  4313. Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
  4314. You should fix the source of the mismatch.`;
  4315. {
  4316. warn$1(preSegment, el, postSegment);
  4317. }
  4318. return true;
  4319. }
  4320. return false;
  4321. }
  4322. function toClassSet(str) {
  4323. return new Set(str.trim().split(/\s+/));
  4324. }
  4325. function isSetEqual(a, b) {
  4326. if (a.size !== b.size) {
  4327. return false;
  4328. }
  4329. for (const s of a) {
  4330. if (!b.has(s)) {
  4331. return false;
  4332. }
  4333. }
  4334. return true;
  4335. }
  4336. function toStyleMap(str) {
  4337. const styleMap = /* @__PURE__ */ new Map();
  4338. for (const item of str.split(";")) {
  4339. let [key, value] = item.split(":");
  4340. key = key.trim();
  4341. value = value && value.trim();
  4342. if (key && value) {
  4343. styleMap.set(key, value);
  4344. }
  4345. }
  4346. return styleMap;
  4347. }
  4348. function isMapEqual(a, b) {
  4349. if (a.size !== b.size) {
  4350. return false;
  4351. }
  4352. for (const [key, value] of a) {
  4353. if (value !== b.get(key)) {
  4354. return false;
  4355. }
  4356. }
  4357. return true;
  4358. }
  4359. function resolveCssVars(instance, vnode, expectedMap) {
  4360. const root = instance.subTree;
  4361. if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
  4362. const cssVars = instance.getCssVars();
  4363. for (const key in cssVars) {
  4364. const value = normalizeCssVarValue(cssVars[key]);
  4365. expectedMap.set(`--${getEscapedCssVarName(key)}`, value);
  4366. }
  4367. }
  4368. if (vnode === root && instance.parent) {
  4369. resolveCssVars(instance.parent, instance.vnode, expectedMap);
  4370. }
  4371. }
  4372. const allowMismatchAttr = "data-allow-mismatch";
  4373. const MismatchTypeString = {
  4374. [0 /* TEXT */]: "text",
  4375. [1 /* CHILDREN */]: "children",
  4376. [2 /* CLASS */]: "class",
  4377. [3 /* STYLE */]: "style",
  4378. [4 /* ATTRIBUTE */]: "attribute"
  4379. };
  4380. function isMismatchAllowed(el, allowedType) {
  4381. if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) {
  4382. while (el && !el.hasAttribute(allowMismatchAttr)) {
  4383. el = el.parentElement;
  4384. }
  4385. }
  4386. const allowedAttr = el && el.getAttribute(allowMismatchAttr);
  4387. if (allowedAttr == null) {
  4388. return false;
  4389. } else if (allowedAttr === "") {
  4390. return true;
  4391. } else {
  4392. const list = allowedAttr.split(",");
  4393. if (allowedType === 0 /* TEXT */ && list.includes("children")) {
  4394. return true;
  4395. }
  4396. return list.includes(MismatchTypeString[allowedType]);
  4397. }
  4398. }
  4399. const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
  4400. const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
  4401. const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
  4402. const id = requestIdleCallback(hydrate, { timeout });
  4403. return () => cancelIdleCallback(id);
  4404. };
  4405. function elementIsVisibleInViewport(el) {
  4406. const { top, left, bottom, right } = el.getBoundingClientRect();
  4407. const { innerHeight, innerWidth } = window;
  4408. return (top > 0 && top < innerHeight || bottom > 0 && bottom < innerHeight) && (left > 0 && left < innerWidth || right > 0 && right < innerWidth);
  4409. }
  4410. const hydrateOnVisible = (opts) => (hydrate, forEach) => {
  4411. const ob = new IntersectionObserver((entries) => {
  4412. for (const e of entries) {
  4413. if (!e.isIntersecting) continue;
  4414. ob.disconnect();
  4415. hydrate();
  4416. break;
  4417. }
  4418. }, opts);
  4419. forEach((el) => {
  4420. if (!(el instanceof Element)) return;
  4421. if (elementIsVisibleInViewport(el)) {
  4422. hydrate();
  4423. ob.disconnect();
  4424. return false;
  4425. }
  4426. ob.observe(el);
  4427. });
  4428. return () => ob.disconnect();
  4429. };
  4430. const hydrateOnMediaQuery = (query) => (hydrate) => {
  4431. if (query) {
  4432. const mql = matchMedia(query);
  4433. if (mql.matches) {
  4434. hydrate();
  4435. } else {
  4436. mql.addEventListener("change", hydrate, { once: true });
  4437. return () => mql.removeEventListener("change", hydrate);
  4438. }
  4439. }
  4440. };
  4441. const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
  4442. if (isString(interactions)) interactions = [interactions];
  4443. let hasHydrated = false;
  4444. const doHydrate = (e) => {
  4445. if (!hasHydrated) {
  4446. hasHydrated = true;
  4447. teardown();
  4448. hydrate();
  4449. e.target.dispatchEvent(new e.constructor(e.type, e));
  4450. }
  4451. };
  4452. const teardown = () => {
  4453. forEach((el) => {
  4454. for (const i of interactions) {
  4455. el.removeEventListener(i, doHydrate);
  4456. }
  4457. });
  4458. };
  4459. forEach((el) => {
  4460. for (const i of interactions) {
  4461. el.addEventListener(i, doHydrate, { once: true });
  4462. }
  4463. });
  4464. return teardown;
  4465. };
  4466. function forEachElement(node, cb) {
  4467. if (isComment(node) && node.data === "[") {
  4468. let depth = 1;
  4469. let next = node.nextSibling;
  4470. while (next) {
  4471. if (next.nodeType === 1) {
  4472. const result = cb(next);
  4473. if (result === false) {
  4474. break;
  4475. }
  4476. } else if (isComment(next)) {
  4477. if (next.data === "]") {
  4478. if (--depth === 0) break;
  4479. } else if (next.data === "[") {
  4480. depth++;
  4481. }
  4482. }
  4483. next = next.nextSibling;
  4484. }
  4485. } else {
  4486. cb(node);
  4487. }
  4488. }
  4489. const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
  4490. /*! #__NO_SIDE_EFFECTS__ */
  4491. // @__NO_SIDE_EFFECTS__
  4492. function defineAsyncComponent(source) {
  4493. if (isFunction(source)) {
  4494. source = { loader: source };
  4495. }
  4496. const {
  4497. loader,
  4498. loadingComponent,
  4499. errorComponent,
  4500. delay = 200,
  4501. hydrate: hydrateStrategy,
  4502. timeout,
  4503. // undefined = never times out
  4504. suspensible = true,
  4505. onError: userOnError
  4506. } = source;
  4507. let pendingRequest = null;
  4508. let resolvedComp;
  4509. let retries = 0;
  4510. const retry = () => {
  4511. retries++;
  4512. pendingRequest = null;
  4513. return load();
  4514. };
  4515. const load = () => {
  4516. let thisRequest;
  4517. return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
  4518. err = err instanceof Error ? err : new Error(String(err));
  4519. if (userOnError) {
  4520. return new Promise((resolve, reject) => {
  4521. const userRetry = () => resolve(retry());
  4522. const userFail = () => reject(err);
  4523. userOnError(err, userRetry, userFail, retries + 1);
  4524. });
  4525. } else {
  4526. throw err;
  4527. }
  4528. }).then((comp) => {
  4529. if (thisRequest !== pendingRequest && pendingRequest) {
  4530. return pendingRequest;
  4531. }
  4532. if (!comp) {
  4533. warn$1(
  4534. `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
  4535. );
  4536. }
  4537. if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
  4538. comp = comp.default;
  4539. }
  4540. if (comp && !isObject(comp) && !isFunction(comp)) {
  4541. throw new Error(`Invalid async component load result: ${comp}`);
  4542. }
  4543. resolvedComp = comp;
  4544. return comp;
  4545. }));
  4546. };
  4547. return defineComponent({
  4548. name: "AsyncComponentWrapper",
  4549. __asyncLoader: load,
  4550. __asyncHydrate(el, instance, hydrate) {
  4551. let patched = false;
  4552. (instance.bu || (instance.bu = [])).push(() => patched = true);
  4553. const performHydrate = () => {
  4554. if (patched) {
  4555. {
  4556. warn$1(
  4557. `Skipping lazy hydration for component '${getComponentName(resolvedComp) || resolvedComp.__file}': it was updated before lazy hydration performed.`
  4558. );
  4559. }
  4560. return;
  4561. }
  4562. hydrate();
  4563. };
  4564. const doHydrate = hydrateStrategy ? () => {
  4565. const teardown = hydrateStrategy(
  4566. performHydrate,
  4567. (cb) => forEachElement(el, cb)
  4568. );
  4569. if (teardown) {
  4570. (instance.bum || (instance.bum = [])).push(teardown);
  4571. }
  4572. } : performHydrate;
  4573. if (resolvedComp) {
  4574. doHydrate();
  4575. } else {
  4576. load().then(() => !instance.isUnmounted && doHydrate());
  4577. }
  4578. },
  4579. get __asyncResolved() {
  4580. return resolvedComp;
  4581. },
  4582. setup() {
  4583. const instance = currentInstance;
  4584. markAsyncBoundary(instance);
  4585. if (resolvedComp) {
  4586. return () => createInnerComp(resolvedComp, instance);
  4587. }
  4588. const onError = (err) => {
  4589. pendingRequest = null;
  4590. handleError(
  4591. err,
  4592. instance,
  4593. 13,
  4594. !errorComponent
  4595. );
  4596. };
  4597. if (suspensible && instance.suspense || isInSSRComponentSetup) {
  4598. return load().then((comp) => {
  4599. return () => createInnerComp(comp, instance);
  4600. }).catch((err) => {
  4601. onError(err);
  4602. return () => errorComponent ? createVNode(errorComponent, {
  4603. error: err
  4604. }) : null;
  4605. });
  4606. }
  4607. const loaded = ref(false);
  4608. const error = ref();
  4609. const delayed = ref(!!delay);
  4610. if (delay) {
  4611. setTimeout(() => {
  4612. delayed.value = false;
  4613. }, delay);
  4614. }
  4615. if (timeout != null) {
  4616. setTimeout(() => {
  4617. if (!loaded.value && !error.value) {
  4618. const err = new Error(
  4619. `Async component timed out after ${timeout}ms.`
  4620. );
  4621. onError(err);
  4622. error.value = err;
  4623. }
  4624. }, timeout);
  4625. }
  4626. load().then(() => {
  4627. loaded.value = true;
  4628. if (instance.parent && isKeepAlive(instance.parent.vnode)) {
  4629. instance.parent.update();
  4630. }
  4631. }).catch((err) => {
  4632. onError(err);
  4633. error.value = err;
  4634. });
  4635. return () => {
  4636. if (loaded.value && resolvedComp) {
  4637. return createInnerComp(resolvedComp, instance);
  4638. } else if (error.value && errorComponent) {
  4639. return createVNode(errorComponent, {
  4640. error: error.value
  4641. });
  4642. } else if (loadingComponent && !delayed.value) {
  4643. return createVNode(loadingComponent);
  4644. }
  4645. };
  4646. }
  4647. });
  4648. }
  4649. function createInnerComp(comp, parent) {
  4650. const { ref: ref2, props, children, ce } = parent.vnode;
  4651. const vnode = createVNode(comp, props, children);
  4652. vnode.ref = ref2;
  4653. vnode.ce = ce;
  4654. delete parent.vnode.ce;
  4655. return vnode;
  4656. }
  4657. const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
  4658. const KeepAliveImpl = {
  4659. name: `KeepAlive`,
  4660. // Marker for special handling inside the renderer. We are not using a ===
  4661. // check directly on KeepAlive in the renderer, because importing it directly
  4662. // would prevent it from being tree-shaken.
  4663. __isKeepAlive: true,
  4664. props: {
  4665. include: [String, RegExp, Array],
  4666. exclude: [String, RegExp, Array],
  4667. max: [String, Number]
  4668. },
  4669. setup(props, { slots }) {
  4670. const instance = getCurrentInstance();
  4671. const sharedContext = instance.ctx;
  4672. if (!sharedContext.renderer) {
  4673. return () => {
  4674. const children = slots.default && slots.default();
  4675. return children && children.length === 1 ? children[0] : children;
  4676. };
  4677. }
  4678. const cache = /* @__PURE__ */ new Map();
  4679. const keys = /* @__PURE__ */ new Set();
  4680. let current = null;
  4681. {
  4682. instance.__v_cache = cache;
  4683. }
  4684. const parentSuspense = instance.suspense;
  4685. const {
  4686. renderer: {
  4687. p: patch,
  4688. m: move,
  4689. um: _unmount,
  4690. o: { createElement }
  4691. }
  4692. } = sharedContext;
  4693. const storageContainer = createElement("div");
  4694. sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
  4695. const instance2 = vnode.component;
  4696. move(vnode, container, anchor, 0, parentSuspense);
  4697. patch(
  4698. instance2.vnode,
  4699. vnode,
  4700. container,
  4701. anchor,
  4702. instance2,
  4703. parentSuspense,
  4704. namespace,
  4705. vnode.slotScopeIds,
  4706. optimized
  4707. );
  4708. queuePostRenderEffect(() => {
  4709. instance2.isDeactivated = false;
  4710. if (instance2.a) {
  4711. invokeArrayFns(instance2.a);
  4712. }
  4713. const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
  4714. if (vnodeHook) {
  4715. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  4716. }
  4717. }, parentSuspense);
  4718. {
  4719. devtoolsComponentAdded(instance2);
  4720. }
  4721. };
  4722. sharedContext.deactivate = (vnode) => {
  4723. const instance2 = vnode.component;
  4724. invalidateMount(instance2.m);
  4725. invalidateMount(instance2.a);
  4726. move(vnode, storageContainer, null, 1, parentSuspense);
  4727. queuePostRenderEffect(() => {
  4728. if (instance2.da) {
  4729. invokeArrayFns(instance2.da);
  4730. }
  4731. const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
  4732. if (vnodeHook) {
  4733. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  4734. }
  4735. instance2.isDeactivated = true;
  4736. }, parentSuspense);
  4737. {
  4738. devtoolsComponentAdded(instance2);
  4739. }
  4740. {
  4741. instance2.__keepAliveStorageContainer = storageContainer;
  4742. }
  4743. };
  4744. function unmount(vnode) {
  4745. resetShapeFlag(vnode);
  4746. _unmount(vnode, instance, parentSuspense, true);
  4747. }
  4748. function pruneCache(filter) {
  4749. cache.forEach((vnode, key) => {
  4750. const name = getComponentName(vnode.type);
  4751. if (name && !filter(name)) {
  4752. pruneCacheEntry(key);
  4753. }
  4754. });
  4755. }
  4756. function pruneCacheEntry(key) {
  4757. const cached = cache.get(key);
  4758. if (cached && (!current || !isSameVNodeType(cached, current))) {
  4759. unmount(cached);
  4760. } else if (current) {
  4761. resetShapeFlag(current);
  4762. }
  4763. cache.delete(key);
  4764. keys.delete(key);
  4765. }
  4766. watch(
  4767. () => [props.include, props.exclude],
  4768. ([include, exclude]) => {
  4769. include && pruneCache((name) => matches(include, name));
  4770. exclude && pruneCache((name) => !matches(exclude, name));
  4771. },
  4772. // prune post-render after `current` has been updated
  4773. { flush: "post", deep: true }
  4774. );
  4775. let pendingCacheKey = null;
  4776. const cacheSubtree = () => {
  4777. if (pendingCacheKey != null) {
  4778. if (isSuspense(instance.subTree.type)) {
  4779. queuePostRenderEffect(() => {
  4780. cache.set(pendingCacheKey, getInnerChild(instance.subTree));
  4781. }, instance.subTree.suspense);
  4782. } else {
  4783. cache.set(pendingCacheKey, getInnerChild(instance.subTree));
  4784. }
  4785. }
  4786. };
  4787. onMounted(cacheSubtree);
  4788. onUpdated(cacheSubtree);
  4789. onBeforeUnmount(() => {
  4790. cache.forEach((cached) => {
  4791. const { subTree, suspense } = instance;
  4792. const vnode = getInnerChild(subTree);
  4793. if (cached.type === vnode.type && cached.key === vnode.key) {
  4794. resetShapeFlag(vnode);
  4795. const da = vnode.component.da;
  4796. da && queuePostRenderEffect(da, suspense);
  4797. return;
  4798. }
  4799. unmount(cached);
  4800. });
  4801. });
  4802. return () => {
  4803. pendingCacheKey = null;
  4804. if (!slots.default) {
  4805. return current = null;
  4806. }
  4807. const children = slots.default();
  4808. const rawVNode = children[0];
  4809. if (children.length > 1) {
  4810. {
  4811. warn$1(`KeepAlive should contain exactly one component child.`);
  4812. }
  4813. current = null;
  4814. return children;
  4815. } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
  4816. current = null;
  4817. return rawVNode;
  4818. }
  4819. let vnode = getInnerChild(rawVNode);
  4820. if (vnode.type === Comment) {
  4821. current = null;
  4822. return vnode;
  4823. }
  4824. const comp = vnode.type;
  4825. const name = getComponentName(
  4826. isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
  4827. );
  4828. const { include, exclude, max } = props;
  4829. if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
  4830. vnode.shapeFlag &= -257;
  4831. current = vnode;
  4832. return rawVNode;
  4833. }
  4834. const key = vnode.key == null ? comp : vnode.key;
  4835. const cachedVNode = cache.get(key);
  4836. if (vnode.el) {
  4837. vnode = cloneVNode(vnode);
  4838. if (rawVNode.shapeFlag & 128) {
  4839. rawVNode.ssContent = vnode;
  4840. }
  4841. }
  4842. pendingCacheKey = key;
  4843. if (cachedVNode) {
  4844. vnode.el = cachedVNode.el;
  4845. vnode.component = cachedVNode.component;
  4846. if (vnode.transition) {
  4847. setTransitionHooks(vnode, vnode.transition);
  4848. }
  4849. vnode.shapeFlag |= 512;
  4850. keys.delete(key);
  4851. keys.add(key);
  4852. } else {
  4853. keys.add(key);
  4854. if (max && keys.size > parseInt(max, 10)) {
  4855. pruneCacheEntry(keys.values().next().value);
  4856. }
  4857. }
  4858. vnode.shapeFlag |= 256;
  4859. current = vnode;
  4860. return isSuspense(rawVNode.type) ? rawVNode : vnode;
  4861. };
  4862. }
  4863. };
  4864. const KeepAlive = KeepAliveImpl;
  4865. function matches(pattern, name) {
  4866. if (isArray(pattern)) {
  4867. return pattern.some((p) => matches(p, name));
  4868. } else if (isString(pattern)) {
  4869. return pattern.split(",").includes(name);
  4870. } else if (isRegExp(pattern)) {
  4871. pattern.lastIndex = 0;
  4872. return pattern.test(name);
  4873. }
  4874. return false;
  4875. }
  4876. function onActivated(hook, target) {
  4877. registerKeepAliveHook(hook, "a", target);
  4878. }
  4879. function onDeactivated(hook, target) {
  4880. registerKeepAliveHook(hook, "da", target);
  4881. }
  4882. function registerKeepAliveHook(hook, type, target = currentInstance) {
  4883. const wrappedHook = hook.__wdc || (hook.__wdc = () => {
  4884. let current = target;
  4885. while (current) {
  4886. if (current.isDeactivated) {
  4887. return;
  4888. }
  4889. current = current.parent;
  4890. }
  4891. return hook();
  4892. });
  4893. injectHook(type, wrappedHook, target);
  4894. if (target) {
  4895. let current = target.parent;
  4896. while (current && current.parent) {
  4897. if (isKeepAlive(current.parent.vnode)) {
  4898. injectToKeepAliveRoot(wrappedHook, type, target, current);
  4899. }
  4900. current = current.parent;
  4901. }
  4902. }
  4903. }
  4904. function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  4905. const injected = injectHook(
  4906. type,
  4907. hook,
  4908. keepAliveRoot,
  4909. true
  4910. /* prepend */
  4911. );
  4912. onUnmounted(() => {
  4913. remove(keepAliveRoot[type], injected);
  4914. }, target);
  4915. }
  4916. function resetShapeFlag(vnode) {
  4917. vnode.shapeFlag &= -257;
  4918. vnode.shapeFlag &= -513;
  4919. }
  4920. function getInnerChild(vnode) {
  4921. return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
  4922. }
  4923. function injectHook(type, hook, target = currentInstance, prepend = false) {
  4924. if (target) {
  4925. const hooks = target[type] || (target[type] = []);
  4926. const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
  4927. pauseTracking();
  4928. const reset = setCurrentInstance(target);
  4929. const res = callWithAsyncErrorHandling(hook, target, type, args);
  4930. reset();
  4931. resetTracking();
  4932. return res;
  4933. });
  4934. if (prepend) {
  4935. hooks.unshift(wrappedHook);
  4936. } else {
  4937. hooks.push(wrappedHook);
  4938. }
  4939. return wrappedHook;
  4940. } else {
  4941. const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
  4942. warn$1(
  4943. `${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.` )
  4944. );
  4945. }
  4946. }
  4947. const createHook = (lifecycle) => (hook, target = currentInstance) => {
  4948. if (!isInSSRComponentSetup || lifecycle === "sp") {
  4949. injectHook(lifecycle, (...args) => hook(...args), target);
  4950. }
  4951. };
  4952. const onBeforeMount = createHook("bm");
  4953. const onMounted = createHook("m");
  4954. const onBeforeUpdate = createHook(
  4955. "bu"
  4956. );
  4957. const onUpdated = createHook("u");
  4958. const onBeforeUnmount = createHook(
  4959. "bum"
  4960. );
  4961. const onUnmounted = createHook("um");
  4962. const onServerPrefetch = createHook(
  4963. "sp"
  4964. );
  4965. const onRenderTriggered = createHook("rtg");
  4966. const onRenderTracked = createHook("rtc");
  4967. function onErrorCaptured(hook, target = currentInstance) {
  4968. injectHook("ec", hook, target);
  4969. }
  4970. const COMPONENTS = "components";
  4971. const DIRECTIVES = "directives";
  4972. function resolveComponent(name, maybeSelfReference) {
  4973. return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
  4974. }
  4975. const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
  4976. function resolveDynamicComponent(component) {
  4977. if (isString(component)) {
  4978. return resolveAsset(COMPONENTS, component, false) || component;
  4979. } else {
  4980. return component || NULL_DYNAMIC_COMPONENT;
  4981. }
  4982. }
  4983. function resolveDirective(name) {
  4984. return resolveAsset(DIRECTIVES, name);
  4985. }
  4986. function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
  4987. const instance = currentRenderingInstance || currentInstance;
  4988. if (instance) {
  4989. const Component = instance.type;
  4990. if (type === COMPONENTS) {
  4991. const selfName = getComponentName(
  4992. Component,
  4993. false
  4994. );
  4995. if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
  4996. return Component;
  4997. }
  4998. }
  4999. const res = (
  5000. // local registration
  5001. // check instance[type] first which is resolved for options API
  5002. resolve(instance[type] || Component[type], name) || // global registration
  5003. resolve(instance.appContext[type], name)
  5004. );
  5005. if (!res && maybeSelfReference) {
  5006. return Component;
  5007. }
  5008. if (warnMissing && !res) {
  5009. const extra = type === COMPONENTS ? `
  5010. If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
  5011. warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
  5012. }
  5013. return res;
  5014. } else {
  5015. warn$1(
  5016. `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
  5017. );
  5018. }
  5019. }
  5020. function resolve(registry, name) {
  5021. return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
  5022. }
  5023. function renderList(source, renderItem, cache, index) {
  5024. let ret;
  5025. const cached = cache && cache[index];
  5026. const sourceIsArray = isArray(source);
  5027. if (sourceIsArray || isString(source)) {
  5028. const sourceIsReactiveArray = sourceIsArray && isReactive(source);
  5029. let needsWrap = false;
  5030. let isReadonlySource = false;
  5031. if (sourceIsReactiveArray) {
  5032. needsWrap = !isShallow(source);
  5033. isReadonlySource = isReadonly(source);
  5034. source = shallowReadArray(source);
  5035. }
  5036. ret = new Array(source.length);
  5037. for (let i = 0, l = source.length; i < l; i++) {
  5038. ret[i] = renderItem(
  5039. needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i],
  5040. i,
  5041. void 0,
  5042. cached && cached[i]
  5043. );
  5044. }
  5045. } else if (typeof source === "number") {
  5046. if (!Number.isInteger(source)) {
  5047. warn$1(`The v-for range expect an integer value but got ${source}.`);
  5048. }
  5049. ret = new Array(source);
  5050. for (let i = 0; i < source; i++) {
  5051. ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
  5052. }
  5053. } else if (isObject(source)) {
  5054. if (source[Symbol.iterator]) {
  5055. ret = Array.from(
  5056. source,
  5057. (item, i) => renderItem(item, i, void 0, cached && cached[i])
  5058. );
  5059. } else {
  5060. const keys = Object.keys(source);
  5061. ret = new Array(keys.length);
  5062. for (let i = 0, l = keys.length; i < l; i++) {
  5063. const key = keys[i];
  5064. ret[i] = renderItem(source[key], key, i, cached && cached[i]);
  5065. }
  5066. }
  5067. } else {
  5068. ret = [];
  5069. }
  5070. if (cache) {
  5071. cache[index] = ret;
  5072. }
  5073. return ret;
  5074. }
  5075. function createSlots(slots, dynamicSlots) {
  5076. for (let i = 0; i < dynamicSlots.length; i++) {
  5077. const slot = dynamicSlots[i];
  5078. if (isArray(slot)) {
  5079. for (let j = 0; j < slot.length; j++) {
  5080. slots[slot[j].name] = slot[j].fn;
  5081. }
  5082. } else if (slot) {
  5083. slots[slot.name] = slot.key ? (...args) => {
  5084. const res = slot.fn(...args);
  5085. if (res) res.key = slot.key;
  5086. return res;
  5087. } : slot.fn;
  5088. }
  5089. }
  5090. return slots;
  5091. }
  5092. function renderSlot(slots, name, props = {}, fallback, noSlotted) {
  5093. if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
  5094. if (name !== "default") props.name = name;
  5095. return openBlock(), createBlock(
  5096. Fragment,
  5097. null,
  5098. [createVNode("slot", props, fallback && fallback())],
  5099. 64
  5100. );
  5101. }
  5102. let slot = slots[name];
  5103. if (slot && slot.length > 1) {
  5104. warn$1(
  5105. `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.`
  5106. );
  5107. slot = () => [];
  5108. }
  5109. if (slot && slot._c) {
  5110. slot._d = false;
  5111. }
  5112. openBlock();
  5113. const validSlotContent = slot && ensureValidVNode(slot(props));
  5114. const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
  5115. // key attached in the `createSlots` helper, respect that
  5116. validSlotContent && validSlotContent.key;
  5117. const rendered = createBlock(
  5118. Fragment,
  5119. {
  5120. key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
  5121. (!validSlotContent && fallback ? "_fb" : "")
  5122. },
  5123. validSlotContent || (fallback ? fallback() : []),
  5124. validSlotContent && slots._ === 1 ? 64 : -2
  5125. );
  5126. if (!noSlotted && rendered.scopeId) {
  5127. rendered.slotScopeIds = [rendered.scopeId + "-s"];
  5128. }
  5129. if (slot && slot._c) {
  5130. slot._d = true;
  5131. }
  5132. return rendered;
  5133. }
  5134. function ensureValidVNode(vnodes) {
  5135. return vnodes.some((child) => {
  5136. if (!isVNode(child)) return true;
  5137. if (child.type === Comment) return false;
  5138. if (child.type === Fragment && !ensureValidVNode(child.children))
  5139. return false;
  5140. return true;
  5141. }) ? vnodes : null;
  5142. }
  5143. function toHandlers(obj, preserveCaseIfNecessary) {
  5144. const ret = {};
  5145. if (!isObject(obj)) {
  5146. warn$1(`v-on with no argument expects an object value.`);
  5147. return ret;
  5148. }
  5149. for (const key in obj) {
  5150. ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];
  5151. }
  5152. return ret;
  5153. }
  5154. const getPublicInstance = (i) => {
  5155. if (!i) return null;
  5156. if (isStatefulComponent(i)) return getComponentPublicInstance(i);
  5157. return getPublicInstance(i.parent);
  5158. };
  5159. const publicPropertiesMap = (
  5160. // Move PURE marker to new line to workaround compiler discarding it
  5161. // due to type annotation
  5162. /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
  5163. $: (i) => i,
  5164. $el: (i) => i.vnode.el,
  5165. $data: (i) => i.data,
  5166. $props: (i) => shallowReadonly(i.props) ,
  5167. $attrs: (i) => shallowReadonly(i.attrs) ,
  5168. $slots: (i) => shallowReadonly(i.slots) ,
  5169. $refs: (i) => shallowReadonly(i.refs) ,
  5170. $parent: (i) => getPublicInstance(i.parent),
  5171. $root: (i) => getPublicInstance(i.root),
  5172. $host: (i) => i.ce,
  5173. $emit: (i) => i.emit,
  5174. $options: (i) => resolveMergedOptions(i) ,
  5175. $forceUpdate: (i) => i.f || (i.f = () => {
  5176. queueJob(i.update);
  5177. }),
  5178. $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
  5179. $watch: (i) => instanceWatch.bind(i)
  5180. })
  5181. );
  5182. const isReservedPrefix = (key) => key === "_" || key === "$";
  5183. const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
  5184. const PublicInstanceProxyHandlers = {
  5185. get({ _: instance }, key) {
  5186. if (key === "__v_skip") {
  5187. return true;
  5188. }
  5189. const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
  5190. if (key === "__isVue") {
  5191. return true;
  5192. }
  5193. let normalizedProps;
  5194. if (key[0] !== "$") {
  5195. const n = accessCache[key];
  5196. if (n !== void 0) {
  5197. switch (n) {
  5198. case 1 /* SETUP */:
  5199. return setupState[key];
  5200. case 2 /* DATA */:
  5201. return data[key];
  5202. case 4 /* CONTEXT */:
  5203. return ctx[key];
  5204. case 3 /* PROPS */:
  5205. return props[key];
  5206. }
  5207. } else if (hasSetupBinding(setupState, key)) {
  5208. accessCache[key] = 1 /* SETUP */;
  5209. return setupState[key];
  5210. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  5211. accessCache[key] = 2 /* DATA */;
  5212. return data[key];
  5213. } else if (
  5214. // only cache other properties when instance has declared (thus stable)
  5215. // props
  5216. (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)
  5217. ) {
  5218. accessCache[key] = 3 /* PROPS */;
  5219. return props[key];
  5220. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  5221. accessCache[key] = 4 /* CONTEXT */;
  5222. return ctx[key];
  5223. } else if (shouldCacheAccess) {
  5224. accessCache[key] = 0 /* OTHER */;
  5225. }
  5226. }
  5227. const publicGetter = publicPropertiesMap[key];
  5228. let cssModule, globalProperties;
  5229. if (publicGetter) {
  5230. if (key === "$attrs") {
  5231. track(instance.attrs, "get", "");
  5232. markAttrsAccessed();
  5233. } else if (key === "$slots") {
  5234. track(instance, "get", key);
  5235. }
  5236. return publicGetter(instance);
  5237. } else if (
  5238. // css module (injected by vue-loader)
  5239. (cssModule = type.__cssModules) && (cssModule = cssModule[key])
  5240. ) {
  5241. return cssModule;
  5242. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  5243. accessCache[key] = 4 /* CONTEXT */;
  5244. return ctx[key];
  5245. } else if (
  5246. // global properties
  5247. globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)
  5248. ) {
  5249. {
  5250. return globalProperties[key];
  5251. }
  5252. } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading
  5253. // to infinite warning loop
  5254. key.indexOf("__v") !== 0)) {
  5255. if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
  5256. warn$1(
  5257. `Property ${JSON.stringify(
  5258. key
  5259. )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
  5260. );
  5261. } else if (instance === currentRenderingInstance) {
  5262. warn$1(
  5263. `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`
  5264. );
  5265. }
  5266. }
  5267. },
  5268. set({ _: instance }, key, value) {
  5269. const { data, setupState, ctx } = instance;
  5270. if (hasSetupBinding(setupState, key)) {
  5271. setupState[key] = value;
  5272. return true;
  5273. } else if (setupState.__isScriptSetup && hasOwn(setupState, key)) {
  5274. warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
  5275. return false;
  5276. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  5277. data[key] = value;
  5278. return true;
  5279. } else if (hasOwn(instance.props, key)) {
  5280. warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
  5281. return false;
  5282. }
  5283. if (key[0] === "$" && key.slice(1) in instance) {
  5284. warn$1(
  5285. `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`
  5286. );
  5287. return false;
  5288. } else {
  5289. if (key in instance.appContext.config.globalProperties) {
  5290. Object.defineProperty(ctx, key, {
  5291. enumerable: true,
  5292. configurable: true,
  5293. value
  5294. });
  5295. } else {
  5296. ctx[key] = value;
  5297. }
  5298. }
  5299. return true;
  5300. },
  5301. has({
  5302. _: { data, setupState, accessCache, ctx, appContext, propsOptions }
  5303. }, key) {
  5304. let normalizedProps;
  5305. 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);
  5306. },
  5307. defineProperty(target, key, descriptor) {
  5308. if (descriptor.get != null) {
  5309. target._.accessCache[key] = 0;
  5310. } else if (hasOwn(descriptor, "value")) {
  5311. this.set(target, key, descriptor.value, null);
  5312. }
  5313. return Reflect.defineProperty(target, key, descriptor);
  5314. }
  5315. };
  5316. {
  5317. PublicInstanceProxyHandlers.ownKeys = (target) => {
  5318. warn$1(
  5319. `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`
  5320. );
  5321. return Reflect.ownKeys(target);
  5322. };
  5323. }
  5324. const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend({}, PublicInstanceProxyHandlers, {
  5325. get(target, key) {
  5326. if (key === Symbol.unscopables) {
  5327. return;
  5328. }
  5329. return PublicInstanceProxyHandlers.get(target, key, target);
  5330. },
  5331. has(_, key) {
  5332. const has = key[0] !== "_" && !isGloballyAllowed(key);
  5333. if (!has && PublicInstanceProxyHandlers.has(_, key)) {
  5334. warn$1(
  5335. `Property ${JSON.stringify(
  5336. key
  5337. )} should not start with _ which is a reserved prefix for Vue internals.`
  5338. );
  5339. }
  5340. return has;
  5341. }
  5342. });
  5343. function createDevRenderContext(instance) {
  5344. const target = {};
  5345. Object.defineProperty(target, `_`, {
  5346. configurable: true,
  5347. enumerable: false,
  5348. get: () => instance
  5349. });
  5350. Object.keys(publicPropertiesMap).forEach((key) => {
  5351. Object.defineProperty(target, key, {
  5352. configurable: true,
  5353. enumerable: false,
  5354. get: () => publicPropertiesMap[key](instance),
  5355. // intercepted by the proxy so no need for implementation,
  5356. // but needed to prevent set errors
  5357. set: NOOP
  5358. });
  5359. });
  5360. return target;
  5361. }
  5362. function exposePropsOnRenderContext(instance) {
  5363. const {
  5364. ctx,
  5365. propsOptions: [propsOptions]
  5366. } = instance;
  5367. if (propsOptions) {
  5368. Object.keys(propsOptions).forEach((key) => {
  5369. Object.defineProperty(ctx, key, {
  5370. enumerable: true,
  5371. configurable: true,
  5372. get: () => instance.props[key],
  5373. set: NOOP
  5374. });
  5375. });
  5376. }
  5377. }
  5378. function exposeSetupStateOnRenderContext(instance) {
  5379. const { ctx, setupState } = instance;
  5380. Object.keys(toRaw(setupState)).forEach((key) => {
  5381. if (!setupState.__isScriptSetup) {
  5382. if (isReservedPrefix(key[0])) {
  5383. warn$1(
  5384. `setup() return property ${JSON.stringify(
  5385. key
  5386. )} should not start with "$" or "_" which are reserved prefixes for Vue internals.`
  5387. );
  5388. return;
  5389. }
  5390. Object.defineProperty(ctx, key, {
  5391. enumerable: true,
  5392. configurable: true,
  5393. get: () => setupState[key],
  5394. set: NOOP
  5395. });
  5396. }
  5397. });
  5398. }
  5399. const warnRuntimeUsage = (method) => warn$1(
  5400. `${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.`
  5401. );
  5402. function defineProps() {
  5403. {
  5404. warnRuntimeUsage(`defineProps`);
  5405. }
  5406. return null;
  5407. }
  5408. function defineEmits() {
  5409. {
  5410. warnRuntimeUsage(`defineEmits`);
  5411. }
  5412. return null;
  5413. }
  5414. function defineExpose(exposed) {
  5415. {
  5416. warnRuntimeUsage(`defineExpose`);
  5417. }
  5418. }
  5419. function defineOptions(options) {
  5420. {
  5421. warnRuntimeUsage(`defineOptions`);
  5422. }
  5423. }
  5424. function defineSlots() {
  5425. {
  5426. warnRuntimeUsage(`defineSlots`);
  5427. }
  5428. return null;
  5429. }
  5430. function defineModel() {
  5431. {
  5432. warnRuntimeUsage("defineModel");
  5433. }
  5434. }
  5435. function withDefaults(props, defaults) {
  5436. {
  5437. warnRuntimeUsage(`withDefaults`);
  5438. }
  5439. return null;
  5440. }
  5441. function useSlots() {
  5442. return getContext("useSlots").slots;
  5443. }
  5444. function useAttrs() {
  5445. return getContext("useAttrs").attrs;
  5446. }
  5447. function getContext(calledFunctionName) {
  5448. const i = getCurrentInstance();
  5449. if (!i) {
  5450. warn$1(`${calledFunctionName}() called without active instance.`);
  5451. }
  5452. return i.setupContext || (i.setupContext = createSetupContext(i));
  5453. }
  5454. function normalizePropsOrEmits(props) {
  5455. return isArray(props) ? props.reduce(
  5456. (normalized, p) => (normalized[p] = null, normalized),
  5457. {}
  5458. ) : props;
  5459. }
  5460. function mergeDefaults(raw, defaults) {
  5461. const props = normalizePropsOrEmits(raw);
  5462. for (const key in defaults) {
  5463. if (key.startsWith("__skip")) continue;
  5464. let opt = props[key];
  5465. if (opt) {
  5466. if (isArray(opt) || isFunction(opt)) {
  5467. opt = props[key] = { type: opt, default: defaults[key] };
  5468. } else {
  5469. opt.default = defaults[key];
  5470. }
  5471. } else if (opt === null) {
  5472. opt = props[key] = { default: defaults[key] };
  5473. } else {
  5474. warn$1(`props default key "${key}" has no corresponding declaration.`);
  5475. }
  5476. if (opt && defaults[`__skip_${key}`]) {
  5477. opt.skipFactory = true;
  5478. }
  5479. }
  5480. return props;
  5481. }
  5482. function mergeModels(a, b) {
  5483. if (!a || !b) return a || b;
  5484. if (isArray(a) && isArray(b)) return a.concat(b);
  5485. return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
  5486. }
  5487. function createPropsRestProxy(props, excludedKeys) {
  5488. const ret = {};
  5489. for (const key in props) {
  5490. if (!excludedKeys.includes(key)) {
  5491. Object.defineProperty(ret, key, {
  5492. enumerable: true,
  5493. get: () => props[key]
  5494. });
  5495. }
  5496. }
  5497. return ret;
  5498. }
  5499. function withAsyncContext(getAwaitable) {
  5500. const ctx = getCurrentInstance();
  5501. if (!ctx) {
  5502. warn$1(
  5503. `withAsyncContext called without active current instance. This is likely a bug.`
  5504. );
  5505. }
  5506. let awaitable = getAwaitable();
  5507. unsetCurrentInstance();
  5508. if (isPromise(awaitable)) {
  5509. awaitable = awaitable.catch((e) => {
  5510. setCurrentInstance(ctx);
  5511. throw e;
  5512. });
  5513. }
  5514. return [awaitable, () => setCurrentInstance(ctx)];
  5515. }
  5516. function createDuplicateChecker() {
  5517. const cache = /* @__PURE__ */ Object.create(null);
  5518. return (type, key) => {
  5519. if (cache[key]) {
  5520. warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`);
  5521. } else {
  5522. cache[key] = type;
  5523. }
  5524. };
  5525. }
  5526. let shouldCacheAccess = true;
  5527. function applyOptions(instance) {
  5528. const options = resolveMergedOptions(instance);
  5529. const publicThis = instance.proxy;
  5530. const ctx = instance.ctx;
  5531. shouldCacheAccess = false;
  5532. if (options.beforeCreate) {
  5533. callHook$1(options.beforeCreate, instance, "bc");
  5534. }
  5535. const {
  5536. // state
  5537. data: dataOptions,
  5538. computed: computedOptions,
  5539. methods,
  5540. watch: watchOptions,
  5541. provide: provideOptions,
  5542. inject: injectOptions,
  5543. // lifecycle
  5544. created,
  5545. beforeMount,
  5546. mounted,
  5547. beforeUpdate,
  5548. updated,
  5549. activated,
  5550. deactivated,
  5551. beforeDestroy,
  5552. beforeUnmount,
  5553. destroyed,
  5554. unmounted,
  5555. render,
  5556. renderTracked,
  5557. renderTriggered,
  5558. errorCaptured,
  5559. serverPrefetch,
  5560. // public API
  5561. expose,
  5562. inheritAttrs,
  5563. // assets
  5564. components,
  5565. directives,
  5566. filters
  5567. } = options;
  5568. const checkDuplicateProperties = createDuplicateChecker() ;
  5569. {
  5570. const [propsOptions] = instance.propsOptions;
  5571. if (propsOptions) {
  5572. for (const key in propsOptions) {
  5573. checkDuplicateProperties("Props" /* PROPS */, key);
  5574. }
  5575. }
  5576. }
  5577. if (injectOptions) {
  5578. resolveInjections(injectOptions, ctx, checkDuplicateProperties);
  5579. }
  5580. if (methods) {
  5581. for (const key in methods) {
  5582. const methodHandler = methods[key];
  5583. if (isFunction(methodHandler)) {
  5584. {
  5585. Object.defineProperty(ctx, key, {
  5586. value: methodHandler.bind(publicThis),
  5587. configurable: true,
  5588. enumerable: true,
  5589. writable: true
  5590. });
  5591. }
  5592. {
  5593. checkDuplicateProperties("Methods" /* METHODS */, key);
  5594. }
  5595. } else {
  5596. warn$1(
  5597. `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`
  5598. );
  5599. }
  5600. }
  5601. }
  5602. if (dataOptions) {
  5603. if (!isFunction(dataOptions)) {
  5604. warn$1(
  5605. `The data option must be a function. Plain object usage is no longer supported.`
  5606. );
  5607. }
  5608. const data = dataOptions.call(publicThis, publicThis);
  5609. if (isPromise(data)) {
  5610. warn$1(
  5611. `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`
  5612. );
  5613. }
  5614. if (!isObject(data)) {
  5615. warn$1(`data() should return an object.`);
  5616. } else {
  5617. instance.data = reactive(data);
  5618. {
  5619. for (const key in data) {
  5620. checkDuplicateProperties("Data" /* DATA */, key);
  5621. if (!isReservedPrefix(key[0])) {
  5622. Object.defineProperty(ctx, key, {
  5623. configurable: true,
  5624. enumerable: true,
  5625. get: () => data[key],
  5626. set: NOOP
  5627. });
  5628. }
  5629. }
  5630. }
  5631. }
  5632. }
  5633. shouldCacheAccess = true;
  5634. if (computedOptions) {
  5635. for (const key in computedOptions) {
  5636. const opt = computedOptions[key];
  5637. const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
  5638. if (get === NOOP) {
  5639. warn$1(`Computed property "${key}" has no getter.`);
  5640. }
  5641. const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
  5642. warn$1(
  5643. `Write operation failed: computed property "${key}" is readonly.`
  5644. );
  5645. } ;
  5646. const c = computed({
  5647. get,
  5648. set
  5649. });
  5650. Object.defineProperty(ctx, key, {
  5651. enumerable: true,
  5652. configurable: true,
  5653. get: () => c.value,
  5654. set: (v) => c.value = v
  5655. });
  5656. {
  5657. checkDuplicateProperties("Computed" /* COMPUTED */, key);
  5658. }
  5659. }
  5660. }
  5661. if (watchOptions) {
  5662. for (const key in watchOptions) {
  5663. createWatcher(watchOptions[key], ctx, publicThis, key);
  5664. }
  5665. }
  5666. if (provideOptions) {
  5667. const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
  5668. Reflect.ownKeys(provides).forEach((key) => {
  5669. provide(key, provides[key]);
  5670. });
  5671. }
  5672. if (created) {
  5673. callHook$1(created, instance, "c");
  5674. }
  5675. function registerLifecycleHook(register, hook) {
  5676. if (isArray(hook)) {
  5677. hook.forEach((_hook) => register(_hook.bind(publicThis)));
  5678. } else if (hook) {
  5679. register(hook.bind(publicThis));
  5680. }
  5681. }
  5682. registerLifecycleHook(onBeforeMount, beforeMount);
  5683. registerLifecycleHook(onMounted, mounted);
  5684. registerLifecycleHook(onBeforeUpdate, beforeUpdate);
  5685. registerLifecycleHook(onUpdated, updated);
  5686. registerLifecycleHook(onActivated, activated);
  5687. registerLifecycleHook(onDeactivated, deactivated);
  5688. registerLifecycleHook(onErrorCaptured, errorCaptured);
  5689. registerLifecycleHook(onRenderTracked, renderTracked);
  5690. registerLifecycleHook(onRenderTriggered, renderTriggered);
  5691. registerLifecycleHook(onBeforeUnmount, beforeUnmount);
  5692. registerLifecycleHook(onUnmounted, unmounted);
  5693. registerLifecycleHook(onServerPrefetch, serverPrefetch);
  5694. if (isArray(expose)) {
  5695. if (expose.length) {
  5696. const exposed = instance.exposed || (instance.exposed = {});
  5697. expose.forEach((key) => {
  5698. Object.defineProperty(exposed, key, {
  5699. get: () => publicThis[key],
  5700. set: (val) => publicThis[key] = val,
  5701. enumerable: true
  5702. });
  5703. });
  5704. } else if (!instance.exposed) {
  5705. instance.exposed = {};
  5706. }
  5707. }
  5708. if (render && instance.render === NOOP) {
  5709. instance.render = render;
  5710. }
  5711. if (inheritAttrs != null) {
  5712. instance.inheritAttrs = inheritAttrs;
  5713. }
  5714. if (components) instance.components = components;
  5715. if (directives) instance.directives = directives;
  5716. if (serverPrefetch) {
  5717. markAsyncBoundary(instance);
  5718. }
  5719. }
  5720. function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
  5721. if (isArray(injectOptions)) {
  5722. injectOptions = normalizeInject(injectOptions);
  5723. }
  5724. for (const key in injectOptions) {
  5725. const opt = injectOptions[key];
  5726. let injected;
  5727. if (isObject(opt)) {
  5728. if ("default" in opt) {
  5729. injected = inject(
  5730. opt.from || key,
  5731. opt.default,
  5732. true
  5733. );
  5734. } else {
  5735. injected = inject(opt.from || key);
  5736. }
  5737. } else {
  5738. injected = inject(opt);
  5739. }
  5740. if (isRef(injected)) {
  5741. Object.defineProperty(ctx, key, {
  5742. enumerable: true,
  5743. configurable: true,
  5744. get: () => injected.value,
  5745. set: (v) => injected.value = v
  5746. });
  5747. } else {
  5748. ctx[key] = injected;
  5749. }
  5750. {
  5751. checkDuplicateProperties("Inject" /* INJECT */, key);
  5752. }
  5753. }
  5754. }
  5755. function callHook$1(hook, instance, type) {
  5756. callWithAsyncErrorHandling(
  5757. isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy),
  5758. instance,
  5759. type
  5760. );
  5761. }
  5762. function createWatcher(raw, ctx, publicThis, key) {
  5763. let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  5764. if (isString(raw)) {
  5765. const handler = ctx[raw];
  5766. if (isFunction(handler)) {
  5767. {
  5768. watch(getter, handler);
  5769. }
  5770. } else {
  5771. warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
  5772. }
  5773. } else if (isFunction(raw)) {
  5774. {
  5775. watch(getter, raw.bind(publicThis));
  5776. }
  5777. } else if (isObject(raw)) {
  5778. if (isArray(raw)) {
  5779. raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
  5780. } else {
  5781. const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
  5782. if (isFunction(handler)) {
  5783. watch(getter, handler, raw);
  5784. } else {
  5785. warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
  5786. }
  5787. }
  5788. } else {
  5789. warn$1(`Invalid watch option: "${key}"`, raw);
  5790. }
  5791. }
  5792. function resolveMergedOptions(instance) {
  5793. const base = instance.type;
  5794. const { mixins, extends: extendsOptions } = base;
  5795. const {
  5796. mixins: globalMixins,
  5797. optionsCache: cache,
  5798. config: { optionMergeStrategies }
  5799. } = instance.appContext;
  5800. const cached = cache.get(base);
  5801. let resolved;
  5802. if (cached) {
  5803. resolved = cached;
  5804. } else if (!globalMixins.length && !mixins && !extendsOptions) {
  5805. {
  5806. resolved = base;
  5807. }
  5808. } else {
  5809. resolved = {};
  5810. if (globalMixins.length) {
  5811. globalMixins.forEach(
  5812. (m) => mergeOptions(resolved, m, optionMergeStrategies, true)
  5813. );
  5814. }
  5815. mergeOptions(resolved, base, optionMergeStrategies);
  5816. }
  5817. if (isObject(base)) {
  5818. cache.set(base, resolved);
  5819. }
  5820. return resolved;
  5821. }
  5822. function mergeOptions(to, from, strats, asMixin = false) {
  5823. const { mixins, extends: extendsOptions } = from;
  5824. if (extendsOptions) {
  5825. mergeOptions(to, extendsOptions, strats, true);
  5826. }
  5827. if (mixins) {
  5828. mixins.forEach(
  5829. (m) => mergeOptions(to, m, strats, true)
  5830. );
  5831. }
  5832. for (const key in from) {
  5833. if (asMixin && key === "expose") {
  5834. warn$1(
  5835. `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`
  5836. );
  5837. } else {
  5838. const strat = internalOptionMergeStrats[key] || strats && strats[key];
  5839. to[key] = strat ? strat(to[key], from[key]) : from[key];
  5840. }
  5841. }
  5842. return to;
  5843. }
  5844. const internalOptionMergeStrats = {
  5845. data: mergeDataFn,
  5846. props: mergeEmitsOrPropsOptions,
  5847. emits: mergeEmitsOrPropsOptions,
  5848. // objects
  5849. methods: mergeObjectOptions,
  5850. computed: mergeObjectOptions,
  5851. // lifecycle
  5852. beforeCreate: mergeAsArray,
  5853. created: mergeAsArray,
  5854. beforeMount: mergeAsArray,
  5855. mounted: mergeAsArray,
  5856. beforeUpdate: mergeAsArray,
  5857. updated: mergeAsArray,
  5858. beforeDestroy: mergeAsArray,
  5859. beforeUnmount: mergeAsArray,
  5860. destroyed: mergeAsArray,
  5861. unmounted: mergeAsArray,
  5862. activated: mergeAsArray,
  5863. deactivated: mergeAsArray,
  5864. errorCaptured: mergeAsArray,
  5865. serverPrefetch: mergeAsArray,
  5866. // assets
  5867. components: mergeObjectOptions,
  5868. directives: mergeObjectOptions,
  5869. // watch
  5870. watch: mergeWatchOptions,
  5871. // provide / inject
  5872. provide: mergeDataFn,
  5873. inject: mergeInject
  5874. };
  5875. function mergeDataFn(to, from) {
  5876. if (!from) {
  5877. return to;
  5878. }
  5879. if (!to) {
  5880. return from;
  5881. }
  5882. return function mergedDataFn() {
  5883. return (extend)(
  5884. isFunction(to) ? to.call(this, this) : to,
  5885. isFunction(from) ? from.call(this, this) : from
  5886. );
  5887. };
  5888. }
  5889. function mergeInject(to, from) {
  5890. return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
  5891. }
  5892. function normalizeInject(raw) {
  5893. if (isArray(raw)) {
  5894. const res = {};
  5895. for (let i = 0; i < raw.length; i++) {
  5896. res[raw[i]] = raw[i];
  5897. }
  5898. return res;
  5899. }
  5900. return raw;
  5901. }
  5902. function mergeAsArray(to, from) {
  5903. return to ? [...new Set([].concat(to, from))] : from;
  5904. }
  5905. function mergeObjectOptions(to, from) {
  5906. return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
  5907. }
  5908. function mergeEmitsOrPropsOptions(to, from) {
  5909. if (to) {
  5910. if (isArray(to) && isArray(from)) {
  5911. return [.../* @__PURE__ */ new Set([...to, ...from])];
  5912. }
  5913. return extend(
  5914. /* @__PURE__ */ Object.create(null),
  5915. normalizePropsOrEmits(to),
  5916. normalizePropsOrEmits(from != null ? from : {})
  5917. );
  5918. } else {
  5919. return from;
  5920. }
  5921. }
  5922. function mergeWatchOptions(to, from) {
  5923. if (!to) return from;
  5924. if (!from) return to;
  5925. const merged = extend(/* @__PURE__ */ Object.create(null), to);
  5926. for (const key in from) {
  5927. merged[key] = mergeAsArray(to[key], from[key]);
  5928. }
  5929. return merged;
  5930. }
  5931. function createAppContext() {
  5932. return {
  5933. app: null,
  5934. config: {
  5935. isNativeTag: NO,
  5936. performance: false,
  5937. globalProperties: {},
  5938. optionMergeStrategies: {},
  5939. errorHandler: void 0,
  5940. warnHandler: void 0,
  5941. compilerOptions: {}
  5942. },
  5943. mixins: [],
  5944. components: {},
  5945. directives: {},
  5946. provides: /* @__PURE__ */ Object.create(null),
  5947. optionsCache: /* @__PURE__ */ new WeakMap(),
  5948. propsCache: /* @__PURE__ */ new WeakMap(),
  5949. emitsCache: /* @__PURE__ */ new WeakMap()
  5950. };
  5951. }
  5952. let uid$1 = 0;
  5953. function createAppAPI(render, hydrate) {
  5954. return function createApp(rootComponent, rootProps = null) {
  5955. if (!isFunction(rootComponent)) {
  5956. rootComponent = extend({}, rootComponent);
  5957. }
  5958. if (rootProps != null && !isObject(rootProps)) {
  5959. warn$1(`root props passed to app.mount() must be an object.`);
  5960. rootProps = null;
  5961. }
  5962. const context = createAppContext();
  5963. const installedPlugins = /* @__PURE__ */ new WeakSet();
  5964. const pluginCleanupFns = [];
  5965. let isMounted = false;
  5966. const app = context.app = {
  5967. _uid: uid$1++,
  5968. _component: rootComponent,
  5969. _props: rootProps,
  5970. _container: null,
  5971. _context: context,
  5972. _instance: null,
  5973. version,
  5974. get config() {
  5975. return context.config;
  5976. },
  5977. set config(v) {
  5978. {
  5979. warn$1(
  5980. `app.config cannot be replaced. Modify individual options instead.`
  5981. );
  5982. }
  5983. },
  5984. use(plugin, ...options) {
  5985. if (installedPlugins.has(plugin)) {
  5986. warn$1(`Plugin has already been applied to target app.`);
  5987. } else if (plugin && isFunction(plugin.install)) {
  5988. installedPlugins.add(plugin);
  5989. plugin.install(app, ...options);
  5990. } else if (isFunction(plugin)) {
  5991. installedPlugins.add(plugin);
  5992. plugin(app, ...options);
  5993. } else {
  5994. warn$1(
  5995. `A plugin must either be a function or an object with an "install" function.`
  5996. );
  5997. }
  5998. return app;
  5999. },
  6000. mixin(mixin) {
  6001. {
  6002. if (!context.mixins.includes(mixin)) {
  6003. context.mixins.push(mixin);
  6004. } else {
  6005. warn$1(
  6006. "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
  6007. );
  6008. }
  6009. }
  6010. return app;
  6011. },
  6012. component(name, component) {
  6013. {
  6014. validateComponentName(name, context.config);
  6015. }
  6016. if (!component) {
  6017. return context.components[name];
  6018. }
  6019. if (context.components[name]) {
  6020. warn$1(`Component "${name}" has already been registered in target app.`);
  6021. }
  6022. context.components[name] = component;
  6023. return app;
  6024. },
  6025. directive(name, directive) {
  6026. {
  6027. validateDirectiveName(name);
  6028. }
  6029. if (!directive) {
  6030. return context.directives[name];
  6031. }
  6032. if (context.directives[name]) {
  6033. warn$1(`Directive "${name}" has already been registered in target app.`);
  6034. }
  6035. context.directives[name] = directive;
  6036. return app;
  6037. },
  6038. mount(rootContainer, isHydrate, namespace) {
  6039. if (!isMounted) {
  6040. if (rootContainer.__vue_app__) {
  6041. warn$1(
  6042. `There is already an app instance mounted on the host container.
  6043. If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
  6044. );
  6045. }
  6046. const vnode = app._ceVNode || createVNode(rootComponent, rootProps);
  6047. vnode.appContext = context;
  6048. if (namespace === true) {
  6049. namespace = "svg";
  6050. } else if (namespace === false) {
  6051. namespace = void 0;
  6052. }
  6053. {
  6054. context.reload = () => {
  6055. const cloned = cloneVNode(vnode);
  6056. cloned.el = null;
  6057. render(cloned, rootContainer, namespace);
  6058. };
  6059. }
  6060. if (isHydrate && hydrate) {
  6061. hydrate(vnode, rootContainer);
  6062. } else {
  6063. render(vnode, rootContainer, namespace);
  6064. }
  6065. isMounted = true;
  6066. app._container = rootContainer;
  6067. rootContainer.__vue_app__ = app;
  6068. {
  6069. app._instance = vnode.component;
  6070. devtoolsInitApp(app, version);
  6071. }
  6072. return getComponentPublicInstance(vnode.component);
  6073. } else {
  6074. warn$1(
  6075. `App has already been mounted.
  6076. 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)\``
  6077. );
  6078. }
  6079. },
  6080. onUnmount(cleanupFn) {
  6081. if (typeof cleanupFn !== "function") {
  6082. warn$1(
  6083. `Expected function as first argument to app.onUnmount(), but got ${typeof cleanupFn}`
  6084. );
  6085. }
  6086. pluginCleanupFns.push(cleanupFn);
  6087. },
  6088. unmount() {
  6089. if (isMounted) {
  6090. callWithAsyncErrorHandling(
  6091. pluginCleanupFns,
  6092. app._instance,
  6093. 16
  6094. );
  6095. render(null, app._container);
  6096. {
  6097. app._instance = null;
  6098. devtoolsUnmountApp(app);
  6099. }
  6100. delete app._container.__vue_app__;
  6101. } else {
  6102. warn$1(`Cannot unmount an app that is not mounted.`);
  6103. }
  6104. },
  6105. provide(key, value) {
  6106. if (key in context.provides) {
  6107. if (hasOwn(context.provides, key)) {
  6108. warn$1(
  6109. `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
  6110. );
  6111. } else {
  6112. warn$1(
  6113. `App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`
  6114. );
  6115. }
  6116. }
  6117. context.provides[key] = value;
  6118. return app;
  6119. },
  6120. runWithContext(fn) {
  6121. const lastApp = currentApp;
  6122. currentApp = app;
  6123. try {
  6124. return fn();
  6125. } finally {
  6126. currentApp = lastApp;
  6127. }
  6128. }
  6129. };
  6130. return app;
  6131. };
  6132. }
  6133. let currentApp = null;
  6134. function provide(key, value) {
  6135. if (!currentInstance) {
  6136. {
  6137. warn$1(`provide() can only be used inside setup().`);
  6138. }
  6139. } else {
  6140. let provides = currentInstance.provides;
  6141. const parentProvides = currentInstance.parent && currentInstance.parent.provides;
  6142. if (parentProvides === provides) {
  6143. provides = currentInstance.provides = Object.create(parentProvides);
  6144. }
  6145. provides[key] = value;
  6146. }
  6147. }
  6148. function inject(key, defaultValue, treatDefaultAsFactory = false) {
  6149. const instance = getCurrentInstance();
  6150. if (instance || currentApp) {
  6151. let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
  6152. if (provides && key in provides) {
  6153. return provides[key];
  6154. } else if (arguments.length > 1) {
  6155. return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
  6156. } else {
  6157. warn$1(`injection "${String(key)}" not found.`);
  6158. }
  6159. } else {
  6160. warn$1(`inject() can only be used inside setup() or functional components.`);
  6161. }
  6162. }
  6163. function hasInjectionContext() {
  6164. return !!(getCurrentInstance() || currentApp);
  6165. }
  6166. const internalObjectProto = {};
  6167. const createInternalObject = () => Object.create(internalObjectProto);
  6168. const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
  6169. function initProps(instance, rawProps, isStateful, isSSR = false) {
  6170. const props = {};
  6171. const attrs = createInternalObject();
  6172. instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  6173. setFullProps(instance, rawProps, props, attrs);
  6174. for (const key in instance.propsOptions[0]) {
  6175. if (!(key in props)) {
  6176. props[key] = void 0;
  6177. }
  6178. }
  6179. {
  6180. validateProps(rawProps || {}, props, instance);
  6181. }
  6182. if (isStateful) {
  6183. instance.props = isSSR ? props : shallowReactive(props);
  6184. } else {
  6185. if (!instance.type.props) {
  6186. instance.props = attrs;
  6187. } else {
  6188. instance.props = props;
  6189. }
  6190. }
  6191. instance.attrs = attrs;
  6192. }
  6193. function isInHmrContext(instance) {
  6194. while (instance) {
  6195. if (instance.type.__hmrId) return true;
  6196. instance = instance.parent;
  6197. }
  6198. }
  6199. function updateProps(instance, rawProps, rawPrevProps, optimized) {
  6200. const {
  6201. props,
  6202. attrs,
  6203. vnode: { patchFlag }
  6204. } = instance;
  6205. const rawCurrentProps = toRaw(props);
  6206. const [options] = instance.propsOptions;
  6207. let hasAttrsChanged = false;
  6208. if (
  6209. // always force full diff in dev
  6210. // - #1942 if hmr is enabled with sfc component
  6211. // - vite#872 non-sfc component used by sfc component
  6212. !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
  6213. ) {
  6214. if (patchFlag & 8) {
  6215. const propsToUpdate = instance.vnode.dynamicProps;
  6216. for (let i = 0; i < propsToUpdate.length; i++) {
  6217. let key = propsToUpdate[i];
  6218. if (isEmitListener(instance.emitsOptions, key)) {
  6219. continue;
  6220. }
  6221. const value = rawProps[key];
  6222. if (options) {
  6223. if (hasOwn(attrs, key)) {
  6224. if (value !== attrs[key]) {
  6225. attrs[key] = value;
  6226. hasAttrsChanged = true;
  6227. }
  6228. } else {
  6229. const camelizedKey = camelize(key);
  6230. props[camelizedKey] = resolvePropValue(
  6231. options,
  6232. rawCurrentProps,
  6233. camelizedKey,
  6234. value,
  6235. instance,
  6236. false
  6237. );
  6238. }
  6239. } else {
  6240. if (value !== attrs[key]) {
  6241. attrs[key] = value;
  6242. hasAttrsChanged = true;
  6243. }
  6244. }
  6245. }
  6246. }
  6247. } else {
  6248. if (setFullProps(instance, rawProps, props, attrs)) {
  6249. hasAttrsChanged = true;
  6250. }
  6251. let kebabKey;
  6252. for (const key in rawCurrentProps) {
  6253. if (!rawProps || // for camelCase
  6254. !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
  6255. // and converted to camelCase (#955)
  6256. ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
  6257. if (options) {
  6258. if (rawPrevProps && // for camelCase
  6259. (rawPrevProps[key] !== void 0 || // for kebab-case
  6260. rawPrevProps[kebabKey] !== void 0)) {
  6261. props[key] = resolvePropValue(
  6262. options,
  6263. rawCurrentProps,
  6264. key,
  6265. void 0,
  6266. instance,
  6267. true
  6268. );
  6269. }
  6270. } else {
  6271. delete props[key];
  6272. }
  6273. }
  6274. }
  6275. if (attrs !== rawCurrentProps) {
  6276. for (const key in attrs) {
  6277. if (!rawProps || !hasOwn(rawProps, key) && true) {
  6278. delete attrs[key];
  6279. hasAttrsChanged = true;
  6280. }
  6281. }
  6282. }
  6283. }
  6284. if (hasAttrsChanged) {
  6285. trigger(instance.attrs, "set", "");
  6286. }
  6287. {
  6288. validateProps(rawProps || {}, props, instance);
  6289. }
  6290. }
  6291. function setFullProps(instance, rawProps, props, attrs) {
  6292. const [options, needCastKeys] = instance.propsOptions;
  6293. let hasAttrsChanged = false;
  6294. let rawCastValues;
  6295. if (rawProps) {
  6296. for (let key in rawProps) {
  6297. if (isReservedProp(key)) {
  6298. continue;
  6299. }
  6300. const value = rawProps[key];
  6301. let camelKey;
  6302. if (options && hasOwn(options, camelKey = camelize(key))) {
  6303. if (!needCastKeys || !needCastKeys.includes(camelKey)) {
  6304. props[camelKey] = value;
  6305. } else {
  6306. (rawCastValues || (rawCastValues = {}))[camelKey] = value;
  6307. }
  6308. } else if (!isEmitListener(instance.emitsOptions, key)) {
  6309. if (!(key in attrs) || value !== attrs[key]) {
  6310. attrs[key] = value;
  6311. hasAttrsChanged = true;
  6312. }
  6313. }
  6314. }
  6315. }
  6316. if (needCastKeys) {
  6317. const rawCurrentProps = toRaw(props);
  6318. const castValues = rawCastValues || EMPTY_OBJ;
  6319. for (let i = 0; i < needCastKeys.length; i++) {
  6320. const key = needCastKeys[i];
  6321. props[key] = resolvePropValue(
  6322. options,
  6323. rawCurrentProps,
  6324. key,
  6325. castValues[key],
  6326. instance,
  6327. !hasOwn(castValues, key)
  6328. );
  6329. }
  6330. }
  6331. return hasAttrsChanged;
  6332. }
  6333. function resolvePropValue(options, props, key, value, instance, isAbsent) {
  6334. const opt = options[key];
  6335. if (opt != null) {
  6336. const hasDefault = hasOwn(opt, "default");
  6337. if (hasDefault && value === void 0) {
  6338. const defaultValue = opt.default;
  6339. if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
  6340. const { propsDefaults } = instance;
  6341. if (key in propsDefaults) {
  6342. value = propsDefaults[key];
  6343. } else {
  6344. const reset = setCurrentInstance(instance);
  6345. value = propsDefaults[key] = defaultValue.call(
  6346. null,
  6347. props
  6348. );
  6349. reset();
  6350. }
  6351. } else {
  6352. value = defaultValue;
  6353. }
  6354. if (instance.ce) {
  6355. instance.ce._setProp(key, value);
  6356. }
  6357. }
  6358. if (opt[0 /* shouldCast */]) {
  6359. if (isAbsent && !hasDefault) {
  6360. value = false;
  6361. } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) {
  6362. value = true;
  6363. }
  6364. }
  6365. }
  6366. return value;
  6367. }
  6368. const mixinPropsCache = /* @__PURE__ */ new WeakMap();
  6369. function normalizePropsOptions(comp, appContext, asMixin = false) {
  6370. const cache = asMixin ? mixinPropsCache : appContext.propsCache;
  6371. const cached = cache.get(comp);
  6372. if (cached) {
  6373. return cached;
  6374. }
  6375. const raw = comp.props;
  6376. const normalized = {};
  6377. const needCastKeys = [];
  6378. let hasExtends = false;
  6379. if (!isFunction(comp)) {
  6380. const extendProps = (raw2) => {
  6381. hasExtends = true;
  6382. const [props, keys] = normalizePropsOptions(raw2, appContext, true);
  6383. extend(normalized, props);
  6384. if (keys) needCastKeys.push(...keys);
  6385. };
  6386. if (!asMixin && appContext.mixins.length) {
  6387. appContext.mixins.forEach(extendProps);
  6388. }
  6389. if (comp.extends) {
  6390. extendProps(comp.extends);
  6391. }
  6392. if (comp.mixins) {
  6393. comp.mixins.forEach(extendProps);
  6394. }
  6395. }
  6396. if (!raw && !hasExtends) {
  6397. if (isObject(comp)) {
  6398. cache.set(comp, EMPTY_ARR);
  6399. }
  6400. return EMPTY_ARR;
  6401. }
  6402. if (isArray(raw)) {
  6403. for (let i = 0; i < raw.length; i++) {
  6404. if (!isString(raw[i])) {
  6405. warn$1(`props must be strings when using array syntax.`, raw[i]);
  6406. }
  6407. const normalizedKey = camelize(raw[i]);
  6408. if (validatePropName(normalizedKey)) {
  6409. normalized[normalizedKey] = EMPTY_OBJ;
  6410. }
  6411. }
  6412. } else if (raw) {
  6413. if (!isObject(raw)) {
  6414. warn$1(`invalid props options`, raw);
  6415. }
  6416. for (const key in raw) {
  6417. const normalizedKey = camelize(key);
  6418. if (validatePropName(normalizedKey)) {
  6419. const opt = raw[key];
  6420. const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
  6421. const propType = prop.type;
  6422. let shouldCast = false;
  6423. let shouldCastTrue = true;
  6424. if (isArray(propType)) {
  6425. for (let index = 0; index < propType.length; ++index) {
  6426. const type = propType[index];
  6427. const typeName = isFunction(type) && type.name;
  6428. if (typeName === "Boolean") {
  6429. shouldCast = true;
  6430. break;
  6431. } else if (typeName === "String") {
  6432. shouldCastTrue = false;
  6433. }
  6434. }
  6435. } else {
  6436. shouldCast = isFunction(propType) && propType.name === "Boolean";
  6437. }
  6438. prop[0 /* shouldCast */] = shouldCast;
  6439. prop[1 /* shouldCastTrue */] = shouldCastTrue;
  6440. if (shouldCast || hasOwn(prop, "default")) {
  6441. needCastKeys.push(normalizedKey);
  6442. }
  6443. }
  6444. }
  6445. }
  6446. const res = [normalized, needCastKeys];
  6447. if (isObject(comp)) {
  6448. cache.set(comp, res);
  6449. }
  6450. return res;
  6451. }
  6452. function validatePropName(key) {
  6453. if (key[0] !== "$" && !isReservedProp(key)) {
  6454. return true;
  6455. } else {
  6456. warn$1(`Invalid prop name: "${key}" is a reserved property.`);
  6457. }
  6458. return false;
  6459. }
  6460. function getType(ctor) {
  6461. if (ctor === null) {
  6462. return "null";
  6463. }
  6464. if (typeof ctor === "function") {
  6465. return ctor.name || "";
  6466. } else if (typeof ctor === "object") {
  6467. const name = ctor.constructor && ctor.constructor.name;
  6468. return name || "";
  6469. }
  6470. return "";
  6471. }
  6472. function validateProps(rawProps, props, instance) {
  6473. const resolvedValues = toRaw(props);
  6474. const options = instance.propsOptions[0];
  6475. const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
  6476. for (const key in options) {
  6477. let opt = options[key];
  6478. if (opt == null) continue;
  6479. validateProp(
  6480. key,
  6481. resolvedValues[key],
  6482. opt,
  6483. shallowReadonly(resolvedValues) ,
  6484. !camelizePropsKey.includes(key)
  6485. );
  6486. }
  6487. }
  6488. function validateProp(name, value, prop, props, isAbsent) {
  6489. const { type, required, validator, skipCheck } = prop;
  6490. if (required && isAbsent) {
  6491. warn$1('Missing required prop: "' + name + '"');
  6492. return;
  6493. }
  6494. if (value == null && !required) {
  6495. return;
  6496. }
  6497. if (type != null && type !== true && !skipCheck) {
  6498. let isValid = false;
  6499. const types = isArray(type) ? type : [type];
  6500. const expectedTypes = [];
  6501. for (let i = 0; i < types.length && !isValid; i++) {
  6502. const { valid, expectedType } = assertType(value, types[i]);
  6503. expectedTypes.push(expectedType || "");
  6504. isValid = valid;
  6505. }
  6506. if (!isValid) {
  6507. warn$1(getInvalidTypeMessage(name, value, expectedTypes));
  6508. return;
  6509. }
  6510. }
  6511. if (validator && !validator(value, props)) {
  6512. warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
  6513. }
  6514. }
  6515. const isSimpleType = /* @__PURE__ */ makeMap(
  6516. "String,Number,Boolean,Function,Symbol,BigInt"
  6517. );
  6518. function assertType(value, type) {
  6519. let valid;
  6520. const expectedType = getType(type);
  6521. if (expectedType === "null") {
  6522. valid = value === null;
  6523. } else if (isSimpleType(expectedType)) {
  6524. const t = typeof value;
  6525. valid = t === expectedType.toLowerCase();
  6526. if (!valid && t === "object") {
  6527. valid = value instanceof type;
  6528. }
  6529. } else if (expectedType === "Object") {
  6530. valid = isObject(value);
  6531. } else if (expectedType === "Array") {
  6532. valid = isArray(value);
  6533. } else {
  6534. valid = value instanceof type;
  6535. }
  6536. return {
  6537. valid,
  6538. expectedType
  6539. };
  6540. }
  6541. function getInvalidTypeMessage(name, value, expectedTypes) {
  6542. if (expectedTypes.length === 0) {
  6543. return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
  6544. }
  6545. let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
  6546. const expectedType = expectedTypes[0];
  6547. const receivedType = toRawType(value);
  6548. const expectedValue = styleValue(value, expectedType);
  6549. const receivedValue = styleValue(value, receivedType);
  6550. if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
  6551. message += ` with value ${expectedValue}`;
  6552. }
  6553. message += `, got ${receivedType} `;
  6554. if (isExplicable(receivedType)) {
  6555. message += `with value ${receivedValue}.`;
  6556. }
  6557. return message;
  6558. }
  6559. function styleValue(value, type) {
  6560. if (type === "String") {
  6561. return `"${value}"`;
  6562. } else if (type === "Number") {
  6563. return `${Number(value)}`;
  6564. } else {
  6565. return `${value}`;
  6566. }
  6567. }
  6568. function isExplicable(type) {
  6569. const explicitTypes = ["string", "number", "boolean"];
  6570. return explicitTypes.some((elem) => type.toLowerCase() === elem);
  6571. }
  6572. function isBoolean(...args) {
  6573. return args.some((elem) => elem.toLowerCase() === "boolean");
  6574. }
  6575. const isInternalKey = (key) => key === "_" || key === "__" || key === "_ctx" || key === "$stable";
  6576. const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
  6577. const normalizeSlot = (key, rawSlot, ctx) => {
  6578. if (rawSlot._n) {
  6579. return rawSlot;
  6580. }
  6581. const normalized = withCtx((...args) => {
  6582. if (currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) {
  6583. warn$1(
  6584. `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.`
  6585. );
  6586. }
  6587. return normalizeSlotValue(rawSlot(...args));
  6588. }, ctx);
  6589. normalized._c = false;
  6590. return normalized;
  6591. };
  6592. const normalizeObjectSlots = (rawSlots, slots, instance) => {
  6593. const ctx = rawSlots._ctx;
  6594. for (const key in rawSlots) {
  6595. if (isInternalKey(key)) continue;
  6596. const value = rawSlots[key];
  6597. if (isFunction(value)) {
  6598. slots[key] = normalizeSlot(key, value, ctx);
  6599. } else if (value != null) {
  6600. {
  6601. warn$1(
  6602. `Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
  6603. );
  6604. }
  6605. const normalized = normalizeSlotValue(value);
  6606. slots[key] = () => normalized;
  6607. }
  6608. }
  6609. };
  6610. const normalizeVNodeSlots = (instance, children) => {
  6611. if (!isKeepAlive(instance.vnode) && true) {
  6612. warn$1(
  6613. `Non-function value encountered for default slot. Prefer function slots for better performance.`
  6614. );
  6615. }
  6616. const normalized = normalizeSlotValue(children);
  6617. instance.slots.default = () => normalized;
  6618. };
  6619. const assignSlots = (slots, children, optimized) => {
  6620. for (const key in children) {
  6621. if (optimized || !isInternalKey(key)) {
  6622. slots[key] = children[key];
  6623. }
  6624. }
  6625. };
  6626. const initSlots = (instance, children, optimized) => {
  6627. const slots = instance.slots = createInternalObject();
  6628. if (instance.vnode.shapeFlag & 32) {
  6629. const cacheIndexes = children.__;
  6630. if (cacheIndexes) def(slots, "__", cacheIndexes, true);
  6631. const type = children._;
  6632. if (type) {
  6633. assignSlots(slots, children, optimized);
  6634. if (optimized) {
  6635. def(slots, "_", type, true);
  6636. }
  6637. } else {
  6638. normalizeObjectSlots(children, slots);
  6639. }
  6640. } else if (children) {
  6641. normalizeVNodeSlots(instance, children);
  6642. }
  6643. };
  6644. const updateSlots = (instance, children, optimized) => {
  6645. const { vnode, slots } = instance;
  6646. let needDeletionCheck = true;
  6647. let deletionComparisonTarget = EMPTY_OBJ;
  6648. if (vnode.shapeFlag & 32) {
  6649. const type = children._;
  6650. if (type) {
  6651. if (isHmrUpdating) {
  6652. assignSlots(slots, children, optimized);
  6653. trigger(instance, "set", "$slots");
  6654. } else if (optimized && type === 1) {
  6655. needDeletionCheck = false;
  6656. } else {
  6657. assignSlots(slots, children, optimized);
  6658. }
  6659. } else {
  6660. needDeletionCheck = !children.$stable;
  6661. normalizeObjectSlots(children, slots);
  6662. }
  6663. deletionComparisonTarget = children;
  6664. } else if (children) {
  6665. normalizeVNodeSlots(instance, children);
  6666. deletionComparisonTarget = { default: 1 };
  6667. }
  6668. if (needDeletionCheck) {
  6669. for (const key in slots) {
  6670. if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
  6671. delete slots[key];
  6672. }
  6673. }
  6674. }
  6675. };
  6676. let supported;
  6677. let perf;
  6678. function startMeasure(instance, type) {
  6679. if (instance.appContext.config.performance && isSupported()) {
  6680. perf.mark(`vue-${type}-${instance.uid}`);
  6681. }
  6682. {
  6683. devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
  6684. }
  6685. }
  6686. function endMeasure(instance, type) {
  6687. if (instance.appContext.config.performance && isSupported()) {
  6688. const startTag = `vue-${type}-${instance.uid}`;
  6689. const endTag = startTag + `:end`;
  6690. perf.mark(endTag);
  6691. perf.measure(
  6692. `<${formatComponentName(instance, instance.type)}> ${type}`,
  6693. startTag,
  6694. endTag
  6695. );
  6696. perf.clearMarks(startTag);
  6697. perf.clearMarks(endTag);
  6698. }
  6699. {
  6700. devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
  6701. }
  6702. }
  6703. function isSupported() {
  6704. if (supported !== void 0) {
  6705. return supported;
  6706. }
  6707. if (typeof window !== "undefined" && window.performance) {
  6708. supported = true;
  6709. perf = window.performance;
  6710. } else {
  6711. supported = false;
  6712. }
  6713. return supported;
  6714. }
  6715. const queuePostRenderEffect = queueEffectWithSuspense ;
  6716. function createRenderer(options) {
  6717. return baseCreateRenderer(options);
  6718. }
  6719. function createHydrationRenderer(options) {
  6720. return baseCreateRenderer(options, createHydrationFunctions);
  6721. }
  6722. function baseCreateRenderer(options, createHydrationFns) {
  6723. const target = getGlobalThis();
  6724. target.__VUE__ = true;
  6725. {
  6726. setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
  6727. }
  6728. const {
  6729. insert: hostInsert,
  6730. remove: hostRemove,
  6731. patchProp: hostPatchProp,
  6732. createElement: hostCreateElement,
  6733. createText: hostCreateText,
  6734. createComment: hostCreateComment,
  6735. setText: hostSetText,
  6736. setElementText: hostSetElementText,
  6737. parentNode: hostParentNode,
  6738. nextSibling: hostNextSibling,
  6739. setScopeId: hostSetScopeId = NOOP,
  6740. insertStaticContent: hostInsertStaticContent
  6741. } = options;
  6742. const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
  6743. if (n1 === n2) {
  6744. return;
  6745. }
  6746. if (n1 && !isSameVNodeType(n1, n2)) {
  6747. anchor = getNextHostNode(n1);
  6748. unmount(n1, parentComponent, parentSuspense, true);
  6749. n1 = null;
  6750. }
  6751. if (n2.patchFlag === -2) {
  6752. optimized = false;
  6753. n2.dynamicChildren = null;
  6754. }
  6755. const { type, ref, shapeFlag } = n2;
  6756. switch (type) {
  6757. case Text:
  6758. processText(n1, n2, container, anchor);
  6759. break;
  6760. case Comment:
  6761. processCommentNode(n1, n2, container, anchor);
  6762. break;
  6763. case Static:
  6764. if (n1 == null) {
  6765. mountStaticNode(n2, container, anchor, namespace);
  6766. } else {
  6767. patchStaticNode(n1, n2, container, namespace);
  6768. }
  6769. break;
  6770. case Fragment:
  6771. processFragment(
  6772. n1,
  6773. n2,
  6774. container,
  6775. anchor,
  6776. parentComponent,
  6777. parentSuspense,
  6778. namespace,
  6779. slotScopeIds,
  6780. optimized
  6781. );
  6782. break;
  6783. default:
  6784. if (shapeFlag & 1) {
  6785. processElement(
  6786. n1,
  6787. n2,
  6788. container,
  6789. anchor,
  6790. parentComponent,
  6791. parentSuspense,
  6792. namespace,
  6793. slotScopeIds,
  6794. optimized
  6795. );
  6796. } else if (shapeFlag & 6) {
  6797. processComponent(
  6798. n1,
  6799. n2,
  6800. container,
  6801. anchor,
  6802. parentComponent,
  6803. parentSuspense,
  6804. namespace,
  6805. slotScopeIds,
  6806. optimized
  6807. );
  6808. } else if (shapeFlag & 64) {
  6809. type.process(
  6810. n1,
  6811. n2,
  6812. container,
  6813. anchor,
  6814. parentComponent,
  6815. parentSuspense,
  6816. namespace,
  6817. slotScopeIds,
  6818. optimized,
  6819. internals
  6820. );
  6821. } else if (shapeFlag & 128) {
  6822. type.process(
  6823. n1,
  6824. n2,
  6825. container,
  6826. anchor,
  6827. parentComponent,
  6828. parentSuspense,
  6829. namespace,
  6830. slotScopeIds,
  6831. optimized,
  6832. internals
  6833. );
  6834. } else {
  6835. warn$1("Invalid VNode type:", type, `(${typeof type})`);
  6836. }
  6837. }
  6838. if (ref != null && parentComponent) {
  6839. setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
  6840. } else if (ref == null && n1 && n1.ref != null) {
  6841. setRef(n1.ref, null, parentSuspense, n1, true);
  6842. }
  6843. };
  6844. const processText = (n1, n2, container, anchor) => {
  6845. if (n1 == null) {
  6846. hostInsert(
  6847. n2.el = hostCreateText(n2.children),
  6848. container,
  6849. anchor
  6850. );
  6851. } else {
  6852. const el = n2.el = n1.el;
  6853. if (n2.children !== n1.children) {
  6854. hostSetText(el, n2.children);
  6855. }
  6856. }
  6857. };
  6858. const processCommentNode = (n1, n2, container, anchor) => {
  6859. if (n1 == null) {
  6860. hostInsert(
  6861. n2.el = hostCreateComment(n2.children || ""),
  6862. container,
  6863. anchor
  6864. );
  6865. } else {
  6866. n2.el = n1.el;
  6867. }
  6868. };
  6869. const mountStaticNode = (n2, container, anchor, namespace) => {
  6870. [n2.el, n2.anchor] = hostInsertStaticContent(
  6871. n2.children,
  6872. container,
  6873. anchor,
  6874. namespace,
  6875. n2.el,
  6876. n2.anchor
  6877. );
  6878. };
  6879. const patchStaticNode = (n1, n2, container, namespace) => {
  6880. if (n2.children !== n1.children) {
  6881. const anchor = hostNextSibling(n1.anchor);
  6882. removeStaticNode(n1);
  6883. [n2.el, n2.anchor] = hostInsertStaticContent(
  6884. n2.children,
  6885. container,
  6886. anchor,
  6887. namespace
  6888. );
  6889. } else {
  6890. n2.el = n1.el;
  6891. n2.anchor = n1.anchor;
  6892. }
  6893. };
  6894. const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
  6895. let next;
  6896. while (el && el !== anchor) {
  6897. next = hostNextSibling(el);
  6898. hostInsert(el, container, nextSibling);
  6899. el = next;
  6900. }
  6901. hostInsert(anchor, container, nextSibling);
  6902. };
  6903. const removeStaticNode = ({ el, anchor }) => {
  6904. let next;
  6905. while (el && el !== anchor) {
  6906. next = hostNextSibling(el);
  6907. hostRemove(el);
  6908. el = next;
  6909. }
  6910. hostRemove(anchor);
  6911. };
  6912. const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  6913. if (n2.type === "svg") {
  6914. namespace = "svg";
  6915. } else if (n2.type === "math") {
  6916. namespace = "mathml";
  6917. }
  6918. if (n1 == null) {
  6919. mountElement(
  6920. n2,
  6921. container,
  6922. anchor,
  6923. parentComponent,
  6924. parentSuspense,
  6925. namespace,
  6926. slotScopeIds,
  6927. optimized
  6928. );
  6929. } else {
  6930. patchElement(
  6931. n1,
  6932. n2,
  6933. parentComponent,
  6934. parentSuspense,
  6935. namespace,
  6936. slotScopeIds,
  6937. optimized
  6938. );
  6939. }
  6940. };
  6941. const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  6942. let el;
  6943. let vnodeHook;
  6944. const { props, shapeFlag, transition, dirs } = vnode;
  6945. el = vnode.el = hostCreateElement(
  6946. vnode.type,
  6947. namespace,
  6948. props && props.is,
  6949. props
  6950. );
  6951. if (shapeFlag & 8) {
  6952. hostSetElementText(el, vnode.children);
  6953. } else if (shapeFlag & 16) {
  6954. mountChildren(
  6955. vnode.children,
  6956. el,
  6957. null,
  6958. parentComponent,
  6959. parentSuspense,
  6960. resolveChildrenNamespace(vnode, namespace),
  6961. slotScopeIds,
  6962. optimized
  6963. );
  6964. }
  6965. if (dirs) {
  6966. invokeDirectiveHook(vnode, null, parentComponent, "created");
  6967. }
  6968. setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
  6969. if (props) {
  6970. for (const key in props) {
  6971. if (key !== "value" && !isReservedProp(key)) {
  6972. hostPatchProp(el, key, null, props[key], namespace, parentComponent);
  6973. }
  6974. }
  6975. if ("value" in props) {
  6976. hostPatchProp(el, "value", null, props.value, namespace);
  6977. }
  6978. if (vnodeHook = props.onVnodeBeforeMount) {
  6979. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  6980. }
  6981. }
  6982. {
  6983. def(el, "__vnode", vnode, true);
  6984. def(el, "__vueParentComponent", parentComponent, true);
  6985. }
  6986. if (dirs) {
  6987. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  6988. }
  6989. const needCallTransitionHooks = needTransition(parentSuspense, transition);
  6990. if (needCallTransitionHooks) {
  6991. transition.beforeEnter(el);
  6992. }
  6993. hostInsert(el, container, anchor);
  6994. if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
  6995. queuePostRenderEffect(() => {
  6996. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  6997. needCallTransitionHooks && transition.enter(el);
  6998. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  6999. }, parentSuspense);
  7000. }
  7001. };
  7002. const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
  7003. if (scopeId) {
  7004. hostSetScopeId(el, scopeId);
  7005. }
  7006. if (slotScopeIds) {
  7007. for (let i = 0; i < slotScopeIds.length; i++) {
  7008. hostSetScopeId(el, slotScopeIds[i]);
  7009. }
  7010. }
  7011. if (parentComponent) {
  7012. let subTree = parentComponent.subTree;
  7013. if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
  7014. subTree = filterSingleRoot(subTree.children) || subTree;
  7015. }
  7016. if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
  7017. const parentVNode = parentComponent.vnode;
  7018. setScopeId(
  7019. el,
  7020. parentVNode,
  7021. parentVNode.scopeId,
  7022. parentVNode.slotScopeIds,
  7023. parentComponent.parent
  7024. );
  7025. }
  7026. }
  7027. };
  7028. const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
  7029. for (let i = start; i < children.length; i++) {
  7030. const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
  7031. patch(
  7032. null,
  7033. child,
  7034. container,
  7035. anchor,
  7036. parentComponent,
  7037. parentSuspense,
  7038. namespace,
  7039. slotScopeIds,
  7040. optimized
  7041. );
  7042. }
  7043. };
  7044. const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  7045. const el = n2.el = n1.el;
  7046. {
  7047. el.__vnode = n2;
  7048. }
  7049. let { patchFlag, dynamicChildren, dirs } = n2;
  7050. patchFlag |= n1.patchFlag & 16;
  7051. const oldProps = n1.props || EMPTY_OBJ;
  7052. const newProps = n2.props || EMPTY_OBJ;
  7053. let vnodeHook;
  7054. parentComponent && toggleRecurse(parentComponent, false);
  7055. if (vnodeHook = newProps.onVnodeBeforeUpdate) {
  7056. invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  7057. }
  7058. if (dirs) {
  7059. invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
  7060. }
  7061. parentComponent && toggleRecurse(parentComponent, true);
  7062. if (isHmrUpdating) {
  7063. patchFlag = 0;
  7064. optimized = false;
  7065. dynamicChildren = null;
  7066. }
  7067. if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
  7068. hostSetElementText(el, "");
  7069. }
  7070. if (dynamicChildren) {
  7071. patchBlockChildren(
  7072. n1.dynamicChildren,
  7073. dynamicChildren,
  7074. el,
  7075. parentComponent,
  7076. parentSuspense,
  7077. resolveChildrenNamespace(n2, namespace),
  7078. slotScopeIds
  7079. );
  7080. {
  7081. traverseStaticChildren(n1, n2);
  7082. }
  7083. } else if (!optimized) {
  7084. patchChildren(
  7085. n1,
  7086. n2,
  7087. el,
  7088. null,
  7089. parentComponent,
  7090. parentSuspense,
  7091. resolveChildrenNamespace(n2, namespace),
  7092. slotScopeIds,
  7093. false
  7094. );
  7095. }
  7096. if (patchFlag > 0) {
  7097. if (patchFlag & 16) {
  7098. patchProps(el, oldProps, newProps, parentComponent, namespace);
  7099. } else {
  7100. if (patchFlag & 2) {
  7101. if (oldProps.class !== newProps.class) {
  7102. hostPatchProp(el, "class", null, newProps.class, namespace);
  7103. }
  7104. }
  7105. if (patchFlag & 4) {
  7106. hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
  7107. }
  7108. if (patchFlag & 8) {
  7109. const propsToUpdate = n2.dynamicProps;
  7110. for (let i = 0; i < propsToUpdate.length; i++) {
  7111. const key = propsToUpdate[i];
  7112. const prev = oldProps[key];
  7113. const next = newProps[key];
  7114. if (next !== prev || key === "value") {
  7115. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  7116. }
  7117. }
  7118. }
  7119. }
  7120. if (patchFlag & 1) {
  7121. if (n1.children !== n2.children) {
  7122. hostSetElementText(el, n2.children);
  7123. }
  7124. }
  7125. } else if (!optimized && dynamicChildren == null) {
  7126. patchProps(el, oldProps, newProps, parentComponent, namespace);
  7127. }
  7128. if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
  7129. queuePostRenderEffect(() => {
  7130. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  7131. dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
  7132. }, parentSuspense);
  7133. }
  7134. };
  7135. const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
  7136. for (let i = 0; i < newChildren.length; i++) {
  7137. const oldVNode = oldChildren[i];
  7138. const newVNode = newChildren[i];
  7139. const container = (
  7140. // oldVNode may be an errored async setup() component inside Suspense
  7141. // which will not have a mounted element
  7142. oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
  7143. // of the Fragment itself so it can move its children.
  7144. (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
  7145. // which also requires the correct parent container
  7146. !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
  7147. oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
  7148. // In other cases, the parent container is not actually used so we
  7149. // just pass the block element here to avoid a DOM parentNode call.
  7150. fallbackContainer
  7151. )
  7152. );
  7153. patch(
  7154. oldVNode,
  7155. newVNode,
  7156. container,
  7157. null,
  7158. parentComponent,
  7159. parentSuspense,
  7160. namespace,
  7161. slotScopeIds,
  7162. true
  7163. );
  7164. }
  7165. };
  7166. const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
  7167. if (oldProps !== newProps) {
  7168. if (oldProps !== EMPTY_OBJ) {
  7169. for (const key in oldProps) {
  7170. if (!isReservedProp(key) && !(key in newProps)) {
  7171. hostPatchProp(
  7172. el,
  7173. key,
  7174. oldProps[key],
  7175. null,
  7176. namespace,
  7177. parentComponent
  7178. );
  7179. }
  7180. }
  7181. }
  7182. for (const key in newProps) {
  7183. if (isReservedProp(key)) continue;
  7184. const next = newProps[key];
  7185. const prev = oldProps[key];
  7186. if (next !== prev && key !== "value") {
  7187. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  7188. }
  7189. }
  7190. if ("value" in newProps) {
  7191. hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
  7192. }
  7193. }
  7194. };
  7195. const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  7196. const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
  7197. const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
  7198. let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
  7199. if (
  7200. // #5523 dev root fragment may inherit directives
  7201. isHmrUpdating || patchFlag & 2048
  7202. ) {
  7203. patchFlag = 0;
  7204. optimized = false;
  7205. dynamicChildren = null;
  7206. }
  7207. if (fragmentSlotScopeIds) {
  7208. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  7209. }
  7210. if (n1 == null) {
  7211. hostInsert(fragmentStartAnchor, container, anchor);
  7212. hostInsert(fragmentEndAnchor, container, anchor);
  7213. mountChildren(
  7214. // #10007
  7215. // such fragment like `<></>` will be compiled into
  7216. // a fragment which doesn't have a children.
  7217. // In this case fallback to an empty array
  7218. n2.children || [],
  7219. container,
  7220. fragmentEndAnchor,
  7221. parentComponent,
  7222. parentSuspense,
  7223. namespace,
  7224. slotScopeIds,
  7225. optimized
  7226. );
  7227. } else {
  7228. if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
  7229. // of renderSlot() with no valid children
  7230. n1.dynamicChildren) {
  7231. patchBlockChildren(
  7232. n1.dynamicChildren,
  7233. dynamicChildren,
  7234. container,
  7235. parentComponent,
  7236. parentSuspense,
  7237. namespace,
  7238. slotScopeIds
  7239. );
  7240. {
  7241. traverseStaticChildren(n1, n2);
  7242. }
  7243. } else {
  7244. patchChildren(
  7245. n1,
  7246. n2,
  7247. container,
  7248. fragmentEndAnchor,
  7249. parentComponent,
  7250. parentSuspense,
  7251. namespace,
  7252. slotScopeIds,
  7253. optimized
  7254. );
  7255. }
  7256. }
  7257. };
  7258. const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  7259. n2.slotScopeIds = slotScopeIds;
  7260. if (n1 == null) {
  7261. if (n2.shapeFlag & 512) {
  7262. parentComponent.ctx.activate(
  7263. n2,
  7264. container,
  7265. anchor,
  7266. namespace,
  7267. optimized
  7268. );
  7269. } else {
  7270. mountComponent(
  7271. n2,
  7272. container,
  7273. anchor,
  7274. parentComponent,
  7275. parentSuspense,
  7276. namespace,
  7277. optimized
  7278. );
  7279. }
  7280. } else {
  7281. updateComponent(n1, n2, optimized);
  7282. }
  7283. };
  7284. const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
  7285. const instance = (initialVNode.component = createComponentInstance(
  7286. initialVNode,
  7287. parentComponent,
  7288. parentSuspense
  7289. ));
  7290. if (instance.type.__hmrId) {
  7291. registerHMR(instance);
  7292. }
  7293. {
  7294. pushWarningContext(initialVNode);
  7295. startMeasure(instance, `mount`);
  7296. }
  7297. if (isKeepAlive(initialVNode)) {
  7298. instance.ctx.renderer = internals;
  7299. }
  7300. {
  7301. {
  7302. startMeasure(instance, `init`);
  7303. }
  7304. setupComponent(instance, false, optimized);
  7305. {
  7306. endMeasure(instance, `init`);
  7307. }
  7308. }
  7309. if (isHmrUpdating) initialVNode.el = null;
  7310. if (instance.asyncDep) {
  7311. parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
  7312. if (!initialVNode.el) {
  7313. const placeholder = instance.subTree = createVNode(Comment);
  7314. processCommentNode(null, placeholder, container, anchor);
  7315. initialVNode.placeholder = placeholder.el;
  7316. }
  7317. } else {
  7318. setupRenderEffect(
  7319. instance,
  7320. initialVNode,
  7321. container,
  7322. anchor,
  7323. parentSuspense,
  7324. namespace,
  7325. optimized
  7326. );
  7327. }
  7328. {
  7329. popWarningContext();
  7330. endMeasure(instance, `mount`);
  7331. }
  7332. };
  7333. const updateComponent = (n1, n2, optimized) => {
  7334. const instance = n2.component = n1.component;
  7335. if (shouldUpdateComponent(n1, n2, optimized)) {
  7336. if (instance.asyncDep && !instance.asyncResolved) {
  7337. {
  7338. pushWarningContext(n2);
  7339. }
  7340. updateComponentPreRender(instance, n2, optimized);
  7341. {
  7342. popWarningContext();
  7343. }
  7344. return;
  7345. } else {
  7346. instance.next = n2;
  7347. instance.update();
  7348. }
  7349. } else {
  7350. n2.el = n1.el;
  7351. instance.vnode = n2;
  7352. }
  7353. };
  7354. const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
  7355. const componentUpdateFn = () => {
  7356. if (!instance.isMounted) {
  7357. let vnodeHook;
  7358. const { el, props } = initialVNode;
  7359. const { bm, m, parent, root, type } = instance;
  7360. const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
  7361. toggleRecurse(instance, false);
  7362. if (bm) {
  7363. invokeArrayFns(bm);
  7364. }
  7365. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
  7366. invokeVNodeHook(vnodeHook, parent, initialVNode);
  7367. }
  7368. toggleRecurse(instance, true);
  7369. if (el && hydrateNode) {
  7370. const hydrateSubTree = () => {
  7371. {
  7372. startMeasure(instance, `render`);
  7373. }
  7374. instance.subTree = renderComponentRoot(instance);
  7375. {
  7376. endMeasure(instance, `render`);
  7377. }
  7378. {
  7379. startMeasure(instance, `hydrate`);
  7380. }
  7381. hydrateNode(
  7382. el,
  7383. instance.subTree,
  7384. instance,
  7385. parentSuspense,
  7386. null
  7387. );
  7388. {
  7389. endMeasure(instance, `hydrate`);
  7390. }
  7391. };
  7392. if (isAsyncWrapperVNode && type.__asyncHydrate) {
  7393. type.__asyncHydrate(
  7394. el,
  7395. instance,
  7396. hydrateSubTree
  7397. );
  7398. } else {
  7399. hydrateSubTree();
  7400. }
  7401. } else {
  7402. if (root.ce && // @ts-expect-error _def is private
  7403. root.ce._def.shadowRoot !== false) {
  7404. root.ce._injectChildStyle(type);
  7405. }
  7406. {
  7407. startMeasure(instance, `render`);
  7408. }
  7409. const subTree = instance.subTree = renderComponentRoot(instance);
  7410. {
  7411. endMeasure(instance, `render`);
  7412. }
  7413. {
  7414. startMeasure(instance, `patch`);
  7415. }
  7416. patch(
  7417. null,
  7418. subTree,
  7419. container,
  7420. anchor,
  7421. instance,
  7422. parentSuspense,
  7423. namespace
  7424. );
  7425. {
  7426. endMeasure(instance, `patch`);
  7427. }
  7428. initialVNode.el = subTree.el;
  7429. }
  7430. if (m) {
  7431. queuePostRenderEffect(m, parentSuspense);
  7432. }
  7433. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
  7434. const scopedInitialVNode = initialVNode;
  7435. queuePostRenderEffect(
  7436. () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
  7437. parentSuspense
  7438. );
  7439. }
  7440. if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
  7441. instance.a && queuePostRenderEffect(instance.a, parentSuspense);
  7442. }
  7443. instance.isMounted = true;
  7444. {
  7445. devtoolsComponentAdded(instance);
  7446. }
  7447. initialVNode = container = anchor = null;
  7448. } else {
  7449. let { next, bu, u, parent, vnode } = instance;
  7450. {
  7451. const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
  7452. if (nonHydratedAsyncRoot) {
  7453. if (next) {
  7454. next.el = vnode.el;
  7455. updateComponentPreRender(instance, next, optimized);
  7456. }
  7457. nonHydratedAsyncRoot.asyncDep.then(() => {
  7458. if (!instance.isUnmounted) {
  7459. componentUpdateFn();
  7460. }
  7461. });
  7462. return;
  7463. }
  7464. }
  7465. let originNext = next;
  7466. let vnodeHook;
  7467. {
  7468. pushWarningContext(next || instance.vnode);
  7469. }
  7470. toggleRecurse(instance, false);
  7471. if (next) {
  7472. next.el = vnode.el;
  7473. updateComponentPreRender(instance, next, optimized);
  7474. } else {
  7475. next = vnode;
  7476. }
  7477. if (bu) {
  7478. invokeArrayFns(bu);
  7479. }
  7480. if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
  7481. invokeVNodeHook(vnodeHook, parent, next, vnode);
  7482. }
  7483. toggleRecurse(instance, true);
  7484. {
  7485. startMeasure(instance, `render`);
  7486. }
  7487. const nextTree = renderComponentRoot(instance);
  7488. {
  7489. endMeasure(instance, `render`);
  7490. }
  7491. const prevTree = instance.subTree;
  7492. instance.subTree = nextTree;
  7493. {
  7494. startMeasure(instance, `patch`);
  7495. }
  7496. patch(
  7497. prevTree,
  7498. nextTree,
  7499. // parent may have changed if it's in a teleport
  7500. hostParentNode(prevTree.el),
  7501. // anchor may have changed if it's in a fragment
  7502. getNextHostNode(prevTree),
  7503. instance,
  7504. parentSuspense,
  7505. namespace
  7506. );
  7507. {
  7508. endMeasure(instance, `patch`);
  7509. }
  7510. next.el = nextTree.el;
  7511. if (originNext === null) {
  7512. updateHOCHostEl(instance, nextTree.el);
  7513. }
  7514. if (u) {
  7515. queuePostRenderEffect(u, parentSuspense);
  7516. }
  7517. if (vnodeHook = next.props && next.props.onVnodeUpdated) {
  7518. queuePostRenderEffect(
  7519. () => invokeVNodeHook(vnodeHook, parent, next, vnode),
  7520. parentSuspense
  7521. );
  7522. }
  7523. {
  7524. devtoolsComponentUpdated(instance);
  7525. }
  7526. {
  7527. popWarningContext();
  7528. }
  7529. }
  7530. };
  7531. instance.scope.on();
  7532. const effect = instance.effect = new ReactiveEffect(componentUpdateFn);
  7533. instance.scope.off();
  7534. const update = instance.update = effect.run.bind(effect);
  7535. const job = instance.job = effect.runIfDirty.bind(effect);
  7536. job.i = instance;
  7537. job.id = instance.uid;
  7538. effect.scheduler = () => queueJob(job);
  7539. toggleRecurse(instance, true);
  7540. {
  7541. effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
  7542. effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
  7543. }
  7544. update();
  7545. };
  7546. const updateComponentPreRender = (instance, nextVNode, optimized) => {
  7547. nextVNode.component = instance;
  7548. const prevProps = instance.vnode.props;
  7549. instance.vnode = nextVNode;
  7550. instance.next = null;
  7551. updateProps(instance, nextVNode.props, prevProps, optimized);
  7552. updateSlots(instance, nextVNode.children, optimized);
  7553. pauseTracking();
  7554. flushPreFlushCbs(instance);
  7555. resetTracking();
  7556. };
  7557. const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
  7558. const c1 = n1 && n1.children;
  7559. const prevShapeFlag = n1 ? n1.shapeFlag : 0;
  7560. const c2 = n2.children;
  7561. const { patchFlag, shapeFlag } = n2;
  7562. if (patchFlag > 0) {
  7563. if (patchFlag & 128) {
  7564. patchKeyedChildren(
  7565. c1,
  7566. c2,
  7567. container,
  7568. anchor,
  7569. parentComponent,
  7570. parentSuspense,
  7571. namespace,
  7572. slotScopeIds,
  7573. optimized
  7574. );
  7575. return;
  7576. } else if (patchFlag & 256) {
  7577. patchUnkeyedChildren(
  7578. c1,
  7579. c2,
  7580. container,
  7581. anchor,
  7582. parentComponent,
  7583. parentSuspense,
  7584. namespace,
  7585. slotScopeIds,
  7586. optimized
  7587. );
  7588. return;
  7589. }
  7590. }
  7591. if (shapeFlag & 8) {
  7592. if (prevShapeFlag & 16) {
  7593. unmountChildren(c1, parentComponent, parentSuspense);
  7594. }
  7595. if (c2 !== c1) {
  7596. hostSetElementText(container, c2);
  7597. }
  7598. } else {
  7599. if (prevShapeFlag & 16) {
  7600. if (shapeFlag & 16) {
  7601. patchKeyedChildren(
  7602. c1,
  7603. c2,
  7604. container,
  7605. anchor,
  7606. parentComponent,
  7607. parentSuspense,
  7608. namespace,
  7609. slotScopeIds,
  7610. optimized
  7611. );
  7612. } else {
  7613. unmountChildren(c1, parentComponent, parentSuspense, true);
  7614. }
  7615. } else {
  7616. if (prevShapeFlag & 8) {
  7617. hostSetElementText(container, "");
  7618. }
  7619. if (shapeFlag & 16) {
  7620. mountChildren(
  7621. c2,
  7622. container,
  7623. anchor,
  7624. parentComponent,
  7625. parentSuspense,
  7626. namespace,
  7627. slotScopeIds,
  7628. optimized
  7629. );
  7630. }
  7631. }
  7632. }
  7633. };
  7634. const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  7635. c1 = c1 || EMPTY_ARR;
  7636. c2 = c2 || EMPTY_ARR;
  7637. const oldLength = c1.length;
  7638. const newLength = c2.length;
  7639. const commonLength = Math.min(oldLength, newLength);
  7640. let i;
  7641. for (i = 0; i < commonLength; i++) {
  7642. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  7643. patch(
  7644. c1[i],
  7645. nextChild,
  7646. container,
  7647. null,
  7648. parentComponent,
  7649. parentSuspense,
  7650. namespace,
  7651. slotScopeIds,
  7652. optimized
  7653. );
  7654. }
  7655. if (oldLength > newLength) {
  7656. unmountChildren(
  7657. c1,
  7658. parentComponent,
  7659. parentSuspense,
  7660. true,
  7661. false,
  7662. commonLength
  7663. );
  7664. } else {
  7665. mountChildren(
  7666. c2,
  7667. container,
  7668. anchor,
  7669. parentComponent,
  7670. parentSuspense,
  7671. namespace,
  7672. slotScopeIds,
  7673. optimized,
  7674. commonLength
  7675. );
  7676. }
  7677. };
  7678. const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  7679. let i = 0;
  7680. const l2 = c2.length;
  7681. let e1 = c1.length - 1;
  7682. let e2 = l2 - 1;
  7683. while (i <= e1 && i <= e2) {
  7684. const n1 = c1[i];
  7685. const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  7686. if (isSameVNodeType(n1, n2)) {
  7687. patch(
  7688. n1,
  7689. n2,
  7690. container,
  7691. null,
  7692. parentComponent,
  7693. parentSuspense,
  7694. namespace,
  7695. slotScopeIds,
  7696. optimized
  7697. );
  7698. } else {
  7699. break;
  7700. }
  7701. i++;
  7702. }
  7703. while (i <= e1 && i <= e2) {
  7704. const n1 = c1[e1];
  7705. const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
  7706. if (isSameVNodeType(n1, n2)) {
  7707. patch(
  7708. n1,
  7709. n2,
  7710. container,
  7711. null,
  7712. parentComponent,
  7713. parentSuspense,
  7714. namespace,
  7715. slotScopeIds,
  7716. optimized
  7717. );
  7718. } else {
  7719. break;
  7720. }
  7721. e1--;
  7722. e2--;
  7723. }
  7724. if (i > e1) {
  7725. if (i <= e2) {
  7726. const nextPos = e2 + 1;
  7727. const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
  7728. while (i <= e2) {
  7729. patch(
  7730. null,
  7731. c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
  7732. container,
  7733. anchor,
  7734. parentComponent,
  7735. parentSuspense,
  7736. namespace,
  7737. slotScopeIds,
  7738. optimized
  7739. );
  7740. i++;
  7741. }
  7742. }
  7743. } else if (i > e2) {
  7744. while (i <= e1) {
  7745. unmount(c1[i], parentComponent, parentSuspense, true);
  7746. i++;
  7747. }
  7748. } else {
  7749. const s1 = i;
  7750. const s2 = i;
  7751. const keyToNewIndexMap = /* @__PURE__ */ new Map();
  7752. for (i = s2; i <= e2; i++) {
  7753. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  7754. if (nextChild.key != null) {
  7755. if (keyToNewIndexMap.has(nextChild.key)) {
  7756. warn$1(
  7757. `Duplicate keys found during update:`,
  7758. JSON.stringify(nextChild.key),
  7759. `Make sure keys are unique.`
  7760. );
  7761. }
  7762. keyToNewIndexMap.set(nextChild.key, i);
  7763. }
  7764. }
  7765. let j;
  7766. let patched = 0;
  7767. const toBePatched = e2 - s2 + 1;
  7768. let moved = false;
  7769. let maxNewIndexSoFar = 0;
  7770. const newIndexToOldIndexMap = new Array(toBePatched);
  7771. for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0;
  7772. for (i = s1; i <= e1; i++) {
  7773. const prevChild = c1[i];
  7774. if (patched >= toBePatched) {
  7775. unmount(prevChild, parentComponent, parentSuspense, true);
  7776. continue;
  7777. }
  7778. let newIndex;
  7779. if (prevChild.key != null) {
  7780. newIndex = keyToNewIndexMap.get(prevChild.key);
  7781. } else {
  7782. for (j = s2; j <= e2; j++) {
  7783. if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
  7784. newIndex = j;
  7785. break;
  7786. }
  7787. }
  7788. }
  7789. if (newIndex === void 0) {
  7790. unmount(prevChild, parentComponent, parentSuspense, true);
  7791. } else {
  7792. newIndexToOldIndexMap[newIndex - s2] = i + 1;
  7793. if (newIndex >= maxNewIndexSoFar) {
  7794. maxNewIndexSoFar = newIndex;
  7795. } else {
  7796. moved = true;
  7797. }
  7798. patch(
  7799. prevChild,
  7800. c2[newIndex],
  7801. container,
  7802. null,
  7803. parentComponent,
  7804. parentSuspense,
  7805. namespace,
  7806. slotScopeIds,
  7807. optimized
  7808. );
  7809. patched++;
  7810. }
  7811. }
  7812. const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
  7813. j = increasingNewIndexSequence.length - 1;
  7814. for (i = toBePatched - 1; i >= 0; i--) {
  7815. const nextIndex = s2 + i;
  7816. const nextChild = c2[nextIndex];
  7817. const anchorVNode = c2[nextIndex + 1];
  7818. const anchor = nextIndex + 1 < l2 ? (
  7819. // #13559, fallback to el placeholder for unresolved async component
  7820. anchorVNode.el || anchorVNode.placeholder
  7821. ) : parentAnchor;
  7822. if (newIndexToOldIndexMap[i] === 0) {
  7823. patch(
  7824. null,
  7825. nextChild,
  7826. container,
  7827. anchor,
  7828. parentComponent,
  7829. parentSuspense,
  7830. namespace,
  7831. slotScopeIds,
  7832. optimized
  7833. );
  7834. } else if (moved) {
  7835. if (j < 0 || i !== increasingNewIndexSequence[j]) {
  7836. move(nextChild, container, anchor, 2);
  7837. } else {
  7838. j--;
  7839. }
  7840. }
  7841. }
  7842. }
  7843. };
  7844. const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
  7845. const { el, type, transition, children, shapeFlag } = vnode;
  7846. if (shapeFlag & 6) {
  7847. move(vnode.component.subTree, container, anchor, moveType);
  7848. return;
  7849. }
  7850. if (shapeFlag & 128) {
  7851. vnode.suspense.move(container, anchor, moveType);
  7852. return;
  7853. }
  7854. if (shapeFlag & 64) {
  7855. type.move(vnode, container, anchor, internals);
  7856. return;
  7857. }
  7858. if (type === Fragment) {
  7859. hostInsert(el, container, anchor);
  7860. for (let i = 0; i < children.length; i++) {
  7861. move(children[i], container, anchor, moveType);
  7862. }
  7863. hostInsert(vnode.anchor, container, anchor);
  7864. return;
  7865. }
  7866. if (type === Static) {
  7867. moveStaticNode(vnode, container, anchor);
  7868. return;
  7869. }
  7870. const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
  7871. if (needTransition2) {
  7872. if (moveType === 0) {
  7873. transition.beforeEnter(el);
  7874. hostInsert(el, container, anchor);
  7875. queuePostRenderEffect(() => transition.enter(el), parentSuspense);
  7876. } else {
  7877. const { leave, delayLeave, afterLeave } = transition;
  7878. const remove2 = () => {
  7879. if (vnode.ctx.isUnmounted) {
  7880. hostRemove(el);
  7881. } else {
  7882. hostInsert(el, container, anchor);
  7883. }
  7884. };
  7885. const performLeave = () => {
  7886. leave(el, () => {
  7887. remove2();
  7888. afterLeave && afterLeave();
  7889. });
  7890. };
  7891. if (delayLeave) {
  7892. delayLeave(el, remove2, performLeave);
  7893. } else {
  7894. performLeave();
  7895. }
  7896. }
  7897. } else {
  7898. hostInsert(el, container, anchor);
  7899. }
  7900. };
  7901. const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
  7902. const {
  7903. type,
  7904. props,
  7905. ref,
  7906. children,
  7907. dynamicChildren,
  7908. shapeFlag,
  7909. patchFlag,
  7910. dirs,
  7911. cacheIndex
  7912. } = vnode;
  7913. if (patchFlag === -2) {
  7914. optimized = false;
  7915. }
  7916. if (ref != null) {
  7917. pauseTracking();
  7918. setRef(ref, null, parentSuspense, vnode, true);
  7919. resetTracking();
  7920. }
  7921. if (cacheIndex != null) {
  7922. parentComponent.renderCache[cacheIndex] = void 0;
  7923. }
  7924. if (shapeFlag & 256) {
  7925. parentComponent.ctx.deactivate(vnode);
  7926. return;
  7927. }
  7928. const shouldInvokeDirs = shapeFlag & 1 && dirs;
  7929. const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
  7930. let vnodeHook;
  7931. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
  7932. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  7933. }
  7934. if (shapeFlag & 6) {
  7935. unmountComponent(vnode.component, parentSuspense, doRemove);
  7936. } else {
  7937. if (shapeFlag & 128) {
  7938. vnode.suspense.unmount(parentSuspense, doRemove);
  7939. return;
  7940. }
  7941. if (shouldInvokeDirs) {
  7942. invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
  7943. }
  7944. if (shapeFlag & 64) {
  7945. vnode.type.remove(
  7946. vnode,
  7947. parentComponent,
  7948. parentSuspense,
  7949. internals,
  7950. doRemove
  7951. );
  7952. } else if (dynamicChildren && // #5154
  7953. // when v-once is used inside a block, setBlockTracking(-1) marks the
  7954. // parent block with hasOnce: true
  7955. // so that it doesn't take the fast path during unmount - otherwise
  7956. // components nested in v-once are never unmounted.
  7957. !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments
  7958. (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
  7959. unmountChildren(
  7960. dynamicChildren,
  7961. parentComponent,
  7962. parentSuspense,
  7963. false,
  7964. true
  7965. );
  7966. } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
  7967. unmountChildren(children, parentComponent, parentSuspense);
  7968. }
  7969. if (doRemove) {
  7970. remove(vnode);
  7971. }
  7972. }
  7973. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
  7974. queuePostRenderEffect(() => {
  7975. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  7976. shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
  7977. }, parentSuspense);
  7978. }
  7979. };
  7980. const remove = (vnode) => {
  7981. const { type, el, anchor, transition } = vnode;
  7982. if (type === Fragment) {
  7983. if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) {
  7984. vnode.children.forEach((child) => {
  7985. if (child.type === Comment) {
  7986. hostRemove(child.el);
  7987. } else {
  7988. remove(child);
  7989. }
  7990. });
  7991. } else {
  7992. removeFragment(el, anchor);
  7993. }
  7994. return;
  7995. }
  7996. if (type === Static) {
  7997. removeStaticNode(vnode);
  7998. return;
  7999. }
  8000. const performRemove = () => {
  8001. hostRemove(el);
  8002. if (transition && !transition.persisted && transition.afterLeave) {
  8003. transition.afterLeave();
  8004. }
  8005. };
  8006. if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
  8007. const { leave, delayLeave } = transition;
  8008. const performLeave = () => leave(el, performRemove);
  8009. if (delayLeave) {
  8010. delayLeave(vnode.el, performRemove, performLeave);
  8011. } else {
  8012. performLeave();
  8013. }
  8014. } else {
  8015. performRemove();
  8016. }
  8017. };
  8018. const removeFragment = (cur, end) => {
  8019. let next;
  8020. while (cur !== end) {
  8021. next = hostNextSibling(cur);
  8022. hostRemove(cur);
  8023. cur = next;
  8024. }
  8025. hostRemove(end);
  8026. };
  8027. const unmountComponent = (instance, parentSuspense, doRemove) => {
  8028. if (instance.type.__hmrId) {
  8029. unregisterHMR(instance);
  8030. }
  8031. const {
  8032. bum,
  8033. scope,
  8034. job,
  8035. subTree,
  8036. um,
  8037. m,
  8038. a,
  8039. parent,
  8040. slots: { __: slotCacheKeys }
  8041. } = instance;
  8042. invalidateMount(m);
  8043. invalidateMount(a);
  8044. if (bum) {
  8045. invokeArrayFns(bum);
  8046. }
  8047. if (parent && isArray(slotCacheKeys)) {
  8048. slotCacheKeys.forEach((v) => {
  8049. parent.renderCache[v] = void 0;
  8050. });
  8051. }
  8052. scope.stop();
  8053. if (job) {
  8054. job.flags |= 8;
  8055. unmount(subTree, instance, parentSuspense, doRemove);
  8056. }
  8057. if (um) {
  8058. queuePostRenderEffect(um, parentSuspense);
  8059. }
  8060. queuePostRenderEffect(() => {
  8061. instance.isUnmounted = true;
  8062. }, parentSuspense);
  8063. if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
  8064. parentSuspense.deps--;
  8065. if (parentSuspense.deps === 0) {
  8066. parentSuspense.resolve();
  8067. }
  8068. }
  8069. {
  8070. devtoolsComponentRemoved(instance);
  8071. }
  8072. };
  8073. const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
  8074. for (let i = start; i < children.length; i++) {
  8075. unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
  8076. }
  8077. };
  8078. const getNextHostNode = (vnode) => {
  8079. if (vnode.shapeFlag & 6) {
  8080. return getNextHostNode(vnode.component.subTree);
  8081. }
  8082. if (vnode.shapeFlag & 128) {
  8083. return vnode.suspense.next();
  8084. }
  8085. const el = hostNextSibling(vnode.anchor || vnode.el);
  8086. const teleportEnd = el && el[TeleportEndKey];
  8087. return teleportEnd ? hostNextSibling(teleportEnd) : el;
  8088. };
  8089. let isFlushing = false;
  8090. const render = (vnode, container, namespace) => {
  8091. if (vnode == null) {
  8092. if (container._vnode) {
  8093. unmount(container._vnode, null, null, true);
  8094. }
  8095. } else {
  8096. patch(
  8097. container._vnode || null,
  8098. vnode,
  8099. container,
  8100. null,
  8101. null,
  8102. null,
  8103. namespace
  8104. );
  8105. }
  8106. container._vnode = vnode;
  8107. if (!isFlushing) {
  8108. isFlushing = true;
  8109. flushPreFlushCbs();
  8110. flushPostFlushCbs();
  8111. isFlushing = false;
  8112. }
  8113. };
  8114. const internals = {
  8115. p: patch,
  8116. um: unmount,
  8117. m: move,
  8118. r: remove,
  8119. mt: mountComponent,
  8120. mc: mountChildren,
  8121. pc: patchChildren,
  8122. pbc: patchBlockChildren,
  8123. n: getNextHostNode,
  8124. o: options
  8125. };
  8126. let hydrate;
  8127. let hydrateNode;
  8128. if (createHydrationFns) {
  8129. [hydrate, hydrateNode] = createHydrationFns(
  8130. internals
  8131. );
  8132. }
  8133. return {
  8134. render,
  8135. hydrate,
  8136. createApp: createAppAPI(render, hydrate)
  8137. };
  8138. }
  8139. function resolveChildrenNamespace({ type, props }, currentNamespace) {
  8140. return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
  8141. }
  8142. function toggleRecurse({ effect, job }, allowed) {
  8143. if (allowed) {
  8144. effect.flags |= 32;
  8145. job.flags |= 4;
  8146. } else {
  8147. effect.flags &= -33;
  8148. job.flags &= -5;
  8149. }
  8150. }
  8151. function needTransition(parentSuspense, transition) {
  8152. return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
  8153. }
  8154. function traverseStaticChildren(n1, n2, shallow = false) {
  8155. const ch1 = n1.children;
  8156. const ch2 = n2.children;
  8157. if (isArray(ch1) && isArray(ch2)) {
  8158. for (let i = 0; i < ch1.length; i++) {
  8159. const c1 = ch1[i];
  8160. let c2 = ch2[i];
  8161. if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
  8162. if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
  8163. c2 = ch2[i] = cloneIfMounted(ch2[i]);
  8164. c2.el = c1.el;
  8165. }
  8166. if (!shallow && c2.patchFlag !== -2)
  8167. traverseStaticChildren(c1, c2);
  8168. }
  8169. if (c2.type === Text) {
  8170. c2.el = c1.el;
  8171. }
  8172. if (c2.type === Comment && !c2.el) {
  8173. c2.el = c1.el;
  8174. }
  8175. {
  8176. c2.el && (c2.el.__vnode = c2);
  8177. }
  8178. }
  8179. }
  8180. }
  8181. function getSequence(arr) {
  8182. const p = arr.slice();
  8183. const result = [0];
  8184. let i, j, u, v, c;
  8185. const len = arr.length;
  8186. for (i = 0; i < len; i++) {
  8187. const arrI = arr[i];
  8188. if (arrI !== 0) {
  8189. j = result[result.length - 1];
  8190. if (arr[j] < arrI) {
  8191. p[i] = j;
  8192. result.push(i);
  8193. continue;
  8194. }
  8195. u = 0;
  8196. v = result.length - 1;
  8197. while (u < v) {
  8198. c = u + v >> 1;
  8199. if (arr[result[c]] < arrI) {
  8200. u = c + 1;
  8201. } else {
  8202. v = c;
  8203. }
  8204. }
  8205. if (arrI < arr[result[u]]) {
  8206. if (u > 0) {
  8207. p[i] = result[u - 1];
  8208. }
  8209. result[u] = i;
  8210. }
  8211. }
  8212. }
  8213. u = result.length;
  8214. v = result[u - 1];
  8215. while (u-- > 0) {
  8216. result[u] = v;
  8217. v = p[v];
  8218. }
  8219. return result;
  8220. }
  8221. function locateNonHydratedAsyncRoot(instance) {
  8222. const subComponent = instance.subTree.component;
  8223. if (subComponent) {
  8224. if (subComponent.asyncDep && !subComponent.asyncResolved) {
  8225. return subComponent;
  8226. } else {
  8227. return locateNonHydratedAsyncRoot(subComponent);
  8228. }
  8229. }
  8230. }
  8231. function invalidateMount(hooks) {
  8232. if (hooks) {
  8233. for (let i = 0; i < hooks.length; i++)
  8234. hooks[i].flags |= 8;
  8235. }
  8236. }
  8237. const ssrContextKey = Symbol.for("v-scx");
  8238. const useSSRContext = () => {
  8239. {
  8240. const ctx = inject(ssrContextKey);
  8241. if (!ctx) {
  8242. warn$1(
  8243. `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
  8244. );
  8245. }
  8246. return ctx;
  8247. }
  8248. };
  8249. function watchEffect(effect, options) {
  8250. return doWatch(effect, null, options);
  8251. }
  8252. function watchPostEffect(effect, options) {
  8253. return doWatch(
  8254. effect,
  8255. null,
  8256. extend({}, options, { flush: "post" })
  8257. );
  8258. }
  8259. function watchSyncEffect(effect, options) {
  8260. return doWatch(
  8261. effect,
  8262. null,
  8263. extend({}, options, { flush: "sync" })
  8264. );
  8265. }
  8266. function watch(source, cb, options) {
  8267. if (!isFunction(cb)) {
  8268. warn$1(
  8269. `\`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.`
  8270. );
  8271. }
  8272. return doWatch(source, cb, options);
  8273. }
  8274. function doWatch(source, cb, options = EMPTY_OBJ) {
  8275. const { immediate, deep, flush, once } = options;
  8276. if (!cb) {
  8277. if (immediate !== void 0) {
  8278. warn$1(
  8279. `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
  8280. );
  8281. }
  8282. if (deep !== void 0) {
  8283. warn$1(
  8284. `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
  8285. );
  8286. }
  8287. if (once !== void 0) {
  8288. warn$1(
  8289. `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
  8290. );
  8291. }
  8292. }
  8293. const baseWatchOptions = extend({}, options);
  8294. baseWatchOptions.onWarn = warn$1;
  8295. const runsImmediately = cb && immediate || !cb && flush !== "post";
  8296. let ssrCleanup;
  8297. if (isInSSRComponentSetup) {
  8298. if (flush === "sync") {
  8299. const ctx = useSSRContext();
  8300. ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
  8301. } else if (!runsImmediately) {
  8302. const watchStopHandle = () => {
  8303. };
  8304. watchStopHandle.stop = NOOP;
  8305. watchStopHandle.resume = NOOP;
  8306. watchStopHandle.pause = NOOP;
  8307. return watchStopHandle;
  8308. }
  8309. }
  8310. const instance = currentInstance;
  8311. baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
  8312. let isPre = false;
  8313. if (flush === "post") {
  8314. baseWatchOptions.scheduler = (job) => {
  8315. queuePostRenderEffect(job, instance && instance.suspense);
  8316. };
  8317. } else if (flush !== "sync") {
  8318. isPre = true;
  8319. baseWatchOptions.scheduler = (job, isFirstRun) => {
  8320. if (isFirstRun) {
  8321. job();
  8322. } else {
  8323. queueJob(job);
  8324. }
  8325. };
  8326. }
  8327. baseWatchOptions.augmentJob = (job) => {
  8328. if (cb) {
  8329. job.flags |= 4;
  8330. }
  8331. if (isPre) {
  8332. job.flags |= 2;
  8333. if (instance) {
  8334. job.id = instance.uid;
  8335. job.i = instance;
  8336. }
  8337. }
  8338. };
  8339. const watchHandle = watch$1(source, cb, baseWatchOptions);
  8340. if (isInSSRComponentSetup) {
  8341. if (ssrCleanup) {
  8342. ssrCleanup.push(watchHandle);
  8343. } else if (runsImmediately) {
  8344. watchHandle();
  8345. }
  8346. }
  8347. return watchHandle;
  8348. }
  8349. function instanceWatch(source, value, options) {
  8350. const publicThis = this.proxy;
  8351. const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  8352. let cb;
  8353. if (isFunction(value)) {
  8354. cb = value;
  8355. } else {
  8356. cb = value.handler;
  8357. options = value;
  8358. }
  8359. const reset = setCurrentInstance(this);
  8360. const res = doWatch(getter, cb.bind(publicThis), options);
  8361. reset();
  8362. return res;
  8363. }
  8364. function createPathGetter(ctx, path) {
  8365. const segments = path.split(".");
  8366. return () => {
  8367. let cur = ctx;
  8368. for (let i = 0; i < segments.length && cur; i++) {
  8369. cur = cur[segments[i]];
  8370. }
  8371. return cur;
  8372. };
  8373. }
  8374. function useModel(props, name, options = EMPTY_OBJ) {
  8375. const i = getCurrentInstance();
  8376. if (!i) {
  8377. warn$1(`useModel() called without active instance.`);
  8378. return ref();
  8379. }
  8380. const camelizedName = camelize(name);
  8381. if (!i.propsOptions[0][camelizedName]) {
  8382. warn$1(`useModel() called with prop "${name}" which is not declared.`);
  8383. return ref();
  8384. }
  8385. const hyphenatedName = hyphenate(name);
  8386. const modifiers = getModelModifiers(props, camelizedName);
  8387. const res = customRef((track, trigger) => {
  8388. let localValue;
  8389. let prevSetValue = EMPTY_OBJ;
  8390. let prevEmittedValue;
  8391. watchSyncEffect(() => {
  8392. const propValue = props[camelizedName];
  8393. if (hasChanged(localValue, propValue)) {
  8394. localValue = propValue;
  8395. trigger();
  8396. }
  8397. });
  8398. return {
  8399. get() {
  8400. track();
  8401. return options.get ? options.get(localValue) : localValue;
  8402. },
  8403. set(value) {
  8404. const emittedValue = options.set ? options.set(value) : value;
  8405. if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
  8406. return;
  8407. }
  8408. const rawProps = i.vnode.props;
  8409. if (!(rawProps && // check if parent has passed v-model
  8410. (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
  8411. localValue = value;
  8412. trigger();
  8413. }
  8414. i.emit(`update:${name}`, emittedValue);
  8415. if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
  8416. trigger();
  8417. }
  8418. prevSetValue = value;
  8419. prevEmittedValue = emittedValue;
  8420. }
  8421. };
  8422. });
  8423. res[Symbol.iterator] = () => {
  8424. let i2 = 0;
  8425. return {
  8426. next() {
  8427. if (i2 < 2) {
  8428. return { value: i2++ ? modifiers || EMPTY_OBJ : res, done: false };
  8429. } else {
  8430. return { done: true };
  8431. }
  8432. }
  8433. };
  8434. };
  8435. return res;
  8436. }
  8437. const getModelModifiers = (props, modelName) => {
  8438. return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];
  8439. };
  8440. function emit(instance, event, ...rawArgs) {
  8441. if (instance.isUnmounted) return;
  8442. const props = instance.vnode.props || EMPTY_OBJ;
  8443. {
  8444. const {
  8445. emitsOptions,
  8446. propsOptions: [propsOptions]
  8447. } = instance;
  8448. if (emitsOptions) {
  8449. if (!(event in emitsOptions) && true) {
  8450. if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
  8451. warn$1(
  8452. `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`
  8453. );
  8454. }
  8455. } else {
  8456. const validator = emitsOptions[event];
  8457. if (isFunction(validator)) {
  8458. const isValid = validator(...rawArgs);
  8459. if (!isValid) {
  8460. warn$1(
  8461. `Invalid event arguments: event validation failed for event "${event}".`
  8462. );
  8463. }
  8464. }
  8465. }
  8466. }
  8467. }
  8468. let args = rawArgs;
  8469. const isModelListener = event.startsWith("update:");
  8470. const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
  8471. if (modifiers) {
  8472. if (modifiers.trim) {
  8473. args = rawArgs.map((a) => isString(a) ? a.trim() : a);
  8474. }
  8475. if (modifiers.number) {
  8476. args = rawArgs.map(looseToNumber);
  8477. }
  8478. }
  8479. {
  8480. devtoolsComponentEmit(instance, event, args);
  8481. }
  8482. {
  8483. const lowerCaseEvent = event.toLowerCase();
  8484. if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
  8485. warn$1(
  8486. `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
  8487. instance,
  8488. instance.type
  8489. )} 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(
  8490. event
  8491. )}" instead of "${event}".`
  8492. );
  8493. }
  8494. }
  8495. let handlerName;
  8496. let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
  8497. props[handlerName = toHandlerKey(camelize(event))];
  8498. if (!handler && isModelListener) {
  8499. handler = props[handlerName = toHandlerKey(hyphenate(event))];
  8500. }
  8501. if (handler) {
  8502. callWithAsyncErrorHandling(
  8503. handler,
  8504. instance,
  8505. 6,
  8506. args
  8507. );
  8508. }
  8509. const onceHandler = props[handlerName + `Once`];
  8510. if (onceHandler) {
  8511. if (!instance.emitted) {
  8512. instance.emitted = {};
  8513. } else if (instance.emitted[handlerName]) {
  8514. return;
  8515. }
  8516. instance.emitted[handlerName] = true;
  8517. callWithAsyncErrorHandling(
  8518. onceHandler,
  8519. instance,
  8520. 6,
  8521. args
  8522. );
  8523. }
  8524. }
  8525. function normalizeEmitsOptions(comp, appContext, asMixin = false) {
  8526. const cache = appContext.emitsCache;
  8527. const cached = cache.get(comp);
  8528. if (cached !== void 0) {
  8529. return cached;
  8530. }
  8531. const raw = comp.emits;
  8532. let normalized = {};
  8533. let hasExtends = false;
  8534. if (!isFunction(comp)) {
  8535. const extendEmits = (raw2) => {
  8536. const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
  8537. if (normalizedFromExtend) {
  8538. hasExtends = true;
  8539. extend(normalized, normalizedFromExtend);
  8540. }
  8541. };
  8542. if (!asMixin && appContext.mixins.length) {
  8543. appContext.mixins.forEach(extendEmits);
  8544. }
  8545. if (comp.extends) {
  8546. extendEmits(comp.extends);
  8547. }
  8548. if (comp.mixins) {
  8549. comp.mixins.forEach(extendEmits);
  8550. }
  8551. }
  8552. if (!raw && !hasExtends) {
  8553. if (isObject(comp)) {
  8554. cache.set(comp, null);
  8555. }
  8556. return null;
  8557. }
  8558. if (isArray(raw)) {
  8559. raw.forEach((key) => normalized[key] = null);
  8560. } else {
  8561. extend(normalized, raw);
  8562. }
  8563. if (isObject(comp)) {
  8564. cache.set(comp, normalized);
  8565. }
  8566. return normalized;
  8567. }
  8568. function isEmitListener(options, key) {
  8569. if (!options || !isOn(key)) {
  8570. return false;
  8571. }
  8572. key = key.slice(2).replace(/Once$/, "");
  8573. return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
  8574. }
  8575. let accessedAttrs = false;
  8576. function markAttrsAccessed() {
  8577. accessedAttrs = true;
  8578. }
  8579. function renderComponentRoot(instance) {
  8580. const {
  8581. type: Component,
  8582. vnode,
  8583. proxy,
  8584. withProxy,
  8585. propsOptions: [propsOptions],
  8586. slots,
  8587. attrs,
  8588. emit,
  8589. render,
  8590. renderCache,
  8591. props,
  8592. data,
  8593. setupState,
  8594. ctx,
  8595. inheritAttrs
  8596. } = instance;
  8597. const prev = setCurrentRenderingInstance(instance);
  8598. let result;
  8599. let fallthroughAttrs;
  8600. {
  8601. accessedAttrs = false;
  8602. }
  8603. try {
  8604. if (vnode.shapeFlag & 4) {
  8605. const proxyToUse = withProxy || proxy;
  8606. const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
  8607. get(target, key, receiver) {
  8608. warn$1(
  8609. `Property '${String(
  8610. key
  8611. )}' was accessed via 'this'. Avoid using 'this' in templates.`
  8612. );
  8613. return Reflect.get(target, key, receiver);
  8614. }
  8615. }) : proxyToUse;
  8616. result = normalizeVNode(
  8617. render.call(
  8618. thisProxy,
  8619. proxyToUse,
  8620. renderCache,
  8621. true ? shallowReadonly(props) : props,
  8622. setupState,
  8623. data,
  8624. ctx
  8625. )
  8626. );
  8627. fallthroughAttrs = attrs;
  8628. } else {
  8629. const render2 = Component;
  8630. if (attrs === props) {
  8631. markAttrsAccessed();
  8632. }
  8633. result = normalizeVNode(
  8634. render2.length > 1 ? render2(
  8635. true ? shallowReadonly(props) : props,
  8636. true ? {
  8637. get attrs() {
  8638. markAttrsAccessed();
  8639. return shallowReadonly(attrs);
  8640. },
  8641. slots,
  8642. emit
  8643. } : { attrs, slots, emit }
  8644. ) : render2(
  8645. true ? shallowReadonly(props) : props,
  8646. null
  8647. )
  8648. );
  8649. fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
  8650. }
  8651. } catch (err) {
  8652. blockStack.length = 0;
  8653. handleError(err, instance, 1);
  8654. result = createVNode(Comment);
  8655. }
  8656. let root = result;
  8657. let setRoot = void 0;
  8658. if (result.patchFlag > 0 && result.patchFlag & 2048) {
  8659. [root, setRoot] = getChildRoot(result);
  8660. }
  8661. if (fallthroughAttrs && inheritAttrs !== false) {
  8662. const keys = Object.keys(fallthroughAttrs);
  8663. const { shapeFlag } = root;
  8664. if (keys.length) {
  8665. if (shapeFlag & (1 | 6)) {
  8666. if (propsOptions && keys.some(isModelListener)) {
  8667. fallthroughAttrs = filterModelListeners(
  8668. fallthroughAttrs,
  8669. propsOptions
  8670. );
  8671. }
  8672. root = cloneVNode(root, fallthroughAttrs, false, true);
  8673. } else if (!accessedAttrs && root.type !== Comment) {
  8674. const allAttrs = Object.keys(attrs);
  8675. const eventAttrs = [];
  8676. const extraAttrs = [];
  8677. for (let i = 0, l = allAttrs.length; i < l; i++) {
  8678. const key = allAttrs[i];
  8679. if (isOn(key)) {
  8680. if (!isModelListener(key)) {
  8681. eventAttrs.push(key[2].toLowerCase() + key.slice(3));
  8682. }
  8683. } else {
  8684. extraAttrs.push(key);
  8685. }
  8686. }
  8687. if (extraAttrs.length) {
  8688. warn$1(
  8689. `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`
  8690. );
  8691. }
  8692. if (eventAttrs.length) {
  8693. warn$1(
  8694. `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.`
  8695. );
  8696. }
  8697. }
  8698. }
  8699. }
  8700. if (vnode.dirs) {
  8701. if (!isElementRoot(root)) {
  8702. warn$1(
  8703. `Runtime directive used on component with non-element root node. The directives will not function as intended.`
  8704. );
  8705. }
  8706. root = cloneVNode(root, null, false, true);
  8707. root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
  8708. }
  8709. if (vnode.transition) {
  8710. if (!isElementRoot(root)) {
  8711. warn$1(
  8712. `Component inside <Transition> renders non-element root node that cannot be animated.`
  8713. );
  8714. }
  8715. setTransitionHooks(root, vnode.transition);
  8716. }
  8717. if (setRoot) {
  8718. setRoot(root);
  8719. } else {
  8720. result = root;
  8721. }
  8722. setCurrentRenderingInstance(prev);
  8723. return result;
  8724. }
  8725. const getChildRoot = (vnode) => {
  8726. const rawChildren = vnode.children;
  8727. const dynamicChildren = vnode.dynamicChildren;
  8728. const childRoot = filterSingleRoot(rawChildren, false);
  8729. if (!childRoot) {
  8730. return [vnode, void 0];
  8731. } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) {
  8732. return getChildRoot(childRoot);
  8733. }
  8734. const index = rawChildren.indexOf(childRoot);
  8735. const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
  8736. const setRoot = (updatedRoot) => {
  8737. rawChildren[index] = updatedRoot;
  8738. if (dynamicChildren) {
  8739. if (dynamicIndex > -1) {
  8740. dynamicChildren[dynamicIndex] = updatedRoot;
  8741. } else if (updatedRoot.patchFlag > 0) {
  8742. vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
  8743. }
  8744. }
  8745. };
  8746. return [normalizeVNode(childRoot), setRoot];
  8747. };
  8748. function filterSingleRoot(children, recurse = true) {
  8749. let singleRoot;
  8750. for (let i = 0; i < children.length; i++) {
  8751. const child = children[i];
  8752. if (isVNode(child)) {
  8753. if (child.type !== Comment || child.children === "v-if") {
  8754. if (singleRoot) {
  8755. return;
  8756. } else {
  8757. singleRoot = child;
  8758. if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) {
  8759. return filterSingleRoot(singleRoot.children);
  8760. }
  8761. }
  8762. }
  8763. } else {
  8764. return;
  8765. }
  8766. }
  8767. return singleRoot;
  8768. }
  8769. const getFunctionalFallthrough = (attrs) => {
  8770. let res;
  8771. for (const key in attrs) {
  8772. if (key === "class" || key === "style" || isOn(key)) {
  8773. (res || (res = {}))[key] = attrs[key];
  8774. }
  8775. }
  8776. return res;
  8777. };
  8778. const filterModelListeners = (attrs, props) => {
  8779. const res = {};
  8780. for (const key in attrs) {
  8781. if (!isModelListener(key) || !(key.slice(9) in props)) {
  8782. res[key] = attrs[key];
  8783. }
  8784. }
  8785. return res;
  8786. };
  8787. const isElementRoot = (vnode) => {
  8788. return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;
  8789. };
  8790. function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
  8791. const { props: prevProps, children: prevChildren, component } = prevVNode;
  8792. const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
  8793. const emits = component.emitsOptions;
  8794. if ((prevChildren || nextChildren) && isHmrUpdating) {
  8795. return true;
  8796. }
  8797. if (nextVNode.dirs || nextVNode.transition) {
  8798. return true;
  8799. }
  8800. if (optimized && patchFlag >= 0) {
  8801. if (patchFlag & 1024) {
  8802. return true;
  8803. }
  8804. if (patchFlag & 16) {
  8805. if (!prevProps) {
  8806. return !!nextProps;
  8807. }
  8808. return hasPropsChanged(prevProps, nextProps, emits);
  8809. } else if (patchFlag & 8) {
  8810. const dynamicProps = nextVNode.dynamicProps;
  8811. for (let i = 0; i < dynamicProps.length; i++) {
  8812. const key = dynamicProps[i];
  8813. if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
  8814. return true;
  8815. }
  8816. }
  8817. }
  8818. } else {
  8819. if (prevChildren || nextChildren) {
  8820. if (!nextChildren || !nextChildren.$stable) {
  8821. return true;
  8822. }
  8823. }
  8824. if (prevProps === nextProps) {
  8825. return false;
  8826. }
  8827. if (!prevProps) {
  8828. return !!nextProps;
  8829. }
  8830. if (!nextProps) {
  8831. return true;
  8832. }
  8833. return hasPropsChanged(prevProps, nextProps, emits);
  8834. }
  8835. return false;
  8836. }
  8837. function hasPropsChanged(prevProps, nextProps, emitsOptions) {
  8838. const nextKeys = Object.keys(nextProps);
  8839. if (nextKeys.length !== Object.keys(prevProps).length) {
  8840. return true;
  8841. }
  8842. for (let i = 0; i < nextKeys.length; i++) {
  8843. const key = nextKeys[i];
  8844. if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
  8845. return true;
  8846. }
  8847. }
  8848. return false;
  8849. }
  8850. function updateHOCHostEl({ vnode, parent }, el) {
  8851. while (parent) {
  8852. const root = parent.subTree;
  8853. if (root.suspense && root.suspense.activeBranch === vnode) {
  8854. root.el = vnode.el;
  8855. }
  8856. if (root === vnode) {
  8857. (vnode = parent.vnode).el = el;
  8858. parent = parent.parent;
  8859. } else {
  8860. break;
  8861. }
  8862. }
  8863. }
  8864. const isSuspense = (type) => type.__isSuspense;
  8865. let suspenseId = 0;
  8866. const SuspenseImpl = {
  8867. name: "Suspense",
  8868. // In order to make Suspense tree-shakable, we need to avoid importing it
  8869. // directly in the renderer. The renderer checks for the __isSuspense flag
  8870. // on a vnode's type and calls the `process` method, passing in renderer
  8871. // internals.
  8872. __isSuspense: true,
  8873. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
  8874. if (n1 == null) {
  8875. mountSuspense(
  8876. n2,
  8877. container,
  8878. anchor,
  8879. parentComponent,
  8880. parentSuspense,
  8881. namespace,
  8882. slotScopeIds,
  8883. optimized,
  8884. rendererInternals
  8885. );
  8886. } else {
  8887. if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
  8888. n2.suspense = n1.suspense;
  8889. n2.suspense.vnode = n2;
  8890. n2.el = n1.el;
  8891. return;
  8892. }
  8893. patchSuspense(
  8894. n1,
  8895. n2,
  8896. container,
  8897. anchor,
  8898. parentComponent,
  8899. namespace,
  8900. slotScopeIds,
  8901. optimized,
  8902. rendererInternals
  8903. );
  8904. }
  8905. },
  8906. hydrate: hydrateSuspense,
  8907. normalize: normalizeSuspenseChildren
  8908. };
  8909. const Suspense = SuspenseImpl ;
  8910. function triggerEvent(vnode, name) {
  8911. const eventListener = vnode.props && vnode.props[name];
  8912. if (isFunction(eventListener)) {
  8913. eventListener();
  8914. }
  8915. }
  8916. function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
  8917. const {
  8918. p: patch,
  8919. o: { createElement }
  8920. } = rendererInternals;
  8921. const hiddenContainer = createElement("div");
  8922. const suspense = vnode.suspense = createSuspenseBoundary(
  8923. vnode,
  8924. parentSuspense,
  8925. parentComponent,
  8926. container,
  8927. hiddenContainer,
  8928. anchor,
  8929. namespace,
  8930. slotScopeIds,
  8931. optimized,
  8932. rendererInternals
  8933. );
  8934. patch(
  8935. null,
  8936. suspense.pendingBranch = vnode.ssContent,
  8937. hiddenContainer,
  8938. null,
  8939. parentComponent,
  8940. suspense,
  8941. namespace,
  8942. slotScopeIds
  8943. );
  8944. if (suspense.deps > 0) {
  8945. triggerEvent(vnode, "onPending");
  8946. triggerEvent(vnode, "onFallback");
  8947. patch(
  8948. null,
  8949. vnode.ssFallback,
  8950. container,
  8951. anchor,
  8952. parentComponent,
  8953. null,
  8954. // fallback tree will not have suspense context
  8955. namespace,
  8956. slotScopeIds
  8957. );
  8958. setActiveBranch(suspense, vnode.ssFallback);
  8959. } else {
  8960. suspense.resolve(false, true);
  8961. }
  8962. }
  8963. function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
  8964. const suspense = n2.suspense = n1.suspense;
  8965. suspense.vnode = n2;
  8966. n2.el = n1.el;
  8967. const newBranch = n2.ssContent;
  8968. const newFallback = n2.ssFallback;
  8969. const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
  8970. if (pendingBranch) {
  8971. suspense.pendingBranch = newBranch;
  8972. if (isSameVNodeType(newBranch, pendingBranch)) {
  8973. patch(
  8974. pendingBranch,
  8975. newBranch,
  8976. suspense.hiddenContainer,
  8977. null,
  8978. parentComponent,
  8979. suspense,
  8980. namespace,
  8981. slotScopeIds,
  8982. optimized
  8983. );
  8984. if (suspense.deps <= 0) {
  8985. suspense.resolve();
  8986. } else if (isInFallback) {
  8987. if (!isHydrating) {
  8988. patch(
  8989. activeBranch,
  8990. newFallback,
  8991. container,
  8992. anchor,
  8993. parentComponent,
  8994. null,
  8995. // fallback tree will not have suspense context
  8996. namespace,
  8997. slotScopeIds,
  8998. optimized
  8999. );
  9000. setActiveBranch(suspense, newFallback);
  9001. }
  9002. }
  9003. } else {
  9004. suspense.pendingId = suspenseId++;
  9005. if (isHydrating) {
  9006. suspense.isHydrating = false;
  9007. suspense.activeBranch = pendingBranch;
  9008. } else {
  9009. unmount(pendingBranch, parentComponent, suspense);
  9010. }
  9011. suspense.deps = 0;
  9012. suspense.effects.length = 0;
  9013. suspense.hiddenContainer = createElement("div");
  9014. if (isInFallback) {
  9015. patch(
  9016. null,
  9017. newBranch,
  9018. suspense.hiddenContainer,
  9019. null,
  9020. parentComponent,
  9021. suspense,
  9022. namespace,
  9023. slotScopeIds,
  9024. optimized
  9025. );
  9026. if (suspense.deps <= 0) {
  9027. suspense.resolve();
  9028. } else {
  9029. patch(
  9030. activeBranch,
  9031. newFallback,
  9032. container,
  9033. anchor,
  9034. parentComponent,
  9035. null,
  9036. // fallback tree will not have suspense context
  9037. namespace,
  9038. slotScopeIds,
  9039. optimized
  9040. );
  9041. setActiveBranch(suspense, newFallback);
  9042. }
  9043. } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
  9044. patch(
  9045. activeBranch,
  9046. newBranch,
  9047. container,
  9048. anchor,
  9049. parentComponent,
  9050. suspense,
  9051. namespace,
  9052. slotScopeIds,
  9053. optimized
  9054. );
  9055. suspense.resolve(true);
  9056. } else {
  9057. patch(
  9058. null,
  9059. newBranch,
  9060. suspense.hiddenContainer,
  9061. null,
  9062. parentComponent,
  9063. suspense,
  9064. namespace,
  9065. slotScopeIds,
  9066. optimized
  9067. );
  9068. if (suspense.deps <= 0) {
  9069. suspense.resolve();
  9070. }
  9071. }
  9072. }
  9073. } else {
  9074. if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
  9075. patch(
  9076. activeBranch,
  9077. newBranch,
  9078. container,
  9079. anchor,
  9080. parentComponent,
  9081. suspense,
  9082. namespace,
  9083. slotScopeIds,
  9084. optimized
  9085. );
  9086. setActiveBranch(suspense, newBranch);
  9087. } else {
  9088. triggerEvent(n2, "onPending");
  9089. suspense.pendingBranch = newBranch;
  9090. if (newBranch.shapeFlag & 512) {
  9091. suspense.pendingId = newBranch.component.suspenseId;
  9092. } else {
  9093. suspense.pendingId = suspenseId++;
  9094. }
  9095. patch(
  9096. null,
  9097. newBranch,
  9098. suspense.hiddenContainer,
  9099. null,
  9100. parentComponent,
  9101. suspense,
  9102. namespace,
  9103. slotScopeIds,
  9104. optimized
  9105. );
  9106. if (suspense.deps <= 0) {
  9107. suspense.resolve();
  9108. } else {
  9109. const { timeout, pendingId } = suspense;
  9110. if (timeout > 0) {
  9111. setTimeout(() => {
  9112. if (suspense.pendingId === pendingId) {
  9113. suspense.fallback(newFallback);
  9114. }
  9115. }, timeout);
  9116. } else if (timeout === 0) {
  9117. suspense.fallback(newFallback);
  9118. }
  9119. }
  9120. }
  9121. }
  9122. }
  9123. let hasWarned = false;
  9124. function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
  9125. if (!hasWarned) {
  9126. hasWarned = true;
  9127. console[console.info ? "info" : "log"](
  9128. `<Suspense> is an experimental feature and its API will likely change.`
  9129. );
  9130. }
  9131. const {
  9132. p: patch,
  9133. m: move,
  9134. um: unmount,
  9135. n: next,
  9136. o: { parentNode, remove }
  9137. } = rendererInternals;
  9138. let parentSuspenseId;
  9139. const isSuspensible = isVNodeSuspensible(vnode);
  9140. if (isSuspensible) {
  9141. if (parentSuspense && parentSuspense.pendingBranch) {
  9142. parentSuspenseId = parentSuspense.pendingId;
  9143. parentSuspense.deps++;
  9144. }
  9145. }
  9146. const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0;
  9147. {
  9148. assertNumber(timeout, `Suspense timeout`);
  9149. }
  9150. const initialAnchor = anchor;
  9151. const suspense = {
  9152. vnode,
  9153. parent: parentSuspense,
  9154. parentComponent,
  9155. namespace,
  9156. container,
  9157. hiddenContainer,
  9158. deps: 0,
  9159. pendingId: suspenseId++,
  9160. timeout: typeof timeout === "number" ? timeout : -1,
  9161. activeBranch: null,
  9162. pendingBranch: null,
  9163. isInFallback: !isHydrating,
  9164. isHydrating,
  9165. isUnmounted: false,
  9166. effects: [],
  9167. resolve(resume = false, sync = false) {
  9168. {
  9169. if (!resume && !suspense.pendingBranch) {
  9170. throw new Error(
  9171. `suspense.resolve() is called without a pending branch.`
  9172. );
  9173. }
  9174. if (suspense.isUnmounted) {
  9175. throw new Error(
  9176. `suspense.resolve() is called on an already unmounted suspense boundary.`
  9177. );
  9178. }
  9179. }
  9180. const {
  9181. vnode: vnode2,
  9182. activeBranch,
  9183. pendingBranch,
  9184. pendingId,
  9185. effects,
  9186. parentComponent: parentComponent2,
  9187. container: container2
  9188. } = suspense;
  9189. let delayEnter = false;
  9190. if (suspense.isHydrating) {
  9191. suspense.isHydrating = false;
  9192. } else if (!resume) {
  9193. delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
  9194. if (delayEnter) {
  9195. activeBranch.transition.afterLeave = () => {
  9196. if (pendingId === suspense.pendingId) {
  9197. move(
  9198. pendingBranch,
  9199. container2,
  9200. anchor === initialAnchor ? next(activeBranch) : anchor,
  9201. 0
  9202. );
  9203. queuePostFlushCb(effects);
  9204. }
  9205. };
  9206. }
  9207. if (activeBranch) {
  9208. if (parentNode(activeBranch.el) === container2) {
  9209. anchor = next(activeBranch);
  9210. }
  9211. unmount(activeBranch, parentComponent2, suspense, true);
  9212. }
  9213. if (!delayEnter) {
  9214. move(pendingBranch, container2, anchor, 0);
  9215. }
  9216. }
  9217. setActiveBranch(suspense, pendingBranch);
  9218. suspense.pendingBranch = null;
  9219. suspense.isInFallback = false;
  9220. let parent = suspense.parent;
  9221. let hasUnresolvedAncestor = false;
  9222. while (parent) {
  9223. if (parent.pendingBranch) {
  9224. parent.effects.push(...effects);
  9225. hasUnresolvedAncestor = true;
  9226. break;
  9227. }
  9228. parent = parent.parent;
  9229. }
  9230. if (!hasUnresolvedAncestor && !delayEnter) {
  9231. queuePostFlushCb(effects);
  9232. }
  9233. suspense.effects = [];
  9234. if (isSuspensible) {
  9235. if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
  9236. parentSuspense.deps--;
  9237. if (parentSuspense.deps === 0 && !sync) {
  9238. parentSuspense.resolve();
  9239. }
  9240. }
  9241. }
  9242. triggerEvent(vnode2, "onResolve");
  9243. },
  9244. fallback(fallbackVNode) {
  9245. if (!suspense.pendingBranch) {
  9246. return;
  9247. }
  9248. const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
  9249. triggerEvent(vnode2, "onFallback");
  9250. const anchor2 = next(activeBranch);
  9251. const mountFallback = () => {
  9252. if (!suspense.isInFallback) {
  9253. return;
  9254. }
  9255. patch(
  9256. null,
  9257. fallbackVNode,
  9258. container2,
  9259. anchor2,
  9260. parentComponent2,
  9261. null,
  9262. // fallback tree will not have suspense context
  9263. namespace2,
  9264. slotScopeIds,
  9265. optimized
  9266. );
  9267. setActiveBranch(suspense, fallbackVNode);
  9268. };
  9269. const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
  9270. if (delayEnter) {
  9271. activeBranch.transition.afterLeave = mountFallback;
  9272. }
  9273. suspense.isInFallback = true;
  9274. unmount(
  9275. activeBranch,
  9276. parentComponent2,
  9277. null,
  9278. // no suspense so unmount hooks fire now
  9279. true
  9280. // shouldRemove
  9281. );
  9282. if (!delayEnter) {
  9283. mountFallback();
  9284. }
  9285. },
  9286. move(container2, anchor2, type) {
  9287. suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
  9288. suspense.container = container2;
  9289. },
  9290. next() {
  9291. return suspense.activeBranch && next(suspense.activeBranch);
  9292. },
  9293. registerDep(instance, setupRenderEffect, optimized2) {
  9294. const isInPendingSuspense = !!suspense.pendingBranch;
  9295. if (isInPendingSuspense) {
  9296. suspense.deps++;
  9297. }
  9298. const hydratedEl = instance.vnode.el;
  9299. instance.asyncDep.catch((err) => {
  9300. handleError(err, instance, 0);
  9301. }).then((asyncSetupResult) => {
  9302. if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
  9303. return;
  9304. }
  9305. instance.asyncResolved = true;
  9306. const { vnode: vnode2 } = instance;
  9307. {
  9308. pushWarningContext(vnode2);
  9309. }
  9310. handleSetupResult(instance, asyncSetupResult, false);
  9311. if (hydratedEl) {
  9312. vnode2.el = hydratedEl;
  9313. }
  9314. const placeholder = !hydratedEl && instance.subTree.el;
  9315. setupRenderEffect(
  9316. instance,
  9317. vnode2,
  9318. // component may have been moved before resolve.
  9319. // if this is not a hydration, instance.subTree will be the comment
  9320. // placeholder.
  9321. parentNode(hydratedEl || instance.subTree.el),
  9322. // anchor will not be used if this is hydration, so only need to
  9323. // consider the comment placeholder case.
  9324. hydratedEl ? null : next(instance.subTree),
  9325. suspense,
  9326. namespace,
  9327. optimized2
  9328. );
  9329. if (placeholder) {
  9330. remove(placeholder);
  9331. }
  9332. updateHOCHostEl(instance, vnode2.el);
  9333. {
  9334. popWarningContext();
  9335. }
  9336. if (isInPendingSuspense && --suspense.deps === 0) {
  9337. suspense.resolve();
  9338. }
  9339. });
  9340. },
  9341. unmount(parentSuspense2, doRemove) {
  9342. suspense.isUnmounted = true;
  9343. if (suspense.activeBranch) {
  9344. unmount(
  9345. suspense.activeBranch,
  9346. parentComponent,
  9347. parentSuspense2,
  9348. doRemove
  9349. );
  9350. }
  9351. if (suspense.pendingBranch) {
  9352. unmount(
  9353. suspense.pendingBranch,
  9354. parentComponent,
  9355. parentSuspense2,
  9356. doRemove
  9357. );
  9358. }
  9359. }
  9360. };
  9361. return suspense;
  9362. }
  9363. function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
  9364. const suspense = vnode.suspense = createSuspenseBoundary(
  9365. vnode,
  9366. parentSuspense,
  9367. parentComponent,
  9368. node.parentNode,
  9369. // eslint-disable-next-line no-restricted-globals
  9370. document.createElement("div"),
  9371. null,
  9372. namespace,
  9373. slotScopeIds,
  9374. optimized,
  9375. rendererInternals,
  9376. true
  9377. );
  9378. const result = hydrateNode(
  9379. node,
  9380. suspense.pendingBranch = vnode.ssContent,
  9381. parentComponent,
  9382. suspense,
  9383. slotScopeIds,
  9384. optimized
  9385. );
  9386. if (suspense.deps === 0) {
  9387. suspense.resolve(false, true);
  9388. }
  9389. return result;
  9390. }
  9391. function normalizeSuspenseChildren(vnode) {
  9392. const { shapeFlag, children } = vnode;
  9393. const isSlotChildren = shapeFlag & 32;
  9394. vnode.ssContent = normalizeSuspenseSlot(
  9395. isSlotChildren ? children.default : children
  9396. );
  9397. vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment);
  9398. }
  9399. function normalizeSuspenseSlot(s) {
  9400. let block;
  9401. if (isFunction(s)) {
  9402. const trackBlock = isBlockTreeEnabled && s._c;
  9403. if (trackBlock) {
  9404. s._d = false;
  9405. openBlock();
  9406. }
  9407. s = s();
  9408. if (trackBlock) {
  9409. s._d = true;
  9410. block = currentBlock;
  9411. closeBlock();
  9412. }
  9413. }
  9414. if (isArray(s)) {
  9415. const singleChild = filterSingleRoot(s);
  9416. if (!singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) {
  9417. warn$1(`<Suspense> slots expect a single root node.`);
  9418. }
  9419. s = singleChild;
  9420. }
  9421. s = normalizeVNode(s);
  9422. if (block && !s.dynamicChildren) {
  9423. s.dynamicChildren = block.filter((c) => c !== s);
  9424. }
  9425. return s;
  9426. }
  9427. function queueEffectWithSuspense(fn, suspense) {
  9428. if (suspense && suspense.pendingBranch) {
  9429. if (isArray(fn)) {
  9430. suspense.effects.push(...fn);
  9431. } else {
  9432. suspense.effects.push(fn);
  9433. }
  9434. } else {
  9435. queuePostFlushCb(fn);
  9436. }
  9437. }
  9438. function setActiveBranch(suspense, branch) {
  9439. suspense.activeBranch = branch;
  9440. const { vnode, parentComponent } = suspense;
  9441. let el = branch.el;
  9442. while (!el && branch.component) {
  9443. branch = branch.component.subTree;
  9444. el = branch.el;
  9445. }
  9446. vnode.el = el;
  9447. if (parentComponent && parentComponent.subTree === vnode) {
  9448. parentComponent.vnode.el = el;
  9449. updateHOCHostEl(parentComponent, el);
  9450. }
  9451. }
  9452. function isVNodeSuspensible(vnode) {
  9453. const suspensible = vnode.props && vnode.props.suspensible;
  9454. return suspensible != null && suspensible !== false;
  9455. }
  9456. const Fragment = Symbol.for("v-fgt");
  9457. const Text = Symbol.for("v-txt");
  9458. const Comment = Symbol.for("v-cmt");
  9459. const Static = Symbol.for("v-stc");
  9460. const blockStack = [];
  9461. let currentBlock = null;
  9462. function openBlock(disableTracking = false) {
  9463. blockStack.push(currentBlock = disableTracking ? null : []);
  9464. }
  9465. function closeBlock() {
  9466. blockStack.pop();
  9467. currentBlock = blockStack[blockStack.length - 1] || null;
  9468. }
  9469. let isBlockTreeEnabled = 1;
  9470. function setBlockTracking(value, inVOnce = false) {
  9471. isBlockTreeEnabled += value;
  9472. if (value < 0 && currentBlock && inVOnce) {
  9473. currentBlock.hasOnce = true;
  9474. }
  9475. }
  9476. function setupBlock(vnode) {
  9477. vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
  9478. closeBlock();
  9479. if (isBlockTreeEnabled > 0 && currentBlock) {
  9480. currentBlock.push(vnode);
  9481. }
  9482. return vnode;
  9483. }
  9484. function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
  9485. return setupBlock(
  9486. createBaseVNode(
  9487. type,
  9488. props,
  9489. children,
  9490. patchFlag,
  9491. dynamicProps,
  9492. shapeFlag,
  9493. true
  9494. )
  9495. );
  9496. }
  9497. function createBlock(type, props, children, patchFlag, dynamicProps) {
  9498. return setupBlock(
  9499. createVNode(
  9500. type,
  9501. props,
  9502. children,
  9503. patchFlag,
  9504. dynamicProps,
  9505. true
  9506. )
  9507. );
  9508. }
  9509. function isVNode(value) {
  9510. return value ? value.__v_isVNode === true : false;
  9511. }
  9512. function isSameVNodeType(n1, n2) {
  9513. if (n2.shapeFlag & 6 && n1.component) {
  9514. const dirtyInstances = hmrDirtyComponents.get(n2.type);
  9515. if (dirtyInstances && dirtyInstances.has(n1.component)) {
  9516. n1.shapeFlag &= -257;
  9517. n2.shapeFlag &= -513;
  9518. return false;
  9519. }
  9520. }
  9521. return n1.type === n2.type && n1.key === n2.key;
  9522. }
  9523. let vnodeArgsTransformer;
  9524. function transformVNodeArgs(transformer) {
  9525. vnodeArgsTransformer = transformer;
  9526. }
  9527. const createVNodeWithArgsTransform = (...args) => {
  9528. return _createVNode(
  9529. ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args
  9530. );
  9531. };
  9532. const normalizeKey = ({ key }) => key != null ? key : null;
  9533. const normalizeRef = ({
  9534. ref,
  9535. ref_key,
  9536. ref_for
  9537. }) => {
  9538. if (typeof ref === "number") {
  9539. ref = "" + ref;
  9540. }
  9541. return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
  9542. };
  9543. function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
  9544. const vnode = {
  9545. __v_isVNode: true,
  9546. __v_skip: true,
  9547. type,
  9548. props,
  9549. key: props && normalizeKey(props),
  9550. ref: props && normalizeRef(props),
  9551. scopeId: currentScopeId,
  9552. slotScopeIds: null,
  9553. children,
  9554. component: null,
  9555. suspense: null,
  9556. ssContent: null,
  9557. ssFallback: null,
  9558. dirs: null,
  9559. transition: null,
  9560. el: null,
  9561. anchor: null,
  9562. target: null,
  9563. targetStart: null,
  9564. targetAnchor: null,
  9565. staticCount: 0,
  9566. shapeFlag,
  9567. patchFlag,
  9568. dynamicProps,
  9569. dynamicChildren: null,
  9570. appContext: null,
  9571. ctx: currentRenderingInstance
  9572. };
  9573. if (needFullChildrenNormalization) {
  9574. normalizeChildren(vnode, children);
  9575. if (shapeFlag & 128) {
  9576. type.normalize(vnode);
  9577. }
  9578. } else if (children) {
  9579. vnode.shapeFlag |= isString(children) ? 8 : 16;
  9580. }
  9581. if (vnode.key !== vnode.key) {
  9582. warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
  9583. }
  9584. if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
  9585. !isBlockNode && // has current parent block
  9586. currentBlock && // presence of a patch flag indicates this node needs patching on updates.
  9587. // component nodes also should always be patched, because even if the
  9588. // component doesn't need to update, it needs to persist the instance on to
  9589. // the next vnode so that it can be properly unmounted later.
  9590. (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
  9591. // vnode should not be considered dynamic due to handler caching.
  9592. vnode.patchFlag !== 32) {
  9593. currentBlock.push(vnode);
  9594. }
  9595. return vnode;
  9596. }
  9597. const createVNode = createVNodeWithArgsTransform ;
  9598. function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
  9599. if (!type || type === NULL_DYNAMIC_COMPONENT) {
  9600. if (!type) {
  9601. warn$1(`Invalid vnode type when creating vnode: ${type}.`);
  9602. }
  9603. type = Comment;
  9604. }
  9605. if (isVNode(type)) {
  9606. const cloned = cloneVNode(
  9607. type,
  9608. props,
  9609. true
  9610. /* mergeRef: true */
  9611. );
  9612. if (children) {
  9613. normalizeChildren(cloned, children);
  9614. }
  9615. if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
  9616. if (cloned.shapeFlag & 6) {
  9617. currentBlock[currentBlock.indexOf(type)] = cloned;
  9618. } else {
  9619. currentBlock.push(cloned);
  9620. }
  9621. }
  9622. cloned.patchFlag = -2;
  9623. return cloned;
  9624. }
  9625. if (isClassComponent(type)) {
  9626. type = type.__vccOpts;
  9627. }
  9628. if (props) {
  9629. props = guardReactiveProps(props);
  9630. let { class: klass, style } = props;
  9631. if (klass && !isString(klass)) {
  9632. props.class = normalizeClass(klass);
  9633. }
  9634. if (isObject(style)) {
  9635. if (isProxy(style) && !isArray(style)) {
  9636. style = extend({}, style);
  9637. }
  9638. props.style = normalizeStyle(style);
  9639. }
  9640. }
  9641. const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
  9642. if (shapeFlag & 4 && isProxy(type)) {
  9643. type = toRaw(type);
  9644. warn$1(
  9645. `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\`.`,
  9646. `
  9647. Component that was made reactive: `,
  9648. type
  9649. );
  9650. }
  9651. return createBaseVNode(
  9652. type,
  9653. props,
  9654. children,
  9655. patchFlag,
  9656. dynamicProps,
  9657. shapeFlag,
  9658. isBlockNode,
  9659. true
  9660. );
  9661. }
  9662. function guardReactiveProps(props) {
  9663. if (!props) return null;
  9664. return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
  9665. }
  9666. function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
  9667. const { props, ref, patchFlag, children, transition } = vnode;
  9668. const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
  9669. const cloned = {
  9670. __v_isVNode: true,
  9671. __v_skip: true,
  9672. type: vnode.type,
  9673. props: mergedProps,
  9674. key: mergedProps && normalizeKey(mergedProps),
  9675. ref: extraProps && extraProps.ref ? (
  9676. // #2078 in the case of <component :is="vnode" ref="extra"/>
  9677. // if the vnode itself already has a ref, cloneVNode will need to merge
  9678. // the refs so the single vnode can be set on multiple refs
  9679. mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps)
  9680. ) : ref,
  9681. scopeId: vnode.scopeId,
  9682. slotScopeIds: vnode.slotScopeIds,
  9683. children: patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children,
  9684. target: vnode.target,
  9685. targetStart: vnode.targetStart,
  9686. targetAnchor: vnode.targetAnchor,
  9687. staticCount: vnode.staticCount,
  9688. shapeFlag: vnode.shapeFlag,
  9689. // if the vnode is cloned with extra props, we can no longer assume its
  9690. // existing patch flag to be reliable and need to add the FULL_PROPS flag.
  9691. // note: preserve flag for fragments since they use the flag for children
  9692. // fast paths only.
  9693. patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
  9694. dynamicProps: vnode.dynamicProps,
  9695. dynamicChildren: vnode.dynamicChildren,
  9696. appContext: vnode.appContext,
  9697. dirs: vnode.dirs,
  9698. transition,
  9699. // These should technically only be non-null on mounted VNodes. However,
  9700. // they *should* be copied for kept-alive vnodes. So we just always copy
  9701. // them since them being non-null during a mount doesn't affect the logic as
  9702. // they will simply be overwritten.
  9703. component: vnode.component,
  9704. suspense: vnode.suspense,
  9705. ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
  9706. ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
  9707. placeholder: vnode.placeholder,
  9708. el: vnode.el,
  9709. anchor: vnode.anchor,
  9710. ctx: vnode.ctx,
  9711. ce: vnode.ce
  9712. };
  9713. if (transition && cloneTransition) {
  9714. setTransitionHooks(
  9715. cloned,
  9716. transition.clone(cloned)
  9717. );
  9718. }
  9719. return cloned;
  9720. }
  9721. function deepCloneVNode(vnode) {
  9722. const cloned = cloneVNode(vnode);
  9723. if (isArray(vnode.children)) {
  9724. cloned.children = vnode.children.map(deepCloneVNode);
  9725. }
  9726. return cloned;
  9727. }
  9728. function createTextVNode(text = " ", flag = 0) {
  9729. return createVNode(Text, null, text, flag);
  9730. }
  9731. function createStaticVNode(content, numberOfNodes) {
  9732. const vnode = createVNode(Static, null, content);
  9733. vnode.staticCount = numberOfNodes;
  9734. return vnode;
  9735. }
  9736. function createCommentVNode(text = "", asBlock = false) {
  9737. return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
  9738. }
  9739. function normalizeVNode(child) {
  9740. if (child == null || typeof child === "boolean") {
  9741. return createVNode(Comment);
  9742. } else if (isArray(child)) {
  9743. return createVNode(
  9744. Fragment,
  9745. null,
  9746. // #3666, avoid reference pollution when reusing vnode
  9747. child.slice()
  9748. );
  9749. } else if (isVNode(child)) {
  9750. return cloneIfMounted(child);
  9751. } else {
  9752. return createVNode(Text, null, String(child));
  9753. }
  9754. }
  9755. function cloneIfMounted(child) {
  9756. return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
  9757. }
  9758. function normalizeChildren(vnode, children) {
  9759. let type = 0;
  9760. const { shapeFlag } = vnode;
  9761. if (children == null) {
  9762. children = null;
  9763. } else if (isArray(children)) {
  9764. type = 16;
  9765. } else if (typeof children === "object") {
  9766. if (shapeFlag & (1 | 64)) {
  9767. const slot = children.default;
  9768. if (slot) {
  9769. slot._c && (slot._d = false);
  9770. normalizeChildren(vnode, slot());
  9771. slot._c && (slot._d = true);
  9772. }
  9773. return;
  9774. } else {
  9775. type = 32;
  9776. const slotFlag = children._;
  9777. if (!slotFlag && !isInternalObject(children)) {
  9778. children._ctx = currentRenderingInstance;
  9779. } else if (slotFlag === 3 && currentRenderingInstance) {
  9780. if (currentRenderingInstance.slots._ === 1) {
  9781. children._ = 1;
  9782. } else {
  9783. children._ = 2;
  9784. vnode.patchFlag |= 1024;
  9785. }
  9786. }
  9787. }
  9788. } else if (isFunction(children)) {
  9789. children = { default: children, _ctx: currentRenderingInstance };
  9790. type = 32;
  9791. } else {
  9792. children = String(children);
  9793. if (shapeFlag & 64) {
  9794. type = 16;
  9795. children = [createTextVNode(children)];
  9796. } else {
  9797. type = 8;
  9798. }
  9799. }
  9800. vnode.children = children;
  9801. vnode.shapeFlag |= type;
  9802. }
  9803. function mergeProps(...args) {
  9804. const ret = {};
  9805. for (let i = 0; i < args.length; i++) {
  9806. const toMerge = args[i];
  9807. for (const key in toMerge) {
  9808. if (key === "class") {
  9809. if (ret.class !== toMerge.class) {
  9810. ret.class = normalizeClass([ret.class, toMerge.class]);
  9811. }
  9812. } else if (key === "style") {
  9813. ret.style = normalizeStyle([ret.style, toMerge.style]);
  9814. } else if (isOn(key)) {
  9815. const existing = ret[key];
  9816. const incoming = toMerge[key];
  9817. if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
  9818. ret[key] = existing ? [].concat(existing, incoming) : incoming;
  9819. }
  9820. } else if (key !== "") {
  9821. ret[key] = toMerge[key];
  9822. }
  9823. }
  9824. }
  9825. return ret;
  9826. }
  9827. function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
  9828. callWithAsyncErrorHandling(hook, instance, 7, [
  9829. vnode,
  9830. prevVNode
  9831. ]);
  9832. }
  9833. const emptyAppContext = createAppContext();
  9834. let uid = 0;
  9835. function createComponentInstance(vnode, parent, suspense) {
  9836. const type = vnode.type;
  9837. const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  9838. const instance = {
  9839. uid: uid++,
  9840. vnode,
  9841. type,
  9842. parent,
  9843. appContext,
  9844. root: null,
  9845. // to be immediately set
  9846. next: null,
  9847. subTree: null,
  9848. // will be set synchronously right after creation
  9849. effect: null,
  9850. update: null,
  9851. // will be set synchronously right after creation
  9852. job: null,
  9853. scope: new EffectScope(
  9854. true
  9855. /* detached */
  9856. ),
  9857. render: null,
  9858. proxy: null,
  9859. exposed: null,
  9860. exposeProxy: null,
  9861. withProxy: null,
  9862. provides: parent ? parent.provides : Object.create(appContext.provides),
  9863. ids: parent ? parent.ids : ["", 0, 0],
  9864. accessCache: null,
  9865. renderCache: [],
  9866. // local resolved assets
  9867. components: null,
  9868. directives: null,
  9869. // resolved props and emits options
  9870. propsOptions: normalizePropsOptions(type, appContext),
  9871. emitsOptions: normalizeEmitsOptions(type, appContext),
  9872. // emit
  9873. emit: null,
  9874. // to be set immediately
  9875. emitted: null,
  9876. // props default value
  9877. propsDefaults: EMPTY_OBJ,
  9878. // inheritAttrs
  9879. inheritAttrs: type.inheritAttrs,
  9880. // state
  9881. ctx: EMPTY_OBJ,
  9882. data: EMPTY_OBJ,
  9883. props: EMPTY_OBJ,
  9884. attrs: EMPTY_OBJ,
  9885. slots: EMPTY_OBJ,
  9886. refs: EMPTY_OBJ,
  9887. setupState: EMPTY_OBJ,
  9888. setupContext: null,
  9889. // suspense related
  9890. suspense,
  9891. suspenseId: suspense ? suspense.pendingId : 0,
  9892. asyncDep: null,
  9893. asyncResolved: false,
  9894. // lifecycle hooks
  9895. // not using enums here because it results in computed properties
  9896. isMounted: false,
  9897. isUnmounted: false,
  9898. isDeactivated: false,
  9899. bc: null,
  9900. c: null,
  9901. bm: null,
  9902. m: null,
  9903. bu: null,
  9904. u: null,
  9905. um: null,
  9906. bum: null,
  9907. da: null,
  9908. a: null,
  9909. rtg: null,
  9910. rtc: null,
  9911. ec: null,
  9912. sp: null
  9913. };
  9914. {
  9915. instance.ctx = createDevRenderContext(instance);
  9916. }
  9917. instance.root = parent ? parent.root : instance;
  9918. instance.emit = emit.bind(null, instance);
  9919. if (vnode.ce) {
  9920. vnode.ce(instance);
  9921. }
  9922. return instance;
  9923. }
  9924. let currentInstance = null;
  9925. const getCurrentInstance = () => currentInstance || currentRenderingInstance;
  9926. let internalSetCurrentInstance;
  9927. let setInSSRSetupState;
  9928. {
  9929. const g = getGlobalThis();
  9930. const registerGlobalSetter = (key, setter) => {
  9931. let setters;
  9932. if (!(setters = g[key])) setters = g[key] = [];
  9933. setters.push(setter);
  9934. return (v) => {
  9935. if (setters.length > 1) setters.forEach((set) => set(v));
  9936. else setters[0](v);
  9937. };
  9938. };
  9939. internalSetCurrentInstance = registerGlobalSetter(
  9940. `__VUE_INSTANCE_SETTERS__`,
  9941. (v) => currentInstance = v
  9942. );
  9943. setInSSRSetupState = registerGlobalSetter(
  9944. `__VUE_SSR_SETTERS__`,
  9945. (v) => isInSSRComponentSetup = v
  9946. );
  9947. }
  9948. const setCurrentInstance = (instance) => {
  9949. const prev = currentInstance;
  9950. internalSetCurrentInstance(instance);
  9951. instance.scope.on();
  9952. return () => {
  9953. instance.scope.off();
  9954. internalSetCurrentInstance(prev);
  9955. };
  9956. };
  9957. const unsetCurrentInstance = () => {
  9958. currentInstance && currentInstance.scope.off();
  9959. internalSetCurrentInstance(null);
  9960. };
  9961. const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
  9962. function validateComponentName(name, { isNativeTag }) {
  9963. if (isBuiltInTag(name) || isNativeTag(name)) {
  9964. warn$1(
  9965. "Do not use built-in or reserved HTML elements as component id: " + name
  9966. );
  9967. }
  9968. }
  9969. function isStatefulComponent(instance) {
  9970. return instance.vnode.shapeFlag & 4;
  9971. }
  9972. let isInSSRComponentSetup = false;
  9973. function setupComponent(instance, isSSR = false, optimized = false) {
  9974. isSSR && setInSSRSetupState(isSSR);
  9975. const { props, children } = instance.vnode;
  9976. const isStateful = isStatefulComponent(instance);
  9977. initProps(instance, props, isStateful, isSSR);
  9978. initSlots(instance, children, optimized || isSSR);
  9979. const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  9980. isSSR && setInSSRSetupState(false);
  9981. return setupResult;
  9982. }
  9983. function setupStatefulComponent(instance, isSSR) {
  9984. var _a;
  9985. const Component = instance.type;
  9986. {
  9987. if (Component.name) {
  9988. validateComponentName(Component.name, instance.appContext.config);
  9989. }
  9990. if (Component.components) {
  9991. const names = Object.keys(Component.components);
  9992. for (let i = 0; i < names.length; i++) {
  9993. validateComponentName(names[i], instance.appContext.config);
  9994. }
  9995. }
  9996. if (Component.directives) {
  9997. const names = Object.keys(Component.directives);
  9998. for (let i = 0; i < names.length; i++) {
  9999. validateDirectiveName(names[i]);
  10000. }
  10001. }
  10002. if (Component.compilerOptions && isRuntimeOnly()) {
  10003. warn$1(
  10004. `"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.`
  10005. );
  10006. }
  10007. }
  10008. instance.accessCache = /* @__PURE__ */ Object.create(null);
  10009. instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
  10010. {
  10011. exposePropsOnRenderContext(instance);
  10012. }
  10013. const { setup } = Component;
  10014. if (setup) {
  10015. pauseTracking();
  10016. const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
  10017. const reset = setCurrentInstance(instance);
  10018. const setupResult = callWithErrorHandling(
  10019. setup,
  10020. instance,
  10021. 0,
  10022. [
  10023. shallowReadonly(instance.props) ,
  10024. setupContext
  10025. ]
  10026. );
  10027. const isAsyncSetup = isPromise(setupResult);
  10028. resetTracking();
  10029. reset();
  10030. if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
  10031. markAsyncBoundary(instance);
  10032. }
  10033. if (isAsyncSetup) {
  10034. setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
  10035. if (isSSR) {
  10036. return setupResult.then((resolvedResult) => {
  10037. handleSetupResult(instance, resolvedResult, isSSR);
  10038. }).catch((e) => {
  10039. handleError(e, instance, 0);
  10040. });
  10041. } else {
  10042. instance.asyncDep = setupResult;
  10043. if (!instance.suspense) {
  10044. const name = (_a = Component.name) != null ? _a : "Anonymous";
  10045. warn$1(
  10046. `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.`
  10047. );
  10048. }
  10049. }
  10050. } else {
  10051. handleSetupResult(instance, setupResult, isSSR);
  10052. }
  10053. } else {
  10054. finishComponentSetup(instance, isSSR);
  10055. }
  10056. }
  10057. function handleSetupResult(instance, setupResult, isSSR) {
  10058. if (isFunction(setupResult)) {
  10059. if (instance.type.__ssrInlineRender) {
  10060. instance.ssrRender = setupResult;
  10061. } else {
  10062. instance.render = setupResult;
  10063. }
  10064. } else if (isObject(setupResult)) {
  10065. if (isVNode(setupResult)) {
  10066. warn$1(
  10067. `setup() should not return VNodes directly - return a render function instead.`
  10068. );
  10069. }
  10070. {
  10071. instance.devtoolsRawSetupState = setupResult;
  10072. }
  10073. instance.setupState = proxyRefs(setupResult);
  10074. {
  10075. exposeSetupStateOnRenderContext(instance);
  10076. }
  10077. } else if (setupResult !== void 0) {
  10078. warn$1(
  10079. `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`
  10080. );
  10081. }
  10082. finishComponentSetup(instance, isSSR);
  10083. }
  10084. let compile$1;
  10085. let installWithProxy;
  10086. function registerRuntimeCompiler(_compile) {
  10087. compile$1 = _compile;
  10088. installWithProxy = (i) => {
  10089. if (i.render._rc) {
  10090. i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
  10091. }
  10092. };
  10093. }
  10094. const isRuntimeOnly = () => !compile$1;
  10095. function finishComponentSetup(instance, isSSR, skipOptions) {
  10096. const Component = instance.type;
  10097. if (!instance.render) {
  10098. if (!isSSR && compile$1 && !Component.render) {
  10099. const template = Component.template || resolveMergedOptions(instance).template;
  10100. if (template) {
  10101. {
  10102. startMeasure(instance, `compile`);
  10103. }
  10104. const { isCustomElement, compilerOptions } = instance.appContext.config;
  10105. const { delimiters, compilerOptions: componentCompilerOptions } = Component;
  10106. const finalCompilerOptions = extend(
  10107. extend(
  10108. {
  10109. isCustomElement,
  10110. delimiters
  10111. },
  10112. compilerOptions
  10113. ),
  10114. componentCompilerOptions
  10115. );
  10116. Component.render = compile$1(template, finalCompilerOptions);
  10117. {
  10118. endMeasure(instance, `compile`);
  10119. }
  10120. }
  10121. }
  10122. instance.render = Component.render || NOOP;
  10123. if (installWithProxy) {
  10124. installWithProxy(instance);
  10125. }
  10126. }
  10127. {
  10128. const reset = setCurrentInstance(instance);
  10129. pauseTracking();
  10130. try {
  10131. applyOptions(instance);
  10132. } finally {
  10133. resetTracking();
  10134. reset();
  10135. }
  10136. }
  10137. if (!Component.render && instance.render === NOOP && !isSSR) {
  10138. if (!compile$1 && Component.template) {
  10139. warn$1(
  10140. `Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Use "vue.esm-browser.js" instead.` )
  10141. );
  10142. } else {
  10143. warn$1(`Component is missing template or render function: `, Component);
  10144. }
  10145. }
  10146. }
  10147. const attrsProxyHandlers = {
  10148. get(target, key) {
  10149. markAttrsAccessed();
  10150. track(target, "get", "");
  10151. return target[key];
  10152. },
  10153. set() {
  10154. warn$1(`setupContext.attrs is readonly.`);
  10155. return false;
  10156. },
  10157. deleteProperty() {
  10158. warn$1(`setupContext.attrs is readonly.`);
  10159. return false;
  10160. }
  10161. } ;
  10162. function getSlotsProxy(instance) {
  10163. return new Proxy(instance.slots, {
  10164. get(target, key) {
  10165. track(instance, "get", "$slots");
  10166. return target[key];
  10167. }
  10168. });
  10169. }
  10170. function createSetupContext(instance) {
  10171. const expose = (exposed) => {
  10172. {
  10173. if (instance.exposed) {
  10174. warn$1(`expose() should be called only once per setup().`);
  10175. }
  10176. if (exposed != null) {
  10177. let exposedType = typeof exposed;
  10178. if (exposedType === "object") {
  10179. if (isArray(exposed)) {
  10180. exposedType = "array";
  10181. } else if (isRef(exposed)) {
  10182. exposedType = "ref";
  10183. }
  10184. }
  10185. if (exposedType !== "object") {
  10186. warn$1(
  10187. `expose() should be passed a plain object, received ${exposedType}.`
  10188. );
  10189. }
  10190. }
  10191. }
  10192. instance.exposed = exposed || {};
  10193. };
  10194. {
  10195. let attrsProxy;
  10196. let slotsProxy;
  10197. return Object.freeze({
  10198. get attrs() {
  10199. return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));
  10200. },
  10201. get slots() {
  10202. return slotsProxy || (slotsProxy = getSlotsProxy(instance));
  10203. },
  10204. get emit() {
  10205. return (event, ...args) => instance.emit(event, ...args);
  10206. },
  10207. expose
  10208. });
  10209. }
  10210. }
  10211. function getComponentPublicInstance(instance) {
  10212. if (instance.exposed) {
  10213. return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
  10214. get(target, key) {
  10215. if (key in target) {
  10216. return target[key];
  10217. } else if (key in publicPropertiesMap) {
  10218. return publicPropertiesMap[key](instance);
  10219. }
  10220. },
  10221. has(target, key) {
  10222. return key in target || key in publicPropertiesMap;
  10223. }
  10224. }));
  10225. } else {
  10226. return instance.proxy;
  10227. }
  10228. }
  10229. const classifyRE = /(?:^|[-_])(\w)/g;
  10230. const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
  10231. function getComponentName(Component, includeInferred = true) {
  10232. return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
  10233. }
  10234. function formatComponentName(instance, Component, isRoot = false) {
  10235. let name = getComponentName(Component);
  10236. if (!name && Component.__file) {
  10237. const match = Component.__file.match(/([^/\\]+)\.\w+$/);
  10238. if (match) {
  10239. name = match[1];
  10240. }
  10241. }
  10242. if (!name && instance && instance.parent) {
  10243. const inferFromRegistry = (registry) => {
  10244. for (const key in registry) {
  10245. if (registry[key] === Component) {
  10246. return key;
  10247. }
  10248. }
  10249. };
  10250. name = inferFromRegistry(
  10251. instance.components || instance.parent.type.components
  10252. ) || inferFromRegistry(instance.appContext.components);
  10253. }
  10254. return name ? classify(name) : isRoot ? `App` : `Anonymous`;
  10255. }
  10256. function isClassComponent(value) {
  10257. return isFunction(value) && "__vccOpts" in value;
  10258. }
  10259. const computed = (getterOrOptions, debugOptions) => {
  10260. const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
  10261. {
  10262. const i = getCurrentInstance();
  10263. if (i && i.appContext.config.warnRecursiveComputed) {
  10264. c._warnRecursive = true;
  10265. }
  10266. }
  10267. return c;
  10268. };
  10269. function h(type, propsOrChildren, children) {
  10270. const l = arguments.length;
  10271. if (l === 2) {
  10272. if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
  10273. if (isVNode(propsOrChildren)) {
  10274. return createVNode(type, null, [propsOrChildren]);
  10275. }
  10276. return createVNode(type, propsOrChildren);
  10277. } else {
  10278. return createVNode(type, null, propsOrChildren);
  10279. }
  10280. } else {
  10281. if (l > 3) {
  10282. children = Array.prototype.slice.call(arguments, 2);
  10283. } else if (l === 3 && isVNode(children)) {
  10284. children = [children];
  10285. }
  10286. return createVNode(type, propsOrChildren, children);
  10287. }
  10288. }
  10289. function initCustomFormatter() {
  10290. if (typeof window === "undefined") {
  10291. return;
  10292. }
  10293. const vueStyle = { style: "color:#3ba776" };
  10294. const numberStyle = { style: "color:#1677ff" };
  10295. const stringStyle = { style: "color:#f5222d" };
  10296. const keywordStyle = { style: "color:#eb2f96" };
  10297. const formatter = {
  10298. __vue_custom_formatter: true,
  10299. header(obj) {
  10300. if (!isObject(obj)) {
  10301. return null;
  10302. }
  10303. if (obj.__isVue) {
  10304. return ["div", vueStyle, `VueInstance`];
  10305. } else if (isRef(obj)) {
  10306. pauseTracking();
  10307. const value = obj.value;
  10308. resetTracking();
  10309. return [
  10310. "div",
  10311. {},
  10312. ["span", vueStyle, genRefFlag(obj)],
  10313. "<",
  10314. formatValue(value),
  10315. `>`
  10316. ];
  10317. } else if (isReactive(obj)) {
  10318. return [
  10319. "div",
  10320. {},
  10321. ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"],
  10322. "<",
  10323. formatValue(obj),
  10324. `>${isReadonly(obj) ? ` (readonly)` : ``}`
  10325. ];
  10326. } else if (isReadonly(obj)) {
  10327. return [
  10328. "div",
  10329. {},
  10330. ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"],
  10331. "<",
  10332. formatValue(obj),
  10333. ">"
  10334. ];
  10335. }
  10336. return null;
  10337. },
  10338. hasBody(obj) {
  10339. return obj && obj.__isVue;
  10340. },
  10341. body(obj) {
  10342. if (obj && obj.__isVue) {
  10343. return [
  10344. "div",
  10345. {},
  10346. ...formatInstance(obj.$)
  10347. ];
  10348. }
  10349. }
  10350. };
  10351. function formatInstance(instance) {
  10352. const blocks = [];
  10353. if (instance.type.props && instance.props) {
  10354. blocks.push(createInstanceBlock("props", toRaw(instance.props)));
  10355. }
  10356. if (instance.setupState !== EMPTY_OBJ) {
  10357. blocks.push(createInstanceBlock("setup", instance.setupState));
  10358. }
  10359. if (instance.data !== EMPTY_OBJ) {
  10360. blocks.push(createInstanceBlock("data", toRaw(instance.data)));
  10361. }
  10362. const computed = extractKeys(instance, "computed");
  10363. if (computed) {
  10364. blocks.push(createInstanceBlock("computed", computed));
  10365. }
  10366. const injected = extractKeys(instance, "inject");
  10367. if (injected) {
  10368. blocks.push(createInstanceBlock("injected", injected));
  10369. }
  10370. blocks.push([
  10371. "div",
  10372. {},
  10373. [
  10374. "span",
  10375. {
  10376. style: keywordStyle.style + ";opacity:0.66"
  10377. },
  10378. "$ (internal): "
  10379. ],
  10380. ["object", { object: instance }]
  10381. ]);
  10382. return blocks;
  10383. }
  10384. function createInstanceBlock(type, target) {
  10385. target = extend({}, target);
  10386. if (!Object.keys(target).length) {
  10387. return ["span", {}];
  10388. }
  10389. return [
  10390. "div",
  10391. { style: "line-height:1.25em;margin-bottom:0.6em" },
  10392. [
  10393. "div",
  10394. {
  10395. style: "color:#476582"
  10396. },
  10397. type
  10398. ],
  10399. [
  10400. "div",
  10401. {
  10402. style: "padding-left:1.25em"
  10403. },
  10404. ...Object.keys(target).map((key) => {
  10405. return [
  10406. "div",
  10407. {},
  10408. ["span", keywordStyle, key + ": "],
  10409. formatValue(target[key], false)
  10410. ];
  10411. })
  10412. ]
  10413. ];
  10414. }
  10415. function formatValue(v, asRaw = true) {
  10416. if (typeof v === "number") {
  10417. return ["span", numberStyle, v];
  10418. } else if (typeof v === "string") {
  10419. return ["span", stringStyle, JSON.stringify(v)];
  10420. } else if (typeof v === "boolean") {
  10421. return ["span", keywordStyle, v];
  10422. } else if (isObject(v)) {
  10423. return ["object", { object: asRaw ? toRaw(v) : v }];
  10424. } else {
  10425. return ["span", stringStyle, String(v)];
  10426. }
  10427. }
  10428. function extractKeys(instance, type) {
  10429. const Comp = instance.type;
  10430. if (isFunction(Comp)) {
  10431. return;
  10432. }
  10433. const extracted = {};
  10434. for (const key in instance.ctx) {
  10435. if (isKeyOfType(Comp, key, type)) {
  10436. extracted[key] = instance.ctx[key];
  10437. }
  10438. }
  10439. return extracted;
  10440. }
  10441. function isKeyOfType(Comp, key, type) {
  10442. const opts = Comp[type];
  10443. if (isArray(opts) && opts.includes(key) || isObject(opts) && key in opts) {
  10444. return true;
  10445. }
  10446. if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {
  10447. return true;
  10448. }
  10449. if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) {
  10450. return true;
  10451. }
  10452. }
  10453. function genRefFlag(v) {
  10454. if (isShallow(v)) {
  10455. return `ShallowRef`;
  10456. }
  10457. if (v.effect) {
  10458. return `ComputedRef`;
  10459. }
  10460. return `Ref`;
  10461. }
  10462. if (window.devtoolsFormatters) {
  10463. window.devtoolsFormatters.push(formatter);
  10464. } else {
  10465. window.devtoolsFormatters = [formatter];
  10466. }
  10467. }
  10468. function withMemo(memo, render, cache, index) {
  10469. const cached = cache[index];
  10470. if (cached && isMemoSame(cached, memo)) {
  10471. return cached;
  10472. }
  10473. const ret = render();
  10474. ret.memo = memo.slice();
  10475. ret.cacheIndex = index;
  10476. return cache[index] = ret;
  10477. }
  10478. function isMemoSame(cached, memo) {
  10479. const prev = cached.memo;
  10480. if (prev.length != memo.length) {
  10481. return false;
  10482. }
  10483. for (let i = 0; i < prev.length; i++) {
  10484. if (hasChanged(prev[i], memo[i])) {
  10485. return false;
  10486. }
  10487. }
  10488. if (isBlockTreeEnabled > 0 && currentBlock) {
  10489. currentBlock.push(cached);
  10490. }
  10491. return true;
  10492. }
  10493. const version = "3.5.18";
  10494. const warn = warn$1 ;
  10495. const ErrorTypeStrings = ErrorTypeStrings$1 ;
  10496. const devtools = devtools$1 ;
  10497. const setDevtoolsHook = setDevtoolsHook$1 ;
  10498. const _ssrUtils = {
  10499. createComponentInstance,
  10500. setupComponent,
  10501. renderComponentRoot,
  10502. setCurrentRenderingInstance,
  10503. isVNode: isVNode,
  10504. normalizeVNode,
  10505. getComponentPublicInstance,
  10506. ensureValidVNode,
  10507. pushWarningContext,
  10508. popWarningContext
  10509. };
  10510. const ssrUtils = _ssrUtils ;
  10511. const resolveFilter = null;
  10512. const compatUtils = null;
  10513. const DeprecationTypes = null;
  10514. let policy = void 0;
  10515. const tt = typeof window !== "undefined" && window.trustedTypes;
  10516. if (tt) {
  10517. try {
  10518. policy = /* @__PURE__ */ tt.createPolicy("vue", {
  10519. createHTML: (val) => val
  10520. });
  10521. } catch (e) {
  10522. warn(`Error creating trusted types policy: ${e}`);
  10523. }
  10524. }
  10525. const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val;
  10526. const svgNS = "http://www.w3.org/2000/svg";
  10527. const mathmlNS = "http://www.w3.org/1998/Math/MathML";
  10528. const doc = typeof document !== "undefined" ? document : null;
  10529. const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
  10530. const nodeOps = {
  10531. insert: (child, parent, anchor) => {
  10532. parent.insertBefore(child, anchor || null);
  10533. },
  10534. remove: (child) => {
  10535. const parent = child.parentNode;
  10536. if (parent) {
  10537. parent.removeChild(child);
  10538. }
  10539. },
  10540. createElement: (tag, namespace, is, props) => {
  10541. const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag);
  10542. if (tag === "select" && props && props.multiple != null) {
  10543. el.setAttribute("multiple", props.multiple);
  10544. }
  10545. return el;
  10546. },
  10547. createText: (text) => doc.createTextNode(text),
  10548. createComment: (text) => doc.createComment(text),
  10549. setText: (node, text) => {
  10550. node.nodeValue = text;
  10551. },
  10552. setElementText: (el, text) => {
  10553. el.textContent = text;
  10554. },
  10555. parentNode: (node) => node.parentNode,
  10556. nextSibling: (node) => node.nextSibling,
  10557. querySelector: (selector) => doc.querySelector(selector),
  10558. setScopeId(el, id) {
  10559. el.setAttribute(id, "");
  10560. },
  10561. // __UNSAFE__
  10562. // Reason: innerHTML.
  10563. // Static content here can only come from compiled templates.
  10564. // As long as the user only uses trusted templates, this is safe.
  10565. insertStaticContent(content, parent, anchor, namespace, start, end) {
  10566. const before = anchor ? anchor.previousSibling : parent.lastChild;
  10567. if (start && (start === end || start.nextSibling)) {
  10568. while (true) {
  10569. parent.insertBefore(start.cloneNode(true), anchor);
  10570. if (start === end || !(start = start.nextSibling)) break;
  10571. }
  10572. } else {
  10573. templateContainer.innerHTML = unsafeToTrustedHTML(
  10574. namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content
  10575. );
  10576. const template = templateContainer.content;
  10577. if (namespace === "svg" || namespace === "mathml") {
  10578. const wrapper = template.firstChild;
  10579. while (wrapper.firstChild) {
  10580. template.appendChild(wrapper.firstChild);
  10581. }
  10582. template.removeChild(wrapper);
  10583. }
  10584. parent.insertBefore(template, anchor);
  10585. }
  10586. return [
  10587. // first
  10588. before ? before.nextSibling : parent.firstChild,
  10589. // last
  10590. anchor ? anchor.previousSibling : parent.lastChild
  10591. ];
  10592. }
  10593. };
  10594. const TRANSITION = "transition";
  10595. const ANIMATION = "animation";
  10596. const vtcKey = Symbol("_vtc");
  10597. const DOMTransitionPropsValidators = {
  10598. name: String,
  10599. type: String,
  10600. css: {
  10601. type: Boolean,
  10602. default: true
  10603. },
  10604. duration: [String, Number, Object],
  10605. enterFromClass: String,
  10606. enterActiveClass: String,
  10607. enterToClass: String,
  10608. appearFromClass: String,
  10609. appearActiveClass: String,
  10610. appearToClass: String,
  10611. leaveFromClass: String,
  10612. leaveActiveClass: String,
  10613. leaveToClass: String
  10614. };
  10615. const TransitionPropsValidators = /* @__PURE__ */ extend(
  10616. {},
  10617. BaseTransitionPropsValidators,
  10618. DOMTransitionPropsValidators
  10619. );
  10620. const decorate$1 = (t) => {
  10621. t.displayName = "Transition";
  10622. t.props = TransitionPropsValidators;
  10623. return t;
  10624. };
  10625. const Transition = /* @__PURE__ */ decorate$1(
  10626. (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots)
  10627. );
  10628. const callHook = (hook, args = []) => {
  10629. if (isArray(hook)) {
  10630. hook.forEach((h2) => h2(...args));
  10631. } else if (hook) {
  10632. hook(...args);
  10633. }
  10634. };
  10635. const hasExplicitCallback = (hook) => {
  10636. return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
  10637. };
  10638. function resolveTransitionProps(rawProps) {
  10639. const baseProps = {};
  10640. for (const key in rawProps) {
  10641. if (!(key in DOMTransitionPropsValidators)) {
  10642. baseProps[key] = rawProps[key];
  10643. }
  10644. }
  10645. if (rawProps.css === false) {
  10646. return baseProps;
  10647. }
  10648. const {
  10649. name = "v",
  10650. type,
  10651. duration,
  10652. enterFromClass = `${name}-enter-from`,
  10653. enterActiveClass = `${name}-enter-active`,
  10654. enterToClass = `${name}-enter-to`,
  10655. appearFromClass = enterFromClass,
  10656. appearActiveClass = enterActiveClass,
  10657. appearToClass = enterToClass,
  10658. leaveFromClass = `${name}-leave-from`,
  10659. leaveActiveClass = `${name}-leave-active`,
  10660. leaveToClass = `${name}-leave-to`
  10661. } = rawProps;
  10662. const durations = normalizeDuration(duration);
  10663. const enterDuration = durations && durations[0];
  10664. const leaveDuration = durations && durations[1];
  10665. const {
  10666. onBeforeEnter,
  10667. onEnter,
  10668. onEnterCancelled,
  10669. onLeave,
  10670. onLeaveCancelled,
  10671. onBeforeAppear = onBeforeEnter,
  10672. onAppear = onEnter,
  10673. onAppearCancelled = onEnterCancelled
  10674. } = baseProps;
  10675. const finishEnter = (el, isAppear, done, isCancelled) => {
  10676. el._enterCancelled = isCancelled;
  10677. removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
  10678. removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
  10679. done && done();
  10680. };
  10681. const finishLeave = (el, done) => {
  10682. el._isLeaving = false;
  10683. removeTransitionClass(el, leaveFromClass);
  10684. removeTransitionClass(el, leaveToClass);
  10685. removeTransitionClass(el, leaveActiveClass);
  10686. done && done();
  10687. };
  10688. const makeEnterHook = (isAppear) => {
  10689. return (el, done) => {
  10690. const hook = isAppear ? onAppear : onEnter;
  10691. const resolve = () => finishEnter(el, isAppear, done);
  10692. callHook(hook, [el, resolve]);
  10693. nextFrame(() => {
  10694. removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
  10695. addTransitionClass(el, isAppear ? appearToClass : enterToClass);
  10696. if (!hasExplicitCallback(hook)) {
  10697. whenTransitionEnds(el, type, enterDuration, resolve);
  10698. }
  10699. });
  10700. };
  10701. };
  10702. return extend(baseProps, {
  10703. onBeforeEnter(el) {
  10704. callHook(onBeforeEnter, [el]);
  10705. addTransitionClass(el, enterFromClass);
  10706. addTransitionClass(el, enterActiveClass);
  10707. },
  10708. onBeforeAppear(el) {
  10709. callHook(onBeforeAppear, [el]);
  10710. addTransitionClass(el, appearFromClass);
  10711. addTransitionClass(el, appearActiveClass);
  10712. },
  10713. onEnter: makeEnterHook(false),
  10714. onAppear: makeEnterHook(true),
  10715. onLeave(el, done) {
  10716. el._isLeaving = true;
  10717. const resolve = () => finishLeave(el, done);
  10718. addTransitionClass(el, leaveFromClass);
  10719. if (!el._enterCancelled) {
  10720. forceReflow();
  10721. addTransitionClass(el, leaveActiveClass);
  10722. } else {
  10723. addTransitionClass(el, leaveActiveClass);
  10724. forceReflow();
  10725. }
  10726. nextFrame(() => {
  10727. if (!el._isLeaving) {
  10728. return;
  10729. }
  10730. removeTransitionClass(el, leaveFromClass);
  10731. addTransitionClass(el, leaveToClass);
  10732. if (!hasExplicitCallback(onLeave)) {
  10733. whenTransitionEnds(el, type, leaveDuration, resolve);
  10734. }
  10735. });
  10736. callHook(onLeave, [el, resolve]);
  10737. },
  10738. onEnterCancelled(el) {
  10739. finishEnter(el, false, void 0, true);
  10740. callHook(onEnterCancelled, [el]);
  10741. },
  10742. onAppearCancelled(el) {
  10743. finishEnter(el, true, void 0, true);
  10744. callHook(onAppearCancelled, [el]);
  10745. },
  10746. onLeaveCancelled(el) {
  10747. finishLeave(el);
  10748. callHook(onLeaveCancelled, [el]);
  10749. }
  10750. });
  10751. }
  10752. function normalizeDuration(duration) {
  10753. if (duration == null) {
  10754. return null;
  10755. } else if (isObject(duration)) {
  10756. return [NumberOf(duration.enter), NumberOf(duration.leave)];
  10757. } else {
  10758. const n = NumberOf(duration);
  10759. return [n, n];
  10760. }
  10761. }
  10762. function NumberOf(val) {
  10763. const res = toNumber(val);
  10764. {
  10765. assertNumber(res, "<transition> explicit duration");
  10766. }
  10767. return res;
  10768. }
  10769. function addTransitionClass(el, cls) {
  10770. cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
  10771. (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
  10772. }
  10773. function removeTransitionClass(el, cls) {
  10774. cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
  10775. const _vtc = el[vtcKey];
  10776. if (_vtc) {
  10777. _vtc.delete(cls);
  10778. if (!_vtc.size) {
  10779. el[vtcKey] = void 0;
  10780. }
  10781. }
  10782. }
  10783. function nextFrame(cb) {
  10784. requestAnimationFrame(() => {
  10785. requestAnimationFrame(cb);
  10786. });
  10787. }
  10788. let endId = 0;
  10789. function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
  10790. const id = el._endId = ++endId;
  10791. const resolveIfNotStale = () => {
  10792. if (id === el._endId) {
  10793. resolve();
  10794. }
  10795. };
  10796. if (explicitTimeout != null) {
  10797. return setTimeout(resolveIfNotStale, explicitTimeout);
  10798. }
  10799. const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
  10800. if (!type) {
  10801. return resolve();
  10802. }
  10803. const endEvent = type + "end";
  10804. let ended = 0;
  10805. const end = () => {
  10806. el.removeEventListener(endEvent, onEnd);
  10807. resolveIfNotStale();
  10808. };
  10809. const onEnd = (e) => {
  10810. if (e.target === el && ++ended >= propCount) {
  10811. end();
  10812. }
  10813. };
  10814. setTimeout(() => {
  10815. if (ended < propCount) {
  10816. end();
  10817. }
  10818. }, timeout + 1);
  10819. el.addEventListener(endEvent, onEnd);
  10820. }
  10821. function getTransitionInfo(el, expectedType) {
  10822. const styles = window.getComputedStyle(el);
  10823. const getStyleProperties = (key) => (styles[key] || "").split(", ");
  10824. const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
  10825. const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
  10826. const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  10827. const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
  10828. const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
  10829. const animationTimeout = getTimeout(animationDelays, animationDurations);
  10830. let type = null;
  10831. let timeout = 0;
  10832. let propCount = 0;
  10833. if (expectedType === TRANSITION) {
  10834. if (transitionTimeout > 0) {
  10835. type = TRANSITION;
  10836. timeout = transitionTimeout;
  10837. propCount = transitionDurations.length;
  10838. }
  10839. } else if (expectedType === ANIMATION) {
  10840. if (animationTimeout > 0) {
  10841. type = ANIMATION;
  10842. timeout = animationTimeout;
  10843. propCount = animationDurations.length;
  10844. }
  10845. } else {
  10846. timeout = Math.max(transitionTimeout, animationTimeout);
  10847. type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
  10848. propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
  10849. }
  10850. const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
  10851. getStyleProperties(`${TRANSITION}Property`).toString()
  10852. );
  10853. return {
  10854. type,
  10855. timeout,
  10856. propCount,
  10857. hasTransform
  10858. };
  10859. }
  10860. function getTimeout(delays, durations) {
  10861. while (delays.length < durations.length) {
  10862. delays = delays.concat(delays);
  10863. }
  10864. return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
  10865. }
  10866. function toMs(s) {
  10867. if (s === "auto") return 0;
  10868. return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
  10869. }
  10870. function forceReflow() {
  10871. return document.body.offsetHeight;
  10872. }
  10873. function patchClass(el, value, isSVG) {
  10874. const transitionClasses = el[vtcKey];
  10875. if (transitionClasses) {
  10876. value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
  10877. }
  10878. if (value == null) {
  10879. el.removeAttribute("class");
  10880. } else if (isSVG) {
  10881. el.setAttribute("class", value);
  10882. } else {
  10883. el.className = value;
  10884. }
  10885. }
  10886. const vShowOriginalDisplay = Symbol("_vod");
  10887. const vShowHidden = Symbol("_vsh");
  10888. const vShow = {
  10889. beforeMount(el, { value }, { transition }) {
  10890. el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
  10891. if (transition && value) {
  10892. transition.beforeEnter(el);
  10893. } else {
  10894. setDisplay(el, value);
  10895. }
  10896. },
  10897. mounted(el, { value }, { transition }) {
  10898. if (transition && value) {
  10899. transition.enter(el);
  10900. }
  10901. },
  10902. updated(el, { value, oldValue }, { transition }) {
  10903. if (!value === !oldValue) return;
  10904. if (transition) {
  10905. if (value) {
  10906. transition.beforeEnter(el);
  10907. setDisplay(el, true);
  10908. transition.enter(el);
  10909. } else {
  10910. transition.leave(el, () => {
  10911. setDisplay(el, false);
  10912. });
  10913. }
  10914. } else {
  10915. setDisplay(el, value);
  10916. }
  10917. },
  10918. beforeUnmount(el, { value }) {
  10919. setDisplay(el, value);
  10920. }
  10921. };
  10922. {
  10923. vShow.name = "show";
  10924. }
  10925. function setDisplay(el, value) {
  10926. el.style.display = value ? el[vShowOriginalDisplay] : "none";
  10927. el[vShowHidden] = !value;
  10928. }
  10929. function initVShowForSSR() {
  10930. vShow.getSSRProps = ({ value }) => {
  10931. if (!value) {
  10932. return { style: { display: "none" } };
  10933. }
  10934. };
  10935. }
  10936. const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
  10937. function useCssVars(getter) {
  10938. const instance = getCurrentInstance();
  10939. if (!instance) {
  10940. warn(`useCssVars is called without current active component instance.`);
  10941. return;
  10942. }
  10943. const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
  10944. Array.from(
  10945. document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
  10946. ).forEach((node) => setVarsOnNode(node, vars));
  10947. };
  10948. {
  10949. instance.getCssVars = () => getter(instance.proxy);
  10950. }
  10951. const setVars = () => {
  10952. const vars = getter(instance.proxy);
  10953. if (instance.ce) {
  10954. setVarsOnNode(instance.ce, vars);
  10955. } else {
  10956. setVarsOnVNode(instance.subTree, vars);
  10957. }
  10958. updateTeleports(vars);
  10959. };
  10960. onBeforeUpdate(() => {
  10961. queuePostFlushCb(setVars);
  10962. });
  10963. onMounted(() => {
  10964. watch(setVars, NOOP, { flush: "post" });
  10965. const ob = new MutationObserver(setVars);
  10966. ob.observe(instance.subTree.el.parentNode, { childList: true });
  10967. onUnmounted(() => ob.disconnect());
  10968. });
  10969. }
  10970. function setVarsOnVNode(vnode, vars) {
  10971. if (vnode.shapeFlag & 128) {
  10972. const suspense = vnode.suspense;
  10973. vnode = suspense.activeBranch;
  10974. if (suspense.pendingBranch && !suspense.isHydrating) {
  10975. suspense.effects.push(() => {
  10976. setVarsOnVNode(suspense.activeBranch, vars);
  10977. });
  10978. }
  10979. }
  10980. while (vnode.component) {
  10981. vnode = vnode.component.subTree;
  10982. }
  10983. if (vnode.shapeFlag & 1 && vnode.el) {
  10984. setVarsOnNode(vnode.el, vars);
  10985. } else if (vnode.type === Fragment) {
  10986. vnode.children.forEach((c) => setVarsOnVNode(c, vars));
  10987. } else if (vnode.type === Static) {
  10988. let { el, anchor } = vnode;
  10989. while (el) {
  10990. setVarsOnNode(el, vars);
  10991. if (el === anchor) break;
  10992. el = el.nextSibling;
  10993. }
  10994. }
  10995. }
  10996. function setVarsOnNode(el, vars) {
  10997. if (el.nodeType === 1) {
  10998. const style = el.style;
  10999. let cssText = "";
  11000. for (const key in vars) {
  11001. const value = normalizeCssVarValue(vars[key]);
  11002. style.setProperty(`--${key}`, value);
  11003. cssText += `--${key}: ${value};`;
  11004. }
  11005. style[CSS_VAR_TEXT] = cssText;
  11006. }
  11007. }
  11008. const displayRE = /(^|;)\s*display\s*:/;
  11009. function patchStyle(el, prev, next) {
  11010. const style = el.style;
  11011. const isCssString = isString(next);
  11012. let hasControlledDisplay = false;
  11013. if (next && !isCssString) {
  11014. if (prev) {
  11015. if (!isString(prev)) {
  11016. for (const key in prev) {
  11017. if (next[key] == null) {
  11018. setStyle(style, key, "");
  11019. }
  11020. }
  11021. } else {
  11022. for (const prevStyle of prev.split(";")) {
  11023. const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
  11024. if (next[key] == null) {
  11025. setStyle(style, key, "");
  11026. }
  11027. }
  11028. }
  11029. }
  11030. for (const key in next) {
  11031. if (key === "display") {
  11032. hasControlledDisplay = true;
  11033. }
  11034. setStyle(style, key, next[key]);
  11035. }
  11036. } else {
  11037. if (isCssString) {
  11038. if (prev !== next) {
  11039. const cssVarText = style[CSS_VAR_TEXT];
  11040. if (cssVarText) {
  11041. next += ";" + cssVarText;
  11042. }
  11043. style.cssText = next;
  11044. hasControlledDisplay = displayRE.test(next);
  11045. }
  11046. } else if (prev) {
  11047. el.removeAttribute("style");
  11048. }
  11049. }
  11050. if (vShowOriginalDisplay in el) {
  11051. el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
  11052. if (el[vShowHidden]) {
  11053. style.display = "none";
  11054. }
  11055. }
  11056. }
  11057. const semicolonRE = /[^\\];\s*$/;
  11058. const importantRE = /\s*!important$/;
  11059. function setStyle(style, name, val) {
  11060. if (isArray(val)) {
  11061. val.forEach((v) => setStyle(style, name, v));
  11062. } else {
  11063. if (val == null) val = "";
  11064. {
  11065. if (semicolonRE.test(val)) {
  11066. warn(
  11067. `Unexpected semicolon at the end of '${name}' style value: '${val}'`
  11068. );
  11069. }
  11070. }
  11071. if (name.startsWith("--")) {
  11072. style.setProperty(name, val);
  11073. } else {
  11074. const prefixed = autoPrefix(style, name);
  11075. if (importantRE.test(val)) {
  11076. style.setProperty(
  11077. hyphenate(prefixed),
  11078. val.replace(importantRE, ""),
  11079. "important"
  11080. );
  11081. } else {
  11082. style[prefixed] = val;
  11083. }
  11084. }
  11085. }
  11086. }
  11087. const prefixes = ["Webkit", "Moz", "ms"];
  11088. const prefixCache = {};
  11089. function autoPrefix(style, rawName) {
  11090. const cached = prefixCache[rawName];
  11091. if (cached) {
  11092. return cached;
  11093. }
  11094. let name = camelize(rawName);
  11095. if (name !== "filter" && name in style) {
  11096. return prefixCache[rawName] = name;
  11097. }
  11098. name = capitalize(name);
  11099. for (let i = 0; i < prefixes.length; i++) {
  11100. const prefixed = prefixes[i] + name;
  11101. if (prefixed in style) {
  11102. return prefixCache[rawName] = prefixed;
  11103. }
  11104. }
  11105. return rawName;
  11106. }
  11107. const xlinkNS = "http://www.w3.org/1999/xlink";
  11108. function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
  11109. if (isSVG && key.startsWith("xlink:")) {
  11110. if (value == null) {
  11111. el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
  11112. } else {
  11113. el.setAttributeNS(xlinkNS, key, value);
  11114. }
  11115. } else {
  11116. if (value == null || isBoolean && !includeBooleanAttr(value)) {
  11117. el.removeAttribute(key);
  11118. } else {
  11119. el.setAttribute(
  11120. key,
  11121. isBoolean ? "" : isSymbol(value) ? String(value) : value
  11122. );
  11123. }
  11124. }
  11125. }
  11126. function patchDOMProp(el, key, value, parentComponent, attrName) {
  11127. if (key === "innerHTML" || key === "textContent") {
  11128. if (value != null) {
  11129. el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
  11130. }
  11131. return;
  11132. }
  11133. const tag = el.tagName;
  11134. if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
  11135. !tag.includes("-")) {
  11136. const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
  11137. const newValue = value == null ? (
  11138. // #11647: value should be set as empty string for null and undefined,
  11139. // but <input type="checkbox"> should be set as 'on'.
  11140. el.type === "checkbox" ? "on" : ""
  11141. ) : String(value);
  11142. if (oldValue !== newValue || !("_value" in el)) {
  11143. el.value = newValue;
  11144. }
  11145. if (value == null) {
  11146. el.removeAttribute(key);
  11147. }
  11148. el._value = value;
  11149. return;
  11150. }
  11151. let needRemove = false;
  11152. if (value === "" || value == null) {
  11153. const type = typeof el[key];
  11154. if (type === "boolean") {
  11155. value = includeBooleanAttr(value);
  11156. } else if (value == null && type === "string") {
  11157. value = "";
  11158. needRemove = true;
  11159. } else if (type === "number") {
  11160. value = 0;
  11161. needRemove = true;
  11162. }
  11163. }
  11164. try {
  11165. el[key] = value;
  11166. } catch (e) {
  11167. if (!needRemove) {
  11168. warn(
  11169. `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
  11170. e
  11171. );
  11172. }
  11173. }
  11174. needRemove && el.removeAttribute(attrName || key);
  11175. }
  11176. function addEventListener(el, event, handler, options) {
  11177. el.addEventListener(event, handler, options);
  11178. }
  11179. function removeEventListener(el, event, handler, options) {
  11180. el.removeEventListener(event, handler, options);
  11181. }
  11182. const veiKey = Symbol("_vei");
  11183. function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
  11184. const invokers = el[veiKey] || (el[veiKey] = {});
  11185. const existingInvoker = invokers[rawName];
  11186. if (nextValue && existingInvoker) {
  11187. existingInvoker.value = sanitizeEventValue(nextValue, rawName) ;
  11188. } else {
  11189. const [name, options] = parseName(rawName);
  11190. if (nextValue) {
  11191. const invoker = invokers[rawName] = createInvoker(
  11192. sanitizeEventValue(nextValue, rawName) ,
  11193. instance
  11194. );
  11195. addEventListener(el, name, invoker, options);
  11196. } else if (existingInvoker) {
  11197. removeEventListener(el, name, existingInvoker, options);
  11198. invokers[rawName] = void 0;
  11199. }
  11200. }
  11201. }
  11202. const optionsModifierRE = /(?:Once|Passive|Capture)$/;
  11203. function parseName(name) {
  11204. let options;
  11205. if (optionsModifierRE.test(name)) {
  11206. options = {};
  11207. let m;
  11208. while (m = name.match(optionsModifierRE)) {
  11209. name = name.slice(0, name.length - m[0].length);
  11210. options[m[0].toLowerCase()] = true;
  11211. }
  11212. }
  11213. const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
  11214. return [event, options];
  11215. }
  11216. let cachedNow = 0;
  11217. const p = /* @__PURE__ */ Promise.resolve();
  11218. const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
  11219. function createInvoker(initialValue, instance) {
  11220. const invoker = (e) => {
  11221. if (!e._vts) {
  11222. e._vts = Date.now();
  11223. } else if (e._vts <= invoker.attached) {
  11224. return;
  11225. }
  11226. callWithAsyncErrorHandling(
  11227. patchStopImmediatePropagation(e, invoker.value),
  11228. instance,
  11229. 5,
  11230. [e]
  11231. );
  11232. };
  11233. invoker.value = initialValue;
  11234. invoker.attached = getNow();
  11235. return invoker;
  11236. }
  11237. function sanitizeEventValue(value, propName) {
  11238. if (isFunction(value) || isArray(value)) {
  11239. return value;
  11240. }
  11241. warn(
  11242. `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?
  11243. Expected function or array of functions, received type ${typeof value}.`
  11244. );
  11245. return NOOP;
  11246. }
  11247. function patchStopImmediatePropagation(e, value) {
  11248. if (isArray(value)) {
  11249. const originalStop = e.stopImmediatePropagation;
  11250. e.stopImmediatePropagation = () => {
  11251. originalStop.call(e);
  11252. e._stopped = true;
  11253. };
  11254. return value.map(
  11255. (fn) => (e2) => !e2._stopped && fn && fn(e2)
  11256. );
  11257. } else {
  11258. return value;
  11259. }
  11260. }
  11261. const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
  11262. key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
  11263. const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
  11264. const isSVG = namespace === "svg";
  11265. if (key === "class") {
  11266. patchClass(el, nextValue, isSVG);
  11267. } else if (key === "style") {
  11268. patchStyle(el, prevValue, nextValue);
  11269. } else if (isOn(key)) {
  11270. if (!isModelListener(key)) {
  11271. patchEvent(el, key, prevValue, nextValue, parentComponent);
  11272. }
  11273. } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
  11274. patchDOMProp(el, key, nextValue);
  11275. if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
  11276. patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
  11277. }
  11278. } else if (
  11279. // #11081 force set props for possible async custom element
  11280. el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
  11281. ) {
  11282. patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
  11283. } else {
  11284. if (key === "true-value") {
  11285. el._trueValue = nextValue;
  11286. } else if (key === "false-value") {
  11287. el._falseValue = nextValue;
  11288. }
  11289. patchAttr(el, key, nextValue, isSVG);
  11290. }
  11291. };
  11292. function shouldSetAsProp(el, key, value, isSVG) {
  11293. if (isSVG) {
  11294. if (key === "innerHTML" || key === "textContent") {
  11295. return true;
  11296. }
  11297. if (key in el && isNativeOn(key) && isFunction(value)) {
  11298. return true;
  11299. }
  11300. return false;
  11301. }
  11302. if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
  11303. return false;
  11304. }
  11305. if (key === "form") {
  11306. return false;
  11307. }
  11308. if (key === "list" && el.tagName === "INPUT") {
  11309. return false;
  11310. }
  11311. if (key === "type" && el.tagName === "TEXTAREA") {
  11312. return false;
  11313. }
  11314. if (key === "width" || key === "height") {
  11315. const tag = el.tagName;
  11316. if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
  11317. return false;
  11318. }
  11319. }
  11320. if (isNativeOn(key) && isString(value)) {
  11321. return false;
  11322. }
  11323. return key in el;
  11324. }
  11325. const REMOVAL = {};
  11326. /*! #__NO_SIDE_EFFECTS__ */
  11327. // @__NO_SIDE_EFFECTS__
  11328. function defineCustomElement(options, extraOptions, _createApp) {
  11329. const Comp = defineComponent(options, extraOptions);
  11330. if (isPlainObject(Comp)) extend(Comp, extraOptions);
  11331. class VueCustomElement extends VueElement {
  11332. constructor(initialProps) {
  11333. super(Comp, initialProps, _createApp);
  11334. }
  11335. }
  11336. VueCustomElement.def = Comp;
  11337. return VueCustomElement;
  11338. }
  11339. /*! #__NO_SIDE_EFFECTS__ */
  11340. const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
  11341. return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
  11342. };
  11343. const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
  11344. };
  11345. class VueElement extends BaseClass {
  11346. constructor(_def, _props = {}, _createApp = createApp) {
  11347. super();
  11348. this._def = _def;
  11349. this._props = _props;
  11350. this._createApp = _createApp;
  11351. this._isVueCE = true;
  11352. /**
  11353. * @internal
  11354. */
  11355. this._instance = null;
  11356. /**
  11357. * @internal
  11358. */
  11359. this._app = null;
  11360. /**
  11361. * @internal
  11362. */
  11363. this._nonce = this._def.nonce;
  11364. this._connected = false;
  11365. this._resolved = false;
  11366. this._numberProps = null;
  11367. this._styleChildren = /* @__PURE__ */ new WeakSet();
  11368. this._ob = null;
  11369. if (this.shadowRoot && _createApp !== createApp) {
  11370. this._root = this.shadowRoot;
  11371. } else {
  11372. if (this.shadowRoot) {
  11373. warn(
  11374. `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
  11375. );
  11376. }
  11377. if (_def.shadowRoot !== false) {
  11378. this.attachShadow({ mode: "open" });
  11379. this._root = this.shadowRoot;
  11380. } else {
  11381. this._root = this;
  11382. }
  11383. }
  11384. }
  11385. connectedCallback() {
  11386. if (!this.isConnected) return;
  11387. if (!this.shadowRoot && !this._resolved) {
  11388. this._parseSlots();
  11389. }
  11390. this._connected = true;
  11391. let parent = this;
  11392. while (parent = parent && (parent.parentNode || parent.host)) {
  11393. if (parent instanceof VueElement) {
  11394. this._parent = parent;
  11395. break;
  11396. }
  11397. }
  11398. if (!this._instance) {
  11399. if (this._resolved) {
  11400. this._mount(this._def);
  11401. } else {
  11402. if (parent && parent._pendingResolve) {
  11403. this._pendingResolve = parent._pendingResolve.then(() => {
  11404. this._pendingResolve = void 0;
  11405. this._resolveDef();
  11406. });
  11407. } else {
  11408. this._resolveDef();
  11409. }
  11410. }
  11411. }
  11412. }
  11413. _setParent(parent = this._parent) {
  11414. if (parent) {
  11415. this._instance.parent = parent._instance;
  11416. this._inheritParentContext(parent);
  11417. }
  11418. }
  11419. _inheritParentContext(parent = this._parent) {
  11420. if (parent && this._app) {
  11421. Object.setPrototypeOf(
  11422. this._app._context.provides,
  11423. parent._instance.provides
  11424. );
  11425. }
  11426. }
  11427. disconnectedCallback() {
  11428. this._connected = false;
  11429. nextTick(() => {
  11430. if (!this._connected) {
  11431. if (this._ob) {
  11432. this._ob.disconnect();
  11433. this._ob = null;
  11434. }
  11435. this._app && this._app.unmount();
  11436. if (this._instance) this._instance.ce = void 0;
  11437. this._app = this._instance = null;
  11438. }
  11439. });
  11440. }
  11441. /**
  11442. * resolve inner component definition (handle possible async component)
  11443. */
  11444. _resolveDef() {
  11445. if (this._pendingResolve) {
  11446. return;
  11447. }
  11448. for (let i = 0; i < this.attributes.length; i++) {
  11449. this._setAttr(this.attributes[i].name);
  11450. }
  11451. this._ob = new MutationObserver((mutations) => {
  11452. for (const m of mutations) {
  11453. this._setAttr(m.attributeName);
  11454. }
  11455. });
  11456. this._ob.observe(this, { attributes: true });
  11457. const resolve = (def, isAsync = false) => {
  11458. this._resolved = true;
  11459. this._pendingResolve = void 0;
  11460. const { props, styles } = def;
  11461. let numberProps;
  11462. if (props && !isArray(props)) {
  11463. for (const key in props) {
  11464. const opt = props[key];
  11465. if (opt === Number || opt && opt.type === Number) {
  11466. if (key in this._props) {
  11467. this._props[key] = toNumber(this._props[key]);
  11468. }
  11469. (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
  11470. }
  11471. }
  11472. }
  11473. this._numberProps = numberProps;
  11474. this._resolveProps(def);
  11475. if (this.shadowRoot) {
  11476. this._applyStyles(styles);
  11477. } else if (styles) {
  11478. warn(
  11479. "Custom element style injection is not supported when using shadowRoot: false"
  11480. );
  11481. }
  11482. this._mount(def);
  11483. };
  11484. const asyncDef = this._def.__asyncLoader;
  11485. if (asyncDef) {
  11486. this._pendingResolve = asyncDef().then((def) => {
  11487. def.configureApp = this._def.configureApp;
  11488. resolve(this._def = def, true);
  11489. });
  11490. } else {
  11491. resolve(this._def);
  11492. }
  11493. }
  11494. _mount(def) {
  11495. if (!def.name) {
  11496. def.name = "VueElement";
  11497. }
  11498. this._app = this._createApp(def);
  11499. this._inheritParentContext();
  11500. if (def.configureApp) {
  11501. def.configureApp(this._app);
  11502. }
  11503. this._app._ceVNode = this._createVNode();
  11504. this._app.mount(this._root);
  11505. const exposed = this._instance && this._instance.exposed;
  11506. if (!exposed) return;
  11507. for (const key in exposed) {
  11508. if (!hasOwn(this, key)) {
  11509. Object.defineProperty(this, key, {
  11510. // unwrap ref to be consistent with public instance behavior
  11511. get: () => unref(exposed[key])
  11512. });
  11513. } else {
  11514. warn(`Exposed property "${key}" already exists on custom element.`);
  11515. }
  11516. }
  11517. }
  11518. _resolveProps(def) {
  11519. const { props } = def;
  11520. const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
  11521. for (const key of Object.keys(this)) {
  11522. if (key[0] !== "_" && declaredPropKeys.includes(key)) {
  11523. this._setProp(key, this[key]);
  11524. }
  11525. }
  11526. for (const key of declaredPropKeys.map(camelize)) {
  11527. Object.defineProperty(this, key, {
  11528. get() {
  11529. return this._getProp(key);
  11530. },
  11531. set(val) {
  11532. this._setProp(key, val, true, true);
  11533. }
  11534. });
  11535. }
  11536. }
  11537. _setAttr(key) {
  11538. if (key.startsWith("data-v-")) return;
  11539. const has = this.hasAttribute(key);
  11540. let value = has ? this.getAttribute(key) : REMOVAL;
  11541. const camelKey = camelize(key);
  11542. if (has && this._numberProps && this._numberProps[camelKey]) {
  11543. value = toNumber(value);
  11544. }
  11545. this._setProp(camelKey, value, false, true);
  11546. }
  11547. /**
  11548. * @internal
  11549. */
  11550. _getProp(key) {
  11551. return this._props[key];
  11552. }
  11553. /**
  11554. * @internal
  11555. */
  11556. _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
  11557. if (val !== this._props[key]) {
  11558. if (val === REMOVAL) {
  11559. delete this._props[key];
  11560. } else {
  11561. this._props[key] = val;
  11562. if (key === "key" && this._app) {
  11563. this._app._ceVNode.key = val;
  11564. }
  11565. }
  11566. if (shouldUpdate && this._instance) {
  11567. this._update();
  11568. }
  11569. if (shouldReflect) {
  11570. const ob = this._ob;
  11571. ob && ob.disconnect();
  11572. if (val === true) {
  11573. this.setAttribute(hyphenate(key), "");
  11574. } else if (typeof val === "string" || typeof val === "number") {
  11575. this.setAttribute(hyphenate(key), val + "");
  11576. } else if (!val) {
  11577. this.removeAttribute(hyphenate(key));
  11578. }
  11579. ob && ob.observe(this, { attributes: true });
  11580. }
  11581. }
  11582. }
  11583. _update() {
  11584. const vnode = this._createVNode();
  11585. if (this._app) vnode.appContext = this._app._context;
  11586. render(vnode, this._root);
  11587. }
  11588. _createVNode() {
  11589. const baseProps = {};
  11590. if (!this.shadowRoot) {
  11591. baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
  11592. }
  11593. const vnode = createVNode(this._def, extend(baseProps, this._props));
  11594. if (!this._instance) {
  11595. vnode.ce = (instance) => {
  11596. this._instance = instance;
  11597. instance.ce = this;
  11598. instance.isCE = true;
  11599. {
  11600. instance.ceReload = (newStyles) => {
  11601. if (this._styles) {
  11602. this._styles.forEach((s) => this._root.removeChild(s));
  11603. this._styles.length = 0;
  11604. }
  11605. this._applyStyles(newStyles);
  11606. this._instance = null;
  11607. this._update();
  11608. };
  11609. }
  11610. const dispatch = (event, args) => {
  11611. this.dispatchEvent(
  11612. new CustomEvent(
  11613. event,
  11614. isPlainObject(args[0]) ? extend({ detail: args }, args[0]) : { detail: args }
  11615. )
  11616. );
  11617. };
  11618. instance.emit = (event, ...args) => {
  11619. dispatch(event, args);
  11620. if (hyphenate(event) !== event) {
  11621. dispatch(hyphenate(event), args);
  11622. }
  11623. };
  11624. this._setParent();
  11625. };
  11626. }
  11627. return vnode;
  11628. }
  11629. _applyStyles(styles, owner) {
  11630. if (!styles) return;
  11631. if (owner) {
  11632. if (owner === this._def || this._styleChildren.has(owner)) {
  11633. return;
  11634. }
  11635. this._styleChildren.add(owner);
  11636. }
  11637. const nonce = this._nonce;
  11638. for (let i = styles.length - 1; i >= 0; i--) {
  11639. const s = document.createElement("style");
  11640. if (nonce) s.setAttribute("nonce", nonce);
  11641. s.textContent = styles[i];
  11642. this.shadowRoot.prepend(s);
  11643. {
  11644. if (owner) {
  11645. if (owner.__hmrId) {
  11646. if (!this._childStyles) this._childStyles = /* @__PURE__ */ new Map();
  11647. let entry = this._childStyles.get(owner.__hmrId);
  11648. if (!entry) {
  11649. this._childStyles.set(owner.__hmrId, entry = []);
  11650. }
  11651. entry.push(s);
  11652. }
  11653. } else {
  11654. (this._styles || (this._styles = [])).push(s);
  11655. }
  11656. }
  11657. }
  11658. }
  11659. /**
  11660. * Only called when shadowRoot is false
  11661. */
  11662. _parseSlots() {
  11663. const slots = this._slots = {};
  11664. let n;
  11665. while (n = this.firstChild) {
  11666. const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default";
  11667. (slots[slotName] || (slots[slotName] = [])).push(n);
  11668. this.removeChild(n);
  11669. }
  11670. }
  11671. /**
  11672. * Only called when shadowRoot is false
  11673. */
  11674. _renderSlots() {
  11675. const outlets = (this._teleportTarget || this).querySelectorAll("slot");
  11676. const scopeId = this._instance.type.__scopeId;
  11677. for (let i = 0; i < outlets.length; i++) {
  11678. const o = outlets[i];
  11679. const slotName = o.getAttribute("name") || "default";
  11680. const content = this._slots[slotName];
  11681. const parent = o.parentNode;
  11682. if (content) {
  11683. for (const n of content) {
  11684. if (scopeId && n.nodeType === 1) {
  11685. const id = scopeId + "-s";
  11686. const walker = document.createTreeWalker(n, 1);
  11687. n.setAttribute(id, "");
  11688. let child;
  11689. while (child = walker.nextNode()) {
  11690. child.setAttribute(id, "");
  11691. }
  11692. }
  11693. parent.insertBefore(n, o);
  11694. }
  11695. } else {
  11696. while (o.firstChild) parent.insertBefore(o.firstChild, o);
  11697. }
  11698. parent.removeChild(o);
  11699. }
  11700. }
  11701. /**
  11702. * @internal
  11703. */
  11704. _injectChildStyle(comp) {
  11705. this._applyStyles(comp.styles, comp);
  11706. }
  11707. /**
  11708. * @internal
  11709. */
  11710. _removeChildStyle(comp) {
  11711. {
  11712. this._styleChildren.delete(comp);
  11713. if (this._childStyles && comp.__hmrId) {
  11714. const oldStyles = this._childStyles.get(comp.__hmrId);
  11715. if (oldStyles) {
  11716. oldStyles.forEach((s) => this._root.removeChild(s));
  11717. oldStyles.length = 0;
  11718. }
  11719. }
  11720. }
  11721. }
  11722. }
  11723. function useHost(caller) {
  11724. const instance = getCurrentInstance();
  11725. const el = instance && instance.ce;
  11726. if (el) {
  11727. return el;
  11728. } else {
  11729. if (!instance) {
  11730. warn(
  11731. `${caller || "useHost"} called without an active component instance.`
  11732. );
  11733. } else {
  11734. warn(
  11735. `${caller || "useHost"} can only be used in components defined via defineCustomElement.`
  11736. );
  11737. }
  11738. }
  11739. return null;
  11740. }
  11741. function useShadowRoot() {
  11742. const el = useHost("useShadowRoot") ;
  11743. return el && el.shadowRoot;
  11744. }
  11745. function useCssModule(name = "$style") {
  11746. {
  11747. const instance = getCurrentInstance();
  11748. if (!instance) {
  11749. warn(`useCssModule must be called inside setup()`);
  11750. return EMPTY_OBJ;
  11751. }
  11752. const modules = instance.type.__cssModules;
  11753. if (!modules) {
  11754. warn(`Current instance does not have CSS modules injected.`);
  11755. return EMPTY_OBJ;
  11756. }
  11757. const mod = modules[name];
  11758. if (!mod) {
  11759. warn(`Current instance does not have CSS module named "${name}".`);
  11760. return EMPTY_OBJ;
  11761. }
  11762. return mod;
  11763. }
  11764. }
  11765. const positionMap = /* @__PURE__ */ new WeakMap();
  11766. const newPositionMap = /* @__PURE__ */ new WeakMap();
  11767. const moveCbKey = Symbol("_moveCb");
  11768. const enterCbKey = Symbol("_enterCb");
  11769. const decorate = (t) => {
  11770. delete t.props.mode;
  11771. return t;
  11772. };
  11773. const TransitionGroupImpl = /* @__PURE__ */ decorate({
  11774. name: "TransitionGroup",
  11775. props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
  11776. tag: String,
  11777. moveClass: String
  11778. }),
  11779. setup(props, { slots }) {
  11780. const instance = getCurrentInstance();
  11781. const state = useTransitionState();
  11782. let prevChildren;
  11783. let children;
  11784. onUpdated(() => {
  11785. if (!prevChildren.length) {
  11786. return;
  11787. }
  11788. const moveClass = props.moveClass || `${props.name || "v"}-move`;
  11789. if (!hasCSSTransform(
  11790. prevChildren[0].el,
  11791. instance.vnode.el,
  11792. moveClass
  11793. )) {
  11794. prevChildren = [];
  11795. return;
  11796. }
  11797. prevChildren.forEach(callPendingCbs);
  11798. prevChildren.forEach(recordPosition);
  11799. const movedChildren = prevChildren.filter(applyTranslation);
  11800. forceReflow();
  11801. movedChildren.forEach((c) => {
  11802. const el = c.el;
  11803. const style = el.style;
  11804. addTransitionClass(el, moveClass);
  11805. style.transform = style.webkitTransform = style.transitionDuration = "";
  11806. const cb = el[moveCbKey] = (e) => {
  11807. if (e && e.target !== el) {
  11808. return;
  11809. }
  11810. if (!e || /transform$/.test(e.propertyName)) {
  11811. el.removeEventListener("transitionend", cb);
  11812. el[moveCbKey] = null;
  11813. removeTransitionClass(el, moveClass);
  11814. }
  11815. };
  11816. el.addEventListener("transitionend", cb);
  11817. });
  11818. prevChildren = [];
  11819. });
  11820. return () => {
  11821. const rawProps = toRaw(props);
  11822. const cssTransitionProps = resolveTransitionProps(rawProps);
  11823. let tag = rawProps.tag || Fragment;
  11824. prevChildren = [];
  11825. if (children) {
  11826. for (let i = 0; i < children.length; i++) {
  11827. const child = children[i];
  11828. if (child.el && child.el instanceof Element) {
  11829. prevChildren.push(child);
  11830. setTransitionHooks(
  11831. child,
  11832. resolveTransitionHooks(
  11833. child,
  11834. cssTransitionProps,
  11835. state,
  11836. instance
  11837. )
  11838. );
  11839. positionMap.set(
  11840. child,
  11841. child.el.getBoundingClientRect()
  11842. );
  11843. }
  11844. }
  11845. }
  11846. children = slots.default ? getTransitionRawChildren(slots.default()) : [];
  11847. for (let i = 0; i < children.length; i++) {
  11848. const child = children[i];
  11849. if (child.key != null) {
  11850. setTransitionHooks(
  11851. child,
  11852. resolveTransitionHooks(child, cssTransitionProps, state, instance)
  11853. );
  11854. } else if (child.type !== Text) {
  11855. warn(`<TransitionGroup> children must be keyed.`);
  11856. }
  11857. }
  11858. return createVNode(tag, null, children);
  11859. };
  11860. }
  11861. });
  11862. const TransitionGroup = TransitionGroupImpl;
  11863. function callPendingCbs(c) {
  11864. const el = c.el;
  11865. if (el[moveCbKey]) {
  11866. el[moveCbKey]();
  11867. }
  11868. if (el[enterCbKey]) {
  11869. el[enterCbKey]();
  11870. }
  11871. }
  11872. function recordPosition(c) {
  11873. newPositionMap.set(c, c.el.getBoundingClientRect());
  11874. }
  11875. function applyTranslation(c) {
  11876. const oldPos = positionMap.get(c);
  11877. const newPos = newPositionMap.get(c);
  11878. const dx = oldPos.left - newPos.left;
  11879. const dy = oldPos.top - newPos.top;
  11880. if (dx || dy) {
  11881. const s = c.el.style;
  11882. s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
  11883. s.transitionDuration = "0s";
  11884. return c;
  11885. }
  11886. }
  11887. function hasCSSTransform(el, root, moveClass) {
  11888. const clone = el.cloneNode();
  11889. const _vtc = el[vtcKey];
  11890. if (_vtc) {
  11891. _vtc.forEach((cls) => {
  11892. cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
  11893. });
  11894. }
  11895. moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c));
  11896. clone.style.display = "none";
  11897. const container = root.nodeType === 1 ? root : root.parentNode;
  11898. container.appendChild(clone);
  11899. const { hasTransform } = getTransitionInfo(clone);
  11900. container.removeChild(clone);
  11901. return hasTransform;
  11902. }
  11903. const getModelAssigner = (vnode) => {
  11904. const fn = vnode.props["onUpdate:modelValue"] || false;
  11905. return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn;
  11906. };
  11907. function onCompositionStart(e) {
  11908. e.target.composing = true;
  11909. }
  11910. function onCompositionEnd(e) {
  11911. const target = e.target;
  11912. if (target.composing) {
  11913. target.composing = false;
  11914. target.dispatchEvent(new Event("input"));
  11915. }
  11916. }
  11917. const assignKey = Symbol("_assign");
  11918. const vModelText = {
  11919. created(el, { modifiers: { lazy, trim, number } }, vnode) {
  11920. el[assignKey] = getModelAssigner(vnode);
  11921. const castToNumber = number || vnode.props && vnode.props.type === "number";
  11922. addEventListener(el, lazy ? "change" : "input", (e) => {
  11923. if (e.target.composing) return;
  11924. let domValue = el.value;
  11925. if (trim) {
  11926. domValue = domValue.trim();
  11927. }
  11928. if (castToNumber) {
  11929. domValue = looseToNumber(domValue);
  11930. }
  11931. el[assignKey](domValue);
  11932. });
  11933. if (trim) {
  11934. addEventListener(el, "change", () => {
  11935. el.value = el.value.trim();
  11936. });
  11937. }
  11938. if (!lazy) {
  11939. addEventListener(el, "compositionstart", onCompositionStart);
  11940. addEventListener(el, "compositionend", onCompositionEnd);
  11941. addEventListener(el, "change", onCompositionEnd);
  11942. }
  11943. },
  11944. // set value on mounted so it's after min/max for type="range"
  11945. mounted(el, { value }) {
  11946. el.value = value == null ? "" : value;
  11947. },
  11948. beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
  11949. el[assignKey] = getModelAssigner(vnode);
  11950. if (el.composing) return;
  11951. const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
  11952. const newValue = value == null ? "" : value;
  11953. if (elValue === newValue) {
  11954. return;
  11955. }
  11956. if (document.activeElement === el && el.type !== "range") {
  11957. if (lazy && value === oldValue) {
  11958. return;
  11959. }
  11960. if (trim && el.value.trim() === newValue) {
  11961. return;
  11962. }
  11963. }
  11964. el.value = newValue;
  11965. }
  11966. };
  11967. const vModelCheckbox = {
  11968. // #4096 array checkboxes need to be deep traversed
  11969. deep: true,
  11970. created(el, _, vnode) {
  11971. el[assignKey] = getModelAssigner(vnode);
  11972. addEventListener(el, "change", () => {
  11973. const modelValue = el._modelValue;
  11974. const elementValue = getValue(el);
  11975. const checked = el.checked;
  11976. const assign = el[assignKey];
  11977. if (isArray(modelValue)) {
  11978. const index = looseIndexOf(modelValue, elementValue);
  11979. const found = index !== -1;
  11980. if (checked && !found) {
  11981. assign(modelValue.concat(elementValue));
  11982. } else if (!checked && found) {
  11983. const filtered = [...modelValue];
  11984. filtered.splice(index, 1);
  11985. assign(filtered);
  11986. }
  11987. } else if (isSet(modelValue)) {
  11988. const cloned = new Set(modelValue);
  11989. if (checked) {
  11990. cloned.add(elementValue);
  11991. } else {
  11992. cloned.delete(elementValue);
  11993. }
  11994. assign(cloned);
  11995. } else {
  11996. assign(getCheckboxValue(el, checked));
  11997. }
  11998. });
  11999. },
  12000. // set initial checked on mount to wait for true-value/false-value
  12001. mounted: setChecked,
  12002. beforeUpdate(el, binding, vnode) {
  12003. el[assignKey] = getModelAssigner(vnode);
  12004. setChecked(el, binding, vnode);
  12005. }
  12006. };
  12007. function setChecked(el, { value, oldValue }, vnode) {
  12008. el._modelValue = value;
  12009. let checked;
  12010. if (isArray(value)) {
  12011. checked = looseIndexOf(value, vnode.props.value) > -1;
  12012. } else if (isSet(value)) {
  12013. checked = value.has(vnode.props.value);
  12014. } else {
  12015. if (value === oldValue) return;
  12016. checked = looseEqual(value, getCheckboxValue(el, true));
  12017. }
  12018. if (el.checked !== checked) {
  12019. el.checked = checked;
  12020. }
  12021. }
  12022. const vModelRadio = {
  12023. created(el, { value }, vnode) {
  12024. el.checked = looseEqual(value, vnode.props.value);
  12025. el[assignKey] = getModelAssigner(vnode);
  12026. addEventListener(el, "change", () => {
  12027. el[assignKey](getValue(el));
  12028. });
  12029. },
  12030. beforeUpdate(el, { value, oldValue }, vnode) {
  12031. el[assignKey] = getModelAssigner(vnode);
  12032. if (value !== oldValue) {
  12033. el.checked = looseEqual(value, vnode.props.value);
  12034. }
  12035. }
  12036. };
  12037. const vModelSelect = {
  12038. // <select multiple> value need to be deep traversed
  12039. deep: true,
  12040. created(el, { value, modifiers: { number } }, vnode) {
  12041. const isSetModel = isSet(value);
  12042. addEventListener(el, "change", () => {
  12043. const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
  12044. (o) => number ? looseToNumber(getValue(o)) : getValue(o)
  12045. );
  12046. el[assignKey](
  12047. el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
  12048. );
  12049. el._assigning = true;
  12050. nextTick(() => {
  12051. el._assigning = false;
  12052. });
  12053. });
  12054. el[assignKey] = getModelAssigner(vnode);
  12055. },
  12056. // set value in mounted & updated because <select> relies on its children
  12057. // <option>s.
  12058. mounted(el, { value }) {
  12059. setSelected(el, value);
  12060. },
  12061. beforeUpdate(el, _binding, vnode) {
  12062. el[assignKey] = getModelAssigner(vnode);
  12063. },
  12064. updated(el, { value }) {
  12065. if (!el._assigning) {
  12066. setSelected(el, value);
  12067. }
  12068. }
  12069. };
  12070. function setSelected(el, value) {
  12071. const isMultiple = el.multiple;
  12072. const isArrayValue = isArray(value);
  12073. if (isMultiple && !isArrayValue && !isSet(value)) {
  12074. warn(
  12075. `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.`
  12076. );
  12077. return;
  12078. }
  12079. for (let i = 0, l = el.options.length; i < l; i++) {
  12080. const option = el.options[i];
  12081. const optionValue = getValue(option);
  12082. if (isMultiple) {
  12083. if (isArrayValue) {
  12084. const optionType = typeof optionValue;
  12085. if (optionType === "string" || optionType === "number") {
  12086. option.selected = value.some((v) => String(v) === String(optionValue));
  12087. } else {
  12088. option.selected = looseIndexOf(value, optionValue) > -1;
  12089. }
  12090. } else {
  12091. option.selected = value.has(optionValue);
  12092. }
  12093. } else if (looseEqual(getValue(option), value)) {
  12094. if (el.selectedIndex !== i) el.selectedIndex = i;
  12095. return;
  12096. }
  12097. }
  12098. if (!isMultiple && el.selectedIndex !== -1) {
  12099. el.selectedIndex = -1;
  12100. }
  12101. }
  12102. function getValue(el) {
  12103. return "_value" in el ? el._value : el.value;
  12104. }
  12105. function getCheckboxValue(el, checked) {
  12106. const key = checked ? "_trueValue" : "_falseValue";
  12107. return key in el ? el[key] : checked;
  12108. }
  12109. const vModelDynamic = {
  12110. created(el, binding, vnode) {
  12111. callModelHook(el, binding, vnode, null, "created");
  12112. },
  12113. mounted(el, binding, vnode) {
  12114. callModelHook(el, binding, vnode, null, "mounted");
  12115. },
  12116. beforeUpdate(el, binding, vnode, prevVNode) {
  12117. callModelHook(el, binding, vnode, prevVNode, "beforeUpdate");
  12118. },
  12119. updated(el, binding, vnode, prevVNode) {
  12120. callModelHook(el, binding, vnode, prevVNode, "updated");
  12121. }
  12122. };
  12123. function resolveDynamicModel(tagName, type) {
  12124. switch (tagName) {
  12125. case "SELECT":
  12126. return vModelSelect;
  12127. case "TEXTAREA":
  12128. return vModelText;
  12129. default:
  12130. switch (type) {
  12131. case "checkbox":
  12132. return vModelCheckbox;
  12133. case "radio":
  12134. return vModelRadio;
  12135. default:
  12136. return vModelText;
  12137. }
  12138. }
  12139. }
  12140. function callModelHook(el, binding, vnode, prevVNode, hook) {
  12141. const modelToUse = resolveDynamicModel(
  12142. el.tagName,
  12143. vnode.props && vnode.props.type
  12144. );
  12145. const fn = modelToUse[hook];
  12146. fn && fn(el, binding, vnode, prevVNode);
  12147. }
  12148. function initVModelForSSR() {
  12149. vModelText.getSSRProps = ({ value }) => ({ value });
  12150. vModelRadio.getSSRProps = ({ value }, vnode) => {
  12151. if (vnode.props && looseEqual(vnode.props.value, value)) {
  12152. return { checked: true };
  12153. }
  12154. };
  12155. vModelCheckbox.getSSRProps = ({ value }, vnode) => {
  12156. if (isArray(value)) {
  12157. if (vnode.props && looseIndexOf(value, vnode.props.value) > -1) {
  12158. return { checked: true };
  12159. }
  12160. } else if (isSet(value)) {
  12161. if (vnode.props && value.has(vnode.props.value)) {
  12162. return { checked: true };
  12163. }
  12164. } else if (value) {
  12165. return { checked: true };
  12166. }
  12167. };
  12168. vModelDynamic.getSSRProps = (binding, vnode) => {
  12169. if (typeof vnode.type !== "string") {
  12170. return;
  12171. }
  12172. const modelToUse = resolveDynamicModel(
  12173. // resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase
  12174. vnode.type.toUpperCase(),
  12175. vnode.props && vnode.props.type
  12176. );
  12177. if (modelToUse.getSSRProps) {
  12178. return modelToUse.getSSRProps(binding, vnode);
  12179. }
  12180. };
  12181. }
  12182. const systemModifiers = ["ctrl", "shift", "alt", "meta"];
  12183. const modifierGuards = {
  12184. stop: (e) => e.stopPropagation(),
  12185. prevent: (e) => e.preventDefault(),
  12186. self: (e) => e.target !== e.currentTarget,
  12187. ctrl: (e) => !e.ctrlKey,
  12188. shift: (e) => !e.shiftKey,
  12189. alt: (e) => !e.altKey,
  12190. meta: (e) => !e.metaKey,
  12191. left: (e) => "button" in e && e.button !== 0,
  12192. middle: (e) => "button" in e && e.button !== 1,
  12193. right: (e) => "button" in e && e.button !== 2,
  12194. exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
  12195. };
  12196. const withModifiers = (fn, modifiers) => {
  12197. const cache = fn._withMods || (fn._withMods = {});
  12198. const cacheKey = modifiers.join(".");
  12199. return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
  12200. for (let i = 0; i < modifiers.length; i++) {
  12201. const guard = modifierGuards[modifiers[i]];
  12202. if (guard && guard(event, modifiers)) return;
  12203. }
  12204. return fn(event, ...args);
  12205. });
  12206. };
  12207. const keyNames = {
  12208. esc: "escape",
  12209. space: " ",
  12210. up: "arrow-up",
  12211. left: "arrow-left",
  12212. right: "arrow-right",
  12213. down: "arrow-down",
  12214. delete: "backspace"
  12215. };
  12216. const withKeys = (fn, modifiers) => {
  12217. const cache = fn._withKeys || (fn._withKeys = {});
  12218. const cacheKey = modifiers.join(".");
  12219. return cache[cacheKey] || (cache[cacheKey] = (event) => {
  12220. if (!("key" in event)) {
  12221. return;
  12222. }
  12223. const eventKey = hyphenate(event.key);
  12224. if (modifiers.some(
  12225. (k) => k === eventKey || keyNames[k] === eventKey
  12226. )) {
  12227. return fn(event);
  12228. }
  12229. });
  12230. };
  12231. const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
  12232. let renderer;
  12233. let enabledHydration = false;
  12234. function ensureRenderer() {
  12235. return renderer || (renderer = createRenderer(rendererOptions));
  12236. }
  12237. function ensureHydrationRenderer() {
  12238. renderer = enabledHydration ? renderer : createHydrationRenderer(rendererOptions);
  12239. enabledHydration = true;
  12240. return renderer;
  12241. }
  12242. const render = (...args) => {
  12243. ensureRenderer().render(...args);
  12244. };
  12245. const hydrate = (...args) => {
  12246. ensureHydrationRenderer().hydrate(...args);
  12247. };
  12248. const createApp = (...args) => {
  12249. const app = ensureRenderer().createApp(...args);
  12250. {
  12251. injectNativeTagCheck(app);
  12252. injectCompilerOptionsCheck(app);
  12253. }
  12254. const { mount } = app;
  12255. app.mount = (containerOrSelector) => {
  12256. const container = normalizeContainer(containerOrSelector);
  12257. if (!container) return;
  12258. const component = app._component;
  12259. if (!isFunction(component) && !component.render && !component.template) {
  12260. component.template = container.innerHTML;
  12261. }
  12262. if (container.nodeType === 1) {
  12263. container.textContent = "";
  12264. }
  12265. const proxy = mount(container, false, resolveRootNamespace(container));
  12266. if (container instanceof Element) {
  12267. container.removeAttribute("v-cloak");
  12268. container.setAttribute("data-v-app", "");
  12269. }
  12270. return proxy;
  12271. };
  12272. return app;
  12273. };
  12274. const createSSRApp = (...args) => {
  12275. const app = ensureHydrationRenderer().createApp(...args);
  12276. {
  12277. injectNativeTagCheck(app);
  12278. injectCompilerOptionsCheck(app);
  12279. }
  12280. const { mount } = app;
  12281. app.mount = (containerOrSelector) => {
  12282. const container = normalizeContainer(containerOrSelector);
  12283. if (container) {
  12284. return mount(container, true, resolveRootNamespace(container));
  12285. }
  12286. };
  12287. return app;
  12288. };
  12289. function resolveRootNamespace(container) {
  12290. if (container instanceof SVGElement) {
  12291. return "svg";
  12292. }
  12293. if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
  12294. return "mathml";
  12295. }
  12296. }
  12297. function injectNativeTagCheck(app) {
  12298. Object.defineProperty(app.config, "isNativeTag", {
  12299. value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
  12300. writable: false
  12301. });
  12302. }
  12303. function injectCompilerOptionsCheck(app) {
  12304. if (isRuntimeOnly()) {
  12305. const isCustomElement = app.config.isCustomElement;
  12306. Object.defineProperty(app.config, "isCustomElement", {
  12307. get() {
  12308. return isCustomElement;
  12309. },
  12310. set() {
  12311. warn(
  12312. `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.`
  12313. );
  12314. }
  12315. });
  12316. const compilerOptions = app.config.compilerOptions;
  12317. const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead.
  12318. - For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.
  12319. - For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
  12320. - For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`;
  12321. Object.defineProperty(app.config, "compilerOptions", {
  12322. get() {
  12323. warn(msg);
  12324. return compilerOptions;
  12325. },
  12326. set() {
  12327. warn(msg);
  12328. }
  12329. });
  12330. }
  12331. }
  12332. function normalizeContainer(container) {
  12333. if (isString(container)) {
  12334. const res = document.querySelector(container);
  12335. if (!res) {
  12336. warn(
  12337. `Failed to mount app: mount target selector "${container}" returned null.`
  12338. );
  12339. }
  12340. return res;
  12341. }
  12342. if (window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") {
  12343. warn(
  12344. `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`
  12345. );
  12346. }
  12347. return container;
  12348. }
  12349. let ssrDirectiveInitialized = false;
  12350. const initDirectivesForSSR = () => {
  12351. if (!ssrDirectiveInitialized) {
  12352. ssrDirectiveInitialized = true;
  12353. initVModelForSSR();
  12354. initVShowForSSR();
  12355. }
  12356. } ;
  12357. function initDev() {
  12358. {
  12359. {
  12360. console.info(
  12361. `You are running a development build of Vue.
  12362. Make sure to use the production build (*.prod.js) when deploying for production.`
  12363. );
  12364. }
  12365. initCustomFormatter();
  12366. }
  12367. }
  12368. {
  12369. initDev();
  12370. }
  12371. const compile = () => {
  12372. {
  12373. warn(
  12374. `Runtime compilation is not supported in this build of Vue.` + (` Use "vue.esm-browser.js" instead.` )
  12375. );
  12376. }
  12377. };
  12378. export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TriggerOpTypes, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compile, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getCurrentWatcher, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useHost, useId, useModel, useSSRContext, useShadowRoot, useSlots, useTemplateRef, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };