runtime-dom.esm-browser.js 354 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282
  1. /**
  2. * @vue/runtime-dom v3.5.12
  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. let ret = "";
  142. if (!styles || isString(styles)) {
  143. return ret;
  144. }
  145. for (const key in styles) {
  146. const value = styles[key];
  147. if (isString(value) || typeof value === "number") {
  148. const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
  149. ret += `${normalizedKey}:${value};`;
  150. }
  151. }
  152. return ret;
  153. }
  154. function normalizeClass(value) {
  155. let res = "";
  156. if (isString(value)) {
  157. res = value;
  158. } else if (isArray(value)) {
  159. for (let i = 0; i < value.length; i++) {
  160. const normalized = normalizeClass(value[i]);
  161. if (normalized) {
  162. res += normalized + " ";
  163. }
  164. }
  165. } else if (isObject(value)) {
  166. for (const name in value) {
  167. if (value[name]) {
  168. res += name + " ";
  169. }
  170. }
  171. }
  172. return res.trim();
  173. }
  174. function normalizeProps(props) {
  175. if (!props) return null;
  176. let { class: klass, style } = props;
  177. if (klass && !isString(klass)) {
  178. props.class = normalizeClass(klass);
  179. }
  180. if (style) {
  181. props.style = normalizeStyle(style);
  182. }
  183. return props;
  184. }
  185. 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";
  186. 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";
  187. 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";
  188. const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
  189. const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
  190. const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
  191. const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
  192. const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
  193. const isBooleanAttr = /* @__PURE__ */ makeMap(
  194. specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
  195. );
  196. function includeBooleanAttr(value) {
  197. return !!value || value === "";
  198. }
  199. const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
  200. `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`
  201. );
  202. const isKnownSvgAttr = /* @__PURE__ */ makeMap(
  203. `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`
  204. );
  205. function isRenderableAttrValue(value) {
  206. if (value == null) {
  207. return false;
  208. }
  209. const type = typeof value;
  210. return type === "string" || type === "number" || type === "boolean";
  211. }
  212. const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;
  213. function getEscapedCssVarName(key, doubleEscape) {
  214. return key.replace(
  215. cssVarNameEscapeSymbolsRE,
  216. (s) => `\\${s}`
  217. );
  218. }
  219. function looseCompareArrays(a, b) {
  220. if (a.length !== b.length) return false;
  221. let equal = true;
  222. for (let i = 0; equal && i < a.length; i++) {
  223. equal = looseEqual(a[i], b[i]);
  224. }
  225. return equal;
  226. }
  227. function looseEqual(a, b) {
  228. if (a === b) return true;
  229. let aValidType = isDate(a);
  230. let bValidType = isDate(b);
  231. if (aValidType || bValidType) {
  232. return aValidType && bValidType ? a.getTime() === b.getTime() : false;
  233. }
  234. aValidType = isSymbol(a);
  235. bValidType = isSymbol(b);
  236. if (aValidType || bValidType) {
  237. return a === b;
  238. }
  239. aValidType = isArray(a);
  240. bValidType = isArray(b);
  241. if (aValidType || bValidType) {
  242. return aValidType && bValidType ? looseCompareArrays(a, b) : false;
  243. }
  244. aValidType = isObject(a);
  245. bValidType = isObject(b);
  246. if (aValidType || bValidType) {
  247. if (!aValidType || !bValidType) {
  248. return false;
  249. }
  250. const aKeysCount = Object.keys(a).length;
  251. const bKeysCount = Object.keys(b).length;
  252. if (aKeysCount !== bKeysCount) {
  253. return false;
  254. }
  255. for (const key in a) {
  256. const aHasKey = a.hasOwnProperty(key);
  257. const bHasKey = b.hasOwnProperty(key);
  258. if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
  259. return false;
  260. }
  261. }
  262. }
  263. return String(a) === String(b);
  264. }
  265. function looseIndexOf(arr, val) {
  266. return arr.findIndex((item) => looseEqual(item, val));
  267. }
  268. const isRef$1 = (val) => {
  269. return !!(val && val["__v_isRef"] === true);
  270. };
  271. const toDisplayString = (val) => {
  272. 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);
  273. };
  274. const replacer = (_key, val) => {
  275. if (isRef$1(val)) {
  276. return replacer(_key, val.value);
  277. } else if (isMap(val)) {
  278. return {
  279. [`Map(${val.size})`]: [...val.entries()].reduce(
  280. (entries, [key, val2], i) => {
  281. entries[stringifySymbol(key, i) + " =>"] = val2;
  282. return entries;
  283. },
  284. {}
  285. )
  286. };
  287. } else if (isSet(val)) {
  288. return {
  289. [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
  290. };
  291. } else if (isSymbol(val)) {
  292. return stringifySymbol(val);
  293. } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
  294. return String(val);
  295. }
  296. return val;
  297. };
  298. const stringifySymbol = (v, i = "") => {
  299. var _a;
  300. return (
  301. // Symbol.description in es2019+ so we need to cast here to pass
  302. // the lib: es2016 check
  303. isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v
  304. );
  305. };
  306. function warn$2(msg, ...args) {
  307. console.warn(`[Vue warn] ${msg}`, ...args);
  308. }
  309. let activeEffectScope;
  310. class EffectScope {
  311. constructor(detached = false) {
  312. this.detached = detached;
  313. /**
  314. * @internal
  315. */
  316. this._active = true;
  317. /**
  318. * @internal
  319. */
  320. this.effects = [];
  321. /**
  322. * @internal
  323. */
  324. this.cleanups = [];
  325. this._isPaused = false;
  326. this.parent = activeEffectScope;
  327. if (!detached && activeEffectScope) {
  328. this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
  329. this
  330. ) - 1;
  331. }
  332. }
  333. get active() {
  334. return this._active;
  335. }
  336. pause() {
  337. if (this._active) {
  338. this._isPaused = true;
  339. let i, l;
  340. if (this.scopes) {
  341. for (i = 0, l = this.scopes.length; i < l; i++) {
  342. this.scopes[i].pause();
  343. }
  344. }
  345. for (i = 0, l = this.effects.length; i < l; i++) {
  346. this.effects[i].pause();
  347. }
  348. }
  349. }
  350. /**
  351. * Resumes the effect scope, including all child scopes and effects.
  352. */
  353. resume() {
  354. if (this._active) {
  355. if (this._isPaused) {
  356. this._isPaused = false;
  357. let i, l;
  358. if (this.scopes) {
  359. for (i = 0, l = this.scopes.length; i < l; i++) {
  360. this.scopes[i].resume();
  361. }
  362. }
  363. for (i = 0, l = this.effects.length; i < l; i++) {
  364. this.effects[i].resume();
  365. }
  366. }
  367. }
  368. }
  369. run(fn) {
  370. if (this._active) {
  371. const currentEffectScope = activeEffectScope;
  372. try {
  373. activeEffectScope = this;
  374. return fn();
  375. } finally {
  376. activeEffectScope = currentEffectScope;
  377. }
  378. } else {
  379. warn$2(`cannot run an inactive effect scope.`);
  380. }
  381. }
  382. /**
  383. * This should only be called on non-detached scopes
  384. * @internal
  385. */
  386. on() {
  387. activeEffectScope = this;
  388. }
  389. /**
  390. * This should only be called on non-detached scopes
  391. * @internal
  392. */
  393. off() {
  394. activeEffectScope = this.parent;
  395. }
  396. stop(fromParent) {
  397. if (this._active) {
  398. let i, l;
  399. for (i = 0, l = this.effects.length; i < l; i++) {
  400. this.effects[i].stop();
  401. }
  402. for (i = 0, l = this.cleanups.length; i < l; i++) {
  403. this.cleanups[i]();
  404. }
  405. if (this.scopes) {
  406. for (i = 0, l = this.scopes.length; i < l; i++) {
  407. this.scopes[i].stop(true);
  408. }
  409. }
  410. if (!this.detached && this.parent && !fromParent) {
  411. const last = this.parent.scopes.pop();
  412. if (last && last !== this) {
  413. this.parent.scopes[this.index] = last;
  414. last.index = this.index;
  415. }
  416. }
  417. this.parent = void 0;
  418. this._active = false;
  419. }
  420. }
  421. }
  422. function effectScope(detached) {
  423. return new EffectScope(detached);
  424. }
  425. function getCurrentScope() {
  426. return activeEffectScope;
  427. }
  428. function onScopeDispose(fn, failSilently = false) {
  429. if (activeEffectScope) {
  430. activeEffectScope.cleanups.push(fn);
  431. } else if (!failSilently) {
  432. warn$2(
  433. `onScopeDispose() is called when there is no active effect scope to be associated with.`
  434. );
  435. }
  436. }
  437. let activeSub;
  438. const pausedQueueEffects = /* @__PURE__ */ new WeakSet();
  439. class ReactiveEffect {
  440. constructor(fn) {
  441. this.fn = fn;
  442. /**
  443. * @internal
  444. */
  445. this.deps = void 0;
  446. /**
  447. * @internal
  448. */
  449. this.depsTail = void 0;
  450. /**
  451. * @internal
  452. */
  453. this.flags = 1 | 4;
  454. /**
  455. * @internal
  456. */
  457. this.next = void 0;
  458. /**
  459. * @internal
  460. */
  461. this.cleanup = void 0;
  462. this.scheduler = void 0;
  463. if (activeEffectScope && activeEffectScope.active) {
  464. activeEffectScope.effects.push(this);
  465. }
  466. }
  467. pause() {
  468. this.flags |= 64;
  469. }
  470. resume() {
  471. if (this.flags & 64) {
  472. this.flags &= ~64;
  473. if (pausedQueueEffects.has(this)) {
  474. pausedQueueEffects.delete(this);
  475. this.trigger();
  476. }
  477. }
  478. }
  479. /**
  480. * @internal
  481. */
  482. notify() {
  483. if (this.flags & 2 && !(this.flags & 32)) {
  484. return;
  485. }
  486. if (!(this.flags & 8)) {
  487. batch(this);
  488. }
  489. }
  490. run() {
  491. if (!(this.flags & 1)) {
  492. return this.fn();
  493. }
  494. this.flags |= 2;
  495. cleanupEffect(this);
  496. prepareDeps(this);
  497. const prevEffect = activeSub;
  498. const prevShouldTrack = shouldTrack;
  499. activeSub = this;
  500. shouldTrack = true;
  501. try {
  502. return this.fn();
  503. } finally {
  504. if (activeSub !== this) {
  505. warn$2(
  506. "Active effect was not restored correctly - this is likely a Vue internal bug."
  507. );
  508. }
  509. cleanupDeps(this);
  510. activeSub = prevEffect;
  511. shouldTrack = prevShouldTrack;
  512. this.flags &= ~2;
  513. }
  514. }
  515. stop() {
  516. if (this.flags & 1) {
  517. for (let link = this.deps; link; link = link.nextDep) {
  518. removeSub(link);
  519. }
  520. this.deps = this.depsTail = void 0;
  521. cleanupEffect(this);
  522. this.onStop && this.onStop();
  523. this.flags &= ~1;
  524. }
  525. }
  526. trigger() {
  527. if (this.flags & 64) {
  528. pausedQueueEffects.add(this);
  529. } else if (this.scheduler) {
  530. this.scheduler();
  531. } else {
  532. this.runIfDirty();
  533. }
  534. }
  535. /**
  536. * @internal
  537. */
  538. runIfDirty() {
  539. if (isDirty(this)) {
  540. this.run();
  541. }
  542. }
  543. get dirty() {
  544. return isDirty(this);
  545. }
  546. }
  547. let batchDepth = 0;
  548. let batchedSub;
  549. let batchedComputed;
  550. function batch(sub, isComputed = false) {
  551. sub.flags |= 8;
  552. if (isComputed) {
  553. sub.next = batchedComputed;
  554. batchedComputed = sub;
  555. return;
  556. }
  557. sub.next = batchedSub;
  558. batchedSub = sub;
  559. }
  560. function startBatch() {
  561. batchDepth++;
  562. }
  563. function endBatch() {
  564. if (--batchDepth > 0) {
  565. return;
  566. }
  567. if (batchedComputed) {
  568. let e = batchedComputed;
  569. batchedComputed = void 0;
  570. while (e) {
  571. const next = e.next;
  572. e.next = void 0;
  573. e.flags &= ~8;
  574. e = next;
  575. }
  576. }
  577. let error;
  578. while (batchedSub) {
  579. let e = batchedSub;
  580. batchedSub = void 0;
  581. while (e) {
  582. const next = e.next;
  583. e.next = void 0;
  584. e.flags &= ~8;
  585. if (e.flags & 1) {
  586. try {
  587. ;
  588. e.trigger();
  589. } catch (err) {
  590. if (!error) error = err;
  591. }
  592. }
  593. e = next;
  594. }
  595. }
  596. if (error) throw error;
  597. }
  598. function prepareDeps(sub) {
  599. for (let link = sub.deps; link; link = link.nextDep) {
  600. link.version = -1;
  601. link.prevActiveLink = link.dep.activeLink;
  602. link.dep.activeLink = link;
  603. }
  604. }
  605. function cleanupDeps(sub) {
  606. let head;
  607. let tail = sub.depsTail;
  608. let link = tail;
  609. while (link) {
  610. const prev = link.prevDep;
  611. if (link.version === -1) {
  612. if (link === tail) tail = prev;
  613. removeSub(link);
  614. removeDep(link);
  615. } else {
  616. head = link;
  617. }
  618. link.dep.activeLink = link.prevActiveLink;
  619. link.prevActiveLink = void 0;
  620. link = prev;
  621. }
  622. sub.deps = head;
  623. sub.depsTail = tail;
  624. }
  625. function isDirty(sub) {
  626. for (let link = sub.deps; link; link = link.nextDep) {
  627. if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) {
  628. return true;
  629. }
  630. }
  631. if (sub._dirty) {
  632. return true;
  633. }
  634. return false;
  635. }
  636. function refreshComputed(computed) {
  637. if (computed.flags & 4 && !(computed.flags & 16)) {
  638. return;
  639. }
  640. computed.flags &= ~16;
  641. if (computed.globalVersion === globalVersion) {
  642. return;
  643. }
  644. computed.globalVersion = globalVersion;
  645. const dep = computed.dep;
  646. computed.flags |= 2;
  647. if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) {
  648. computed.flags &= ~2;
  649. return;
  650. }
  651. const prevSub = activeSub;
  652. const prevShouldTrack = shouldTrack;
  653. activeSub = computed;
  654. shouldTrack = true;
  655. try {
  656. prepareDeps(computed);
  657. const value = computed.fn(computed._value);
  658. if (dep.version === 0 || hasChanged(value, computed._value)) {
  659. computed._value = value;
  660. dep.version++;
  661. }
  662. } catch (err) {
  663. dep.version++;
  664. throw err;
  665. } finally {
  666. activeSub = prevSub;
  667. shouldTrack = prevShouldTrack;
  668. cleanupDeps(computed);
  669. computed.flags &= ~2;
  670. }
  671. }
  672. function removeSub(link, soft = false) {
  673. const { dep, prevSub, nextSub } = link;
  674. if (prevSub) {
  675. prevSub.nextSub = nextSub;
  676. link.prevSub = void 0;
  677. }
  678. if (nextSub) {
  679. nextSub.prevSub = prevSub;
  680. link.nextSub = void 0;
  681. }
  682. if (dep.subsHead === link) {
  683. dep.subsHead = nextSub;
  684. }
  685. if (dep.subs === link) {
  686. dep.subs = prevSub;
  687. if (!prevSub && dep.computed) {
  688. dep.computed.flags &= ~4;
  689. for (let l = dep.computed.deps; l; l = l.nextDep) {
  690. removeSub(l, true);
  691. }
  692. }
  693. }
  694. if (!soft && !--dep.sc && dep.map) {
  695. dep.map.delete(dep.key);
  696. }
  697. }
  698. function removeDep(link) {
  699. const { prevDep, nextDep } = link;
  700. if (prevDep) {
  701. prevDep.nextDep = nextDep;
  702. link.prevDep = void 0;
  703. }
  704. if (nextDep) {
  705. nextDep.prevDep = prevDep;
  706. link.nextDep = void 0;
  707. }
  708. }
  709. function effect(fn, options) {
  710. if (fn.effect instanceof ReactiveEffect) {
  711. fn = fn.effect.fn;
  712. }
  713. const e = new ReactiveEffect(fn);
  714. if (options) {
  715. extend(e, options);
  716. }
  717. try {
  718. e.run();
  719. } catch (err) {
  720. e.stop();
  721. throw err;
  722. }
  723. const runner = e.run.bind(e);
  724. runner.effect = e;
  725. return runner;
  726. }
  727. function stop(runner) {
  728. runner.effect.stop();
  729. }
  730. let shouldTrack = true;
  731. const trackStack = [];
  732. function pauseTracking() {
  733. trackStack.push(shouldTrack);
  734. shouldTrack = false;
  735. }
  736. function resetTracking() {
  737. const last = trackStack.pop();
  738. shouldTrack = last === void 0 ? true : last;
  739. }
  740. function cleanupEffect(e) {
  741. const { cleanup } = e;
  742. e.cleanup = void 0;
  743. if (cleanup) {
  744. const prevSub = activeSub;
  745. activeSub = void 0;
  746. try {
  747. cleanup();
  748. } finally {
  749. activeSub = prevSub;
  750. }
  751. }
  752. }
  753. let globalVersion = 0;
  754. class Link {
  755. constructor(sub, dep) {
  756. this.sub = sub;
  757. this.dep = dep;
  758. this.version = dep.version;
  759. this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
  760. }
  761. }
  762. class Dep {
  763. constructor(computed) {
  764. this.computed = computed;
  765. this.version = 0;
  766. /**
  767. * Link between this dep and the current active effect
  768. */
  769. this.activeLink = void 0;
  770. /**
  771. * Doubly linked list representing the subscribing effects (tail)
  772. */
  773. this.subs = void 0;
  774. /**
  775. * For object property deps cleanup
  776. */
  777. this.map = void 0;
  778. this.key = void 0;
  779. /**
  780. * Subscriber counter
  781. */
  782. this.sc = 0;
  783. {
  784. this.subsHead = void 0;
  785. }
  786. }
  787. track(debugInfo) {
  788. if (!activeSub || !shouldTrack || activeSub === this.computed) {
  789. return;
  790. }
  791. let link = this.activeLink;
  792. if (link === void 0 || link.sub !== activeSub) {
  793. link = this.activeLink = new Link(activeSub, this);
  794. if (!activeSub.deps) {
  795. activeSub.deps = activeSub.depsTail = link;
  796. } else {
  797. link.prevDep = activeSub.depsTail;
  798. activeSub.depsTail.nextDep = link;
  799. activeSub.depsTail = link;
  800. }
  801. addSub(link);
  802. } else if (link.version === -1) {
  803. link.version = this.version;
  804. if (link.nextDep) {
  805. const next = link.nextDep;
  806. next.prevDep = link.prevDep;
  807. if (link.prevDep) {
  808. link.prevDep.nextDep = next;
  809. }
  810. link.prevDep = activeSub.depsTail;
  811. link.nextDep = void 0;
  812. activeSub.depsTail.nextDep = link;
  813. activeSub.depsTail = link;
  814. if (activeSub.deps === link) {
  815. activeSub.deps = next;
  816. }
  817. }
  818. }
  819. if (activeSub.onTrack) {
  820. activeSub.onTrack(
  821. extend(
  822. {
  823. effect: activeSub
  824. },
  825. debugInfo
  826. )
  827. );
  828. }
  829. return link;
  830. }
  831. trigger(debugInfo) {
  832. this.version++;
  833. globalVersion++;
  834. this.notify(debugInfo);
  835. }
  836. notify(debugInfo) {
  837. startBatch();
  838. try {
  839. if (true) {
  840. for (let head = this.subsHead; head; head = head.nextSub) {
  841. if (head.sub.onTrigger && !(head.sub.flags & 8)) {
  842. head.sub.onTrigger(
  843. extend(
  844. {
  845. effect: head.sub
  846. },
  847. debugInfo
  848. )
  849. );
  850. }
  851. }
  852. }
  853. for (let link = this.subs; link; link = link.prevSub) {
  854. if (link.sub.notify()) {
  855. ;
  856. link.sub.dep.notify();
  857. }
  858. }
  859. } finally {
  860. endBatch();
  861. }
  862. }
  863. }
  864. function addSub(link) {
  865. link.dep.sc++;
  866. if (link.sub.flags & 4) {
  867. const computed = link.dep.computed;
  868. if (computed && !link.dep.subs) {
  869. computed.flags |= 4 | 16;
  870. for (let l = computed.deps; l; l = l.nextDep) {
  871. addSub(l);
  872. }
  873. }
  874. const currentTail = link.dep.subs;
  875. if (currentTail !== link) {
  876. link.prevSub = currentTail;
  877. if (currentTail) currentTail.nextSub = link;
  878. }
  879. if (link.dep.subsHead === void 0) {
  880. link.dep.subsHead = link;
  881. }
  882. link.dep.subs = link;
  883. }
  884. }
  885. const targetMap = /* @__PURE__ */ new WeakMap();
  886. const ITERATE_KEY = Symbol(
  887. "Object iterate"
  888. );
  889. const MAP_KEY_ITERATE_KEY = Symbol(
  890. "Map keys iterate"
  891. );
  892. const ARRAY_ITERATE_KEY = Symbol(
  893. "Array iterate"
  894. );
  895. function track(target, type, key) {
  896. if (shouldTrack && activeSub) {
  897. let depsMap = targetMap.get(target);
  898. if (!depsMap) {
  899. targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
  900. }
  901. let dep = depsMap.get(key);
  902. if (!dep) {
  903. depsMap.set(key, dep = new Dep());
  904. dep.map = depsMap;
  905. dep.key = key;
  906. }
  907. {
  908. dep.track({
  909. target,
  910. type,
  911. key
  912. });
  913. }
  914. }
  915. }
  916. function trigger(target, type, key, newValue, oldValue, oldTarget) {
  917. const depsMap = targetMap.get(target);
  918. if (!depsMap) {
  919. globalVersion++;
  920. return;
  921. }
  922. const run = (dep) => {
  923. if (dep) {
  924. {
  925. dep.trigger({
  926. target,
  927. type,
  928. key,
  929. newValue,
  930. oldValue,
  931. oldTarget
  932. });
  933. }
  934. }
  935. };
  936. startBatch();
  937. if (type === "clear") {
  938. depsMap.forEach(run);
  939. } else {
  940. const targetIsArray = isArray(target);
  941. const isArrayIndex = targetIsArray && isIntegerKey(key);
  942. if (targetIsArray && key === "length") {
  943. const newLength = Number(newValue);
  944. depsMap.forEach((dep, key2) => {
  945. if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {
  946. run(dep);
  947. }
  948. });
  949. } else {
  950. if (key !== void 0 || depsMap.has(void 0)) {
  951. run(depsMap.get(key));
  952. }
  953. if (isArrayIndex) {
  954. run(depsMap.get(ARRAY_ITERATE_KEY));
  955. }
  956. switch (type) {
  957. case "add":
  958. if (!targetIsArray) {
  959. run(depsMap.get(ITERATE_KEY));
  960. if (isMap(target)) {
  961. run(depsMap.get(MAP_KEY_ITERATE_KEY));
  962. }
  963. } else if (isArrayIndex) {
  964. run(depsMap.get("length"));
  965. }
  966. break;
  967. case "delete":
  968. if (!targetIsArray) {
  969. run(depsMap.get(ITERATE_KEY));
  970. if (isMap(target)) {
  971. run(depsMap.get(MAP_KEY_ITERATE_KEY));
  972. }
  973. }
  974. break;
  975. case "set":
  976. if (isMap(target)) {
  977. run(depsMap.get(ITERATE_KEY));
  978. }
  979. break;
  980. }
  981. }
  982. }
  983. endBatch();
  984. }
  985. function getDepFromReactive(object, key) {
  986. const depMap = targetMap.get(object);
  987. return depMap && depMap.get(key);
  988. }
  989. function reactiveReadArray(array) {
  990. const raw = toRaw(array);
  991. if (raw === array) return raw;
  992. track(raw, "iterate", ARRAY_ITERATE_KEY);
  993. return isShallow(array) ? raw : raw.map(toReactive);
  994. }
  995. function shallowReadArray(arr) {
  996. track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
  997. return arr;
  998. }
  999. const arrayInstrumentations = {
  1000. __proto__: null,
  1001. [Symbol.iterator]() {
  1002. return iterator(this, Symbol.iterator, toReactive);
  1003. },
  1004. concat(...args) {
  1005. return reactiveReadArray(this).concat(
  1006. ...args.map((x) => isArray(x) ? reactiveReadArray(x) : x)
  1007. );
  1008. },
  1009. entries() {
  1010. return iterator(this, "entries", (value) => {
  1011. value[1] = toReactive(value[1]);
  1012. return value;
  1013. });
  1014. },
  1015. every(fn, thisArg) {
  1016. return apply(this, "every", fn, thisArg, void 0, arguments);
  1017. },
  1018. filter(fn, thisArg) {
  1019. return apply(this, "filter", fn, thisArg, (v) => v.map(toReactive), arguments);
  1020. },
  1021. find(fn, thisArg) {
  1022. return apply(this, "find", fn, thisArg, toReactive, arguments);
  1023. },
  1024. findIndex(fn, thisArg) {
  1025. return apply(this, "findIndex", fn, thisArg, void 0, arguments);
  1026. },
  1027. findLast(fn, thisArg) {
  1028. return apply(this, "findLast", fn, thisArg, toReactive, arguments);
  1029. },
  1030. findLastIndex(fn, thisArg) {
  1031. return apply(this, "findLastIndex", fn, thisArg, void 0, arguments);
  1032. },
  1033. // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
  1034. forEach(fn, thisArg) {
  1035. return apply(this, "forEach", fn, thisArg, void 0, arguments);
  1036. },
  1037. includes(...args) {
  1038. return searchProxy(this, "includes", args);
  1039. },
  1040. indexOf(...args) {
  1041. return searchProxy(this, "indexOf", args);
  1042. },
  1043. join(separator) {
  1044. return reactiveReadArray(this).join(separator);
  1045. },
  1046. // keys() iterator only reads `length`, no optimisation required
  1047. lastIndexOf(...args) {
  1048. return searchProxy(this, "lastIndexOf", args);
  1049. },
  1050. map(fn, thisArg) {
  1051. return apply(this, "map", fn, thisArg, void 0, arguments);
  1052. },
  1053. pop() {
  1054. return noTracking(this, "pop");
  1055. },
  1056. push(...args) {
  1057. return noTracking(this, "push", args);
  1058. },
  1059. reduce(fn, ...args) {
  1060. return reduce(this, "reduce", fn, args);
  1061. },
  1062. reduceRight(fn, ...args) {
  1063. return reduce(this, "reduceRight", fn, args);
  1064. },
  1065. shift() {
  1066. return noTracking(this, "shift");
  1067. },
  1068. // slice could use ARRAY_ITERATE but also seems to beg for range tracking
  1069. some(fn, thisArg) {
  1070. return apply(this, "some", fn, thisArg, void 0, arguments);
  1071. },
  1072. splice(...args) {
  1073. return noTracking(this, "splice", args);
  1074. },
  1075. toReversed() {
  1076. return reactiveReadArray(this).toReversed();
  1077. },
  1078. toSorted(comparer) {
  1079. return reactiveReadArray(this).toSorted(comparer);
  1080. },
  1081. toSpliced(...args) {
  1082. return reactiveReadArray(this).toSpliced(...args);
  1083. },
  1084. unshift(...args) {
  1085. return noTracking(this, "unshift", args);
  1086. },
  1087. values() {
  1088. return iterator(this, "values", toReactive);
  1089. }
  1090. };
  1091. function iterator(self, method, wrapValue) {
  1092. const arr = shallowReadArray(self);
  1093. const iter = arr[method]();
  1094. if (arr !== self && !isShallow(self)) {
  1095. iter._next = iter.next;
  1096. iter.next = () => {
  1097. const result = iter._next();
  1098. if (result.value) {
  1099. result.value = wrapValue(result.value);
  1100. }
  1101. return result;
  1102. };
  1103. }
  1104. return iter;
  1105. }
  1106. const arrayProto = Array.prototype;
  1107. function apply(self, method, fn, thisArg, wrappedRetFn, args) {
  1108. const arr = shallowReadArray(self);
  1109. const needsWrap = arr !== self && !isShallow(self);
  1110. const methodFn = arr[method];
  1111. if (methodFn !== arrayProto[method]) {
  1112. const result2 = methodFn.apply(self, args);
  1113. return needsWrap ? toReactive(result2) : result2;
  1114. }
  1115. let wrappedFn = fn;
  1116. if (arr !== self) {
  1117. if (needsWrap) {
  1118. wrappedFn = function(item, index) {
  1119. return fn.call(this, toReactive(item), index, self);
  1120. };
  1121. } else if (fn.length > 2) {
  1122. wrappedFn = function(item, index) {
  1123. return fn.call(this, item, index, self);
  1124. };
  1125. }
  1126. }
  1127. const result = methodFn.call(arr, wrappedFn, thisArg);
  1128. return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result;
  1129. }
  1130. function reduce(self, method, fn, args) {
  1131. const arr = shallowReadArray(self);
  1132. let wrappedFn = fn;
  1133. if (arr !== self) {
  1134. if (!isShallow(self)) {
  1135. wrappedFn = function(acc, item, index) {
  1136. return fn.call(this, acc, toReactive(item), index, self);
  1137. };
  1138. } else if (fn.length > 3) {
  1139. wrappedFn = function(acc, item, index) {
  1140. return fn.call(this, acc, item, index, self);
  1141. };
  1142. }
  1143. }
  1144. return arr[method](wrappedFn, ...args);
  1145. }
  1146. function searchProxy(self, method, args) {
  1147. const arr = toRaw(self);
  1148. track(arr, "iterate", ARRAY_ITERATE_KEY);
  1149. const res = arr[method](...args);
  1150. if ((res === -1 || res === false) && isProxy(args[0])) {
  1151. args[0] = toRaw(args[0]);
  1152. return arr[method](...args);
  1153. }
  1154. return res;
  1155. }
  1156. function noTracking(self, method, args = []) {
  1157. pauseTracking();
  1158. startBatch();
  1159. const res = toRaw(self)[method].apply(self, args);
  1160. endBatch();
  1161. resetTracking();
  1162. return res;
  1163. }
  1164. const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
  1165. const builtInSymbols = new Set(
  1166. /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
  1167. );
  1168. function hasOwnProperty(key) {
  1169. if (!isSymbol(key)) key = String(key);
  1170. const obj = toRaw(this);
  1171. track(obj, "has", key);
  1172. return obj.hasOwnProperty(key);
  1173. }
  1174. class BaseReactiveHandler {
  1175. constructor(_isReadonly = false, _isShallow = false) {
  1176. this._isReadonly = _isReadonly;
  1177. this._isShallow = _isShallow;
  1178. }
  1179. get(target, key, receiver) {
  1180. const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
  1181. if (key === "__v_isReactive") {
  1182. return !isReadonly2;
  1183. } else if (key === "__v_isReadonly") {
  1184. return isReadonly2;
  1185. } else if (key === "__v_isShallow") {
  1186. return isShallow2;
  1187. } else if (key === "__v_raw") {
  1188. if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
  1189. // this means the receiver is a user proxy of the reactive proxy
  1190. Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
  1191. return target;
  1192. }
  1193. return;
  1194. }
  1195. const targetIsArray = isArray(target);
  1196. if (!isReadonly2) {
  1197. let fn;
  1198. if (targetIsArray && (fn = arrayInstrumentations[key])) {
  1199. return fn;
  1200. }
  1201. if (key === "hasOwnProperty") {
  1202. return hasOwnProperty;
  1203. }
  1204. }
  1205. const res = Reflect.get(
  1206. target,
  1207. key,
  1208. // if this is a proxy wrapping a ref, return methods using the raw ref
  1209. // as receiver so that we don't have to call `toRaw` on the ref in all
  1210. // its class methods
  1211. isRef(target) ? target : receiver
  1212. );
  1213. if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
  1214. return res;
  1215. }
  1216. if (!isReadonly2) {
  1217. track(target, "get", key);
  1218. }
  1219. if (isShallow2) {
  1220. return res;
  1221. }
  1222. if (isRef(res)) {
  1223. return targetIsArray && isIntegerKey(key) ? res : res.value;
  1224. }
  1225. if (isObject(res)) {
  1226. return isReadonly2 ? readonly(res) : reactive(res);
  1227. }
  1228. return res;
  1229. }
  1230. }
  1231. class MutableReactiveHandler extends BaseReactiveHandler {
  1232. constructor(isShallow2 = false) {
  1233. super(false, isShallow2);
  1234. }
  1235. set(target, key, value, receiver) {
  1236. let oldValue = target[key];
  1237. if (!this._isShallow) {
  1238. const isOldValueReadonly = isReadonly(oldValue);
  1239. if (!isShallow(value) && !isReadonly(value)) {
  1240. oldValue = toRaw(oldValue);
  1241. value = toRaw(value);
  1242. }
  1243. if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
  1244. if (isOldValueReadonly) {
  1245. return false;
  1246. } else {
  1247. oldValue.value = value;
  1248. return true;
  1249. }
  1250. }
  1251. }
  1252. const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
  1253. const result = Reflect.set(
  1254. target,
  1255. key,
  1256. value,
  1257. isRef(target) ? target : receiver
  1258. );
  1259. if (target === toRaw(receiver)) {
  1260. if (!hadKey) {
  1261. trigger(target, "add", key, value);
  1262. } else if (hasChanged(value, oldValue)) {
  1263. trigger(target, "set", key, value, oldValue);
  1264. }
  1265. }
  1266. return result;
  1267. }
  1268. deleteProperty(target, key) {
  1269. const hadKey = hasOwn(target, key);
  1270. const oldValue = target[key];
  1271. const result = Reflect.deleteProperty(target, key);
  1272. if (result && hadKey) {
  1273. trigger(target, "delete", key, void 0, oldValue);
  1274. }
  1275. return result;
  1276. }
  1277. has(target, key) {
  1278. const result = Reflect.has(target, key);
  1279. if (!isSymbol(key) || !builtInSymbols.has(key)) {
  1280. track(target, "has", key);
  1281. }
  1282. return result;
  1283. }
  1284. ownKeys(target) {
  1285. track(
  1286. target,
  1287. "iterate",
  1288. isArray(target) ? "length" : ITERATE_KEY
  1289. );
  1290. return Reflect.ownKeys(target);
  1291. }
  1292. }
  1293. class ReadonlyReactiveHandler extends BaseReactiveHandler {
  1294. constructor(isShallow2 = false) {
  1295. super(true, isShallow2);
  1296. }
  1297. set(target, key) {
  1298. {
  1299. warn$2(
  1300. `Set operation on key "${String(key)}" failed: target is readonly.`,
  1301. target
  1302. );
  1303. }
  1304. return true;
  1305. }
  1306. deleteProperty(target, key) {
  1307. {
  1308. warn$2(
  1309. `Delete operation on key "${String(key)}" failed: target is readonly.`,
  1310. target
  1311. );
  1312. }
  1313. return true;
  1314. }
  1315. }
  1316. const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
  1317. const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
  1318. const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
  1319. const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
  1320. const toShallow = (value) => value;
  1321. const getProto = (v) => Reflect.getPrototypeOf(v);
  1322. function createIterableMethod(method, isReadonly2, isShallow2) {
  1323. return function(...args) {
  1324. const target = this["__v_raw"];
  1325. const rawTarget = toRaw(target);
  1326. const targetIsMap = isMap(rawTarget);
  1327. const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
  1328. const isKeyOnly = method === "keys" && targetIsMap;
  1329. const innerIterator = target[method](...args);
  1330. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  1331. !isReadonly2 && track(
  1332. rawTarget,
  1333. "iterate",
  1334. isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
  1335. );
  1336. return {
  1337. // iterator protocol
  1338. next() {
  1339. const { value, done } = innerIterator.next();
  1340. return done ? { value, done } : {
  1341. value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
  1342. done
  1343. };
  1344. },
  1345. // iterable protocol
  1346. [Symbol.iterator]() {
  1347. return this;
  1348. }
  1349. };
  1350. };
  1351. }
  1352. function createReadonlyMethod(type) {
  1353. return function(...args) {
  1354. {
  1355. const key = args[0] ? `on key "${args[0]}" ` : ``;
  1356. warn$2(
  1357. `${capitalize(type)} operation ${key}failed: target is readonly.`,
  1358. toRaw(this)
  1359. );
  1360. }
  1361. return type === "delete" ? false : type === "clear" ? void 0 : this;
  1362. };
  1363. }
  1364. function createInstrumentations(readonly, shallow) {
  1365. const instrumentations = {
  1366. get(key) {
  1367. const target = this["__v_raw"];
  1368. const rawTarget = toRaw(target);
  1369. const rawKey = toRaw(key);
  1370. if (!readonly) {
  1371. if (hasChanged(key, rawKey)) {
  1372. track(rawTarget, "get", key);
  1373. }
  1374. track(rawTarget, "get", rawKey);
  1375. }
  1376. const { has } = getProto(rawTarget);
  1377. const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
  1378. if (has.call(rawTarget, key)) {
  1379. return wrap(target.get(key));
  1380. } else if (has.call(rawTarget, rawKey)) {
  1381. return wrap(target.get(rawKey));
  1382. } else if (target !== rawTarget) {
  1383. target.get(key);
  1384. }
  1385. },
  1386. get size() {
  1387. const target = this["__v_raw"];
  1388. !readonly && track(toRaw(target), "iterate", ITERATE_KEY);
  1389. return Reflect.get(target, "size", target);
  1390. },
  1391. has(key) {
  1392. const target = this["__v_raw"];
  1393. const rawTarget = toRaw(target);
  1394. const rawKey = toRaw(key);
  1395. if (!readonly) {
  1396. if (hasChanged(key, rawKey)) {
  1397. track(rawTarget, "has", key);
  1398. }
  1399. track(rawTarget, "has", rawKey);
  1400. }
  1401. return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
  1402. },
  1403. forEach(callback, thisArg) {
  1404. const observed = this;
  1405. const target = observed["__v_raw"];
  1406. const rawTarget = toRaw(target);
  1407. const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
  1408. !readonly && track(rawTarget, "iterate", ITERATE_KEY);
  1409. return target.forEach((value, key) => {
  1410. return callback.call(thisArg, wrap(value), wrap(key), observed);
  1411. });
  1412. }
  1413. };
  1414. extend(
  1415. instrumentations,
  1416. readonly ? {
  1417. add: createReadonlyMethod("add"),
  1418. set: createReadonlyMethod("set"),
  1419. delete: createReadonlyMethod("delete"),
  1420. clear: createReadonlyMethod("clear")
  1421. } : {
  1422. add(value) {
  1423. if (!shallow && !isShallow(value) && !isReadonly(value)) {
  1424. value = toRaw(value);
  1425. }
  1426. const target = toRaw(this);
  1427. const proto = getProto(target);
  1428. const hadKey = proto.has.call(target, value);
  1429. if (!hadKey) {
  1430. target.add(value);
  1431. trigger(target, "add", value, value);
  1432. }
  1433. return this;
  1434. },
  1435. set(key, value) {
  1436. if (!shallow && !isShallow(value) && !isReadonly(value)) {
  1437. value = toRaw(value);
  1438. }
  1439. const target = toRaw(this);
  1440. const { has, get } = getProto(target);
  1441. let hadKey = has.call(target, key);
  1442. if (!hadKey) {
  1443. key = toRaw(key);
  1444. hadKey = has.call(target, key);
  1445. } else {
  1446. checkIdentityKeys(target, has, key);
  1447. }
  1448. const oldValue = get.call(target, key);
  1449. target.set(key, value);
  1450. if (!hadKey) {
  1451. trigger(target, "add", key, value);
  1452. } else if (hasChanged(value, oldValue)) {
  1453. trigger(target, "set", key, value, oldValue);
  1454. }
  1455. return this;
  1456. },
  1457. delete(key) {
  1458. const target = toRaw(this);
  1459. const { has, get } = getProto(target);
  1460. let hadKey = has.call(target, key);
  1461. if (!hadKey) {
  1462. key = toRaw(key);
  1463. hadKey = has.call(target, key);
  1464. } else {
  1465. checkIdentityKeys(target, has, key);
  1466. }
  1467. const oldValue = get ? get.call(target, key) : void 0;
  1468. const result = target.delete(key);
  1469. if (hadKey) {
  1470. trigger(target, "delete", key, void 0, oldValue);
  1471. }
  1472. return result;
  1473. },
  1474. clear() {
  1475. const target = toRaw(this);
  1476. const hadItems = target.size !== 0;
  1477. const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
  1478. const result = target.clear();
  1479. if (hadItems) {
  1480. trigger(
  1481. target,
  1482. "clear",
  1483. void 0,
  1484. void 0,
  1485. oldTarget
  1486. );
  1487. }
  1488. return result;
  1489. }
  1490. }
  1491. );
  1492. const iteratorMethods = [
  1493. "keys",
  1494. "values",
  1495. "entries",
  1496. Symbol.iterator
  1497. ];
  1498. iteratorMethods.forEach((method) => {
  1499. instrumentations[method] = createIterableMethod(method, readonly, shallow);
  1500. });
  1501. return instrumentations;
  1502. }
  1503. function createInstrumentationGetter(isReadonly2, shallow) {
  1504. const instrumentations = createInstrumentations(isReadonly2, shallow);
  1505. return (target, key, receiver) => {
  1506. if (key === "__v_isReactive") {
  1507. return !isReadonly2;
  1508. } else if (key === "__v_isReadonly") {
  1509. return isReadonly2;
  1510. } else if (key === "__v_raw") {
  1511. return target;
  1512. }
  1513. return Reflect.get(
  1514. hasOwn(instrumentations, key) && key in target ? instrumentations : target,
  1515. key,
  1516. receiver
  1517. );
  1518. };
  1519. }
  1520. const mutableCollectionHandlers = {
  1521. get: /* @__PURE__ */ createInstrumentationGetter(false, false)
  1522. };
  1523. const shallowCollectionHandlers = {
  1524. get: /* @__PURE__ */ createInstrumentationGetter(false, true)
  1525. };
  1526. const readonlyCollectionHandlers = {
  1527. get: /* @__PURE__ */ createInstrumentationGetter(true, false)
  1528. };
  1529. const shallowReadonlyCollectionHandlers = {
  1530. get: /* @__PURE__ */ createInstrumentationGetter(true, true)
  1531. };
  1532. function checkIdentityKeys(target, has, key) {
  1533. const rawKey = toRaw(key);
  1534. if (rawKey !== key && has.call(target, rawKey)) {
  1535. const type = toRawType(target);
  1536. warn$2(
  1537. `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.`
  1538. );
  1539. }
  1540. }
  1541. const reactiveMap = /* @__PURE__ */ new WeakMap();
  1542. const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
  1543. const readonlyMap = /* @__PURE__ */ new WeakMap();
  1544. const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
  1545. function targetTypeMap(rawType) {
  1546. switch (rawType) {
  1547. case "Object":
  1548. case "Array":
  1549. return 1 /* COMMON */;
  1550. case "Map":
  1551. case "Set":
  1552. case "WeakMap":
  1553. case "WeakSet":
  1554. return 2 /* COLLECTION */;
  1555. default:
  1556. return 0 /* INVALID */;
  1557. }
  1558. }
  1559. function getTargetType(value) {
  1560. return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
  1561. }
  1562. function reactive(target) {
  1563. if (isReadonly(target)) {
  1564. return target;
  1565. }
  1566. return createReactiveObject(
  1567. target,
  1568. false,
  1569. mutableHandlers,
  1570. mutableCollectionHandlers,
  1571. reactiveMap
  1572. );
  1573. }
  1574. function shallowReactive(target) {
  1575. return createReactiveObject(
  1576. target,
  1577. false,
  1578. shallowReactiveHandlers,
  1579. shallowCollectionHandlers,
  1580. shallowReactiveMap
  1581. );
  1582. }
  1583. function readonly(target) {
  1584. return createReactiveObject(
  1585. target,
  1586. true,
  1587. readonlyHandlers,
  1588. readonlyCollectionHandlers,
  1589. readonlyMap
  1590. );
  1591. }
  1592. function shallowReadonly(target) {
  1593. return createReactiveObject(
  1594. target,
  1595. true,
  1596. shallowReadonlyHandlers,
  1597. shallowReadonlyCollectionHandlers,
  1598. shallowReadonlyMap
  1599. );
  1600. }
  1601. function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
  1602. if (!isObject(target)) {
  1603. {
  1604. warn$2(
  1605. `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String(
  1606. target
  1607. )}`
  1608. );
  1609. }
  1610. return target;
  1611. }
  1612. if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
  1613. return target;
  1614. }
  1615. const existingProxy = proxyMap.get(target);
  1616. if (existingProxy) {
  1617. return existingProxy;
  1618. }
  1619. const targetType = getTargetType(target);
  1620. if (targetType === 0 /* INVALID */) {
  1621. return target;
  1622. }
  1623. const proxy = new Proxy(
  1624. target,
  1625. targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
  1626. );
  1627. proxyMap.set(target, proxy);
  1628. return proxy;
  1629. }
  1630. function isReactive(value) {
  1631. if (isReadonly(value)) {
  1632. return isReactive(value["__v_raw"]);
  1633. }
  1634. return !!(value && value["__v_isReactive"]);
  1635. }
  1636. function isReadonly(value) {
  1637. return !!(value && value["__v_isReadonly"]);
  1638. }
  1639. function isShallow(value) {
  1640. return !!(value && value["__v_isShallow"]);
  1641. }
  1642. function isProxy(value) {
  1643. return value ? !!value["__v_raw"] : false;
  1644. }
  1645. function toRaw(observed) {
  1646. const raw = observed && observed["__v_raw"];
  1647. return raw ? toRaw(raw) : observed;
  1648. }
  1649. function markRaw(value) {
  1650. if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
  1651. def(value, "__v_skip", true);
  1652. }
  1653. return value;
  1654. }
  1655. const toReactive = (value) => isObject(value) ? reactive(value) : value;
  1656. const toReadonly = (value) => isObject(value) ? readonly(value) : value;
  1657. function isRef(r) {
  1658. return r ? r["__v_isRef"] === true : false;
  1659. }
  1660. function ref(value) {
  1661. return createRef(value, false);
  1662. }
  1663. function shallowRef(value) {
  1664. return createRef(value, true);
  1665. }
  1666. function createRef(rawValue, shallow) {
  1667. if (isRef(rawValue)) {
  1668. return rawValue;
  1669. }
  1670. return new RefImpl(rawValue, shallow);
  1671. }
  1672. class RefImpl {
  1673. constructor(value, isShallow2) {
  1674. this.dep = new Dep();
  1675. this["__v_isRef"] = true;
  1676. this["__v_isShallow"] = false;
  1677. this._rawValue = isShallow2 ? value : toRaw(value);
  1678. this._value = isShallow2 ? value : toReactive(value);
  1679. this["__v_isShallow"] = isShallow2;
  1680. }
  1681. get value() {
  1682. {
  1683. this.dep.track({
  1684. target: this,
  1685. type: "get",
  1686. key: "value"
  1687. });
  1688. }
  1689. return this._value;
  1690. }
  1691. set value(newValue) {
  1692. const oldValue = this._rawValue;
  1693. const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue);
  1694. newValue = useDirectValue ? newValue : toRaw(newValue);
  1695. if (hasChanged(newValue, oldValue)) {
  1696. this._rawValue = newValue;
  1697. this._value = useDirectValue ? newValue : toReactive(newValue);
  1698. {
  1699. this.dep.trigger({
  1700. target: this,
  1701. type: "set",
  1702. key: "value",
  1703. newValue,
  1704. oldValue
  1705. });
  1706. }
  1707. }
  1708. }
  1709. }
  1710. function triggerRef(ref2) {
  1711. if (ref2.dep) {
  1712. {
  1713. ref2.dep.trigger({
  1714. target: ref2,
  1715. type: "set",
  1716. key: "value",
  1717. newValue: ref2._value
  1718. });
  1719. }
  1720. }
  1721. }
  1722. function unref(ref2) {
  1723. return isRef(ref2) ? ref2.value : ref2;
  1724. }
  1725. function toValue(source) {
  1726. return isFunction(source) ? source() : unref(source);
  1727. }
  1728. const shallowUnwrapHandlers = {
  1729. get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
  1730. set: (target, key, value, receiver) => {
  1731. const oldValue = target[key];
  1732. if (isRef(oldValue) && !isRef(value)) {
  1733. oldValue.value = value;
  1734. return true;
  1735. } else {
  1736. return Reflect.set(target, key, value, receiver);
  1737. }
  1738. }
  1739. };
  1740. function proxyRefs(objectWithRefs) {
  1741. return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
  1742. }
  1743. class CustomRefImpl {
  1744. constructor(factory) {
  1745. this["__v_isRef"] = true;
  1746. this._value = void 0;
  1747. const dep = this.dep = new Dep();
  1748. const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep));
  1749. this._get = get;
  1750. this._set = set;
  1751. }
  1752. get value() {
  1753. return this._value = this._get();
  1754. }
  1755. set value(newVal) {
  1756. this._set(newVal);
  1757. }
  1758. }
  1759. function customRef(factory) {
  1760. return new CustomRefImpl(factory);
  1761. }
  1762. function toRefs(object) {
  1763. if (!isProxy(object)) {
  1764. warn$2(`toRefs() expects a reactive object but received a plain one.`);
  1765. }
  1766. const ret = isArray(object) ? new Array(object.length) : {};
  1767. for (const key in object) {
  1768. ret[key] = propertyToRef(object, key);
  1769. }
  1770. return ret;
  1771. }
  1772. class ObjectRefImpl {
  1773. constructor(_object, _key, _defaultValue) {
  1774. this._object = _object;
  1775. this._key = _key;
  1776. this._defaultValue = _defaultValue;
  1777. this["__v_isRef"] = true;
  1778. this._value = void 0;
  1779. }
  1780. get value() {
  1781. const val = this._object[this._key];
  1782. return this._value = val === void 0 ? this._defaultValue : val;
  1783. }
  1784. set value(newVal) {
  1785. this._object[this._key] = newVal;
  1786. }
  1787. get dep() {
  1788. return getDepFromReactive(toRaw(this._object), this._key);
  1789. }
  1790. }
  1791. class GetterRefImpl {
  1792. constructor(_getter) {
  1793. this._getter = _getter;
  1794. this["__v_isRef"] = true;
  1795. this["__v_isReadonly"] = true;
  1796. this._value = void 0;
  1797. }
  1798. get value() {
  1799. return this._value = this._getter();
  1800. }
  1801. }
  1802. function toRef(source, key, defaultValue) {
  1803. if (isRef(source)) {
  1804. return source;
  1805. } else if (isFunction(source)) {
  1806. return new GetterRefImpl(source);
  1807. } else if (isObject(source) && arguments.length > 1) {
  1808. return propertyToRef(source, key, defaultValue);
  1809. } else {
  1810. return ref(source);
  1811. }
  1812. }
  1813. function propertyToRef(source, key, defaultValue) {
  1814. const val = source[key];
  1815. return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
  1816. }
  1817. class ComputedRefImpl {
  1818. constructor(fn, setter, isSSR) {
  1819. this.fn = fn;
  1820. this.setter = setter;
  1821. /**
  1822. * @internal
  1823. */
  1824. this._value = void 0;
  1825. /**
  1826. * @internal
  1827. */
  1828. this.dep = new Dep(this);
  1829. /**
  1830. * @internal
  1831. */
  1832. this.__v_isRef = true;
  1833. // TODO isolatedDeclarations "__v_isReadonly"
  1834. // A computed is also a subscriber that tracks other deps
  1835. /**
  1836. * @internal
  1837. */
  1838. this.deps = void 0;
  1839. /**
  1840. * @internal
  1841. */
  1842. this.depsTail = void 0;
  1843. /**
  1844. * @internal
  1845. */
  1846. this.flags = 16;
  1847. /**
  1848. * @internal
  1849. */
  1850. this.globalVersion = globalVersion - 1;
  1851. /**
  1852. * @internal
  1853. */
  1854. this.next = void 0;
  1855. // for backwards compat
  1856. this.effect = this;
  1857. this["__v_isReadonly"] = !setter;
  1858. this.isSSR = isSSR;
  1859. }
  1860. /**
  1861. * @internal
  1862. */
  1863. notify() {
  1864. this.flags |= 16;
  1865. if (!(this.flags & 8) && // avoid infinite self recursion
  1866. activeSub !== this) {
  1867. batch(this, true);
  1868. return true;
  1869. }
  1870. }
  1871. get value() {
  1872. const link = this.dep.track({
  1873. target: this,
  1874. type: "get",
  1875. key: "value"
  1876. }) ;
  1877. refreshComputed(this);
  1878. if (link) {
  1879. link.version = this.dep.version;
  1880. }
  1881. return this._value;
  1882. }
  1883. set value(newValue) {
  1884. if (this.setter) {
  1885. this.setter(newValue);
  1886. } else {
  1887. warn$2("Write operation failed: computed value is readonly");
  1888. }
  1889. }
  1890. }
  1891. function computed$1(getterOrOptions, debugOptions, isSSR = false) {
  1892. let getter;
  1893. let setter;
  1894. if (isFunction(getterOrOptions)) {
  1895. getter = getterOrOptions;
  1896. } else {
  1897. getter = getterOrOptions.get;
  1898. setter = getterOrOptions.set;
  1899. }
  1900. const cRef = new ComputedRefImpl(getter, setter, isSSR);
  1901. if (debugOptions && !isSSR) {
  1902. cRef.onTrack = debugOptions.onTrack;
  1903. cRef.onTrigger = debugOptions.onTrigger;
  1904. }
  1905. return cRef;
  1906. }
  1907. const TrackOpTypes = {
  1908. "GET": "get",
  1909. "HAS": "has",
  1910. "ITERATE": "iterate"
  1911. };
  1912. const TriggerOpTypes = {
  1913. "SET": "set",
  1914. "ADD": "add",
  1915. "DELETE": "delete",
  1916. "CLEAR": "clear"
  1917. };
  1918. const INITIAL_WATCHER_VALUE = {};
  1919. const cleanupMap = /* @__PURE__ */ new WeakMap();
  1920. let activeWatcher = void 0;
  1921. function getCurrentWatcher() {
  1922. return activeWatcher;
  1923. }
  1924. function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
  1925. if (owner) {
  1926. let cleanups = cleanupMap.get(owner);
  1927. if (!cleanups) cleanupMap.set(owner, cleanups = []);
  1928. cleanups.push(cleanupFn);
  1929. } else if (!failSilently) {
  1930. warn$2(
  1931. `onWatcherCleanup() was called when there was no active watcher to associate with.`
  1932. );
  1933. }
  1934. }
  1935. function watch$1(source, cb, options = EMPTY_OBJ) {
  1936. const { immediate, deep, once, scheduler, augmentJob, call } = options;
  1937. const warnInvalidSource = (s) => {
  1938. (options.onWarn || warn$2)(
  1939. `Invalid watch source: `,
  1940. s,
  1941. `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
  1942. );
  1943. };
  1944. const reactiveGetter = (source2) => {
  1945. if (deep) return source2;
  1946. if (isShallow(source2) || deep === false || deep === 0)
  1947. return traverse(source2, 1);
  1948. return traverse(source2);
  1949. };
  1950. let effect;
  1951. let getter;
  1952. let cleanup;
  1953. let boundCleanup;
  1954. let forceTrigger = false;
  1955. let isMultiSource = false;
  1956. if (isRef(source)) {
  1957. getter = () => source.value;
  1958. forceTrigger = isShallow(source);
  1959. } else if (isReactive(source)) {
  1960. getter = () => reactiveGetter(source);
  1961. forceTrigger = true;
  1962. } else if (isArray(source)) {
  1963. isMultiSource = true;
  1964. forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
  1965. getter = () => source.map((s) => {
  1966. if (isRef(s)) {
  1967. return s.value;
  1968. } else if (isReactive(s)) {
  1969. return reactiveGetter(s);
  1970. } else if (isFunction(s)) {
  1971. return call ? call(s, 2) : s();
  1972. } else {
  1973. warnInvalidSource(s);
  1974. }
  1975. });
  1976. } else if (isFunction(source)) {
  1977. if (cb) {
  1978. getter = call ? () => call(source, 2) : source;
  1979. } else {
  1980. getter = () => {
  1981. if (cleanup) {
  1982. pauseTracking();
  1983. try {
  1984. cleanup();
  1985. } finally {
  1986. resetTracking();
  1987. }
  1988. }
  1989. const currentEffect = activeWatcher;
  1990. activeWatcher = effect;
  1991. try {
  1992. return call ? call(source, 3, [boundCleanup]) : source(boundCleanup);
  1993. } finally {
  1994. activeWatcher = currentEffect;
  1995. }
  1996. };
  1997. }
  1998. } else {
  1999. getter = NOOP;
  2000. warnInvalidSource(source);
  2001. }
  2002. if (cb && deep) {
  2003. const baseGetter = getter;
  2004. const depth = deep === true ? Infinity : deep;
  2005. getter = () => traverse(baseGetter(), depth);
  2006. }
  2007. const scope = getCurrentScope();
  2008. const watchHandle = () => {
  2009. effect.stop();
  2010. if (scope) {
  2011. remove(scope.effects, effect);
  2012. }
  2013. };
  2014. if (once && cb) {
  2015. const _cb = cb;
  2016. cb = (...args) => {
  2017. _cb(...args);
  2018. watchHandle();
  2019. };
  2020. }
  2021. let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
  2022. const job = (immediateFirstRun) => {
  2023. if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {
  2024. return;
  2025. }
  2026. if (cb) {
  2027. const newValue = effect.run();
  2028. if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
  2029. if (cleanup) {
  2030. cleanup();
  2031. }
  2032. const currentWatcher = activeWatcher;
  2033. activeWatcher = effect;
  2034. try {
  2035. const args = [
  2036. newValue,
  2037. // pass undefined as the old value when it's changed for the first time
  2038. oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
  2039. boundCleanup
  2040. ];
  2041. call ? call(cb, 3, args) : (
  2042. // @ts-expect-error
  2043. cb(...args)
  2044. );
  2045. oldValue = newValue;
  2046. } finally {
  2047. activeWatcher = currentWatcher;
  2048. }
  2049. }
  2050. } else {
  2051. effect.run();
  2052. }
  2053. };
  2054. if (augmentJob) {
  2055. augmentJob(job);
  2056. }
  2057. effect = new ReactiveEffect(getter);
  2058. effect.scheduler = scheduler ? () => scheduler(job, false) : job;
  2059. boundCleanup = (fn) => onWatcherCleanup(fn, false, effect);
  2060. cleanup = effect.onStop = () => {
  2061. const cleanups = cleanupMap.get(effect);
  2062. if (cleanups) {
  2063. if (call) {
  2064. call(cleanups, 4);
  2065. } else {
  2066. for (const cleanup2 of cleanups) cleanup2();
  2067. }
  2068. cleanupMap.delete(effect);
  2069. }
  2070. };
  2071. {
  2072. effect.onTrack = options.onTrack;
  2073. effect.onTrigger = options.onTrigger;
  2074. }
  2075. if (cb) {
  2076. if (immediate) {
  2077. job(true);
  2078. } else {
  2079. oldValue = effect.run();
  2080. }
  2081. } else if (scheduler) {
  2082. scheduler(job.bind(null, true), true);
  2083. } else {
  2084. effect.run();
  2085. }
  2086. watchHandle.pause = effect.pause.bind(effect);
  2087. watchHandle.resume = effect.resume.bind(effect);
  2088. watchHandle.stop = watchHandle;
  2089. return watchHandle;
  2090. }
  2091. function traverse(value, depth = Infinity, seen) {
  2092. if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
  2093. return value;
  2094. }
  2095. seen = seen || /* @__PURE__ */ new Set();
  2096. if (seen.has(value)) {
  2097. return value;
  2098. }
  2099. seen.add(value);
  2100. depth--;
  2101. if (isRef(value)) {
  2102. traverse(value.value, depth, seen);
  2103. } else if (isArray(value)) {
  2104. for (let i = 0; i < value.length; i++) {
  2105. traverse(value[i], depth, seen);
  2106. }
  2107. } else if (isSet(value) || isMap(value)) {
  2108. value.forEach((v) => {
  2109. traverse(v, depth, seen);
  2110. });
  2111. } else if (isPlainObject(value)) {
  2112. for (const key in value) {
  2113. traverse(value[key], depth, seen);
  2114. }
  2115. for (const key of Object.getOwnPropertySymbols(value)) {
  2116. if (Object.prototype.propertyIsEnumerable.call(value, key)) {
  2117. traverse(value[key], depth, seen);
  2118. }
  2119. }
  2120. }
  2121. return value;
  2122. }
  2123. const stack = [];
  2124. function pushWarningContext(vnode) {
  2125. stack.push(vnode);
  2126. }
  2127. function popWarningContext() {
  2128. stack.pop();
  2129. }
  2130. let isWarning = false;
  2131. function warn$1(msg, ...args) {
  2132. if (isWarning) return;
  2133. isWarning = true;
  2134. pauseTracking();
  2135. const instance = stack.length ? stack[stack.length - 1].component : null;
  2136. const appWarnHandler = instance && instance.appContext.config.warnHandler;
  2137. const trace = getComponentTrace();
  2138. if (appWarnHandler) {
  2139. callWithErrorHandling(
  2140. appWarnHandler,
  2141. instance,
  2142. 11,
  2143. [
  2144. // eslint-disable-next-line no-restricted-syntax
  2145. msg + args.map((a) => {
  2146. var _a, _b;
  2147. return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
  2148. }).join(""),
  2149. instance && instance.proxy,
  2150. trace.map(
  2151. ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
  2152. ).join("\n"),
  2153. trace
  2154. ]
  2155. );
  2156. } else {
  2157. const warnArgs = [`[Vue warn]: ${msg}`, ...args];
  2158. if (trace.length && // avoid spamming console during tests
  2159. true) {
  2160. warnArgs.push(`
  2161. `, ...formatTrace(trace));
  2162. }
  2163. console.warn(...warnArgs);
  2164. }
  2165. resetTracking();
  2166. isWarning = false;
  2167. }
  2168. function getComponentTrace() {
  2169. let currentVNode = stack[stack.length - 1];
  2170. if (!currentVNode) {
  2171. return [];
  2172. }
  2173. const normalizedStack = [];
  2174. while (currentVNode) {
  2175. const last = normalizedStack[0];
  2176. if (last && last.vnode === currentVNode) {
  2177. last.recurseCount++;
  2178. } else {
  2179. normalizedStack.push({
  2180. vnode: currentVNode,
  2181. recurseCount: 0
  2182. });
  2183. }
  2184. const parentInstance = currentVNode.component && currentVNode.component.parent;
  2185. currentVNode = parentInstance && parentInstance.vnode;
  2186. }
  2187. return normalizedStack;
  2188. }
  2189. function formatTrace(trace) {
  2190. const logs = [];
  2191. trace.forEach((entry, i) => {
  2192. logs.push(...i === 0 ? [] : [`
  2193. `], ...formatTraceEntry(entry));
  2194. });
  2195. return logs;
  2196. }
  2197. function formatTraceEntry({ vnode, recurseCount }) {
  2198. const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
  2199. const isRoot = vnode.component ? vnode.component.parent == null : false;
  2200. const open = ` at <${formatComponentName(
  2201. vnode.component,
  2202. vnode.type,
  2203. isRoot
  2204. )}`;
  2205. const close = `>` + postfix;
  2206. return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
  2207. }
  2208. function formatProps(props) {
  2209. const res = [];
  2210. const keys = Object.keys(props);
  2211. keys.slice(0, 3).forEach((key) => {
  2212. res.push(...formatProp(key, props[key]));
  2213. });
  2214. if (keys.length > 3) {
  2215. res.push(` ...`);
  2216. }
  2217. return res;
  2218. }
  2219. function formatProp(key, value, raw) {
  2220. if (isString(value)) {
  2221. value = JSON.stringify(value);
  2222. return raw ? value : [`${key}=${value}`];
  2223. } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
  2224. return raw ? value : [`${key}=${value}`];
  2225. } else if (isRef(value)) {
  2226. value = formatProp(key, toRaw(value.value), true);
  2227. return raw ? value : [`${key}=Ref<`, value, `>`];
  2228. } else if (isFunction(value)) {
  2229. return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
  2230. } else {
  2231. value = toRaw(value);
  2232. return raw ? value : [`${key}=`, value];
  2233. }
  2234. }
  2235. function assertNumber(val, type) {
  2236. if (val === void 0) {
  2237. return;
  2238. } else if (typeof val !== "number") {
  2239. warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`);
  2240. } else if (isNaN(val)) {
  2241. warn$1(`${type} is NaN - the duration expression might be incorrect.`);
  2242. }
  2243. }
  2244. const ErrorCodes = {
  2245. "SETUP_FUNCTION": 0,
  2246. "0": "SETUP_FUNCTION",
  2247. "RENDER_FUNCTION": 1,
  2248. "1": "RENDER_FUNCTION",
  2249. "NATIVE_EVENT_HANDLER": 5,
  2250. "5": "NATIVE_EVENT_HANDLER",
  2251. "COMPONENT_EVENT_HANDLER": 6,
  2252. "6": "COMPONENT_EVENT_HANDLER",
  2253. "VNODE_HOOK": 7,
  2254. "7": "VNODE_HOOK",
  2255. "DIRECTIVE_HOOK": 8,
  2256. "8": "DIRECTIVE_HOOK",
  2257. "TRANSITION_HOOK": 9,
  2258. "9": "TRANSITION_HOOK",
  2259. "APP_ERROR_HANDLER": 10,
  2260. "10": "APP_ERROR_HANDLER",
  2261. "APP_WARN_HANDLER": 11,
  2262. "11": "APP_WARN_HANDLER",
  2263. "FUNCTION_REF": 12,
  2264. "12": "FUNCTION_REF",
  2265. "ASYNC_COMPONENT_LOADER": 13,
  2266. "13": "ASYNC_COMPONENT_LOADER",
  2267. "SCHEDULER": 14,
  2268. "14": "SCHEDULER",
  2269. "COMPONENT_UPDATE": 15,
  2270. "15": "COMPONENT_UPDATE",
  2271. "APP_UNMOUNT_CLEANUP": 16,
  2272. "16": "APP_UNMOUNT_CLEANUP"
  2273. };
  2274. const ErrorTypeStrings$1 = {
  2275. ["sp"]: "serverPrefetch hook",
  2276. ["bc"]: "beforeCreate hook",
  2277. ["c"]: "created hook",
  2278. ["bm"]: "beforeMount hook",
  2279. ["m"]: "mounted hook",
  2280. ["bu"]: "beforeUpdate hook",
  2281. ["u"]: "updated",
  2282. ["bum"]: "beforeUnmount hook",
  2283. ["um"]: "unmounted hook",
  2284. ["a"]: "activated hook",
  2285. ["da"]: "deactivated hook",
  2286. ["ec"]: "errorCaptured hook",
  2287. ["rtc"]: "renderTracked hook",
  2288. ["rtg"]: "renderTriggered hook",
  2289. [0]: "setup function",
  2290. [1]: "render function",
  2291. [2]: "watcher getter",
  2292. [3]: "watcher callback",
  2293. [4]: "watcher cleanup function",
  2294. [5]: "native event handler",
  2295. [6]: "component event handler",
  2296. [7]: "vnode hook",
  2297. [8]: "directive hook",
  2298. [9]: "transition hook",
  2299. [10]: "app errorHandler",
  2300. [11]: "app warnHandler",
  2301. [12]: "ref function",
  2302. [13]: "async component loader",
  2303. [14]: "scheduler flush",
  2304. [15]: "component update",
  2305. [16]: "app unmount cleanup function"
  2306. };
  2307. function callWithErrorHandling(fn, instance, type, args) {
  2308. try {
  2309. return args ? fn(...args) : fn();
  2310. } catch (err) {
  2311. handleError(err, instance, type);
  2312. }
  2313. }
  2314. function callWithAsyncErrorHandling(fn, instance, type, args) {
  2315. if (isFunction(fn)) {
  2316. const res = callWithErrorHandling(fn, instance, type, args);
  2317. if (res && isPromise(res)) {
  2318. res.catch((err) => {
  2319. handleError(err, instance, type);
  2320. });
  2321. }
  2322. return res;
  2323. }
  2324. if (isArray(fn)) {
  2325. const values = [];
  2326. for (let i = 0; i < fn.length; i++) {
  2327. values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
  2328. }
  2329. return values;
  2330. } else {
  2331. warn$1(
  2332. `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`
  2333. );
  2334. }
  2335. }
  2336. function handleError(err, instance, type, throwInDev = true) {
  2337. const contextVNode = instance ? instance.vnode : null;
  2338. const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
  2339. if (instance) {
  2340. let cur = instance.parent;
  2341. const exposedInstance = instance.proxy;
  2342. const errorInfo = ErrorTypeStrings$1[type] ;
  2343. while (cur) {
  2344. const errorCapturedHooks = cur.ec;
  2345. if (errorCapturedHooks) {
  2346. for (let i = 0; i < errorCapturedHooks.length; i++) {
  2347. if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
  2348. return;
  2349. }
  2350. }
  2351. }
  2352. cur = cur.parent;
  2353. }
  2354. if (errorHandler) {
  2355. pauseTracking();
  2356. callWithErrorHandling(errorHandler, null, 10, [
  2357. err,
  2358. exposedInstance,
  2359. errorInfo
  2360. ]);
  2361. resetTracking();
  2362. return;
  2363. }
  2364. }
  2365. logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
  2366. }
  2367. function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {
  2368. {
  2369. const info = ErrorTypeStrings$1[type];
  2370. if (contextVNode) {
  2371. pushWarningContext(contextVNode);
  2372. }
  2373. warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
  2374. if (contextVNode) {
  2375. popWarningContext();
  2376. }
  2377. if (throwInDev) {
  2378. throw err;
  2379. } else {
  2380. console.error(err);
  2381. }
  2382. }
  2383. }
  2384. const queue = [];
  2385. let flushIndex = -1;
  2386. const pendingPostFlushCbs = [];
  2387. let activePostFlushCbs = null;
  2388. let postFlushIndex = 0;
  2389. const resolvedPromise = /* @__PURE__ */ Promise.resolve();
  2390. let currentFlushPromise = null;
  2391. const RECURSION_LIMIT = 100;
  2392. function nextTick(fn) {
  2393. const p = currentFlushPromise || resolvedPromise;
  2394. return fn ? p.then(this ? fn.bind(this) : fn) : p;
  2395. }
  2396. function findInsertionIndex(id) {
  2397. let start = flushIndex + 1;
  2398. let end = queue.length;
  2399. while (start < end) {
  2400. const middle = start + end >>> 1;
  2401. const middleJob = queue[middle];
  2402. const middleJobId = getId(middleJob);
  2403. if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
  2404. start = middle + 1;
  2405. } else {
  2406. end = middle;
  2407. }
  2408. }
  2409. return start;
  2410. }
  2411. function queueJob(job) {
  2412. if (!(job.flags & 1)) {
  2413. const jobId = getId(job);
  2414. const lastJob = queue[queue.length - 1];
  2415. if (!lastJob || // fast path when the job id is larger than the tail
  2416. !(job.flags & 2) && jobId >= getId(lastJob)) {
  2417. queue.push(job);
  2418. } else {
  2419. queue.splice(findInsertionIndex(jobId), 0, job);
  2420. }
  2421. job.flags |= 1;
  2422. queueFlush();
  2423. }
  2424. }
  2425. function queueFlush() {
  2426. if (!currentFlushPromise) {
  2427. currentFlushPromise = resolvedPromise.then(flushJobs);
  2428. }
  2429. }
  2430. function queuePostFlushCb(cb) {
  2431. if (!isArray(cb)) {
  2432. if (activePostFlushCbs && cb.id === -1) {
  2433. activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
  2434. } else if (!(cb.flags & 1)) {
  2435. pendingPostFlushCbs.push(cb);
  2436. cb.flags |= 1;
  2437. }
  2438. } else {
  2439. pendingPostFlushCbs.push(...cb);
  2440. }
  2441. queueFlush();
  2442. }
  2443. function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
  2444. {
  2445. seen = seen || /* @__PURE__ */ new Map();
  2446. }
  2447. for (; i < queue.length; i++) {
  2448. const cb = queue[i];
  2449. if (cb && cb.flags & 2) {
  2450. if (instance && cb.id !== instance.uid) {
  2451. continue;
  2452. }
  2453. if (checkRecursiveUpdates(seen, cb)) {
  2454. continue;
  2455. }
  2456. queue.splice(i, 1);
  2457. i--;
  2458. if (cb.flags & 4) {
  2459. cb.flags &= ~1;
  2460. }
  2461. cb();
  2462. if (!(cb.flags & 4)) {
  2463. cb.flags &= ~1;
  2464. }
  2465. }
  2466. }
  2467. }
  2468. function flushPostFlushCbs(seen) {
  2469. if (pendingPostFlushCbs.length) {
  2470. const deduped = [...new Set(pendingPostFlushCbs)].sort(
  2471. (a, b) => getId(a) - getId(b)
  2472. );
  2473. pendingPostFlushCbs.length = 0;
  2474. if (activePostFlushCbs) {
  2475. activePostFlushCbs.push(...deduped);
  2476. return;
  2477. }
  2478. activePostFlushCbs = deduped;
  2479. {
  2480. seen = seen || /* @__PURE__ */ new Map();
  2481. }
  2482. for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
  2483. const cb = activePostFlushCbs[postFlushIndex];
  2484. if (checkRecursiveUpdates(seen, cb)) {
  2485. continue;
  2486. }
  2487. if (cb.flags & 4) {
  2488. cb.flags &= ~1;
  2489. }
  2490. if (!(cb.flags & 8)) cb();
  2491. cb.flags &= ~1;
  2492. }
  2493. activePostFlushCbs = null;
  2494. postFlushIndex = 0;
  2495. }
  2496. }
  2497. const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
  2498. function flushJobs(seen) {
  2499. {
  2500. seen = seen || /* @__PURE__ */ new Map();
  2501. }
  2502. const check = (job) => checkRecursiveUpdates(seen, job) ;
  2503. try {
  2504. for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
  2505. const job = queue[flushIndex];
  2506. if (job && !(job.flags & 8)) {
  2507. if (check(job)) {
  2508. continue;
  2509. }
  2510. if (job.flags & 4) {
  2511. job.flags &= ~1;
  2512. }
  2513. callWithErrorHandling(
  2514. job,
  2515. job.i,
  2516. job.i ? 15 : 14
  2517. );
  2518. if (!(job.flags & 4)) {
  2519. job.flags &= ~1;
  2520. }
  2521. }
  2522. }
  2523. } finally {
  2524. for (; flushIndex < queue.length; flushIndex++) {
  2525. const job = queue[flushIndex];
  2526. if (job) {
  2527. job.flags &= ~1;
  2528. }
  2529. }
  2530. flushIndex = -1;
  2531. queue.length = 0;
  2532. flushPostFlushCbs(seen);
  2533. currentFlushPromise = null;
  2534. if (queue.length || pendingPostFlushCbs.length) {
  2535. flushJobs(seen);
  2536. }
  2537. }
  2538. }
  2539. function checkRecursiveUpdates(seen, fn) {
  2540. const count = seen.get(fn) || 0;
  2541. if (count > RECURSION_LIMIT) {
  2542. const instance = fn.i;
  2543. const componentName = instance && getComponentName(instance.type);
  2544. handleError(
  2545. `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.`,
  2546. null,
  2547. 10
  2548. );
  2549. return true;
  2550. }
  2551. seen.set(fn, count + 1);
  2552. return false;
  2553. }
  2554. let isHmrUpdating = false;
  2555. const hmrDirtyComponents = /* @__PURE__ */ new Map();
  2556. {
  2557. getGlobalThis().__VUE_HMR_RUNTIME__ = {
  2558. createRecord: tryWrap(createRecord),
  2559. rerender: tryWrap(rerender),
  2560. reload: tryWrap(reload)
  2561. };
  2562. }
  2563. const map = /* @__PURE__ */ new Map();
  2564. function registerHMR(instance) {
  2565. const id = instance.type.__hmrId;
  2566. let record = map.get(id);
  2567. if (!record) {
  2568. createRecord(id, instance.type);
  2569. record = map.get(id);
  2570. }
  2571. record.instances.add(instance);
  2572. }
  2573. function unregisterHMR(instance) {
  2574. map.get(instance.type.__hmrId).instances.delete(instance);
  2575. }
  2576. function createRecord(id, initialDef) {
  2577. if (map.has(id)) {
  2578. return false;
  2579. }
  2580. map.set(id, {
  2581. initialDef: normalizeClassComponent(initialDef),
  2582. instances: /* @__PURE__ */ new Set()
  2583. });
  2584. return true;
  2585. }
  2586. function normalizeClassComponent(component) {
  2587. return isClassComponent(component) ? component.__vccOpts : component;
  2588. }
  2589. function rerender(id, newRender) {
  2590. const record = map.get(id);
  2591. if (!record) {
  2592. return;
  2593. }
  2594. record.initialDef.render = newRender;
  2595. [...record.instances].forEach((instance) => {
  2596. if (newRender) {
  2597. instance.render = newRender;
  2598. normalizeClassComponent(instance.type).render = newRender;
  2599. }
  2600. instance.renderCache = [];
  2601. isHmrUpdating = true;
  2602. instance.update();
  2603. isHmrUpdating = false;
  2604. });
  2605. }
  2606. function reload(id, newComp) {
  2607. const record = map.get(id);
  2608. if (!record) return;
  2609. newComp = normalizeClassComponent(newComp);
  2610. updateComponentDef(record.initialDef, newComp);
  2611. const instances = [...record.instances];
  2612. for (let i = 0; i < instances.length; i++) {
  2613. const instance = instances[i];
  2614. const oldComp = normalizeClassComponent(instance.type);
  2615. let dirtyInstances = hmrDirtyComponents.get(oldComp);
  2616. if (!dirtyInstances) {
  2617. if (oldComp !== record.initialDef) {
  2618. updateComponentDef(oldComp, newComp);
  2619. }
  2620. hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
  2621. }
  2622. dirtyInstances.add(instance);
  2623. instance.appContext.propsCache.delete(instance.type);
  2624. instance.appContext.emitsCache.delete(instance.type);
  2625. instance.appContext.optionsCache.delete(instance.type);
  2626. if (instance.ceReload) {
  2627. dirtyInstances.add(instance);
  2628. instance.ceReload(newComp.styles);
  2629. dirtyInstances.delete(instance);
  2630. } else if (instance.parent) {
  2631. queueJob(() => {
  2632. isHmrUpdating = true;
  2633. instance.parent.update();
  2634. isHmrUpdating = false;
  2635. dirtyInstances.delete(instance);
  2636. });
  2637. } else if (instance.appContext.reload) {
  2638. instance.appContext.reload();
  2639. } else if (typeof window !== "undefined") {
  2640. window.location.reload();
  2641. } else {
  2642. console.warn(
  2643. "[HMR] Root or manually mounted instance modified. Full reload required."
  2644. );
  2645. }
  2646. if (instance.root.ce && instance !== instance.root) {
  2647. instance.root.ce._removeChildStyle(oldComp);
  2648. }
  2649. }
  2650. queuePostFlushCb(() => {
  2651. hmrDirtyComponents.clear();
  2652. });
  2653. }
  2654. function updateComponentDef(oldComp, newComp) {
  2655. extend(oldComp, newComp);
  2656. for (const key in oldComp) {
  2657. if (key !== "__file" && !(key in newComp)) {
  2658. delete oldComp[key];
  2659. }
  2660. }
  2661. }
  2662. function tryWrap(fn) {
  2663. return (id, arg) => {
  2664. try {
  2665. return fn(id, arg);
  2666. } catch (e) {
  2667. console.error(e);
  2668. console.warn(
  2669. `[HMR] Something went wrong during Vue component hot-reload. Full reload required.`
  2670. );
  2671. }
  2672. };
  2673. }
  2674. let devtools$1;
  2675. let buffer = [];
  2676. let devtoolsNotInstalled = false;
  2677. function emit$1(event, ...args) {
  2678. if (devtools$1) {
  2679. devtools$1.emit(event, ...args);
  2680. } else if (!devtoolsNotInstalled) {
  2681. buffer.push({ event, args });
  2682. }
  2683. }
  2684. function setDevtoolsHook$1(hook, target) {
  2685. var _a, _b;
  2686. devtools$1 = hook;
  2687. if (devtools$1) {
  2688. devtools$1.enabled = true;
  2689. buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args));
  2690. buffer = [];
  2691. } else if (
  2692. // handle late devtools injection - only do this if we are in an actual
  2693. // browser environment to avoid the timer handle stalling test runner exit
  2694. // (#4815)
  2695. typeof window !== "undefined" && // some envs mock window but not fully
  2696. window.HTMLElement && // also exclude jsdom
  2697. // eslint-disable-next-line no-restricted-syntax
  2698. !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))
  2699. ) {
  2700. const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
  2701. replay.push((newHook) => {
  2702. setDevtoolsHook$1(newHook, target);
  2703. });
  2704. setTimeout(() => {
  2705. if (!devtools$1) {
  2706. target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
  2707. devtoolsNotInstalled = true;
  2708. buffer = [];
  2709. }
  2710. }, 3e3);
  2711. } else {
  2712. devtoolsNotInstalled = true;
  2713. buffer = [];
  2714. }
  2715. }
  2716. function devtoolsInitApp(app, version) {
  2717. emit$1("app:init" /* APP_INIT */, app, version, {
  2718. Fragment,
  2719. Text,
  2720. Comment,
  2721. Static
  2722. });
  2723. }
  2724. function devtoolsUnmountApp(app) {
  2725. emit$1("app:unmount" /* APP_UNMOUNT */, app);
  2726. }
  2727. const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook("component:added" /* COMPONENT_ADDED */);
  2728. const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */);
  2729. const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
  2730. "component:removed" /* COMPONENT_REMOVED */
  2731. );
  2732. const devtoolsComponentRemoved = (component) => {
  2733. if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered
  2734. !devtools$1.cleanupBuffer(component)) {
  2735. _devtoolsComponentRemoved(component);
  2736. }
  2737. };
  2738. /*! #__NO_SIDE_EFFECTS__ */
  2739. // @__NO_SIDE_EFFECTS__
  2740. function createDevtoolsComponentHook(hook) {
  2741. return (component) => {
  2742. emit$1(
  2743. hook,
  2744. component.appContext.app,
  2745. component.uid,
  2746. component.parent ? component.parent.uid : void 0,
  2747. component
  2748. );
  2749. };
  2750. }
  2751. const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:start" /* PERFORMANCE_START */);
  2752. const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:end" /* PERFORMANCE_END */);
  2753. function createDevtoolsPerformanceHook(hook) {
  2754. return (component, type, time) => {
  2755. emit$1(hook, component.appContext.app, component.uid, component, type, time);
  2756. };
  2757. }
  2758. function devtoolsComponentEmit(component, event, params) {
  2759. emit$1(
  2760. "component:emit" /* COMPONENT_EMIT */,
  2761. component.appContext.app,
  2762. component,
  2763. event,
  2764. params
  2765. );
  2766. }
  2767. let currentRenderingInstance = null;
  2768. let currentScopeId = null;
  2769. function setCurrentRenderingInstance(instance) {
  2770. const prev = currentRenderingInstance;
  2771. currentRenderingInstance = instance;
  2772. currentScopeId = instance && instance.type.__scopeId || null;
  2773. return prev;
  2774. }
  2775. function pushScopeId(id) {
  2776. currentScopeId = id;
  2777. }
  2778. function popScopeId() {
  2779. currentScopeId = null;
  2780. }
  2781. const withScopeId = (_id) => withCtx;
  2782. function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
  2783. if (!ctx) return fn;
  2784. if (fn._n) {
  2785. return fn;
  2786. }
  2787. const renderFnWithContext = (...args) => {
  2788. if (renderFnWithContext._d) {
  2789. setBlockTracking(-1);
  2790. }
  2791. const prevInstance = setCurrentRenderingInstance(ctx);
  2792. let res;
  2793. try {
  2794. res = fn(...args);
  2795. } finally {
  2796. setCurrentRenderingInstance(prevInstance);
  2797. if (renderFnWithContext._d) {
  2798. setBlockTracking(1);
  2799. }
  2800. }
  2801. {
  2802. devtoolsComponentUpdated(ctx);
  2803. }
  2804. return res;
  2805. };
  2806. renderFnWithContext._n = true;
  2807. renderFnWithContext._c = true;
  2808. renderFnWithContext._d = true;
  2809. return renderFnWithContext;
  2810. }
  2811. function validateDirectiveName(name) {
  2812. if (isBuiltInDirective(name)) {
  2813. warn$1("Do not use built-in directive ids as custom directive id: " + name);
  2814. }
  2815. }
  2816. function withDirectives(vnode, directives) {
  2817. if (currentRenderingInstance === null) {
  2818. warn$1(`withDirectives can only be used inside render functions.`);
  2819. return vnode;
  2820. }
  2821. const instance = getComponentPublicInstance(currentRenderingInstance);
  2822. const bindings = vnode.dirs || (vnode.dirs = []);
  2823. for (let i = 0; i < directives.length; i++) {
  2824. let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
  2825. if (dir) {
  2826. if (isFunction(dir)) {
  2827. dir = {
  2828. mounted: dir,
  2829. updated: dir
  2830. };
  2831. }
  2832. if (dir.deep) {
  2833. traverse(value);
  2834. }
  2835. bindings.push({
  2836. dir,
  2837. instance,
  2838. value,
  2839. oldValue: void 0,
  2840. arg,
  2841. modifiers
  2842. });
  2843. }
  2844. }
  2845. return vnode;
  2846. }
  2847. function invokeDirectiveHook(vnode, prevVNode, instance, name) {
  2848. const bindings = vnode.dirs;
  2849. const oldBindings = prevVNode && prevVNode.dirs;
  2850. for (let i = 0; i < bindings.length; i++) {
  2851. const binding = bindings[i];
  2852. if (oldBindings) {
  2853. binding.oldValue = oldBindings[i].value;
  2854. }
  2855. let hook = binding.dir[name];
  2856. if (hook) {
  2857. pauseTracking();
  2858. callWithAsyncErrorHandling(hook, instance, 8, [
  2859. vnode.el,
  2860. binding,
  2861. vnode,
  2862. prevVNode
  2863. ]);
  2864. resetTracking();
  2865. }
  2866. }
  2867. }
  2868. const TeleportEndKey = Symbol("_vte");
  2869. const isTeleport = (type) => type.__isTeleport;
  2870. const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
  2871. const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
  2872. const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
  2873. const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
  2874. const resolveTarget = (props, select) => {
  2875. const targetSelector = props && props.to;
  2876. if (isString(targetSelector)) {
  2877. if (!select) {
  2878. warn$1(
  2879. `Current renderer does not support string target for Teleports. (missing querySelector renderer option)`
  2880. );
  2881. return null;
  2882. } else {
  2883. const target = select(targetSelector);
  2884. if (!target && !isTeleportDisabled(props)) {
  2885. warn$1(
  2886. `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.`
  2887. );
  2888. }
  2889. return target;
  2890. }
  2891. } else {
  2892. if (!targetSelector && !isTeleportDisabled(props)) {
  2893. warn$1(`Invalid Teleport target: ${targetSelector}`);
  2894. }
  2895. return targetSelector;
  2896. }
  2897. };
  2898. const TeleportImpl = {
  2899. name: "Teleport",
  2900. __isTeleport: true,
  2901. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
  2902. const {
  2903. mc: mountChildren,
  2904. pc: patchChildren,
  2905. pbc: patchBlockChildren,
  2906. o: { insert, querySelector, createText, createComment }
  2907. } = internals;
  2908. const disabled = isTeleportDisabled(n2.props);
  2909. let { shapeFlag, children, dynamicChildren } = n2;
  2910. if (isHmrUpdating) {
  2911. optimized = false;
  2912. dynamicChildren = null;
  2913. }
  2914. if (n1 == null) {
  2915. const placeholder = n2.el = createComment("teleport start") ;
  2916. const mainAnchor = n2.anchor = createComment("teleport end") ;
  2917. insert(placeholder, container, anchor);
  2918. insert(mainAnchor, container, anchor);
  2919. const mount = (container2, anchor2) => {
  2920. if (shapeFlag & 16) {
  2921. if (parentComponent && parentComponent.isCE) {
  2922. parentComponent.ce._teleportTarget = container2;
  2923. }
  2924. mountChildren(
  2925. children,
  2926. container2,
  2927. anchor2,
  2928. parentComponent,
  2929. parentSuspense,
  2930. namespace,
  2931. slotScopeIds,
  2932. optimized
  2933. );
  2934. }
  2935. };
  2936. const mountToTarget = () => {
  2937. const target = n2.target = resolveTarget(n2.props, querySelector);
  2938. const targetAnchor = prepareAnchor(target, n2, createText, insert);
  2939. if (target) {
  2940. if (namespace !== "svg" && isTargetSVG(target)) {
  2941. namespace = "svg";
  2942. } else if (namespace !== "mathml" && isTargetMathML(target)) {
  2943. namespace = "mathml";
  2944. }
  2945. if (!disabled) {
  2946. mount(target, targetAnchor);
  2947. updateCssVars(n2, false);
  2948. }
  2949. } else if (!disabled) {
  2950. warn$1(
  2951. "Invalid Teleport target on mount:",
  2952. target,
  2953. `(${typeof target})`
  2954. );
  2955. }
  2956. };
  2957. if (disabled) {
  2958. mount(container, mainAnchor);
  2959. updateCssVars(n2, true);
  2960. }
  2961. if (isTeleportDeferred(n2.props)) {
  2962. queuePostRenderEffect(mountToTarget, parentSuspense);
  2963. } else {
  2964. mountToTarget();
  2965. }
  2966. } else {
  2967. n2.el = n1.el;
  2968. n2.targetStart = n1.targetStart;
  2969. const mainAnchor = n2.anchor = n1.anchor;
  2970. const target = n2.target = n1.target;
  2971. const targetAnchor = n2.targetAnchor = n1.targetAnchor;
  2972. const wasDisabled = isTeleportDisabled(n1.props);
  2973. const currentContainer = wasDisabled ? container : target;
  2974. const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
  2975. if (namespace === "svg" || isTargetSVG(target)) {
  2976. namespace = "svg";
  2977. } else if (namespace === "mathml" || isTargetMathML(target)) {
  2978. namespace = "mathml";
  2979. }
  2980. if (dynamicChildren) {
  2981. patchBlockChildren(
  2982. n1.dynamicChildren,
  2983. dynamicChildren,
  2984. currentContainer,
  2985. parentComponent,
  2986. parentSuspense,
  2987. namespace,
  2988. slotScopeIds
  2989. );
  2990. traverseStaticChildren(n1, n2, true);
  2991. } else if (!optimized) {
  2992. patchChildren(
  2993. n1,
  2994. n2,
  2995. currentContainer,
  2996. currentAnchor,
  2997. parentComponent,
  2998. parentSuspense,
  2999. namespace,
  3000. slotScopeIds,
  3001. false
  3002. );
  3003. }
  3004. if (disabled) {
  3005. if (!wasDisabled) {
  3006. moveTeleport(
  3007. n2,
  3008. container,
  3009. mainAnchor,
  3010. internals,
  3011. 1
  3012. );
  3013. } else {
  3014. if (n2.props && n1.props && n2.props.to !== n1.props.to) {
  3015. n2.props.to = n1.props.to;
  3016. }
  3017. }
  3018. } else {
  3019. if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
  3020. const nextTarget = n2.target = resolveTarget(
  3021. n2.props,
  3022. querySelector
  3023. );
  3024. if (nextTarget) {
  3025. moveTeleport(
  3026. n2,
  3027. nextTarget,
  3028. null,
  3029. internals,
  3030. 0
  3031. );
  3032. } else {
  3033. warn$1(
  3034. "Invalid Teleport target on update:",
  3035. target,
  3036. `(${typeof target})`
  3037. );
  3038. }
  3039. } else if (wasDisabled) {
  3040. moveTeleport(
  3041. n2,
  3042. target,
  3043. targetAnchor,
  3044. internals,
  3045. 1
  3046. );
  3047. }
  3048. }
  3049. updateCssVars(n2, disabled);
  3050. }
  3051. },
  3052. remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
  3053. const {
  3054. shapeFlag,
  3055. children,
  3056. anchor,
  3057. targetStart,
  3058. targetAnchor,
  3059. target,
  3060. props
  3061. } = vnode;
  3062. if (target) {
  3063. hostRemove(targetStart);
  3064. hostRemove(targetAnchor);
  3065. }
  3066. doRemove && hostRemove(anchor);
  3067. if (shapeFlag & 16) {
  3068. const shouldRemove = doRemove || !isTeleportDisabled(props);
  3069. for (let i = 0; i < children.length; i++) {
  3070. const child = children[i];
  3071. unmount(
  3072. child,
  3073. parentComponent,
  3074. parentSuspense,
  3075. shouldRemove,
  3076. !!child.dynamicChildren
  3077. );
  3078. }
  3079. }
  3080. },
  3081. move: moveTeleport,
  3082. hydrate: hydrateTeleport
  3083. };
  3084. function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
  3085. if (moveType === 0) {
  3086. insert(vnode.targetAnchor, container, parentAnchor);
  3087. }
  3088. const { el, anchor, shapeFlag, children, props } = vnode;
  3089. const isReorder = moveType === 2;
  3090. if (isReorder) {
  3091. insert(el, container, parentAnchor);
  3092. }
  3093. if (!isReorder || isTeleportDisabled(props)) {
  3094. if (shapeFlag & 16) {
  3095. for (let i = 0; i < children.length; i++) {
  3096. move(
  3097. children[i],
  3098. container,
  3099. parentAnchor,
  3100. 2
  3101. );
  3102. }
  3103. }
  3104. }
  3105. if (isReorder) {
  3106. insert(anchor, container, parentAnchor);
  3107. }
  3108. }
  3109. function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
  3110. o: { nextSibling, parentNode, querySelector, insert, createText }
  3111. }, hydrateChildren) {
  3112. const target = vnode.target = resolveTarget(
  3113. vnode.props,
  3114. querySelector
  3115. );
  3116. if (target) {
  3117. const disabled = isTeleportDisabled(vnode.props);
  3118. const targetNode = target._lpa || target.firstChild;
  3119. if (vnode.shapeFlag & 16) {
  3120. if (disabled) {
  3121. vnode.anchor = hydrateChildren(
  3122. nextSibling(node),
  3123. vnode,
  3124. parentNode(node),
  3125. parentComponent,
  3126. parentSuspense,
  3127. slotScopeIds,
  3128. optimized
  3129. );
  3130. vnode.targetStart = targetNode;
  3131. vnode.targetAnchor = targetNode && nextSibling(targetNode);
  3132. } else {
  3133. vnode.anchor = nextSibling(node);
  3134. let targetAnchor = targetNode;
  3135. while (targetAnchor) {
  3136. if (targetAnchor && targetAnchor.nodeType === 8) {
  3137. if (targetAnchor.data === "teleport start anchor") {
  3138. vnode.targetStart = targetAnchor;
  3139. } else if (targetAnchor.data === "teleport anchor") {
  3140. vnode.targetAnchor = targetAnchor;
  3141. target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
  3142. break;
  3143. }
  3144. }
  3145. targetAnchor = nextSibling(targetAnchor);
  3146. }
  3147. if (!vnode.targetAnchor) {
  3148. prepareAnchor(target, vnode, createText, insert);
  3149. }
  3150. hydrateChildren(
  3151. targetNode && nextSibling(targetNode),
  3152. vnode,
  3153. target,
  3154. parentComponent,
  3155. parentSuspense,
  3156. slotScopeIds,
  3157. optimized
  3158. );
  3159. }
  3160. }
  3161. updateCssVars(vnode, disabled);
  3162. }
  3163. return vnode.anchor && nextSibling(vnode.anchor);
  3164. }
  3165. const Teleport = TeleportImpl;
  3166. function updateCssVars(vnode, isDisabled) {
  3167. const ctx = vnode.ctx;
  3168. if (ctx && ctx.ut) {
  3169. let node, anchor;
  3170. if (isDisabled) {
  3171. node = vnode.el;
  3172. anchor = vnode.anchor;
  3173. } else {
  3174. node = vnode.targetStart;
  3175. anchor = vnode.targetAnchor;
  3176. }
  3177. while (node && node !== anchor) {
  3178. if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
  3179. node = node.nextSibling;
  3180. }
  3181. ctx.ut();
  3182. }
  3183. }
  3184. function prepareAnchor(target, vnode, createText, insert) {
  3185. const targetStart = vnode.targetStart = createText("");
  3186. const targetAnchor = vnode.targetAnchor = createText("");
  3187. targetStart[TeleportEndKey] = targetAnchor;
  3188. if (target) {
  3189. insert(targetStart, target);
  3190. insert(targetAnchor, target);
  3191. }
  3192. return targetAnchor;
  3193. }
  3194. const leaveCbKey = Symbol("_leaveCb");
  3195. const enterCbKey$1 = Symbol("_enterCb");
  3196. function useTransitionState() {
  3197. const state = {
  3198. isMounted: false,
  3199. isLeaving: false,
  3200. isUnmounting: false,
  3201. leavingVNodes: /* @__PURE__ */ new Map()
  3202. };
  3203. onMounted(() => {
  3204. state.isMounted = true;
  3205. });
  3206. onBeforeUnmount(() => {
  3207. state.isUnmounting = true;
  3208. });
  3209. return state;
  3210. }
  3211. const TransitionHookValidator = [Function, Array];
  3212. const BaseTransitionPropsValidators = {
  3213. mode: String,
  3214. appear: Boolean,
  3215. persisted: Boolean,
  3216. // enter
  3217. onBeforeEnter: TransitionHookValidator,
  3218. onEnter: TransitionHookValidator,
  3219. onAfterEnter: TransitionHookValidator,
  3220. onEnterCancelled: TransitionHookValidator,
  3221. // leave
  3222. onBeforeLeave: TransitionHookValidator,
  3223. onLeave: TransitionHookValidator,
  3224. onAfterLeave: TransitionHookValidator,
  3225. onLeaveCancelled: TransitionHookValidator,
  3226. // appear
  3227. onBeforeAppear: TransitionHookValidator,
  3228. onAppear: TransitionHookValidator,
  3229. onAfterAppear: TransitionHookValidator,
  3230. onAppearCancelled: TransitionHookValidator
  3231. };
  3232. const recursiveGetSubtree = (instance) => {
  3233. const subTree = instance.subTree;
  3234. return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
  3235. };
  3236. const BaseTransitionImpl = {
  3237. name: `BaseTransition`,
  3238. props: BaseTransitionPropsValidators,
  3239. setup(props, { slots }) {
  3240. const instance = getCurrentInstance();
  3241. const state = useTransitionState();
  3242. return () => {
  3243. const children = slots.default && getTransitionRawChildren(slots.default(), true);
  3244. if (!children || !children.length) {
  3245. return;
  3246. }
  3247. const child = findNonCommentChild(children);
  3248. const rawProps = toRaw(props);
  3249. const { mode } = rawProps;
  3250. if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
  3251. warn$1(`invalid <transition> mode: ${mode}`);
  3252. }
  3253. if (state.isLeaving) {
  3254. return emptyPlaceholder(child);
  3255. }
  3256. const innerChild = getInnerChild$1(child);
  3257. if (!innerChild) {
  3258. return emptyPlaceholder(child);
  3259. }
  3260. let enterHooks = resolveTransitionHooks(
  3261. innerChild,
  3262. rawProps,
  3263. state,
  3264. instance,
  3265. // #11061, ensure enterHooks is fresh after clone
  3266. (hooks) => enterHooks = hooks
  3267. );
  3268. if (innerChild.type !== Comment) {
  3269. setTransitionHooks(innerChild, enterHooks);
  3270. }
  3271. const oldChild = instance.subTree;
  3272. const oldInnerChild = oldChild && getInnerChild$1(oldChild);
  3273. if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
  3274. const leavingHooks = resolveTransitionHooks(
  3275. oldInnerChild,
  3276. rawProps,
  3277. state,
  3278. instance
  3279. );
  3280. setTransitionHooks(oldInnerChild, leavingHooks);
  3281. if (mode === "out-in" && innerChild.type !== Comment) {
  3282. state.isLeaving = true;
  3283. leavingHooks.afterLeave = () => {
  3284. state.isLeaving = false;
  3285. if (!(instance.job.flags & 8)) {
  3286. instance.update();
  3287. }
  3288. delete leavingHooks.afterLeave;
  3289. };
  3290. return emptyPlaceholder(child);
  3291. } else if (mode === "in-out" && innerChild.type !== Comment) {
  3292. leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
  3293. const leavingVNodesCache = getLeavingNodesForType(
  3294. state,
  3295. oldInnerChild
  3296. );
  3297. leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
  3298. el[leaveCbKey] = () => {
  3299. earlyRemove();
  3300. el[leaveCbKey] = void 0;
  3301. delete enterHooks.delayedLeave;
  3302. };
  3303. enterHooks.delayedLeave = delayedLeave;
  3304. };
  3305. }
  3306. }
  3307. return child;
  3308. };
  3309. }
  3310. };
  3311. function findNonCommentChild(children) {
  3312. let child = children[0];
  3313. if (children.length > 1) {
  3314. let hasFound = false;
  3315. for (const c of children) {
  3316. if (c.type !== Comment) {
  3317. if (hasFound) {
  3318. warn$1(
  3319. "<transition> can only be used on a single element or component. Use <transition-group> for lists."
  3320. );
  3321. break;
  3322. }
  3323. child = c;
  3324. hasFound = true;
  3325. }
  3326. }
  3327. }
  3328. return child;
  3329. }
  3330. const BaseTransition = BaseTransitionImpl;
  3331. function getLeavingNodesForType(state, vnode) {
  3332. const { leavingVNodes } = state;
  3333. let leavingVNodesCache = leavingVNodes.get(vnode.type);
  3334. if (!leavingVNodesCache) {
  3335. leavingVNodesCache = /* @__PURE__ */ Object.create(null);
  3336. leavingVNodes.set(vnode.type, leavingVNodesCache);
  3337. }
  3338. return leavingVNodesCache;
  3339. }
  3340. function resolveTransitionHooks(vnode, props, state, instance, postClone) {
  3341. const {
  3342. appear,
  3343. mode,
  3344. persisted = false,
  3345. onBeforeEnter,
  3346. onEnter,
  3347. onAfterEnter,
  3348. onEnterCancelled,
  3349. onBeforeLeave,
  3350. onLeave,
  3351. onAfterLeave,
  3352. onLeaveCancelled,
  3353. onBeforeAppear,
  3354. onAppear,
  3355. onAfterAppear,
  3356. onAppearCancelled
  3357. } = props;
  3358. const key = String(vnode.key);
  3359. const leavingVNodesCache = getLeavingNodesForType(state, vnode);
  3360. const callHook = (hook, args) => {
  3361. hook && callWithAsyncErrorHandling(
  3362. hook,
  3363. instance,
  3364. 9,
  3365. args
  3366. );
  3367. };
  3368. const callAsyncHook = (hook, args) => {
  3369. const done = args[1];
  3370. callHook(hook, args);
  3371. if (isArray(hook)) {
  3372. if (hook.every((hook2) => hook2.length <= 1)) done();
  3373. } else if (hook.length <= 1) {
  3374. done();
  3375. }
  3376. };
  3377. const hooks = {
  3378. mode,
  3379. persisted,
  3380. beforeEnter(el) {
  3381. let hook = onBeforeEnter;
  3382. if (!state.isMounted) {
  3383. if (appear) {
  3384. hook = onBeforeAppear || onBeforeEnter;
  3385. } else {
  3386. return;
  3387. }
  3388. }
  3389. if (el[leaveCbKey]) {
  3390. el[leaveCbKey](
  3391. true
  3392. /* cancelled */
  3393. );
  3394. }
  3395. const leavingVNode = leavingVNodesCache[key];
  3396. if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
  3397. leavingVNode.el[leaveCbKey]();
  3398. }
  3399. callHook(hook, [el]);
  3400. },
  3401. enter(el) {
  3402. let hook = onEnter;
  3403. let afterHook = onAfterEnter;
  3404. let cancelHook = onEnterCancelled;
  3405. if (!state.isMounted) {
  3406. if (appear) {
  3407. hook = onAppear || onEnter;
  3408. afterHook = onAfterAppear || onAfterEnter;
  3409. cancelHook = onAppearCancelled || onEnterCancelled;
  3410. } else {
  3411. return;
  3412. }
  3413. }
  3414. let called = false;
  3415. const done = el[enterCbKey$1] = (cancelled) => {
  3416. if (called) return;
  3417. called = true;
  3418. if (cancelled) {
  3419. callHook(cancelHook, [el]);
  3420. } else {
  3421. callHook(afterHook, [el]);
  3422. }
  3423. if (hooks.delayedLeave) {
  3424. hooks.delayedLeave();
  3425. }
  3426. el[enterCbKey$1] = void 0;
  3427. };
  3428. if (hook) {
  3429. callAsyncHook(hook, [el, done]);
  3430. } else {
  3431. done();
  3432. }
  3433. },
  3434. leave(el, remove) {
  3435. const key2 = String(vnode.key);
  3436. if (el[enterCbKey$1]) {
  3437. el[enterCbKey$1](
  3438. true
  3439. /* cancelled */
  3440. );
  3441. }
  3442. if (state.isUnmounting) {
  3443. return remove();
  3444. }
  3445. callHook(onBeforeLeave, [el]);
  3446. let called = false;
  3447. const done = el[leaveCbKey] = (cancelled) => {
  3448. if (called) return;
  3449. called = true;
  3450. remove();
  3451. if (cancelled) {
  3452. callHook(onLeaveCancelled, [el]);
  3453. } else {
  3454. callHook(onAfterLeave, [el]);
  3455. }
  3456. el[leaveCbKey] = void 0;
  3457. if (leavingVNodesCache[key2] === vnode) {
  3458. delete leavingVNodesCache[key2];
  3459. }
  3460. };
  3461. leavingVNodesCache[key2] = vnode;
  3462. if (onLeave) {
  3463. callAsyncHook(onLeave, [el, done]);
  3464. } else {
  3465. done();
  3466. }
  3467. },
  3468. clone(vnode2) {
  3469. const hooks2 = resolveTransitionHooks(
  3470. vnode2,
  3471. props,
  3472. state,
  3473. instance,
  3474. postClone
  3475. );
  3476. if (postClone) postClone(hooks2);
  3477. return hooks2;
  3478. }
  3479. };
  3480. return hooks;
  3481. }
  3482. function emptyPlaceholder(vnode) {
  3483. if (isKeepAlive(vnode)) {
  3484. vnode = cloneVNode(vnode);
  3485. vnode.children = null;
  3486. return vnode;
  3487. }
  3488. }
  3489. function getInnerChild$1(vnode) {
  3490. if (!isKeepAlive(vnode)) {
  3491. if (isTeleport(vnode.type) && vnode.children) {
  3492. return findNonCommentChild(vnode.children);
  3493. }
  3494. return vnode;
  3495. }
  3496. if (vnode.component) {
  3497. return vnode.component.subTree;
  3498. }
  3499. const { shapeFlag, children } = vnode;
  3500. if (children) {
  3501. if (shapeFlag & 16) {
  3502. return children[0];
  3503. }
  3504. if (shapeFlag & 32 && isFunction(children.default)) {
  3505. return children.default();
  3506. }
  3507. }
  3508. }
  3509. function setTransitionHooks(vnode, hooks) {
  3510. if (vnode.shapeFlag & 6 && vnode.component) {
  3511. vnode.transition = hooks;
  3512. setTransitionHooks(vnode.component.subTree, hooks);
  3513. } else if (vnode.shapeFlag & 128) {
  3514. vnode.ssContent.transition = hooks.clone(vnode.ssContent);
  3515. vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
  3516. } else {
  3517. vnode.transition = hooks;
  3518. }
  3519. }
  3520. function getTransitionRawChildren(children, keepComment = false, parentKey) {
  3521. let ret = [];
  3522. let keyedFragmentCount = 0;
  3523. for (let i = 0; i < children.length; i++) {
  3524. let child = children[i];
  3525. const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);
  3526. if (child.type === Fragment) {
  3527. if (child.patchFlag & 128) keyedFragmentCount++;
  3528. ret = ret.concat(
  3529. getTransitionRawChildren(child.children, keepComment, key)
  3530. );
  3531. } else if (keepComment || child.type !== Comment) {
  3532. ret.push(key != null ? cloneVNode(child, { key }) : child);
  3533. }
  3534. }
  3535. if (keyedFragmentCount > 1) {
  3536. for (let i = 0; i < ret.length; i++) {
  3537. ret[i].patchFlag = -2;
  3538. }
  3539. }
  3540. return ret;
  3541. }
  3542. /*! #__NO_SIDE_EFFECTS__ */
  3543. // @__NO_SIDE_EFFECTS__
  3544. function defineComponent(options, extraOptions) {
  3545. return isFunction(options) ? (
  3546. // #8236: extend call and options.name access are considered side-effects
  3547. // by Rollup, so we have to wrap it in a pure-annotated IIFE.
  3548. /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
  3549. ) : options;
  3550. }
  3551. function useId() {
  3552. const i = getCurrentInstance();
  3553. if (i) {
  3554. return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
  3555. } else {
  3556. warn$1(
  3557. `useId() is called when there is no active component instance to be associated with.`
  3558. );
  3559. }
  3560. return "";
  3561. }
  3562. function markAsyncBoundary(instance) {
  3563. instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
  3564. }
  3565. const knownTemplateRefs = /* @__PURE__ */ new WeakSet();
  3566. function useTemplateRef(key) {
  3567. const i = getCurrentInstance();
  3568. const r = shallowRef(null);
  3569. if (i) {
  3570. const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
  3571. let desc;
  3572. if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {
  3573. warn$1(`useTemplateRef('${key}') already exists.`);
  3574. } else {
  3575. Object.defineProperty(refs, key, {
  3576. enumerable: true,
  3577. get: () => r.value,
  3578. set: (val) => r.value = val
  3579. });
  3580. }
  3581. } else {
  3582. warn$1(
  3583. `useTemplateRef() is called when there is no active component instance to be associated with.`
  3584. );
  3585. }
  3586. const ret = readonly(r) ;
  3587. {
  3588. knownTemplateRefs.add(ret);
  3589. }
  3590. return ret;
  3591. }
  3592. function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
  3593. if (isArray(rawRef)) {
  3594. rawRef.forEach(
  3595. (r, i) => setRef(
  3596. r,
  3597. oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
  3598. parentSuspense,
  3599. vnode,
  3600. isUnmount
  3601. )
  3602. );
  3603. return;
  3604. }
  3605. if (isAsyncWrapper(vnode) && !isUnmount) {
  3606. return;
  3607. }
  3608. const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
  3609. const value = isUnmount ? null : refValue;
  3610. const { i: owner, r: ref } = rawRef;
  3611. if (!owner) {
  3612. warn$1(
  3613. `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`
  3614. );
  3615. return;
  3616. }
  3617. const oldRef = oldRawRef && oldRawRef.r;
  3618. const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
  3619. const setupState = owner.setupState;
  3620. const rawSetupState = toRaw(setupState);
  3621. const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
  3622. {
  3623. if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
  3624. warn$1(
  3625. `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
  3626. );
  3627. }
  3628. if (knownTemplateRefs.has(rawSetupState[key])) {
  3629. return false;
  3630. }
  3631. }
  3632. return hasOwn(rawSetupState, key);
  3633. };
  3634. if (oldRef != null && oldRef !== ref) {
  3635. if (isString(oldRef)) {
  3636. refs[oldRef] = null;
  3637. if (canSetSetupRef(oldRef)) {
  3638. setupState[oldRef] = null;
  3639. }
  3640. } else if (isRef(oldRef)) {
  3641. oldRef.value = null;
  3642. }
  3643. }
  3644. if (isFunction(ref)) {
  3645. callWithErrorHandling(ref, owner, 12, [value, refs]);
  3646. } else {
  3647. const _isString = isString(ref);
  3648. const _isRef = isRef(ref);
  3649. if (_isString || _isRef) {
  3650. const doSet = () => {
  3651. if (rawRef.f) {
  3652. const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
  3653. if (isUnmount) {
  3654. isArray(existing) && remove(existing, refValue);
  3655. } else {
  3656. if (!isArray(existing)) {
  3657. if (_isString) {
  3658. refs[ref] = [refValue];
  3659. if (canSetSetupRef(ref)) {
  3660. setupState[ref] = refs[ref];
  3661. }
  3662. } else {
  3663. ref.value = [refValue];
  3664. if (rawRef.k) refs[rawRef.k] = ref.value;
  3665. }
  3666. } else if (!existing.includes(refValue)) {
  3667. existing.push(refValue);
  3668. }
  3669. }
  3670. } else if (_isString) {
  3671. refs[ref] = value;
  3672. if (canSetSetupRef(ref)) {
  3673. setupState[ref] = value;
  3674. }
  3675. } else if (_isRef) {
  3676. ref.value = value;
  3677. if (rawRef.k) refs[rawRef.k] = value;
  3678. } else {
  3679. warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
  3680. }
  3681. };
  3682. if (value) {
  3683. doSet.id = -1;
  3684. queuePostRenderEffect(doSet, parentSuspense);
  3685. } else {
  3686. doSet();
  3687. }
  3688. } else {
  3689. warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
  3690. }
  3691. }
  3692. }
  3693. let hasLoggedMismatchError = false;
  3694. const logMismatchError = () => {
  3695. if (hasLoggedMismatchError) {
  3696. return;
  3697. }
  3698. console.error("Hydration completed but contains mismatches.");
  3699. hasLoggedMismatchError = true;
  3700. };
  3701. const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
  3702. const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
  3703. const getContainerType = (container) => {
  3704. if (container.nodeType !== 1) return void 0;
  3705. if (isSVGContainer(container)) return "svg";
  3706. if (isMathMLContainer(container)) return "mathml";
  3707. return void 0;
  3708. };
  3709. const isComment = (node) => node.nodeType === 8;
  3710. function createHydrationFunctions(rendererInternals) {
  3711. const {
  3712. mt: mountComponent,
  3713. p: patch,
  3714. o: {
  3715. patchProp,
  3716. createText,
  3717. nextSibling,
  3718. parentNode,
  3719. remove,
  3720. insert,
  3721. createComment
  3722. }
  3723. } = rendererInternals;
  3724. const hydrate = (vnode, container) => {
  3725. if (!container.hasChildNodes()) {
  3726. warn$1(
  3727. `Attempting to hydrate existing markup but container is empty. Performing full mount instead.`
  3728. );
  3729. patch(null, vnode, container);
  3730. flushPostFlushCbs();
  3731. container._vnode = vnode;
  3732. return;
  3733. }
  3734. hydrateNode(container.firstChild, vnode, null, null, null);
  3735. flushPostFlushCbs();
  3736. container._vnode = vnode;
  3737. };
  3738. const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
  3739. optimized = optimized || !!vnode.dynamicChildren;
  3740. const isFragmentStart = isComment(node) && node.data === "[";
  3741. const onMismatch = () => handleMismatch(
  3742. node,
  3743. vnode,
  3744. parentComponent,
  3745. parentSuspense,
  3746. slotScopeIds,
  3747. isFragmentStart
  3748. );
  3749. const { type, ref, shapeFlag, patchFlag } = vnode;
  3750. let domType = node.nodeType;
  3751. vnode.el = node;
  3752. {
  3753. def(node, "__vnode", vnode, true);
  3754. def(node, "__vueParentComponent", parentComponent, true);
  3755. }
  3756. if (patchFlag === -2) {
  3757. optimized = false;
  3758. vnode.dynamicChildren = null;
  3759. }
  3760. let nextNode = null;
  3761. switch (type) {
  3762. case Text:
  3763. if (domType !== 3) {
  3764. if (vnode.children === "") {
  3765. insert(vnode.el = createText(""), parentNode(node), node);
  3766. nextNode = node;
  3767. } else {
  3768. nextNode = onMismatch();
  3769. }
  3770. } else {
  3771. if (node.data !== vnode.children) {
  3772. warn$1(
  3773. `Hydration text mismatch in`,
  3774. node.parentNode,
  3775. `
  3776. - rendered on server: ${JSON.stringify(
  3777. node.data
  3778. )}
  3779. - expected on client: ${JSON.stringify(vnode.children)}`
  3780. );
  3781. logMismatchError();
  3782. node.data = vnode.children;
  3783. }
  3784. nextNode = nextSibling(node);
  3785. }
  3786. break;
  3787. case Comment:
  3788. if (isTemplateNode(node)) {
  3789. nextNode = nextSibling(node);
  3790. replaceNode(
  3791. vnode.el = node.content.firstChild,
  3792. node,
  3793. parentComponent
  3794. );
  3795. } else if (domType !== 8 || isFragmentStart) {
  3796. nextNode = onMismatch();
  3797. } else {
  3798. nextNode = nextSibling(node);
  3799. }
  3800. break;
  3801. case Static:
  3802. if (isFragmentStart) {
  3803. node = nextSibling(node);
  3804. domType = node.nodeType;
  3805. }
  3806. if (domType === 1 || domType === 3) {
  3807. nextNode = node;
  3808. const needToAdoptContent = !vnode.children.length;
  3809. for (let i = 0; i < vnode.staticCount; i++) {
  3810. if (needToAdoptContent)
  3811. vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data;
  3812. if (i === vnode.staticCount - 1) {
  3813. vnode.anchor = nextNode;
  3814. }
  3815. nextNode = nextSibling(nextNode);
  3816. }
  3817. return isFragmentStart ? nextSibling(nextNode) : nextNode;
  3818. } else {
  3819. onMismatch();
  3820. }
  3821. break;
  3822. case Fragment:
  3823. if (!isFragmentStart) {
  3824. nextNode = onMismatch();
  3825. } else {
  3826. nextNode = hydrateFragment(
  3827. node,
  3828. vnode,
  3829. parentComponent,
  3830. parentSuspense,
  3831. slotScopeIds,
  3832. optimized
  3833. );
  3834. }
  3835. break;
  3836. default:
  3837. if (shapeFlag & 1) {
  3838. if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
  3839. nextNode = onMismatch();
  3840. } else {
  3841. nextNode = hydrateElement(
  3842. node,
  3843. vnode,
  3844. parentComponent,
  3845. parentSuspense,
  3846. slotScopeIds,
  3847. optimized
  3848. );
  3849. }
  3850. } else if (shapeFlag & 6) {
  3851. vnode.slotScopeIds = slotScopeIds;
  3852. const container = parentNode(node);
  3853. if (isFragmentStart) {
  3854. nextNode = locateClosingAnchor(node);
  3855. } else if (isComment(node) && node.data === "teleport start") {
  3856. nextNode = locateClosingAnchor(node, node.data, "teleport end");
  3857. } else {
  3858. nextNode = nextSibling(node);
  3859. }
  3860. mountComponent(
  3861. vnode,
  3862. container,
  3863. null,
  3864. parentComponent,
  3865. parentSuspense,
  3866. getContainerType(container),
  3867. optimized
  3868. );
  3869. if (isAsyncWrapper(vnode)) {
  3870. let subTree;
  3871. if (isFragmentStart) {
  3872. subTree = createVNode(Fragment);
  3873. subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
  3874. } else {
  3875. subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
  3876. }
  3877. subTree.el = node;
  3878. vnode.component.subTree = subTree;
  3879. }
  3880. } else if (shapeFlag & 64) {
  3881. if (domType !== 8) {
  3882. nextNode = onMismatch();
  3883. } else {
  3884. nextNode = vnode.type.hydrate(
  3885. node,
  3886. vnode,
  3887. parentComponent,
  3888. parentSuspense,
  3889. slotScopeIds,
  3890. optimized,
  3891. rendererInternals,
  3892. hydrateChildren
  3893. );
  3894. }
  3895. } else if (shapeFlag & 128) {
  3896. nextNode = vnode.type.hydrate(
  3897. node,
  3898. vnode,
  3899. parentComponent,
  3900. parentSuspense,
  3901. getContainerType(parentNode(node)),
  3902. slotScopeIds,
  3903. optimized,
  3904. rendererInternals,
  3905. hydrateNode
  3906. );
  3907. } else {
  3908. warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
  3909. }
  3910. }
  3911. if (ref != null) {
  3912. setRef(ref, null, parentSuspense, vnode);
  3913. }
  3914. return nextNode;
  3915. };
  3916. const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  3917. optimized = optimized || !!vnode.dynamicChildren;
  3918. const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
  3919. const forcePatch = type === "input" || type === "option";
  3920. {
  3921. if (dirs) {
  3922. invokeDirectiveHook(vnode, null, parentComponent, "created");
  3923. }
  3924. let needCallTransitionHooks = false;
  3925. if (isTemplateNode(el)) {
  3926. needCallTransitionHooks = needTransition(
  3927. null,
  3928. // no need check parentSuspense in hydration
  3929. transition
  3930. ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
  3931. const content = el.content.firstChild;
  3932. if (needCallTransitionHooks) {
  3933. transition.beforeEnter(content);
  3934. }
  3935. replaceNode(content, el, parentComponent);
  3936. vnode.el = el = content;
  3937. }
  3938. if (shapeFlag & 16 && // skip if element has innerHTML / textContent
  3939. !(props && (props.innerHTML || props.textContent))) {
  3940. let next = hydrateChildren(
  3941. el.firstChild,
  3942. vnode,
  3943. el,
  3944. parentComponent,
  3945. parentSuspense,
  3946. slotScopeIds,
  3947. optimized
  3948. );
  3949. let hasWarned = false;
  3950. while (next) {
  3951. if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
  3952. if (!hasWarned) {
  3953. warn$1(
  3954. `Hydration children mismatch on`,
  3955. el,
  3956. `
  3957. Server rendered element contains more child nodes than client vdom.`
  3958. );
  3959. hasWarned = true;
  3960. }
  3961. logMismatchError();
  3962. }
  3963. const cur = next;
  3964. next = next.nextSibling;
  3965. remove(cur);
  3966. }
  3967. } else if (shapeFlag & 8) {
  3968. let clientText = vnode.children;
  3969. if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
  3970. clientText = clientText.slice(1);
  3971. }
  3972. if (el.textContent !== clientText) {
  3973. if (!isMismatchAllowed(el, 0 /* TEXT */)) {
  3974. warn$1(
  3975. `Hydration text content mismatch on`,
  3976. el,
  3977. `
  3978. - rendered on server: ${el.textContent}
  3979. - expected on client: ${vnode.children}`
  3980. );
  3981. logMismatchError();
  3982. }
  3983. el.textContent = vnode.children;
  3984. }
  3985. }
  3986. if (props) {
  3987. {
  3988. const isCustomElement = el.tagName.includes("-");
  3989. for (const key in props) {
  3990. if (// #11189 skip if this node has directives that have created hooks
  3991. // as it could have mutated the DOM in any possible way
  3992. !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
  3993. logMismatchError();
  3994. }
  3995. if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
  3996. key[0] === "." || isCustomElement) {
  3997. patchProp(el, key, null, props[key], void 0, parentComponent);
  3998. }
  3999. }
  4000. }
  4001. }
  4002. let vnodeHooks;
  4003. if (vnodeHooks = props && props.onVnodeBeforeMount) {
  4004. invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  4005. }
  4006. if (dirs) {
  4007. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  4008. }
  4009. if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
  4010. queueEffectWithSuspense(() => {
  4011. vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  4012. needCallTransitionHooks && transition.enter(el);
  4013. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  4014. }, parentSuspense);
  4015. }
  4016. }
  4017. return el.nextSibling;
  4018. };
  4019. const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  4020. optimized = optimized || !!parentVNode.dynamicChildren;
  4021. const children = parentVNode.children;
  4022. const l = children.length;
  4023. let hasWarned = false;
  4024. for (let i = 0; i < l; i++) {
  4025. const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
  4026. const isText = vnode.type === Text;
  4027. if (node) {
  4028. if (isText && !optimized) {
  4029. if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
  4030. insert(
  4031. createText(
  4032. node.data.slice(vnode.children.length)
  4033. ),
  4034. container,
  4035. nextSibling(node)
  4036. );
  4037. node.data = vnode.children;
  4038. }
  4039. }
  4040. node = hydrateNode(
  4041. node,
  4042. vnode,
  4043. parentComponent,
  4044. parentSuspense,
  4045. slotScopeIds,
  4046. optimized
  4047. );
  4048. } else if (isText && !vnode.children) {
  4049. insert(vnode.el = createText(""), container);
  4050. } else {
  4051. if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
  4052. if (!hasWarned) {
  4053. warn$1(
  4054. `Hydration children mismatch on`,
  4055. container,
  4056. `
  4057. Server rendered element contains fewer child nodes than client vdom.`
  4058. );
  4059. hasWarned = true;
  4060. }
  4061. logMismatchError();
  4062. }
  4063. patch(
  4064. null,
  4065. vnode,
  4066. container,
  4067. null,
  4068. parentComponent,
  4069. parentSuspense,
  4070. getContainerType(container),
  4071. slotScopeIds
  4072. );
  4073. }
  4074. }
  4075. return node;
  4076. };
  4077. const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  4078. const { slotScopeIds: fragmentSlotScopeIds } = vnode;
  4079. if (fragmentSlotScopeIds) {
  4080. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  4081. }
  4082. const container = parentNode(node);
  4083. const next = hydrateChildren(
  4084. nextSibling(node),
  4085. vnode,
  4086. container,
  4087. parentComponent,
  4088. parentSuspense,
  4089. slotScopeIds,
  4090. optimized
  4091. );
  4092. if (next && isComment(next) && next.data === "]") {
  4093. return nextSibling(vnode.anchor = next);
  4094. } else {
  4095. logMismatchError();
  4096. insert(vnode.anchor = createComment(`]`), container, next);
  4097. return next;
  4098. }
  4099. };
  4100. const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
  4101. if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) {
  4102. warn$1(
  4103. `Hydration node mismatch:
  4104. - rendered on server:`,
  4105. node,
  4106. node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
  4107. `
  4108. - expected on client:`,
  4109. vnode.type
  4110. );
  4111. logMismatchError();
  4112. }
  4113. vnode.el = null;
  4114. if (isFragment) {
  4115. const end = locateClosingAnchor(node);
  4116. while (true) {
  4117. const next2 = nextSibling(node);
  4118. if (next2 && next2 !== end) {
  4119. remove(next2);
  4120. } else {
  4121. break;
  4122. }
  4123. }
  4124. }
  4125. const next = nextSibling(node);
  4126. const container = parentNode(node);
  4127. remove(node);
  4128. patch(
  4129. null,
  4130. vnode,
  4131. container,
  4132. next,
  4133. parentComponent,
  4134. parentSuspense,
  4135. getContainerType(container),
  4136. slotScopeIds
  4137. );
  4138. return next;
  4139. };
  4140. const locateClosingAnchor = (node, open = "[", close = "]") => {
  4141. let match = 0;
  4142. while (node) {
  4143. node = nextSibling(node);
  4144. if (node && isComment(node)) {
  4145. if (node.data === open) match++;
  4146. if (node.data === close) {
  4147. if (match === 0) {
  4148. return nextSibling(node);
  4149. } else {
  4150. match--;
  4151. }
  4152. }
  4153. }
  4154. }
  4155. return node;
  4156. };
  4157. const replaceNode = (newNode, oldNode, parentComponent) => {
  4158. const parentNode2 = oldNode.parentNode;
  4159. if (parentNode2) {
  4160. parentNode2.replaceChild(newNode, oldNode);
  4161. }
  4162. let parent = parentComponent;
  4163. while (parent) {
  4164. if (parent.vnode.el === oldNode) {
  4165. parent.vnode.el = parent.subTree.el = newNode;
  4166. }
  4167. parent = parent.parent;
  4168. }
  4169. };
  4170. const isTemplateNode = (node) => {
  4171. return node.nodeType === 1 && node.tagName === "TEMPLATE";
  4172. };
  4173. return [hydrate, hydrateNode];
  4174. }
  4175. function propHasMismatch(el, key, clientValue, vnode, instance) {
  4176. let mismatchType;
  4177. let mismatchKey;
  4178. let actual;
  4179. let expected;
  4180. if (key === "class") {
  4181. actual = el.getAttribute("class");
  4182. expected = normalizeClass(clientValue);
  4183. if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
  4184. mismatchType = 2 /* CLASS */;
  4185. mismatchKey = `class`;
  4186. }
  4187. } else if (key === "style") {
  4188. actual = el.getAttribute("style") || "";
  4189. expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
  4190. const actualMap = toStyleMap(actual);
  4191. const expectedMap = toStyleMap(expected);
  4192. if (vnode.dirs) {
  4193. for (const { dir, value } of vnode.dirs) {
  4194. if (dir.name === "show" && !value) {
  4195. expectedMap.set("display", "none");
  4196. }
  4197. }
  4198. }
  4199. if (instance) {
  4200. resolveCssVars(instance, vnode, expectedMap);
  4201. }
  4202. if (!isMapEqual(actualMap, expectedMap)) {
  4203. mismatchType = 3 /* STYLE */;
  4204. mismatchKey = "style";
  4205. }
  4206. } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
  4207. if (isBooleanAttr(key)) {
  4208. actual = el.hasAttribute(key);
  4209. expected = includeBooleanAttr(clientValue);
  4210. } else if (clientValue == null) {
  4211. actual = el.hasAttribute(key);
  4212. expected = false;
  4213. } else {
  4214. if (el.hasAttribute(key)) {
  4215. actual = el.getAttribute(key);
  4216. } else if (key === "value" && el.tagName === "TEXTAREA") {
  4217. actual = el.value;
  4218. } else {
  4219. actual = false;
  4220. }
  4221. expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
  4222. }
  4223. if (actual !== expected) {
  4224. mismatchType = 4 /* ATTRIBUTE */;
  4225. mismatchKey = key;
  4226. }
  4227. }
  4228. if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) {
  4229. const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
  4230. const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`;
  4231. const postSegment = `
  4232. - rendered on server: ${format(actual)}
  4233. - expected on client: ${format(expected)}
  4234. Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
  4235. You should fix the source of the mismatch.`;
  4236. {
  4237. warn$1(preSegment, el, postSegment);
  4238. }
  4239. return true;
  4240. }
  4241. return false;
  4242. }
  4243. function toClassSet(str) {
  4244. return new Set(str.trim().split(/\s+/));
  4245. }
  4246. function isSetEqual(a, b) {
  4247. if (a.size !== b.size) {
  4248. return false;
  4249. }
  4250. for (const s of a) {
  4251. if (!b.has(s)) {
  4252. return false;
  4253. }
  4254. }
  4255. return true;
  4256. }
  4257. function toStyleMap(str) {
  4258. const styleMap = /* @__PURE__ */ new Map();
  4259. for (const item of str.split(";")) {
  4260. let [key, value] = item.split(":");
  4261. key = key.trim();
  4262. value = value && value.trim();
  4263. if (key && value) {
  4264. styleMap.set(key, value);
  4265. }
  4266. }
  4267. return styleMap;
  4268. }
  4269. function isMapEqual(a, b) {
  4270. if (a.size !== b.size) {
  4271. return false;
  4272. }
  4273. for (const [key, value] of a) {
  4274. if (value !== b.get(key)) {
  4275. return false;
  4276. }
  4277. }
  4278. return true;
  4279. }
  4280. function resolveCssVars(instance, vnode, expectedMap) {
  4281. const root = instance.subTree;
  4282. if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
  4283. const cssVars = instance.getCssVars();
  4284. for (const key in cssVars) {
  4285. expectedMap.set(
  4286. `--${getEscapedCssVarName(key)}`,
  4287. String(cssVars[key])
  4288. );
  4289. }
  4290. }
  4291. if (vnode === root && instance.parent) {
  4292. resolveCssVars(instance.parent, instance.vnode, expectedMap);
  4293. }
  4294. }
  4295. const allowMismatchAttr = "data-allow-mismatch";
  4296. const MismatchTypeString = {
  4297. [0 /* TEXT */]: "text",
  4298. [1 /* CHILDREN */]: "children",
  4299. [2 /* CLASS */]: "class",
  4300. [3 /* STYLE */]: "style",
  4301. [4 /* ATTRIBUTE */]: "attribute"
  4302. };
  4303. function isMismatchAllowed(el, allowedType) {
  4304. if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) {
  4305. while (el && !el.hasAttribute(allowMismatchAttr)) {
  4306. el = el.parentElement;
  4307. }
  4308. }
  4309. const allowedAttr = el && el.getAttribute(allowMismatchAttr);
  4310. if (allowedAttr == null) {
  4311. return false;
  4312. } else if (allowedAttr === "") {
  4313. return true;
  4314. } else {
  4315. const list = allowedAttr.split(",");
  4316. if (allowedType === 0 /* TEXT */ && list.includes("children")) {
  4317. return true;
  4318. }
  4319. return allowedAttr.split(",").includes(MismatchTypeString[allowedType]);
  4320. }
  4321. }
  4322. const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
  4323. const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
  4324. const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
  4325. const id = requestIdleCallback(hydrate, { timeout });
  4326. return () => cancelIdleCallback(id);
  4327. };
  4328. function elementIsVisibleInViewport(el) {
  4329. const { top, left, bottom, right } = el.getBoundingClientRect();
  4330. const { innerHeight, innerWidth } = window;
  4331. return (top > 0 && top < innerHeight || bottom > 0 && bottom < innerHeight) && (left > 0 && left < innerWidth || right > 0 && right < innerWidth);
  4332. }
  4333. const hydrateOnVisible = (opts) => (hydrate, forEach) => {
  4334. const ob = new IntersectionObserver((entries) => {
  4335. for (const e of entries) {
  4336. if (!e.isIntersecting) continue;
  4337. ob.disconnect();
  4338. hydrate();
  4339. break;
  4340. }
  4341. }, opts);
  4342. forEach((el) => {
  4343. if (!(el instanceof Element)) return;
  4344. if (elementIsVisibleInViewport(el)) {
  4345. hydrate();
  4346. ob.disconnect();
  4347. return false;
  4348. }
  4349. ob.observe(el);
  4350. });
  4351. return () => ob.disconnect();
  4352. };
  4353. const hydrateOnMediaQuery = (query) => (hydrate) => {
  4354. if (query) {
  4355. const mql = matchMedia(query);
  4356. if (mql.matches) {
  4357. hydrate();
  4358. } else {
  4359. mql.addEventListener("change", hydrate, { once: true });
  4360. return () => mql.removeEventListener("change", hydrate);
  4361. }
  4362. }
  4363. };
  4364. const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
  4365. if (isString(interactions)) interactions = [interactions];
  4366. let hasHydrated = false;
  4367. const doHydrate = (e) => {
  4368. if (!hasHydrated) {
  4369. hasHydrated = true;
  4370. teardown();
  4371. hydrate();
  4372. e.target.dispatchEvent(new e.constructor(e.type, e));
  4373. }
  4374. };
  4375. const teardown = () => {
  4376. forEach((el) => {
  4377. for (const i of interactions) {
  4378. el.removeEventListener(i, doHydrate);
  4379. }
  4380. });
  4381. };
  4382. forEach((el) => {
  4383. for (const i of interactions) {
  4384. el.addEventListener(i, doHydrate, { once: true });
  4385. }
  4386. });
  4387. return teardown;
  4388. };
  4389. function forEachElement(node, cb) {
  4390. if (isComment(node) && node.data === "[") {
  4391. let depth = 1;
  4392. let next = node.nextSibling;
  4393. while (next) {
  4394. if (next.nodeType === 1) {
  4395. const result = cb(next);
  4396. if (result === false) {
  4397. break;
  4398. }
  4399. } else if (isComment(next)) {
  4400. if (next.data === "]") {
  4401. if (--depth === 0) break;
  4402. } else if (next.data === "[") {
  4403. depth++;
  4404. }
  4405. }
  4406. next = next.nextSibling;
  4407. }
  4408. } else {
  4409. cb(node);
  4410. }
  4411. }
  4412. const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
  4413. /*! #__NO_SIDE_EFFECTS__ */
  4414. // @__NO_SIDE_EFFECTS__
  4415. function defineAsyncComponent(source) {
  4416. if (isFunction(source)) {
  4417. source = { loader: source };
  4418. }
  4419. const {
  4420. loader,
  4421. loadingComponent,
  4422. errorComponent,
  4423. delay = 200,
  4424. hydrate: hydrateStrategy,
  4425. timeout,
  4426. // undefined = never times out
  4427. suspensible = true,
  4428. onError: userOnError
  4429. } = source;
  4430. let pendingRequest = null;
  4431. let resolvedComp;
  4432. let retries = 0;
  4433. const retry = () => {
  4434. retries++;
  4435. pendingRequest = null;
  4436. return load();
  4437. };
  4438. const load = () => {
  4439. let thisRequest;
  4440. return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
  4441. err = err instanceof Error ? err : new Error(String(err));
  4442. if (userOnError) {
  4443. return new Promise((resolve, reject) => {
  4444. const userRetry = () => resolve(retry());
  4445. const userFail = () => reject(err);
  4446. userOnError(err, userRetry, userFail, retries + 1);
  4447. });
  4448. } else {
  4449. throw err;
  4450. }
  4451. }).then((comp) => {
  4452. if (thisRequest !== pendingRequest && pendingRequest) {
  4453. return pendingRequest;
  4454. }
  4455. if (!comp) {
  4456. warn$1(
  4457. `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
  4458. );
  4459. }
  4460. if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
  4461. comp = comp.default;
  4462. }
  4463. if (comp && !isObject(comp) && !isFunction(comp)) {
  4464. throw new Error(`Invalid async component load result: ${comp}`);
  4465. }
  4466. resolvedComp = comp;
  4467. return comp;
  4468. }));
  4469. };
  4470. return defineComponent({
  4471. name: "AsyncComponentWrapper",
  4472. __asyncLoader: load,
  4473. __asyncHydrate(el, instance, hydrate) {
  4474. const doHydrate = hydrateStrategy ? () => {
  4475. const teardown = hydrateStrategy(
  4476. hydrate,
  4477. (cb) => forEachElement(el, cb)
  4478. );
  4479. if (teardown) {
  4480. (instance.bum || (instance.bum = [])).push(teardown);
  4481. }
  4482. } : hydrate;
  4483. if (resolvedComp) {
  4484. doHydrate();
  4485. } else {
  4486. load().then(() => !instance.isUnmounted && doHydrate());
  4487. }
  4488. },
  4489. get __asyncResolved() {
  4490. return resolvedComp;
  4491. },
  4492. setup() {
  4493. const instance = currentInstance;
  4494. markAsyncBoundary(instance);
  4495. if (resolvedComp) {
  4496. return () => createInnerComp(resolvedComp, instance);
  4497. }
  4498. const onError = (err) => {
  4499. pendingRequest = null;
  4500. handleError(
  4501. err,
  4502. instance,
  4503. 13,
  4504. !errorComponent
  4505. );
  4506. };
  4507. if (suspensible && instance.suspense || isInSSRComponentSetup) {
  4508. return load().then((comp) => {
  4509. return () => createInnerComp(comp, instance);
  4510. }).catch((err) => {
  4511. onError(err);
  4512. return () => errorComponent ? createVNode(errorComponent, {
  4513. error: err
  4514. }) : null;
  4515. });
  4516. }
  4517. const loaded = ref(false);
  4518. const error = ref();
  4519. const delayed = ref(!!delay);
  4520. if (delay) {
  4521. setTimeout(() => {
  4522. delayed.value = false;
  4523. }, delay);
  4524. }
  4525. if (timeout != null) {
  4526. setTimeout(() => {
  4527. if (!loaded.value && !error.value) {
  4528. const err = new Error(
  4529. `Async component timed out after ${timeout}ms.`
  4530. );
  4531. onError(err);
  4532. error.value = err;
  4533. }
  4534. }, timeout);
  4535. }
  4536. load().then(() => {
  4537. loaded.value = true;
  4538. if (instance.parent && isKeepAlive(instance.parent.vnode)) {
  4539. instance.parent.update();
  4540. }
  4541. }).catch((err) => {
  4542. onError(err);
  4543. error.value = err;
  4544. });
  4545. return () => {
  4546. if (loaded.value && resolvedComp) {
  4547. return createInnerComp(resolvedComp, instance);
  4548. } else if (error.value && errorComponent) {
  4549. return createVNode(errorComponent, {
  4550. error: error.value
  4551. });
  4552. } else if (loadingComponent && !delayed.value) {
  4553. return createVNode(loadingComponent);
  4554. }
  4555. };
  4556. }
  4557. });
  4558. }
  4559. function createInnerComp(comp, parent) {
  4560. const { ref: ref2, props, children, ce } = parent.vnode;
  4561. const vnode = createVNode(comp, props, children);
  4562. vnode.ref = ref2;
  4563. vnode.ce = ce;
  4564. delete parent.vnode.ce;
  4565. return vnode;
  4566. }
  4567. const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
  4568. const KeepAliveImpl = {
  4569. name: `KeepAlive`,
  4570. // Marker for special handling inside the renderer. We are not using a ===
  4571. // check directly on KeepAlive in the renderer, because importing it directly
  4572. // would prevent it from being tree-shaken.
  4573. __isKeepAlive: true,
  4574. props: {
  4575. include: [String, RegExp, Array],
  4576. exclude: [String, RegExp, Array],
  4577. max: [String, Number]
  4578. },
  4579. setup(props, { slots }) {
  4580. const instance = getCurrentInstance();
  4581. const sharedContext = instance.ctx;
  4582. if (!sharedContext.renderer) {
  4583. return () => {
  4584. const children = slots.default && slots.default();
  4585. return children && children.length === 1 ? children[0] : children;
  4586. };
  4587. }
  4588. const cache = /* @__PURE__ */ new Map();
  4589. const keys = /* @__PURE__ */ new Set();
  4590. let current = null;
  4591. {
  4592. instance.__v_cache = cache;
  4593. }
  4594. const parentSuspense = instance.suspense;
  4595. const {
  4596. renderer: {
  4597. p: patch,
  4598. m: move,
  4599. um: _unmount,
  4600. o: { createElement }
  4601. }
  4602. } = sharedContext;
  4603. const storageContainer = createElement("div");
  4604. sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
  4605. const instance2 = vnode.component;
  4606. move(vnode, container, anchor, 0, parentSuspense);
  4607. patch(
  4608. instance2.vnode,
  4609. vnode,
  4610. container,
  4611. anchor,
  4612. instance2,
  4613. parentSuspense,
  4614. namespace,
  4615. vnode.slotScopeIds,
  4616. optimized
  4617. );
  4618. queuePostRenderEffect(() => {
  4619. instance2.isDeactivated = false;
  4620. if (instance2.a) {
  4621. invokeArrayFns(instance2.a);
  4622. }
  4623. const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
  4624. if (vnodeHook) {
  4625. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  4626. }
  4627. }, parentSuspense);
  4628. {
  4629. devtoolsComponentAdded(instance2);
  4630. }
  4631. };
  4632. sharedContext.deactivate = (vnode) => {
  4633. const instance2 = vnode.component;
  4634. invalidateMount(instance2.m);
  4635. invalidateMount(instance2.a);
  4636. move(vnode, storageContainer, null, 1, parentSuspense);
  4637. queuePostRenderEffect(() => {
  4638. if (instance2.da) {
  4639. invokeArrayFns(instance2.da);
  4640. }
  4641. const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
  4642. if (vnodeHook) {
  4643. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  4644. }
  4645. instance2.isDeactivated = true;
  4646. }, parentSuspense);
  4647. {
  4648. devtoolsComponentAdded(instance2);
  4649. }
  4650. };
  4651. function unmount(vnode) {
  4652. resetShapeFlag(vnode);
  4653. _unmount(vnode, instance, parentSuspense, true);
  4654. }
  4655. function pruneCache(filter) {
  4656. cache.forEach((vnode, key) => {
  4657. const name = getComponentName(vnode.type);
  4658. if (name && !filter(name)) {
  4659. pruneCacheEntry(key);
  4660. }
  4661. });
  4662. }
  4663. function pruneCacheEntry(key) {
  4664. const cached = cache.get(key);
  4665. if (cached && (!current || !isSameVNodeType(cached, current))) {
  4666. unmount(cached);
  4667. } else if (current) {
  4668. resetShapeFlag(current);
  4669. }
  4670. cache.delete(key);
  4671. keys.delete(key);
  4672. }
  4673. watch(
  4674. () => [props.include, props.exclude],
  4675. ([include, exclude]) => {
  4676. include && pruneCache((name) => matches(include, name));
  4677. exclude && pruneCache((name) => !matches(exclude, name));
  4678. },
  4679. // prune post-render after `current` has been updated
  4680. { flush: "post", deep: true }
  4681. );
  4682. let pendingCacheKey = null;
  4683. const cacheSubtree = () => {
  4684. if (pendingCacheKey != null) {
  4685. if (isSuspense(instance.subTree.type)) {
  4686. queuePostRenderEffect(() => {
  4687. cache.set(pendingCacheKey, getInnerChild(instance.subTree));
  4688. }, instance.subTree.suspense);
  4689. } else {
  4690. cache.set(pendingCacheKey, getInnerChild(instance.subTree));
  4691. }
  4692. }
  4693. };
  4694. onMounted(cacheSubtree);
  4695. onUpdated(cacheSubtree);
  4696. onBeforeUnmount(() => {
  4697. cache.forEach((cached) => {
  4698. const { subTree, suspense } = instance;
  4699. const vnode = getInnerChild(subTree);
  4700. if (cached.type === vnode.type && cached.key === vnode.key) {
  4701. resetShapeFlag(vnode);
  4702. const da = vnode.component.da;
  4703. da && queuePostRenderEffect(da, suspense);
  4704. return;
  4705. }
  4706. unmount(cached);
  4707. });
  4708. });
  4709. return () => {
  4710. pendingCacheKey = null;
  4711. if (!slots.default) {
  4712. return current = null;
  4713. }
  4714. const children = slots.default();
  4715. const rawVNode = children[0];
  4716. if (children.length > 1) {
  4717. {
  4718. warn$1(`KeepAlive should contain exactly one component child.`);
  4719. }
  4720. current = null;
  4721. return children;
  4722. } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
  4723. current = null;
  4724. return rawVNode;
  4725. }
  4726. let vnode = getInnerChild(rawVNode);
  4727. if (vnode.type === Comment) {
  4728. current = null;
  4729. return vnode;
  4730. }
  4731. const comp = vnode.type;
  4732. const name = getComponentName(
  4733. isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
  4734. );
  4735. const { include, exclude, max } = props;
  4736. if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
  4737. vnode.shapeFlag &= ~256;
  4738. current = vnode;
  4739. return rawVNode;
  4740. }
  4741. const key = vnode.key == null ? comp : vnode.key;
  4742. const cachedVNode = cache.get(key);
  4743. if (vnode.el) {
  4744. vnode = cloneVNode(vnode);
  4745. if (rawVNode.shapeFlag & 128) {
  4746. rawVNode.ssContent = vnode;
  4747. }
  4748. }
  4749. pendingCacheKey = key;
  4750. if (cachedVNode) {
  4751. vnode.el = cachedVNode.el;
  4752. vnode.component = cachedVNode.component;
  4753. if (vnode.transition) {
  4754. setTransitionHooks(vnode, vnode.transition);
  4755. }
  4756. vnode.shapeFlag |= 512;
  4757. keys.delete(key);
  4758. keys.add(key);
  4759. } else {
  4760. keys.add(key);
  4761. if (max && keys.size > parseInt(max, 10)) {
  4762. pruneCacheEntry(keys.values().next().value);
  4763. }
  4764. }
  4765. vnode.shapeFlag |= 256;
  4766. current = vnode;
  4767. return isSuspense(rawVNode.type) ? rawVNode : vnode;
  4768. };
  4769. }
  4770. };
  4771. const KeepAlive = KeepAliveImpl;
  4772. function matches(pattern, name) {
  4773. if (isArray(pattern)) {
  4774. return pattern.some((p) => matches(p, name));
  4775. } else if (isString(pattern)) {
  4776. return pattern.split(",").includes(name);
  4777. } else if (isRegExp(pattern)) {
  4778. pattern.lastIndex = 0;
  4779. return pattern.test(name);
  4780. }
  4781. return false;
  4782. }
  4783. function onActivated(hook, target) {
  4784. registerKeepAliveHook(hook, "a", target);
  4785. }
  4786. function onDeactivated(hook, target) {
  4787. registerKeepAliveHook(hook, "da", target);
  4788. }
  4789. function registerKeepAliveHook(hook, type, target = currentInstance) {
  4790. const wrappedHook = hook.__wdc || (hook.__wdc = () => {
  4791. let current = target;
  4792. while (current) {
  4793. if (current.isDeactivated) {
  4794. return;
  4795. }
  4796. current = current.parent;
  4797. }
  4798. return hook();
  4799. });
  4800. injectHook(type, wrappedHook, target);
  4801. if (target) {
  4802. let current = target.parent;
  4803. while (current && current.parent) {
  4804. if (isKeepAlive(current.parent.vnode)) {
  4805. injectToKeepAliveRoot(wrappedHook, type, target, current);
  4806. }
  4807. current = current.parent;
  4808. }
  4809. }
  4810. }
  4811. function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  4812. const injected = injectHook(
  4813. type,
  4814. hook,
  4815. keepAliveRoot,
  4816. true
  4817. /* prepend */
  4818. );
  4819. onUnmounted(() => {
  4820. remove(keepAliveRoot[type], injected);
  4821. }, target);
  4822. }
  4823. function resetShapeFlag(vnode) {
  4824. vnode.shapeFlag &= ~256;
  4825. vnode.shapeFlag &= ~512;
  4826. }
  4827. function getInnerChild(vnode) {
  4828. return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
  4829. }
  4830. function injectHook(type, hook, target = currentInstance, prepend = false) {
  4831. if (target) {
  4832. const hooks = target[type] || (target[type] = []);
  4833. const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
  4834. pauseTracking();
  4835. const reset = setCurrentInstance(target);
  4836. const res = callWithAsyncErrorHandling(hook, target, type, args);
  4837. reset();
  4838. resetTracking();
  4839. return res;
  4840. });
  4841. if (prepend) {
  4842. hooks.unshift(wrappedHook);
  4843. } else {
  4844. hooks.push(wrappedHook);
  4845. }
  4846. return wrappedHook;
  4847. } else {
  4848. const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
  4849. warn$1(
  4850. `${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.` )
  4851. );
  4852. }
  4853. }
  4854. const createHook = (lifecycle) => (hook, target = currentInstance) => {
  4855. if (!isInSSRComponentSetup || lifecycle === "sp") {
  4856. injectHook(lifecycle, (...args) => hook(...args), target);
  4857. }
  4858. };
  4859. const onBeforeMount = createHook("bm");
  4860. const onMounted = createHook("m");
  4861. const onBeforeUpdate = createHook(
  4862. "bu"
  4863. );
  4864. const onUpdated = createHook("u");
  4865. const onBeforeUnmount = createHook(
  4866. "bum"
  4867. );
  4868. const onUnmounted = createHook("um");
  4869. const onServerPrefetch = createHook(
  4870. "sp"
  4871. );
  4872. const onRenderTriggered = createHook("rtg");
  4873. const onRenderTracked = createHook("rtc");
  4874. function onErrorCaptured(hook, target = currentInstance) {
  4875. injectHook("ec", hook, target);
  4876. }
  4877. const COMPONENTS = "components";
  4878. const DIRECTIVES = "directives";
  4879. function resolveComponent(name, maybeSelfReference) {
  4880. return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
  4881. }
  4882. const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
  4883. function resolveDynamicComponent(component) {
  4884. if (isString(component)) {
  4885. return resolveAsset(COMPONENTS, component, false) || component;
  4886. } else {
  4887. return component || NULL_DYNAMIC_COMPONENT;
  4888. }
  4889. }
  4890. function resolveDirective(name) {
  4891. return resolveAsset(DIRECTIVES, name);
  4892. }
  4893. function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
  4894. const instance = currentRenderingInstance || currentInstance;
  4895. if (instance) {
  4896. const Component = instance.type;
  4897. if (type === COMPONENTS) {
  4898. const selfName = getComponentName(
  4899. Component,
  4900. false
  4901. );
  4902. if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
  4903. return Component;
  4904. }
  4905. }
  4906. const res = (
  4907. // local registration
  4908. // check instance[type] first which is resolved for options API
  4909. resolve(instance[type] || Component[type], name) || // global registration
  4910. resolve(instance.appContext[type], name)
  4911. );
  4912. if (!res && maybeSelfReference) {
  4913. return Component;
  4914. }
  4915. if (warnMissing && !res) {
  4916. const extra = type === COMPONENTS ? `
  4917. If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
  4918. warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
  4919. }
  4920. return res;
  4921. } else {
  4922. warn$1(
  4923. `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
  4924. );
  4925. }
  4926. }
  4927. function resolve(registry, name) {
  4928. return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
  4929. }
  4930. function renderList(source, renderItem, cache, index) {
  4931. let ret;
  4932. const cached = cache && cache[index];
  4933. const sourceIsArray = isArray(source);
  4934. if (sourceIsArray || isString(source)) {
  4935. const sourceIsReactiveArray = sourceIsArray && isReactive(source);
  4936. let needsWrap = false;
  4937. if (sourceIsReactiveArray) {
  4938. needsWrap = !isShallow(source);
  4939. source = shallowReadArray(source);
  4940. }
  4941. ret = new Array(source.length);
  4942. for (let i = 0, l = source.length; i < l; i++) {
  4943. ret[i] = renderItem(
  4944. needsWrap ? toReactive(source[i]) : source[i],
  4945. i,
  4946. void 0,
  4947. cached && cached[i]
  4948. );
  4949. }
  4950. } else if (typeof source === "number") {
  4951. if (!Number.isInteger(source)) {
  4952. warn$1(`The v-for range expect an integer value but got ${source}.`);
  4953. }
  4954. ret = new Array(source);
  4955. for (let i = 0; i < source; i++) {
  4956. ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
  4957. }
  4958. } else if (isObject(source)) {
  4959. if (source[Symbol.iterator]) {
  4960. ret = Array.from(
  4961. source,
  4962. (item, i) => renderItem(item, i, void 0, cached && cached[i])
  4963. );
  4964. } else {
  4965. const keys = Object.keys(source);
  4966. ret = new Array(keys.length);
  4967. for (let i = 0, l = keys.length; i < l; i++) {
  4968. const key = keys[i];
  4969. ret[i] = renderItem(source[key], key, i, cached && cached[i]);
  4970. }
  4971. }
  4972. } else {
  4973. ret = [];
  4974. }
  4975. if (cache) {
  4976. cache[index] = ret;
  4977. }
  4978. return ret;
  4979. }
  4980. function createSlots(slots, dynamicSlots) {
  4981. for (let i = 0; i < dynamicSlots.length; i++) {
  4982. const slot = dynamicSlots[i];
  4983. if (isArray(slot)) {
  4984. for (let j = 0; j < slot.length; j++) {
  4985. slots[slot[j].name] = slot[j].fn;
  4986. }
  4987. } else if (slot) {
  4988. slots[slot.name] = slot.key ? (...args) => {
  4989. const res = slot.fn(...args);
  4990. if (res) res.key = slot.key;
  4991. return res;
  4992. } : slot.fn;
  4993. }
  4994. }
  4995. return slots;
  4996. }
  4997. function renderSlot(slots, name, props = {}, fallback, noSlotted) {
  4998. if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
  4999. if (name !== "default") props.name = name;
  5000. return openBlock(), createBlock(
  5001. Fragment,
  5002. null,
  5003. [createVNode("slot", props, fallback && fallback())],
  5004. 64
  5005. );
  5006. }
  5007. let slot = slots[name];
  5008. if (slot && slot.length > 1) {
  5009. warn$1(
  5010. `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.`
  5011. );
  5012. slot = () => [];
  5013. }
  5014. if (slot && slot._c) {
  5015. slot._d = false;
  5016. }
  5017. openBlock();
  5018. const validSlotContent = slot && ensureValidVNode(slot(props));
  5019. const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
  5020. // key attached in the `createSlots` helper, respect that
  5021. validSlotContent && validSlotContent.key;
  5022. const rendered = createBlock(
  5023. Fragment,
  5024. {
  5025. key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
  5026. (!validSlotContent && fallback ? "_fb" : "")
  5027. },
  5028. validSlotContent || (fallback ? fallback() : []),
  5029. validSlotContent && slots._ === 1 ? 64 : -2
  5030. );
  5031. if (!noSlotted && rendered.scopeId) {
  5032. rendered.slotScopeIds = [rendered.scopeId + "-s"];
  5033. }
  5034. if (slot && slot._c) {
  5035. slot._d = true;
  5036. }
  5037. return rendered;
  5038. }
  5039. function ensureValidVNode(vnodes) {
  5040. return vnodes.some((child) => {
  5041. if (!isVNode(child)) return true;
  5042. if (child.type === Comment) return false;
  5043. if (child.type === Fragment && !ensureValidVNode(child.children))
  5044. return false;
  5045. return true;
  5046. }) ? vnodes : null;
  5047. }
  5048. function toHandlers(obj, preserveCaseIfNecessary) {
  5049. const ret = {};
  5050. if (!isObject(obj)) {
  5051. warn$1(`v-on with no argument expects an object value.`);
  5052. return ret;
  5053. }
  5054. for (const key in obj) {
  5055. ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];
  5056. }
  5057. return ret;
  5058. }
  5059. const getPublicInstance = (i) => {
  5060. if (!i) return null;
  5061. if (isStatefulComponent(i)) return getComponentPublicInstance(i);
  5062. return getPublicInstance(i.parent);
  5063. };
  5064. const publicPropertiesMap = (
  5065. // Move PURE marker to new line to workaround compiler discarding it
  5066. // due to type annotation
  5067. /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
  5068. $: (i) => i,
  5069. $el: (i) => i.vnode.el,
  5070. $data: (i) => i.data,
  5071. $props: (i) => shallowReadonly(i.props) ,
  5072. $attrs: (i) => shallowReadonly(i.attrs) ,
  5073. $slots: (i) => shallowReadonly(i.slots) ,
  5074. $refs: (i) => shallowReadonly(i.refs) ,
  5075. $parent: (i) => getPublicInstance(i.parent),
  5076. $root: (i) => getPublicInstance(i.root),
  5077. $host: (i) => i.ce,
  5078. $emit: (i) => i.emit,
  5079. $options: (i) => resolveMergedOptions(i) ,
  5080. $forceUpdate: (i) => i.f || (i.f = () => {
  5081. queueJob(i.update);
  5082. }),
  5083. $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
  5084. $watch: (i) => instanceWatch.bind(i)
  5085. })
  5086. );
  5087. const isReservedPrefix = (key) => key === "_" || key === "$";
  5088. const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
  5089. const PublicInstanceProxyHandlers = {
  5090. get({ _: instance }, key) {
  5091. if (key === "__v_skip") {
  5092. return true;
  5093. }
  5094. const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
  5095. if (key === "__isVue") {
  5096. return true;
  5097. }
  5098. let normalizedProps;
  5099. if (key[0] !== "$") {
  5100. const n = accessCache[key];
  5101. if (n !== void 0) {
  5102. switch (n) {
  5103. case 1 /* SETUP */:
  5104. return setupState[key];
  5105. case 2 /* DATA */:
  5106. return data[key];
  5107. case 4 /* CONTEXT */:
  5108. return ctx[key];
  5109. case 3 /* PROPS */:
  5110. return props[key];
  5111. }
  5112. } else if (hasSetupBinding(setupState, key)) {
  5113. accessCache[key] = 1 /* SETUP */;
  5114. return setupState[key];
  5115. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  5116. accessCache[key] = 2 /* DATA */;
  5117. return data[key];
  5118. } else if (
  5119. // only cache other properties when instance has declared (thus stable)
  5120. // props
  5121. (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)
  5122. ) {
  5123. accessCache[key] = 3 /* PROPS */;
  5124. return props[key];
  5125. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  5126. accessCache[key] = 4 /* CONTEXT */;
  5127. return ctx[key];
  5128. } else if (shouldCacheAccess) {
  5129. accessCache[key] = 0 /* OTHER */;
  5130. }
  5131. }
  5132. const publicGetter = publicPropertiesMap[key];
  5133. let cssModule, globalProperties;
  5134. if (publicGetter) {
  5135. if (key === "$attrs") {
  5136. track(instance.attrs, "get", "");
  5137. markAttrsAccessed();
  5138. } else if (key === "$slots") {
  5139. track(instance, "get", key);
  5140. }
  5141. return publicGetter(instance);
  5142. } else if (
  5143. // css module (injected by vue-loader)
  5144. (cssModule = type.__cssModules) && (cssModule = cssModule[key])
  5145. ) {
  5146. return cssModule;
  5147. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  5148. accessCache[key] = 4 /* CONTEXT */;
  5149. return ctx[key];
  5150. } else if (
  5151. // global properties
  5152. globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)
  5153. ) {
  5154. {
  5155. return globalProperties[key];
  5156. }
  5157. } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading
  5158. // to infinite warning loop
  5159. key.indexOf("__v") !== 0)) {
  5160. if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
  5161. warn$1(
  5162. `Property ${JSON.stringify(
  5163. key
  5164. )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
  5165. );
  5166. } else if (instance === currentRenderingInstance) {
  5167. warn$1(
  5168. `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`
  5169. );
  5170. }
  5171. }
  5172. },
  5173. set({ _: instance }, key, value) {
  5174. const { data, setupState, ctx } = instance;
  5175. if (hasSetupBinding(setupState, key)) {
  5176. setupState[key] = value;
  5177. return true;
  5178. } else if (setupState.__isScriptSetup && hasOwn(setupState, key)) {
  5179. warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
  5180. return false;
  5181. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  5182. data[key] = value;
  5183. return true;
  5184. } else if (hasOwn(instance.props, key)) {
  5185. warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
  5186. return false;
  5187. }
  5188. if (key[0] === "$" && key.slice(1) in instance) {
  5189. warn$1(
  5190. `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`
  5191. );
  5192. return false;
  5193. } else {
  5194. if (key in instance.appContext.config.globalProperties) {
  5195. Object.defineProperty(ctx, key, {
  5196. enumerable: true,
  5197. configurable: true,
  5198. value
  5199. });
  5200. } else {
  5201. ctx[key] = value;
  5202. }
  5203. }
  5204. return true;
  5205. },
  5206. has({
  5207. _: { data, setupState, accessCache, ctx, appContext, propsOptions }
  5208. }, key) {
  5209. let normalizedProps;
  5210. 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);
  5211. },
  5212. defineProperty(target, key, descriptor) {
  5213. if (descriptor.get != null) {
  5214. target._.accessCache[key] = 0;
  5215. } else if (hasOwn(descriptor, "value")) {
  5216. this.set(target, key, descriptor.value, null);
  5217. }
  5218. return Reflect.defineProperty(target, key, descriptor);
  5219. }
  5220. };
  5221. {
  5222. PublicInstanceProxyHandlers.ownKeys = (target) => {
  5223. warn$1(
  5224. `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`
  5225. );
  5226. return Reflect.ownKeys(target);
  5227. };
  5228. }
  5229. const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend({}, PublicInstanceProxyHandlers, {
  5230. get(target, key) {
  5231. if (key === Symbol.unscopables) {
  5232. return;
  5233. }
  5234. return PublicInstanceProxyHandlers.get(target, key, target);
  5235. },
  5236. has(_, key) {
  5237. const has = key[0] !== "_" && !isGloballyAllowed(key);
  5238. if (!has && PublicInstanceProxyHandlers.has(_, key)) {
  5239. warn$1(
  5240. `Property ${JSON.stringify(
  5241. key
  5242. )} should not start with _ which is a reserved prefix for Vue internals.`
  5243. );
  5244. }
  5245. return has;
  5246. }
  5247. });
  5248. function createDevRenderContext(instance) {
  5249. const target = {};
  5250. Object.defineProperty(target, `_`, {
  5251. configurable: true,
  5252. enumerable: false,
  5253. get: () => instance
  5254. });
  5255. Object.keys(publicPropertiesMap).forEach((key) => {
  5256. Object.defineProperty(target, key, {
  5257. configurable: true,
  5258. enumerable: false,
  5259. get: () => publicPropertiesMap[key](instance),
  5260. // intercepted by the proxy so no need for implementation,
  5261. // but needed to prevent set errors
  5262. set: NOOP
  5263. });
  5264. });
  5265. return target;
  5266. }
  5267. function exposePropsOnRenderContext(instance) {
  5268. const {
  5269. ctx,
  5270. propsOptions: [propsOptions]
  5271. } = instance;
  5272. if (propsOptions) {
  5273. Object.keys(propsOptions).forEach((key) => {
  5274. Object.defineProperty(ctx, key, {
  5275. enumerable: true,
  5276. configurable: true,
  5277. get: () => instance.props[key],
  5278. set: NOOP
  5279. });
  5280. });
  5281. }
  5282. }
  5283. function exposeSetupStateOnRenderContext(instance) {
  5284. const { ctx, setupState } = instance;
  5285. Object.keys(toRaw(setupState)).forEach((key) => {
  5286. if (!setupState.__isScriptSetup) {
  5287. if (isReservedPrefix(key[0])) {
  5288. warn$1(
  5289. `setup() return property ${JSON.stringify(
  5290. key
  5291. )} should not start with "$" or "_" which are reserved prefixes for Vue internals.`
  5292. );
  5293. return;
  5294. }
  5295. Object.defineProperty(ctx, key, {
  5296. enumerable: true,
  5297. configurable: true,
  5298. get: () => setupState[key],
  5299. set: NOOP
  5300. });
  5301. }
  5302. });
  5303. }
  5304. const warnRuntimeUsage = (method) => warn$1(
  5305. `${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.`
  5306. );
  5307. function defineProps() {
  5308. {
  5309. warnRuntimeUsage(`defineProps`);
  5310. }
  5311. return null;
  5312. }
  5313. function defineEmits() {
  5314. {
  5315. warnRuntimeUsage(`defineEmits`);
  5316. }
  5317. return null;
  5318. }
  5319. function defineExpose(exposed) {
  5320. {
  5321. warnRuntimeUsage(`defineExpose`);
  5322. }
  5323. }
  5324. function defineOptions(options) {
  5325. {
  5326. warnRuntimeUsage(`defineOptions`);
  5327. }
  5328. }
  5329. function defineSlots() {
  5330. {
  5331. warnRuntimeUsage(`defineSlots`);
  5332. }
  5333. return null;
  5334. }
  5335. function defineModel() {
  5336. {
  5337. warnRuntimeUsage("defineModel");
  5338. }
  5339. }
  5340. function withDefaults(props, defaults) {
  5341. {
  5342. warnRuntimeUsage(`withDefaults`);
  5343. }
  5344. return null;
  5345. }
  5346. function useSlots() {
  5347. return getContext().slots;
  5348. }
  5349. function useAttrs() {
  5350. return getContext().attrs;
  5351. }
  5352. function getContext() {
  5353. const i = getCurrentInstance();
  5354. if (!i) {
  5355. warn$1(`useContext() called without active instance.`);
  5356. }
  5357. return i.setupContext || (i.setupContext = createSetupContext(i));
  5358. }
  5359. function normalizePropsOrEmits(props) {
  5360. return isArray(props) ? props.reduce(
  5361. (normalized, p) => (normalized[p] = null, normalized),
  5362. {}
  5363. ) : props;
  5364. }
  5365. function mergeDefaults(raw, defaults) {
  5366. const props = normalizePropsOrEmits(raw);
  5367. for (const key in defaults) {
  5368. if (key.startsWith("__skip")) continue;
  5369. let opt = props[key];
  5370. if (opt) {
  5371. if (isArray(opt) || isFunction(opt)) {
  5372. opt = props[key] = { type: opt, default: defaults[key] };
  5373. } else {
  5374. opt.default = defaults[key];
  5375. }
  5376. } else if (opt === null) {
  5377. opt = props[key] = { default: defaults[key] };
  5378. } else {
  5379. warn$1(`props default key "${key}" has no corresponding declaration.`);
  5380. }
  5381. if (opt && defaults[`__skip_${key}`]) {
  5382. opt.skipFactory = true;
  5383. }
  5384. }
  5385. return props;
  5386. }
  5387. function mergeModels(a, b) {
  5388. if (!a || !b) return a || b;
  5389. if (isArray(a) && isArray(b)) return a.concat(b);
  5390. return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
  5391. }
  5392. function createPropsRestProxy(props, excludedKeys) {
  5393. const ret = {};
  5394. for (const key in props) {
  5395. if (!excludedKeys.includes(key)) {
  5396. Object.defineProperty(ret, key, {
  5397. enumerable: true,
  5398. get: () => props[key]
  5399. });
  5400. }
  5401. }
  5402. return ret;
  5403. }
  5404. function withAsyncContext(getAwaitable) {
  5405. const ctx = getCurrentInstance();
  5406. if (!ctx) {
  5407. warn$1(
  5408. `withAsyncContext called without active current instance. This is likely a bug.`
  5409. );
  5410. }
  5411. let awaitable = getAwaitable();
  5412. unsetCurrentInstance();
  5413. if (isPromise(awaitable)) {
  5414. awaitable = awaitable.catch((e) => {
  5415. setCurrentInstance(ctx);
  5416. throw e;
  5417. });
  5418. }
  5419. return [awaitable, () => setCurrentInstance(ctx)];
  5420. }
  5421. function createDuplicateChecker() {
  5422. const cache = /* @__PURE__ */ Object.create(null);
  5423. return (type, key) => {
  5424. if (cache[key]) {
  5425. warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`);
  5426. } else {
  5427. cache[key] = type;
  5428. }
  5429. };
  5430. }
  5431. let shouldCacheAccess = true;
  5432. function applyOptions(instance) {
  5433. const options = resolveMergedOptions(instance);
  5434. const publicThis = instance.proxy;
  5435. const ctx = instance.ctx;
  5436. shouldCacheAccess = false;
  5437. if (options.beforeCreate) {
  5438. callHook$1(options.beforeCreate, instance, "bc");
  5439. }
  5440. const {
  5441. // state
  5442. data: dataOptions,
  5443. computed: computedOptions,
  5444. methods,
  5445. watch: watchOptions,
  5446. provide: provideOptions,
  5447. inject: injectOptions,
  5448. // lifecycle
  5449. created,
  5450. beforeMount,
  5451. mounted,
  5452. beforeUpdate,
  5453. updated,
  5454. activated,
  5455. deactivated,
  5456. beforeDestroy,
  5457. beforeUnmount,
  5458. destroyed,
  5459. unmounted,
  5460. render,
  5461. renderTracked,
  5462. renderTriggered,
  5463. errorCaptured,
  5464. serverPrefetch,
  5465. // public API
  5466. expose,
  5467. inheritAttrs,
  5468. // assets
  5469. components,
  5470. directives,
  5471. filters
  5472. } = options;
  5473. const checkDuplicateProperties = createDuplicateChecker() ;
  5474. {
  5475. const [propsOptions] = instance.propsOptions;
  5476. if (propsOptions) {
  5477. for (const key in propsOptions) {
  5478. checkDuplicateProperties("Props" /* PROPS */, key);
  5479. }
  5480. }
  5481. }
  5482. if (injectOptions) {
  5483. resolveInjections(injectOptions, ctx, checkDuplicateProperties);
  5484. }
  5485. if (methods) {
  5486. for (const key in methods) {
  5487. const methodHandler = methods[key];
  5488. if (isFunction(methodHandler)) {
  5489. {
  5490. Object.defineProperty(ctx, key, {
  5491. value: methodHandler.bind(publicThis),
  5492. configurable: true,
  5493. enumerable: true,
  5494. writable: true
  5495. });
  5496. }
  5497. {
  5498. checkDuplicateProperties("Methods" /* METHODS */, key);
  5499. }
  5500. } else {
  5501. warn$1(
  5502. `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`
  5503. );
  5504. }
  5505. }
  5506. }
  5507. if (dataOptions) {
  5508. if (!isFunction(dataOptions)) {
  5509. warn$1(
  5510. `The data option must be a function. Plain object usage is no longer supported.`
  5511. );
  5512. }
  5513. const data = dataOptions.call(publicThis, publicThis);
  5514. if (isPromise(data)) {
  5515. warn$1(
  5516. `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`
  5517. );
  5518. }
  5519. if (!isObject(data)) {
  5520. warn$1(`data() should return an object.`);
  5521. } else {
  5522. instance.data = reactive(data);
  5523. {
  5524. for (const key in data) {
  5525. checkDuplicateProperties("Data" /* DATA */, key);
  5526. if (!isReservedPrefix(key[0])) {
  5527. Object.defineProperty(ctx, key, {
  5528. configurable: true,
  5529. enumerable: true,
  5530. get: () => data[key],
  5531. set: NOOP
  5532. });
  5533. }
  5534. }
  5535. }
  5536. }
  5537. }
  5538. shouldCacheAccess = true;
  5539. if (computedOptions) {
  5540. for (const key in computedOptions) {
  5541. const opt = computedOptions[key];
  5542. const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
  5543. if (get === NOOP) {
  5544. warn$1(`Computed property "${key}" has no getter.`);
  5545. }
  5546. const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
  5547. warn$1(
  5548. `Write operation failed: computed property "${key}" is readonly.`
  5549. );
  5550. } ;
  5551. const c = computed({
  5552. get,
  5553. set
  5554. });
  5555. Object.defineProperty(ctx, key, {
  5556. enumerable: true,
  5557. configurable: true,
  5558. get: () => c.value,
  5559. set: (v) => c.value = v
  5560. });
  5561. {
  5562. checkDuplicateProperties("Computed" /* COMPUTED */, key);
  5563. }
  5564. }
  5565. }
  5566. if (watchOptions) {
  5567. for (const key in watchOptions) {
  5568. createWatcher(watchOptions[key], ctx, publicThis, key);
  5569. }
  5570. }
  5571. if (provideOptions) {
  5572. const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
  5573. Reflect.ownKeys(provides).forEach((key) => {
  5574. provide(key, provides[key]);
  5575. });
  5576. }
  5577. if (created) {
  5578. callHook$1(created, instance, "c");
  5579. }
  5580. function registerLifecycleHook(register, hook) {
  5581. if (isArray(hook)) {
  5582. hook.forEach((_hook) => register(_hook.bind(publicThis)));
  5583. } else if (hook) {
  5584. register(hook.bind(publicThis));
  5585. }
  5586. }
  5587. registerLifecycleHook(onBeforeMount, beforeMount);
  5588. registerLifecycleHook(onMounted, mounted);
  5589. registerLifecycleHook(onBeforeUpdate, beforeUpdate);
  5590. registerLifecycleHook(onUpdated, updated);
  5591. registerLifecycleHook(onActivated, activated);
  5592. registerLifecycleHook(onDeactivated, deactivated);
  5593. registerLifecycleHook(onErrorCaptured, errorCaptured);
  5594. registerLifecycleHook(onRenderTracked, renderTracked);
  5595. registerLifecycleHook(onRenderTriggered, renderTriggered);
  5596. registerLifecycleHook(onBeforeUnmount, beforeUnmount);
  5597. registerLifecycleHook(onUnmounted, unmounted);
  5598. registerLifecycleHook(onServerPrefetch, serverPrefetch);
  5599. if (isArray(expose)) {
  5600. if (expose.length) {
  5601. const exposed = instance.exposed || (instance.exposed = {});
  5602. expose.forEach((key) => {
  5603. Object.defineProperty(exposed, key, {
  5604. get: () => publicThis[key],
  5605. set: (val) => publicThis[key] = val
  5606. });
  5607. });
  5608. } else if (!instance.exposed) {
  5609. instance.exposed = {};
  5610. }
  5611. }
  5612. if (render && instance.render === NOOP) {
  5613. instance.render = render;
  5614. }
  5615. if (inheritAttrs != null) {
  5616. instance.inheritAttrs = inheritAttrs;
  5617. }
  5618. if (components) instance.components = components;
  5619. if (directives) instance.directives = directives;
  5620. if (serverPrefetch) {
  5621. markAsyncBoundary(instance);
  5622. }
  5623. }
  5624. function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
  5625. if (isArray(injectOptions)) {
  5626. injectOptions = normalizeInject(injectOptions);
  5627. }
  5628. for (const key in injectOptions) {
  5629. const opt = injectOptions[key];
  5630. let injected;
  5631. if (isObject(opt)) {
  5632. if ("default" in opt) {
  5633. injected = inject(
  5634. opt.from || key,
  5635. opt.default,
  5636. true
  5637. );
  5638. } else {
  5639. injected = inject(opt.from || key);
  5640. }
  5641. } else {
  5642. injected = inject(opt);
  5643. }
  5644. if (isRef(injected)) {
  5645. Object.defineProperty(ctx, key, {
  5646. enumerable: true,
  5647. configurable: true,
  5648. get: () => injected.value,
  5649. set: (v) => injected.value = v
  5650. });
  5651. } else {
  5652. ctx[key] = injected;
  5653. }
  5654. {
  5655. checkDuplicateProperties("Inject" /* INJECT */, key);
  5656. }
  5657. }
  5658. }
  5659. function callHook$1(hook, instance, type) {
  5660. callWithAsyncErrorHandling(
  5661. isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy),
  5662. instance,
  5663. type
  5664. );
  5665. }
  5666. function createWatcher(raw, ctx, publicThis, key) {
  5667. let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  5668. if (isString(raw)) {
  5669. const handler = ctx[raw];
  5670. if (isFunction(handler)) {
  5671. {
  5672. watch(getter, handler);
  5673. }
  5674. } else {
  5675. warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
  5676. }
  5677. } else if (isFunction(raw)) {
  5678. {
  5679. watch(getter, raw.bind(publicThis));
  5680. }
  5681. } else if (isObject(raw)) {
  5682. if (isArray(raw)) {
  5683. raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
  5684. } else {
  5685. const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
  5686. if (isFunction(handler)) {
  5687. watch(getter, handler, raw);
  5688. } else {
  5689. warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
  5690. }
  5691. }
  5692. } else {
  5693. warn$1(`Invalid watch option: "${key}"`, raw);
  5694. }
  5695. }
  5696. function resolveMergedOptions(instance) {
  5697. const base = instance.type;
  5698. const { mixins, extends: extendsOptions } = base;
  5699. const {
  5700. mixins: globalMixins,
  5701. optionsCache: cache,
  5702. config: { optionMergeStrategies }
  5703. } = instance.appContext;
  5704. const cached = cache.get(base);
  5705. let resolved;
  5706. if (cached) {
  5707. resolved = cached;
  5708. } else if (!globalMixins.length && !mixins && !extendsOptions) {
  5709. {
  5710. resolved = base;
  5711. }
  5712. } else {
  5713. resolved = {};
  5714. if (globalMixins.length) {
  5715. globalMixins.forEach(
  5716. (m) => mergeOptions(resolved, m, optionMergeStrategies, true)
  5717. );
  5718. }
  5719. mergeOptions(resolved, base, optionMergeStrategies);
  5720. }
  5721. if (isObject(base)) {
  5722. cache.set(base, resolved);
  5723. }
  5724. return resolved;
  5725. }
  5726. function mergeOptions(to, from, strats, asMixin = false) {
  5727. const { mixins, extends: extendsOptions } = from;
  5728. if (extendsOptions) {
  5729. mergeOptions(to, extendsOptions, strats, true);
  5730. }
  5731. if (mixins) {
  5732. mixins.forEach(
  5733. (m) => mergeOptions(to, m, strats, true)
  5734. );
  5735. }
  5736. for (const key in from) {
  5737. if (asMixin && key === "expose") {
  5738. warn$1(
  5739. `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`
  5740. );
  5741. } else {
  5742. const strat = internalOptionMergeStrats[key] || strats && strats[key];
  5743. to[key] = strat ? strat(to[key], from[key]) : from[key];
  5744. }
  5745. }
  5746. return to;
  5747. }
  5748. const internalOptionMergeStrats = {
  5749. data: mergeDataFn,
  5750. props: mergeEmitsOrPropsOptions,
  5751. emits: mergeEmitsOrPropsOptions,
  5752. // objects
  5753. methods: mergeObjectOptions,
  5754. computed: mergeObjectOptions,
  5755. // lifecycle
  5756. beforeCreate: mergeAsArray,
  5757. created: mergeAsArray,
  5758. beforeMount: mergeAsArray,
  5759. mounted: mergeAsArray,
  5760. beforeUpdate: mergeAsArray,
  5761. updated: mergeAsArray,
  5762. beforeDestroy: mergeAsArray,
  5763. beforeUnmount: mergeAsArray,
  5764. destroyed: mergeAsArray,
  5765. unmounted: mergeAsArray,
  5766. activated: mergeAsArray,
  5767. deactivated: mergeAsArray,
  5768. errorCaptured: mergeAsArray,
  5769. serverPrefetch: mergeAsArray,
  5770. // assets
  5771. components: mergeObjectOptions,
  5772. directives: mergeObjectOptions,
  5773. // watch
  5774. watch: mergeWatchOptions,
  5775. // provide / inject
  5776. provide: mergeDataFn,
  5777. inject: mergeInject
  5778. };
  5779. function mergeDataFn(to, from) {
  5780. if (!from) {
  5781. return to;
  5782. }
  5783. if (!to) {
  5784. return from;
  5785. }
  5786. return function mergedDataFn() {
  5787. return (extend)(
  5788. isFunction(to) ? to.call(this, this) : to,
  5789. isFunction(from) ? from.call(this, this) : from
  5790. );
  5791. };
  5792. }
  5793. function mergeInject(to, from) {
  5794. return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
  5795. }
  5796. function normalizeInject(raw) {
  5797. if (isArray(raw)) {
  5798. const res = {};
  5799. for (let i = 0; i < raw.length; i++) {
  5800. res[raw[i]] = raw[i];
  5801. }
  5802. return res;
  5803. }
  5804. return raw;
  5805. }
  5806. function mergeAsArray(to, from) {
  5807. return to ? [...new Set([].concat(to, from))] : from;
  5808. }
  5809. function mergeObjectOptions(to, from) {
  5810. return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
  5811. }
  5812. function mergeEmitsOrPropsOptions(to, from) {
  5813. if (to) {
  5814. if (isArray(to) && isArray(from)) {
  5815. return [.../* @__PURE__ */ new Set([...to, ...from])];
  5816. }
  5817. return extend(
  5818. /* @__PURE__ */ Object.create(null),
  5819. normalizePropsOrEmits(to),
  5820. normalizePropsOrEmits(from != null ? from : {})
  5821. );
  5822. } else {
  5823. return from;
  5824. }
  5825. }
  5826. function mergeWatchOptions(to, from) {
  5827. if (!to) return from;
  5828. if (!from) return to;
  5829. const merged = extend(/* @__PURE__ */ Object.create(null), to);
  5830. for (const key in from) {
  5831. merged[key] = mergeAsArray(to[key], from[key]);
  5832. }
  5833. return merged;
  5834. }
  5835. function createAppContext() {
  5836. return {
  5837. app: null,
  5838. config: {
  5839. isNativeTag: NO,
  5840. performance: false,
  5841. globalProperties: {},
  5842. optionMergeStrategies: {},
  5843. errorHandler: void 0,
  5844. warnHandler: void 0,
  5845. compilerOptions: {}
  5846. },
  5847. mixins: [],
  5848. components: {},
  5849. directives: {},
  5850. provides: /* @__PURE__ */ Object.create(null),
  5851. optionsCache: /* @__PURE__ */ new WeakMap(),
  5852. propsCache: /* @__PURE__ */ new WeakMap(),
  5853. emitsCache: /* @__PURE__ */ new WeakMap()
  5854. };
  5855. }
  5856. let uid$1 = 0;
  5857. function createAppAPI(render, hydrate) {
  5858. return function createApp(rootComponent, rootProps = null) {
  5859. if (!isFunction(rootComponent)) {
  5860. rootComponent = extend({}, rootComponent);
  5861. }
  5862. if (rootProps != null && !isObject(rootProps)) {
  5863. warn$1(`root props passed to app.mount() must be an object.`);
  5864. rootProps = null;
  5865. }
  5866. const context = createAppContext();
  5867. const installedPlugins = /* @__PURE__ */ new WeakSet();
  5868. const pluginCleanupFns = [];
  5869. let isMounted = false;
  5870. const app = context.app = {
  5871. _uid: uid$1++,
  5872. _component: rootComponent,
  5873. _props: rootProps,
  5874. _container: null,
  5875. _context: context,
  5876. _instance: null,
  5877. version,
  5878. get config() {
  5879. return context.config;
  5880. },
  5881. set config(v) {
  5882. {
  5883. warn$1(
  5884. `app.config cannot be replaced. Modify individual options instead.`
  5885. );
  5886. }
  5887. },
  5888. use(plugin, ...options) {
  5889. if (installedPlugins.has(plugin)) {
  5890. warn$1(`Plugin has already been applied to target app.`);
  5891. } else if (plugin && isFunction(plugin.install)) {
  5892. installedPlugins.add(plugin);
  5893. plugin.install(app, ...options);
  5894. } else if (isFunction(plugin)) {
  5895. installedPlugins.add(plugin);
  5896. plugin(app, ...options);
  5897. } else {
  5898. warn$1(
  5899. `A plugin must either be a function or an object with an "install" function.`
  5900. );
  5901. }
  5902. return app;
  5903. },
  5904. mixin(mixin) {
  5905. {
  5906. if (!context.mixins.includes(mixin)) {
  5907. context.mixins.push(mixin);
  5908. } else {
  5909. warn$1(
  5910. "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
  5911. );
  5912. }
  5913. }
  5914. return app;
  5915. },
  5916. component(name, component) {
  5917. {
  5918. validateComponentName(name, context.config);
  5919. }
  5920. if (!component) {
  5921. return context.components[name];
  5922. }
  5923. if (context.components[name]) {
  5924. warn$1(`Component "${name}" has already been registered in target app.`);
  5925. }
  5926. context.components[name] = component;
  5927. return app;
  5928. },
  5929. directive(name, directive) {
  5930. {
  5931. validateDirectiveName(name);
  5932. }
  5933. if (!directive) {
  5934. return context.directives[name];
  5935. }
  5936. if (context.directives[name]) {
  5937. warn$1(`Directive "${name}" has already been registered in target app.`);
  5938. }
  5939. context.directives[name] = directive;
  5940. return app;
  5941. },
  5942. mount(rootContainer, isHydrate, namespace) {
  5943. if (!isMounted) {
  5944. if (rootContainer.__vue_app__) {
  5945. warn$1(
  5946. `There is already an app instance mounted on the host container.
  5947. If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
  5948. );
  5949. }
  5950. const vnode = app._ceVNode || createVNode(rootComponent, rootProps);
  5951. vnode.appContext = context;
  5952. if (namespace === true) {
  5953. namespace = "svg";
  5954. } else if (namespace === false) {
  5955. namespace = void 0;
  5956. }
  5957. {
  5958. context.reload = () => {
  5959. render(
  5960. cloneVNode(vnode),
  5961. rootContainer,
  5962. namespace
  5963. );
  5964. };
  5965. }
  5966. if (isHydrate && hydrate) {
  5967. hydrate(vnode, rootContainer);
  5968. } else {
  5969. render(vnode, rootContainer, namespace);
  5970. }
  5971. isMounted = true;
  5972. app._container = rootContainer;
  5973. rootContainer.__vue_app__ = app;
  5974. {
  5975. app._instance = vnode.component;
  5976. devtoolsInitApp(app, version);
  5977. }
  5978. return getComponentPublicInstance(vnode.component);
  5979. } else {
  5980. warn$1(
  5981. `App has already been mounted.
  5982. 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)\``
  5983. );
  5984. }
  5985. },
  5986. onUnmount(cleanupFn) {
  5987. if (typeof cleanupFn !== "function") {
  5988. warn$1(
  5989. `Expected function as first argument to app.onUnmount(), but got ${typeof cleanupFn}`
  5990. );
  5991. }
  5992. pluginCleanupFns.push(cleanupFn);
  5993. },
  5994. unmount() {
  5995. if (isMounted) {
  5996. callWithAsyncErrorHandling(
  5997. pluginCleanupFns,
  5998. app._instance,
  5999. 16
  6000. );
  6001. render(null, app._container);
  6002. {
  6003. app._instance = null;
  6004. devtoolsUnmountApp(app);
  6005. }
  6006. delete app._container.__vue_app__;
  6007. } else {
  6008. warn$1(`Cannot unmount an app that is not mounted.`);
  6009. }
  6010. },
  6011. provide(key, value) {
  6012. if (key in context.provides) {
  6013. warn$1(
  6014. `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
  6015. );
  6016. }
  6017. context.provides[key] = value;
  6018. return app;
  6019. },
  6020. runWithContext(fn) {
  6021. const lastApp = currentApp;
  6022. currentApp = app;
  6023. try {
  6024. return fn();
  6025. } finally {
  6026. currentApp = lastApp;
  6027. }
  6028. }
  6029. };
  6030. return app;
  6031. };
  6032. }
  6033. let currentApp = null;
  6034. function provide(key, value) {
  6035. if (!currentInstance) {
  6036. {
  6037. warn$1(`provide() can only be used inside setup().`);
  6038. }
  6039. } else {
  6040. let provides = currentInstance.provides;
  6041. const parentProvides = currentInstance.parent && currentInstance.parent.provides;
  6042. if (parentProvides === provides) {
  6043. provides = currentInstance.provides = Object.create(parentProvides);
  6044. }
  6045. provides[key] = value;
  6046. }
  6047. }
  6048. function inject(key, defaultValue, treatDefaultAsFactory = false) {
  6049. const instance = currentInstance || currentRenderingInstance;
  6050. if (instance || currentApp) {
  6051. const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
  6052. if (provides && key in provides) {
  6053. return provides[key];
  6054. } else if (arguments.length > 1) {
  6055. return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
  6056. } else {
  6057. warn$1(`injection "${String(key)}" not found.`);
  6058. }
  6059. } else {
  6060. warn$1(`inject() can only be used inside setup() or functional components.`);
  6061. }
  6062. }
  6063. function hasInjectionContext() {
  6064. return !!(currentInstance || currentRenderingInstance || currentApp);
  6065. }
  6066. const internalObjectProto = {};
  6067. const createInternalObject = () => Object.create(internalObjectProto);
  6068. const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
  6069. function initProps(instance, rawProps, isStateful, isSSR = false) {
  6070. const props = {};
  6071. const attrs = createInternalObject();
  6072. instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  6073. setFullProps(instance, rawProps, props, attrs);
  6074. for (const key in instance.propsOptions[0]) {
  6075. if (!(key in props)) {
  6076. props[key] = void 0;
  6077. }
  6078. }
  6079. {
  6080. validateProps(rawProps || {}, props, instance);
  6081. }
  6082. if (isStateful) {
  6083. instance.props = isSSR ? props : shallowReactive(props);
  6084. } else {
  6085. if (!instance.type.props) {
  6086. instance.props = attrs;
  6087. } else {
  6088. instance.props = props;
  6089. }
  6090. }
  6091. instance.attrs = attrs;
  6092. }
  6093. function isInHmrContext(instance) {
  6094. while (instance) {
  6095. if (instance.type.__hmrId) return true;
  6096. instance = instance.parent;
  6097. }
  6098. }
  6099. function updateProps(instance, rawProps, rawPrevProps, optimized) {
  6100. const {
  6101. props,
  6102. attrs,
  6103. vnode: { patchFlag }
  6104. } = instance;
  6105. const rawCurrentProps = toRaw(props);
  6106. const [options] = instance.propsOptions;
  6107. let hasAttrsChanged = false;
  6108. if (
  6109. // always force full diff in dev
  6110. // - #1942 if hmr is enabled with sfc component
  6111. // - vite#872 non-sfc component used by sfc component
  6112. !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
  6113. ) {
  6114. if (patchFlag & 8) {
  6115. const propsToUpdate = instance.vnode.dynamicProps;
  6116. for (let i = 0; i < propsToUpdate.length; i++) {
  6117. let key = propsToUpdate[i];
  6118. if (isEmitListener(instance.emitsOptions, key)) {
  6119. continue;
  6120. }
  6121. const value = rawProps[key];
  6122. if (options) {
  6123. if (hasOwn(attrs, key)) {
  6124. if (value !== attrs[key]) {
  6125. attrs[key] = value;
  6126. hasAttrsChanged = true;
  6127. }
  6128. } else {
  6129. const camelizedKey = camelize(key);
  6130. props[camelizedKey] = resolvePropValue(
  6131. options,
  6132. rawCurrentProps,
  6133. camelizedKey,
  6134. value,
  6135. instance,
  6136. false
  6137. );
  6138. }
  6139. } else {
  6140. if (value !== attrs[key]) {
  6141. attrs[key] = value;
  6142. hasAttrsChanged = true;
  6143. }
  6144. }
  6145. }
  6146. }
  6147. } else {
  6148. if (setFullProps(instance, rawProps, props, attrs)) {
  6149. hasAttrsChanged = true;
  6150. }
  6151. let kebabKey;
  6152. for (const key in rawCurrentProps) {
  6153. if (!rawProps || // for camelCase
  6154. !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
  6155. // and converted to camelCase (#955)
  6156. ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
  6157. if (options) {
  6158. if (rawPrevProps && // for camelCase
  6159. (rawPrevProps[key] !== void 0 || // for kebab-case
  6160. rawPrevProps[kebabKey] !== void 0)) {
  6161. props[key] = resolvePropValue(
  6162. options,
  6163. rawCurrentProps,
  6164. key,
  6165. void 0,
  6166. instance,
  6167. true
  6168. );
  6169. }
  6170. } else {
  6171. delete props[key];
  6172. }
  6173. }
  6174. }
  6175. if (attrs !== rawCurrentProps) {
  6176. for (const key in attrs) {
  6177. if (!rawProps || !hasOwn(rawProps, key) && true) {
  6178. delete attrs[key];
  6179. hasAttrsChanged = true;
  6180. }
  6181. }
  6182. }
  6183. }
  6184. if (hasAttrsChanged) {
  6185. trigger(instance.attrs, "set", "");
  6186. }
  6187. {
  6188. validateProps(rawProps || {}, props, instance);
  6189. }
  6190. }
  6191. function setFullProps(instance, rawProps, props, attrs) {
  6192. const [options, needCastKeys] = instance.propsOptions;
  6193. let hasAttrsChanged = false;
  6194. let rawCastValues;
  6195. if (rawProps) {
  6196. for (let key in rawProps) {
  6197. if (isReservedProp(key)) {
  6198. continue;
  6199. }
  6200. const value = rawProps[key];
  6201. let camelKey;
  6202. if (options && hasOwn(options, camelKey = camelize(key))) {
  6203. if (!needCastKeys || !needCastKeys.includes(camelKey)) {
  6204. props[camelKey] = value;
  6205. } else {
  6206. (rawCastValues || (rawCastValues = {}))[camelKey] = value;
  6207. }
  6208. } else if (!isEmitListener(instance.emitsOptions, key)) {
  6209. if (!(key in attrs) || value !== attrs[key]) {
  6210. attrs[key] = value;
  6211. hasAttrsChanged = true;
  6212. }
  6213. }
  6214. }
  6215. }
  6216. if (needCastKeys) {
  6217. const rawCurrentProps = toRaw(props);
  6218. const castValues = rawCastValues || EMPTY_OBJ;
  6219. for (let i = 0; i < needCastKeys.length; i++) {
  6220. const key = needCastKeys[i];
  6221. props[key] = resolvePropValue(
  6222. options,
  6223. rawCurrentProps,
  6224. key,
  6225. castValues[key],
  6226. instance,
  6227. !hasOwn(castValues, key)
  6228. );
  6229. }
  6230. }
  6231. return hasAttrsChanged;
  6232. }
  6233. function resolvePropValue(options, props, key, value, instance, isAbsent) {
  6234. const opt = options[key];
  6235. if (opt != null) {
  6236. const hasDefault = hasOwn(opt, "default");
  6237. if (hasDefault && value === void 0) {
  6238. const defaultValue = opt.default;
  6239. if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
  6240. const { propsDefaults } = instance;
  6241. if (key in propsDefaults) {
  6242. value = propsDefaults[key];
  6243. } else {
  6244. const reset = setCurrentInstance(instance);
  6245. value = propsDefaults[key] = defaultValue.call(
  6246. null,
  6247. props
  6248. );
  6249. reset();
  6250. }
  6251. } else {
  6252. value = defaultValue;
  6253. }
  6254. if (instance.ce) {
  6255. instance.ce._setProp(key, value);
  6256. }
  6257. }
  6258. if (opt[0 /* shouldCast */]) {
  6259. if (isAbsent && !hasDefault) {
  6260. value = false;
  6261. } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) {
  6262. value = true;
  6263. }
  6264. }
  6265. }
  6266. return value;
  6267. }
  6268. const mixinPropsCache = /* @__PURE__ */ new WeakMap();
  6269. function normalizePropsOptions(comp, appContext, asMixin = false) {
  6270. const cache = asMixin ? mixinPropsCache : appContext.propsCache;
  6271. const cached = cache.get(comp);
  6272. if (cached) {
  6273. return cached;
  6274. }
  6275. const raw = comp.props;
  6276. const normalized = {};
  6277. const needCastKeys = [];
  6278. let hasExtends = false;
  6279. if (!isFunction(comp)) {
  6280. const extendProps = (raw2) => {
  6281. hasExtends = true;
  6282. const [props, keys] = normalizePropsOptions(raw2, appContext, true);
  6283. extend(normalized, props);
  6284. if (keys) needCastKeys.push(...keys);
  6285. };
  6286. if (!asMixin && appContext.mixins.length) {
  6287. appContext.mixins.forEach(extendProps);
  6288. }
  6289. if (comp.extends) {
  6290. extendProps(comp.extends);
  6291. }
  6292. if (comp.mixins) {
  6293. comp.mixins.forEach(extendProps);
  6294. }
  6295. }
  6296. if (!raw && !hasExtends) {
  6297. if (isObject(comp)) {
  6298. cache.set(comp, EMPTY_ARR);
  6299. }
  6300. return EMPTY_ARR;
  6301. }
  6302. if (isArray(raw)) {
  6303. for (let i = 0; i < raw.length; i++) {
  6304. if (!isString(raw[i])) {
  6305. warn$1(`props must be strings when using array syntax.`, raw[i]);
  6306. }
  6307. const normalizedKey = camelize(raw[i]);
  6308. if (validatePropName(normalizedKey)) {
  6309. normalized[normalizedKey] = EMPTY_OBJ;
  6310. }
  6311. }
  6312. } else if (raw) {
  6313. if (!isObject(raw)) {
  6314. warn$1(`invalid props options`, raw);
  6315. }
  6316. for (const key in raw) {
  6317. const normalizedKey = camelize(key);
  6318. if (validatePropName(normalizedKey)) {
  6319. const opt = raw[key];
  6320. const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
  6321. const propType = prop.type;
  6322. let shouldCast = false;
  6323. let shouldCastTrue = true;
  6324. if (isArray(propType)) {
  6325. for (let index = 0; index < propType.length; ++index) {
  6326. const type = propType[index];
  6327. const typeName = isFunction(type) && type.name;
  6328. if (typeName === "Boolean") {
  6329. shouldCast = true;
  6330. break;
  6331. } else if (typeName === "String") {
  6332. shouldCastTrue = false;
  6333. }
  6334. }
  6335. } else {
  6336. shouldCast = isFunction(propType) && propType.name === "Boolean";
  6337. }
  6338. prop[0 /* shouldCast */] = shouldCast;
  6339. prop[1 /* shouldCastTrue */] = shouldCastTrue;
  6340. if (shouldCast || hasOwn(prop, "default")) {
  6341. needCastKeys.push(normalizedKey);
  6342. }
  6343. }
  6344. }
  6345. }
  6346. const res = [normalized, needCastKeys];
  6347. if (isObject(comp)) {
  6348. cache.set(comp, res);
  6349. }
  6350. return res;
  6351. }
  6352. function validatePropName(key) {
  6353. if (key[0] !== "$" && !isReservedProp(key)) {
  6354. return true;
  6355. } else {
  6356. warn$1(`Invalid prop name: "${key}" is a reserved property.`);
  6357. }
  6358. return false;
  6359. }
  6360. function getType(ctor) {
  6361. if (ctor === null) {
  6362. return "null";
  6363. }
  6364. if (typeof ctor === "function") {
  6365. return ctor.name || "";
  6366. } else if (typeof ctor === "object") {
  6367. const name = ctor.constructor && ctor.constructor.name;
  6368. return name || "";
  6369. }
  6370. return "";
  6371. }
  6372. function validateProps(rawProps, props, instance) {
  6373. const resolvedValues = toRaw(props);
  6374. const options = instance.propsOptions[0];
  6375. const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
  6376. for (const key in options) {
  6377. let opt = options[key];
  6378. if (opt == null) continue;
  6379. validateProp(
  6380. key,
  6381. resolvedValues[key],
  6382. opt,
  6383. shallowReadonly(resolvedValues) ,
  6384. !camelizePropsKey.includes(key)
  6385. );
  6386. }
  6387. }
  6388. function validateProp(name, value, prop, props, isAbsent) {
  6389. const { type, required, validator, skipCheck } = prop;
  6390. if (required && isAbsent) {
  6391. warn$1('Missing required prop: "' + name + '"');
  6392. return;
  6393. }
  6394. if (value == null && !required) {
  6395. return;
  6396. }
  6397. if (type != null && type !== true && !skipCheck) {
  6398. let isValid = false;
  6399. const types = isArray(type) ? type : [type];
  6400. const expectedTypes = [];
  6401. for (let i = 0; i < types.length && !isValid; i++) {
  6402. const { valid, expectedType } = assertType(value, types[i]);
  6403. expectedTypes.push(expectedType || "");
  6404. isValid = valid;
  6405. }
  6406. if (!isValid) {
  6407. warn$1(getInvalidTypeMessage(name, value, expectedTypes));
  6408. return;
  6409. }
  6410. }
  6411. if (validator && !validator(value, props)) {
  6412. warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
  6413. }
  6414. }
  6415. const isSimpleType = /* @__PURE__ */ makeMap(
  6416. "String,Number,Boolean,Function,Symbol,BigInt"
  6417. );
  6418. function assertType(value, type) {
  6419. let valid;
  6420. const expectedType = getType(type);
  6421. if (expectedType === "null") {
  6422. valid = value === null;
  6423. } else if (isSimpleType(expectedType)) {
  6424. const t = typeof value;
  6425. valid = t === expectedType.toLowerCase();
  6426. if (!valid && t === "object") {
  6427. valid = value instanceof type;
  6428. }
  6429. } else if (expectedType === "Object") {
  6430. valid = isObject(value);
  6431. } else if (expectedType === "Array") {
  6432. valid = isArray(value);
  6433. } else {
  6434. valid = value instanceof type;
  6435. }
  6436. return {
  6437. valid,
  6438. expectedType
  6439. };
  6440. }
  6441. function getInvalidTypeMessage(name, value, expectedTypes) {
  6442. if (expectedTypes.length === 0) {
  6443. return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
  6444. }
  6445. let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
  6446. const expectedType = expectedTypes[0];
  6447. const receivedType = toRawType(value);
  6448. const expectedValue = styleValue(value, expectedType);
  6449. const receivedValue = styleValue(value, receivedType);
  6450. if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
  6451. message += ` with value ${expectedValue}`;
  6452. }
  6453. message += `, got ${receivedType} `;
  6454. if (isExplicable(receivedType)) {
  6455. message += `with value ${receivedValue}.`;
  6456. }
  6457. return message;
  6458. }
  6459. function styleValue(value, type) {
  6460. if (type === "String") {
  6461. return `"${value}"`;
  6462. } else if (type === "Number") {
  6463. return `${Number(value)}`;
  6464. } else {
  6465. return `${value}`;
  6466. }
  6467. }
  6468. function isExplicable(type) {
  6469. const explicitTypes = ["string", "number", "boolean"];
  6470. return explicitTypes.some((elem) => type.toLowerCase() === elem);
  6471. }
  6472. function isBoolean(...args) {
  6473. return args.some((elem) => elem.toLowerCase() === "boolean");
  6474. }
  6475. const isInternalKey = (key) => key[0] === "_" || key === "$stable";
  6476. const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
  6477. const normalizeSlot = (key, rawSlot, ctx) => {
  6478. if (rawSlot._n) {
  6479. return rawSlot;
  6480. }
  6481. const normalized = withCtx((...args) => {
  6482. if (currentInstance && (!ctx || ctx.root === currentInstance.root)) {
  6483. warn$1(
  6484. `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.`
  6485. );
  6486. }
  6487. return normalizeSlotValue(rawSlot(...args));
  6488. }, ctx);
  6489. normalized._c = false;
  6490. return normalized;
  6491. };
  6492. const normalizeObjectSlots = (rawSlots, slots, instance) => {
  6493. const ctx = rawSlots._ctx;
  6494. for (const key in rawSlots) {
  6495. if (isInternalKey(key)) continue;
  6496. const value = rawSlots[key];
  6497. if (isFunction(value)) {
  6498. slots[key] = normalizeSlot(key, value, ctx);
  6499. } else if (value != null) {
  6500. {
  6501. warn$1(
  6502. `Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
  6503. );
  6504. }
  6505. const normalized = normalizeSlotValue(value);
  6506. slots[key] = () => normalized;
  6507. }
  6508. }
  6509. };
  6510. const normalizeVNodeSlots = (instance, children) => {
  6511. if (!isKeepAlive(instance.vnode) && true) {
  6512. warn$1(
  6513. `Non-function value encountered for default slot. Prefer function slots for better performance.`
  6514. );
  6515. }
  6516. const normalized = normalizeSlotValue(children);
  6517. instance.slots.default = () => normalized;
  6518. };
  6519. const assignSlots = (slots, children, optimized) => {
  6520. for (const key in children) {
  6521. if (optimized || key !== "_") {
  6522. slots[key] = children[key];
  6523. }
  6524. }
  6525. };
  6526. const initSlots = (instance, children, optimized) => {
  6527. const slots = instance.slots = createInternalObject();
  6528. if (instance.vnode.shapeFlag & 32) {
  6529. const type = children._;
  6530. if (type) {
  6531. assignSlots(slots, children, optimized);
  6532. if (optimized) {
  6533. def(slots, "_", type, true);
  6534. }
  6535. } else {
  6536. normalizeObjectSlots(children, slots);
  6537. }
  6538. } else if (children) {
  6539. normalizeVNodeSlots(instance, children);
  6540. }
  6541. };
  6542. const updateSlots = (instance, children, optimized) => {
  6543. const { vnode, slots } = instance;
  6544. let needDeletionCheck = true;
  6545. let deletionComparisonTarget = EMPTY_OBJ;
  6546. if (vnode.shapeFlag & 32) {
  6547. const type = children._;
  6548. if (type) {
  6549. if (isHmrUpdating) {
  6550. assignSlots(slots, children, optimized);
  6551. trigger(instance, "set", "$slots");
  6552. } else if (optimized && type === 1) {
  6553. needDeletionCheck = false;
  6554. } else {
  6555. assignSlots(slots, children, optimized);
  6556. }
  6557. } else {
  6558. needDeletionCheck = !children.$stable;
  6559. normalizeObjectSlots(children, slots);
  6560. }
  6561. deletionComparisonTarget = children;
  6562. } else if (children) {
  6563. normalizeVNodeSlots(instance, children);
  6564. deletionComparisonTarget = { default: 1 };
  6565. }
  6566. if (needDeletionCheck) {
  6567. for (const key in slots) {
  6568. if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
  6569. delete slots[key];
  6570. }
  6571. }
  6572. }
  6573. };
  6574. let supported;
  6575. let perf;
  6576. function startMeasure(instance, type) {
  6577. if (instance.appContext.config.performance && isSupported()) {
  6578. perf.mark(`vue-${type}-${instance.uid}`);
  6579. }
  6580. {
  6581. devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
  6582. }
  6583. }
  6584. function endMeasure(instance, type) {
  6585. if (instance.appContext.config.performance && isSupported()) {
  6586. const startTag = `vue-${type}-${instance.uid}`;
  6587. const endTag = startTag + `:end`;
  6588. perf.mark(endTag);
  6589. perf.measure(
  6590. `<${formatComponentName(instance, instance.type)}> ${type}`,
  6591. startTag,
  6592. endTag
  6593. );
  6594. perf.clearMarks(startTag);
  6595. perf.clearMarks(endTag);
  6596. }
  6597. {
  6598. devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
  6599. }
  6600. }
  6601. function isSupported() {
  6602. if (supported !== void 0) {
  6603. return supported;
  6604. }
  6605. if (typeof window !== "undefined" && window.performance) {
  6606. supported = true;
  6607. perf = window.performance;
  6608. } else {
  6609. supported = false;
  6610. }
  6611. return supported;
  6612. }
  6613. const queuePostRenderEffect = queueEffectWithSuspense ;
  6614. function createRenderer(options) {
  6615. return baseCreateRenderer(options);
  6616. }
  6617. function createHydrationRenderer(options) {
  6618. return baseCreateRenderer(options, createHydrationFunctions);
  6619. }
  6620. function baseCreateRenderer(options, createHydrationFns) {
  6621. const target = getGlobalThis();
  6622. target.__VUE__ = true;
  6623. {
  6624. setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
  6625. }
  6626. const {
  6627. insert: hostInsert,
  6628. remove: hostRemove,
  6629. patchProp: hostPatchProp,
  6630. createElement: hostCreateElement,
  6631. createText: hostCreateText,
  6632. createComment: hostCreateComment,
  6633. setText: hostSetText,
  6634. setElementText: hostSetElementText,
  6635. parentNode: hostParentNode,
  6636. nextSibling: hostNextSibling,
  6637. setScopeId: hostSetScopeId = NOOP,
  6638. insertStaticContent: hostInsertStaticContent
  6639. } = options;
  6640. const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
  6641. if (n1 === n2) {
  6642. return;
  6643. }
  6644. if (n1 && !isSameVNodeType(n1, n2)) {
  6645. anchor = getNextHostNode(n1);
  6646. unmount(n1, parentComponent, parentSuspense, true);
  6647. n1 = null;
  6648. }
  6649. if (n2.patchFlag === -2) {
  6650. optimized = false;
  6651. n2.dynamicChildren = null;
  6652. }
  6653. const { type, ref, shapeFlag } = n2;
  6654. switch (type) {
  6655. case Text:
  6656. processText(n1, n2, container, anchor);
  6657. break;
  6658. case Comment:
  6659. processCommentNode(n1, n2, container, anchor);
  6660. break;
  6661. case Static:
  6662. if (n1 == null) {
  6663. mountStaticNode(n2, container, anchor, namespace);
  6664. } else {
  6665. patchStaticNode(n1, n2, container, namespace);
  6666. }
  6667. break;
  6668. case Fragment:
  6669. processFragment(
  6670. n1,
  6671. n2,
  6672. container,
  6673. anchor,
  6674. parentComponent,
  6675. parentSuspense,
  6676. namespace,
  6677. slotScopeIds,
  6678. optimized
  6679. );
  6680. break;
  6681. default:
  6682. if (shapeFlag & 1) {
  6683. processElement(
  6684. n1,
  6685. n2,
  6686. container,
  6687. anchor,
  6688. parentComponent,
  6689. parentSuspense,
  6690. namespace,
  6691. slotScopeIds,
  6692. optimized
  6693. );
  6694. } else if (shapeFlag & 6) {
  6695. processComponent(
  6696. n1,
  6697. n2,
  6698. container,
  6699. anchor,
  6700. parentComponent,
  6701. parentSuspense,
  6702. namespace,
  6703. slotScopeIds,
  6704. optimized
  6705. );
  6706. } else if (shapeFlag & 64) {
  6707. type.process(
  6708. n1,
  6709. n2,
  6710. container,
  6711. anchor,
  6712. parentComponent,
  6713. parentSuspense,
  6714. namespace,
  6715. slotScopeIds,
  6716. optimized,
  6717. internals
  6718. );
  6719. } else if (shapeFlag & 128) {
  6720. type.process(
  6721. n1,
  6722. n2,
  6723. container,
  6724. anchor,
  6725. parentComponent,
  6726. parentSuspense,
  6727. namespace,
  6728. slotScopeIds,
  6729. optimized,
  6730. internals
  6731. );
  6732. } else {
  6733. warn$1("Invalid VNode type:", type, `(${typeof type})`);
  6734. }
  6735. }
  6736. if (ref != null && parentComponent) {
  6737. setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
  6738. }
  6739. };
  6740. const processText = (n1, n2, container, anchor) => {
  6741. if (n1 == null) {
  6742. hostInsert(
  6743. n2.el = hostCreateText(n2.children),
  6744. container,
  6745. anchor
  6746. );
  6747. } else {
  6748. const el = n2.el = n1.el;
  6749. if (n2.children !== n1.children) {
  6750. hostSetText(el, n2.children);
  6751. }
  6752. }
  6753. };
  6754. const processCommentNode = (n1, n2, container, anchor) => {
  6755. if (n1 == null) {
  6756. hostInsert(
  6757. n2.el = hostCreateComment(n2.children || ""),
  6758. container,
  6759. anchor
  6760. );
  6761. } else {
  6762. n2.el = n1.el;
  6763. }
  6764. };
  6765. const mountStaticNode = (n2, container, anchor, namespace) => {
  6766. [n2.el, n2.anchor] = hostInsertStaticContent(
  6767. n2.children,
  6768. container,
  6769. anchor,
  6770. namespace,
  6771. n2.el,
  6772. n2.anchor
  6773. );
  6774. };
  6775. const patchStaticNode = (n1, n2, container, namespace) => {
  6776. if (n2.children !== n1.children) {
  6777. const anchor = hostNextSibling(n1.anchor);
  6778. removeStaticNode(n1);
  6779. [n2.el, n2.anchor] = hostInsertStaticContent(
  6780. n2.children,
  6781. container,
  6782. anchor,
  6783. namespace
  6784. );
  6785. } else {
  6786. n2.el = n1.el;
  6787. n2.anchor = n1.anchor;
  6788. }
  6789. };
  6790. const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
  6791. let next;
  6792. while (el && el !== anchor) {
  6793. next = hostNextSibling(el);
  6794. hostInsert(el, container, nextSibling);
  6795. el = next;
  6796. }
  6797. hostInsert(anchor, container, nextSibling);
  6798. };
  6799. const removeStaticNode = ({ el, anchor }) => {
  6800. let next;
  6801. while (el && el !== anchor) {
  6802. next = hostNextSibling(el);
  6803. hostRemove(el);
  6804. el = next;
  6805. }
  6806. hostRemove(anchor);
  6807. };
  6808. const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  6809. if (n2.type === "svg") {
  6810. namespace = "svg";
  6811. } else if (n2.type === "math") {
  6812. namespace = "mathml";
  6813. }
  6814. if (n1 == null) {
  6815. mountElement(
  6816. n2,
  6817. container,
  6818. anchor,
  6819. parentComponent,
  6820. parentSuspense,
  6821. namespace,
  6822. slotScopeIds,
  6823. optimized
  6824. );
  6825. } else {
  6826. patchElement(
  6827. n1,
  6828. n2,
  6829. parentComponent,
  6830. parentSuspense,
  6831. namespace,
  6832. slotScopeIds,
  6833. optimized
  6834. );
  6835. }
  6836. };
  6837. const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  6838. let el;
  6839. let vnodeHook;
  6840. const { props, shapeFlag, transition, dirs } = vnode;
  6841. el = vnode.el = hostCreateElement(
  6842. vnode.type,
  6843. namespace,
  6844. props && props.is,
  6845. props
  6846. );
  6847. if (shapeFlag & 8) {
  6848. hostSetElementText(el, vnode.children);
  6849. } else if (shapeFlag & 16) {
  6850. mountChildren(
  6851. vnode.children,
  6852. el,
  6853. null,
  6854. parentComponent,
  6855. parentSuspense,
  6856. resolveChildrenNamespace(vnode, namespace),
  6857. slotScopeIds,
  6858. optimized
  6859. );
  6860. }
  6861. if (dirs) {
  6862. invokeDirectiveHook(vnode, null, parentComponent, "created");
  6863. }
  6864. setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
  6865. if (props) {
  6866. for (const key in props) {
  6867. if (key !== "value" && !isReservedProp(key)) {
  6868. hostPatchProp(el, key, null, props[key], namespace, parentComponent);
  6869. }
  6870. }
  6871. if ("value" in props) {
  6872. hostPatchProp(el, "value", null, props.value, namespace);
  6873. }
  6874. if (vnodeHook = props.onVnodeBeforeMount) {
  6875. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  6876. }
  6877. }
  6878. {
  6879. def(el, "__vnode", vnode, true);
  6880. def(el, "__vueParentComponent", parentComponent, true);
  6881. }
  6882. if (dirs) {
  6883. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  6884. }
  6885. const needCallTransitionHooks = needTransition(parentSuspense, transition);
  6886. if (needCallTransitionHooks) {
  6887. transition.beforeEnter(el);
  6888. }
  6889. hostInsert(el, container, anchor);
  6890. if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
  6891. queuePostRenderEffect(() => {
  6892. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  6893. needCallTransitionHooks && transition.enter(el);
  6894. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  6895. }, parentSuspense);
  6896. }
  6897. };
  6898. const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
  6899. if (scopeId) {
  6900. hostSetScopeId(el, scopeId);
  6901. }
  6902. if (slotScopeIds) {
  6903. for (let i = 0; i < slotScopeIds.length; i++) {
  6904. hostSetScopeId(el, slotScopeIds[i]);
  6905. }
  6906. }
  6907. if (parentComponent) {
  6908. let subTree = parentComponent.subTree;
  6909. if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
  6910. subTree = filterSingleRoot(subTree.children) || subTree;
  6911. }
  6912. if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
  6913. const parentVNode = parentComponent.vnode;
  6914. setScopeId(
  6915. el,
  6916. parentVNode,
  6917. parentVNode.scopeId,
  6918. parentVNode.slotScopeIds,
  6919. parentComponent.parent
  6920. );
  6921. }
  6922. }
  6923. };
  6924. const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
  6925. for (let i = start; i < children.length; i++) {
  6926. const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
  6927. patch(
  6928. null,
  6929. child,
  6930. container,
  6931. anchor,
  6932. parentComponent,
  6933. parentSuspense,
  6934. namespace,
  6935. slotScopeIds,
  6936. optimized
  6937. );
  6938. }
  6939. };
  6940. const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  6941. const el = n2.el = n1.el;
  6942. {
  6943. el.__vnode = n2;
  6944. }
  6945. let { patchFlag, dynamicChildren, dirs } = n2;
  6946. patchFlag |= n1.patchFlag & 16;
  6947. const oldProps = n1.props || EMPTY_OBJ;
  6948. const newProps = n2.props || EMPTY_OBJ;
  6949. let vnodeHook;
  6950. parentComponent && toggleRecurse(parentComponent, false);
  6951. if (vnodeHook = newProps.onVnodeBeforeUpdate) {
  6952. invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  6953. }
  6954. if (dirs) {
  6955. invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
  6956. }
  6957. parentComponent && toggleRecurse(parentComponent, true);
  6958. if (isHmrUpdating) {
  6959. patchFlag = 0;
  6960. optimized = false;
  6961. dynamicChildren = null;
  6962. }
  6963. if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
  6964. hostSetElementText(el, "");
  6965. }
  6966. if (dynamicChildren) {
  6967. patchBlockChildren(
  6968. n1.dynamicChildren,
  6969. dynamicChildren,
  6970. el,
  6971. parentComponent,
  6972. parentSuspense,
  6973. resolveChildrenNamespace(n2, namespace),
  6974. slotScopeIds
  6975. );
  6976. {
  6977. traverseStaticChildren(n1, n2);
  6978. }
  6979. } else if (!optimized) {
  6980. patchChildren(
  6981. n1,
  6982. n2,
  6983. el,
  6984. null,
  6985. parentComponent,
  6986. parentSuspense,
  6987. resolveChildrenNamespace(n2, namespace),
  6988. slotScopeIds,
  6989. false
  6990. );
  6991. }
  6992. if (patchFlag > 0) {
  6993. if (patchFlag & 16) {
  6994. patchProps(el, oldProps, newProps, parentComponent, namespace);
  6995. } else {
  6996. if (patchFlag & 2) {
  6997. if (oldProps.class !== newProps.class) {
  6998. hostPatchProp(el, "class", null, newProps.class, namespace);
  6999. }
  7000. }
  7001. if (patchFlag & 4) {
  7002. hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
  7003. }
  7004. if (patchFlag & 8) {
  7005. const propsToUpdate = n2.dynamicProps;
  7006. for (let i = 0; i < propsToUpdate.length; i++) {
  7007. const key = propsToUpdate[i];
  7008. const prev = oldProps[key];
  7009. const next = newProps[key];
  7010. if (next !== prev || key === "value") {
  7011. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  7012. }
  7013. }
  7014. }
  7015. }
  7016. if (patchFlag & 1) {
  7017. if (n1.children !== n2.children) {
  7018. hostSetElementText(el, n2.children);
  7019. }
  7020. }
  7021. } else if (!optimized && dynamicChildren == null) {
  7022. patchProps(el, oldProps, newProps, parentComponent, namespace);
  7023. }
  7024. if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
  7025. queuePostRenderEffect(() => {
  7026. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  7027. dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
  7028. }, parentSuspense);
  7029. }
  7030. };
  7031. const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
  7032. for (let i = 0; i < newChildren.length; i++) {
  7033. const oldVNode = oldChildren[i];
  7034. const newVNode = newChildren[i];
  7035. const container = (
  7036. // oldVNode may be an errored async setup() component inside Suspense
  7037. // which will not have a mounted element
  7038. oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
  7039. // of the Fragment itself so it can move its children.
  7040. (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
  7041. // which also requires the correct parent container
  7042. !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
  7043. oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : (
  7044. // In other cases, the parent container is not actually used so we
  7045. // just pass the block element here to avoid a DOM parentNode call.
  7046. fallbackContainer
  7047. )
  7048. );
  7049. patch(
  7050. oldVNode,
  7051. newVNode,
  7052. container,
  7053. null,
  7054. parentComponent,
  7055. parentSuspense,
  7056. namespace,
  7057. slotScopeIds,
  7058. true
  7059. );
  7060. }
  7061. };
  7062. const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
  7063. if (oldProps !== newProps) {
  7064. if (oldProps !== EMPTY_OBJ) {
  7065. for (const key in oldProps) {
  7066. if (!isReservedProp(key) && !(key in newProps)) {
  7067. hostPatchProp(
  7068. el,
  7069. key,
  7070. oldProps[key],
  7071. null,
  7072. namespace,
  7073. parentComponent
  7074. );
  7075. }
  7076. }
  7077. }
  7078. for (const key in newProps) {
  7079. if (isReservedProp(key)) continue;
  7080. const next = newProps[key];
  7081. const prev = oldProps[key];
  7082. if (next !== prev && key !== "value") {
  7083. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  7084. }
  7085. }
  7086. if ("value" in newProps) {
  7087. hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
  7088. }
  7089. }
  7090. };
  7091. const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  7092. const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
  7093. const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
  7094. let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
  7095. if (
  7096. // #5523 dev root fragment may inherit directives
  7097. isHmrUpdating || patchFlag & 2048
  7098. ) {
  7099. patchFlag = 0;
  7100. optimized = false;
  7101. dynamicChildren = null;
  7102. }
  7103. if (fragmentSlotScopeIds) {
  7104. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  7105. }
  7106. if (n1 == null) {
  7107. hostInsert(fragmentStartAnchor, container, anchor);
  7108. hostInsert(fragmentEndAnchor, container, anchor);
  7109. mountChildren(
  7110. // #10007
  7111. // such fragment like `<></>` will be compiled into
  7112. // a fragment which doesn't have a children.
  7113. // In this case fallback to an empty array
  7114. n2.children || [],
  7115. container,
  7116. fragmentEndAnchor,
  7117. parentComponent,
  7118. parentSuspense,
  7119. namespace,
  7120. slotScopeIds,
  7121. optimized
  7122. );
  7123. } else {
  7124. if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
  7125. // of renderSlot() with no valid children
  7126. n1.dynamicChildren) {
  7127. patchBlockChildren(
  7128. n1.dynamicChildren,
  7129. dynamicChildren,
  7130. container,
  7131. parentComponent,
  7132. parentSuspense,
  7133. namespace,
  7134. slotScopeIds
  7135. );
  7136. {
  7137. traverseStaticChildren(n1, n2);
  7138. }
  7139. } else {
  7140. patchChildren(
  7141. n1,
  7142. n2,
  7143. container,
  7144. fragmentEndAnchor,
  7145. parentComponent,
  7146. parentSuspense,
  7147. namespace,
  7148. slotScopeIds,
  7149. optimized
  7150. );
  7151. }
  7152. }
  7153. };
  7154. const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  7155. n2.slotScopeIds = slotScopeIds;
  7156. if (n1 == null) {
  7157. if (n2.shapeFlag & 512) {
  7158. parentComponent.ctx.activate(
  7159. n2,
  7160. container,
  7161. anchor,
  7162. namespace,
  7163. optimized
  7164. );
  7165. } else {
  7166. mountComponent(
  7167. n2,
  7168. container,
  7169. anchor,
  7170. parentComponent,
  7171. parentSuspense,
  7172. namespace,
  7173. optimized
  7174. );
  7175. }
  7176. } else {
  7177. updateComponent(n1, n2, optimized);
  7178. }
  7179. };
  7180. const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
  7181. const instance = (initialVNode.component = createComponentInstance(
  7182. initialVNode,
  7183. parentComponent,
  7184. parentSuspense
  7185. ));
  7186. if (instance.type.__hmrId) {
  7187. registerHMR(instance);
  7188. }
  7189. {
  7190. pushWarningContext(initialVNode);
  7191. startMeasure(instance, `mount`);
  7192. }
  7193. if (isKeepAlive(initialVNode)) {
  7194. instance.ctx.renderer = internals;
  7195. }
  7196. {
  7197. {
  7198. startMeasure(instance, `init`);
  7199. }
  7200. setupComponent(instance, false, optimized);
  7201. {
  7202. endMeasure(instance, `init`);
  7203. }
  7204. }
  7205. if (instance.asyncDep) {
  7206. if (isHmrUpdating) initialVNode.el = null;
  7207. parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
  7208. if (!initialVNode.el) {
  7209. const placeholder = instance.subTree = createVNode(Comment);
  7210. processCommentNode(null, placeholder, container, anchor);
  7211. }
  7212. } else {
  7213. setupRenderEffect(
  7214. instance,
  7215. initialVNode,
  7216. container,
  7217. anchor,
  7218. parentSuspense,
  7219. namespace,
  7220. optimized
  7221. );
  7222. }
  7223. {
  7224. popWarningContext();
  7225. endMeasure(instance, `mount`);
  7226. }
  7227. };
  7228. const updateComponent = (n1, n2, optimized) => {
  7229. const instance = n2.component = n1.component;
  7230. if (shouldUpdateComponent(n1, n2, optimized)) {
  7231. if (instance.asyncDep && !instance.asyncResolved) {
  7232. {
  7233. pushWarningContext(n2);
  7234. }
  7235. updateComponentPreRender(instance, n2, optimized);
  7236. {
  7237. popWarningContext();
  7238. }
  7239. return;
  7240. } else {
  7241. instance.next = n2;
  7242. instance.update();
  7243. }
  7244. } else {
  7245. n2.el = n1.el;
  7246. instance.vnode = n2;
  7247. }
  7248. };
  7249. const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
  7250. const componentUpdateFn = () => {
  7251. if (!instance.isMounted) {
  7252. let vnodeHook;
  7253. const { el, props } = initialVNode;
  7254. const { bm, m, parent, root, type } = instance;
  7255. const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
  7256. toggleRecurse(instance, false);
  7257. if (bm) {
  7258. invokeArrayFns(bm);
  7259. }
  7260. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
  7261. invokeVNodeHook(vnodeHook, parent, initialVNode);
  7262. }
  7263. toggleRecurse(instance, true);
  7264. if (el && hydrateNode) {
  7265. const hydrateSubTree = () => {
  7266. {
  7267. startMeasure(instance, `render`);
  7268. }
  7269. instance.subTree = renderComponentRoot(instance);
  7270. {
  7271. endMeasure(instance, `render`);
  7272. }
  7273. {
  7274. startMeasure(instance, `hydrate`);
  7275. }
  7276. hydrateNode(
  7277. el,
  7278. instance.subTree,
  7279. instance,
  7280. parentSuspense,
  7281. null
  7282. );
  7283. {
  7284. endMeasure(instance, `hydrate`);
  7285. }
  7286. };
  7287. if (isAsyncWrapperVNode && type.__asyncHydrate) {
  7288. type.__asyncHydrate(
  7289. el,
  7290. instance,
  7291. hydrateSubTree
  7292. );
  7293. } else {
  7294. hydrateSubTree();
  7295. }
  7296. } else {
  7297. if (root.ce) {
  7298. root.ce._injectChildStyle(type);
  7299. }
  7300. {
  7301. startMeasure(instance, `render`);
  7302. }
  7303. const subTree = instance.subTree = renderComponentRoot(instance);
  7304. {
  7305. endMeasure(instance, `render`);
  7306. }
  7307. {
  7308. startMeasure(instance, `patch`);
  7309. }
  7310. patch(
  7311. null,
  7312. subTree,
  7313. container,
  7314. anchor,
  7315. instance,
  7316. parentSuspense,
  7317. namespace
  7318. );
  7319. {
  7320. endMeasure(instance, `patch`);
  7321. }
  7322. initialVNode.el = subTree.el;
  7323. }
  7324. if (m) {
  7325. queuePostRenderEffect(m, parentSuspense);
  7326. }
  7327. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
  7328. const scopedInitialVNode = initialVNode;
  7329. queuePostRenderEffect(
  7330. () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
  7331. parentSuspense
  7332. );
  7333. }
  7334. if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
  7335. instance.a && queuePostRenderEffect(instance.a, parentSuspense);
  7336. }
  7337. instance.isMounted = true;
  7338. {
  7339. devtoolsComponentAdded(instance);
  7340. }
  7341. initialVNode = container = anchor = null;
  7342. } else {
  7343. let { next, bu, u, parent, vnode } = instance;
  7344. {
  7345. const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
  7346. if (nonHydratedAsyncRoot) {
  7347. if (next) {
  7348. next.el = vnode.el;
  7349. updateComponentPreRender(instance, next, optimized);
  7350. }
  7351. nonHydratedAsyncRoot.asyncDep.then(() => {
  7352. if (!instance.isUnmounted) {
  7353. componentUpdateFn();
  7354. }
  7355. });
  7356. return;
  7357. }
  7358. }
  7359. let originNext = next;
  7360. let vnodeHook;
  7361. {
  7362. pushWarningContext(next || instance.vnode);
  7363. }
  7364. toggleRecurse(instance, false);
  7365. if (next) {
  7366. next.el = vnode.el;
  7367. updateComponentPreRender(instance, next, optimized);
  7368. } else {
  7369. next = vnode;
  7370. }
  7371. if (bu) {
  7372. invokeArrayFns(bu);
  7373. }
  7374. if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
  7375. invokeVNodeHook(vnodeHook, parent, next, vnode);
  7376. }
  7377. toggleRecurse(instance, true);
  7378. {
  7379. startMeasure(instance, `render`);
  7380. }
  7381. const nextTree = renderComponentRoot(instance);
  7382. {
  7383. endMeasure(instance, `render`);
  7384. }
  7385. const prevTree = instance.subTree;
  7386. instance.subTree = nextTree;
  7387. {
  7388. startMeasure(instance, `patch`);
  7389. }
  7390. patch(
  7391. prevTree,
  7392. nextTree,
  7393. // parent may have changed if it's in a teleport
  7394. hostParentNode(prevTree.el),
  7395. // anchor may have changed if it's in a fragment
  7396. getNextHostNode(prevTree),
  7397. instance,
  7398. parentSuspense,
  7399. namespace
  7400. );
  7401. {
  7402. endMeasure(instance, `patch`);
  7403. }
  7404. next.el = nextTree.el;
  7405. if (originNext === null) {
  7406. updateHOCHostEl(instance, nextTree.el);
  7407. }
  7408. if (u) {
  7409. queuePostRenderEffect(u, parentSuspense);
  7410. }
  7411. if (vnodeHook = next.props && next.props.onVnodeUpdated) {
  7412. queuePostRenderEffect(
  7413. () => invokeVNodeHook(vnodeHook, parent, next, vnode),
  7414. parentSuspense
  7415. );
  7416. }
  7417. {
  7418. devtoolsComponentUpdated(instance);
  7419. }
  7420. {
  7421. popWarningContext();
  7422. }
  7423. }
  7424. };
  7425. instance.scope.on();
  7426. const effect = instance.effect = new ReactiveEffect(componentUpdateFn);
  7427. instance.scope.off();
  7428. const update = instance.update = effect.run.bind(effect);
  7429. const job = instance.job = effect.runIfDirty.bind(effect);
  7430. job.i = instance;
  7431. job.id = instance.uid;
  7432. effect.scheduler = () => queueJob(job);
  7433. toggleRecurse(instance, true);
  7434. {
  7435. effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
  7436. effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
  7437. }
  7438. update();
  7439. };
  7440. const updateComponentPreRender = (instance, nextVNode, optimized) => {
  7441. nextVNode.component = instance;
  7442. const prevProps = instance.vnode.props;
  7443. instance.vnode = nextVNode;
  7444. instance.next = null;
  7445. updateProps(instance, nextVNode.props, prevProps, optimized);
  7446. updateSlots(instance, nextVNode.children, optimized);
  7447. pauseTracking();
  7448. flushPreFlushCbs(instance);
  7449. resetTracking();
  7450. };
  7451. const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
  7452. const c1 = n1 && n1.children;
  7453. const prevShapeFlag = n1 ? n1.shapeFlag : 0;
  7454. const c2 = n2.children;
  7455. const { patchFlag, shapeFlag } = n2;
  7456. if (patchFlag > 0) {
  7457. if (patchFlag & 128) {
  7458. patchKeyedChildren(
  7459. c1,
  7460. c2,
  7461. container,
  7462. anchor,
  7463. parentComponent,
  7464. parentSuspense,
  7465. namespace,
  7466. slotScopeIds,
  7467. optimized
  7468. );
  7469. return;
  7470. } else if (patchFlag & 256) {
  7471. patchUnkeyedChildren(
  7472. c1,
  7473. c2,
  7474. container,
  7475. anchor,
  7476. parentComponent,
  7477. parentSuspense,
  7478. namespace,
  7479. slotScopeIds,
  7480. optimized
  7481. );
  7482. return;
  7483. }
  7484. }
  7485. if (shapeFlag & 8) {
  7486. if (prevShapeFlag & 16) {
  7487. unmountChildren(c1, parentComponent, parentSuspense);
  7488. }
  7489. if (c2 !== c1) {
  7490. hostSetElementText(container, c2);
  7491. }
  7492. } else {
  7493. if (prevShapeFlag & 16) {
  7494. if (shapeFlag & 16) {
  7495. patchKeyedChildren(
  7496. c1,
  7497. c2,
  7498. container,
  7499. anchor,
  7500. parentComponent,
  7501. parentSuspense,
  7502. namespace,
  7503. slotScopeIds,
  7504. optimized
  7505. );
  7506. } else {
  7507. unmountChildren(c1, parentComponent, parentSuspense, true);
  7508. }
  7509. } else {
  7510. if (prevShapeFlag & 8) {
  7511. hostSetElementText(container, "");
  7512. }
  7513. if (shapeFlag & 16) {
  7514. mountChildren(
  7515. c2,
  7516. container,
  7517. anchor,
  7518. parentComponent,
  7519. parentSuspense,
  7520. namespace,
  7521. slotScopeIds,
  7522. optimized
  7523. );
  7524. }
  7525. }
  7526. }
  7527. };
  7528. const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  7529. c1 = c1 || EMPTY_ARR;
  7530. c2 = c2 || EMPTY_ARR;
  7531. const oldLength = c1.length;
  7532. const newLength = c2.length;
  7533. const commonLength = Math.min(oldLength, newLength);
  7534. let i;
  7535. for (i = 0; i < commonLength; i++) {
  7536. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  7537. patch(
  7538. c1[i],
  7539. nextChild,
  7540. container,
  7541. null,
  7542. parentComponent,
  7543. parentSuspense,
  7544. namespace,
  7545. slotScopeIds,
  7546. optimized
  7547. );
  7548. }
  7549. if (oldLength > newLength) {
  7550. unmountChildren(
  7551. c1,
  7552. parentComponent,
  7553. parentSuspense,
  7554. true,
  7555. false,
  7556. commonLength
  7557. );
  7558. } else {
  7559. mountChildren(
  7560. c2,
  7561. container,
  7562. anchor,
  7563. parentComponent,
  7564. parentSuspense,
  7565. namespace,
  7566. slotScopeIds,
  7567. optimized,
  7568. commonLength
  7569. );
  7570. }
  7571. };
  7572. const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  7573. let i = 0;
  7574. const l2 = c2.length;
  7575. let e1 = c1.length - 1;
  7576. let e2 = l2 - 1;
  7577. while (i <= e1 && i <= e2) {
  7578. const n1 = c1[i];
  7579. const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  7580. if (isSameVNodeType(n1, n2)) {
  7581. patch(
  7582. n1,
  7583. n2,
  7584. container,
  7585. null,
  7586. parentComponent,
  7587. parentSuspense,
  7588. namespace,
  7589. slotScopeIds,
  7590. optimized
  7591. );
  7592. } else {
  7593. break;
  7594. }
  7595. i++;
  7596. }
  7597. while (i <= e1 && i <= e2) {
  7598. const n1 = c1[e1];
  7599. const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
  7600. if (isSameVNodeType(n1, n2)) {
  7601. patch(
  7602. n1,
  7603. n2,
  7604. container,
  7605. null,
  7606. parentComponent,
  7607. parentSuspense,
  7608. namespace,
  7609. slotScopeIds,
  7610. optimized
  7611. );
  7612. } else {
  7613. break;
  7614. }
  7615. e1--;
  7616. e2--;
  7617. }
  7618. if (i > e1) {
  7619. if (i <= e2) {
  7620. const nextPos = e2 + 1;
  7621. const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
  7622. while (i <= e2) {
  7623. patch(
  7624. null,
  7625. c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
  7626. container,
  7627. anchor,
  7628. parentComponent,
  7629. parentSuspense,
  7630. namespace,
  7631. slotScopeIds,
  7632. optimized
  7633. );
  7634. i++;
  7635. }
  7636. }
  7637. } else if (i > e2) {
  7638. while (i <= e1) {
  7639. unmount(c1[i], parentComponent, parentSuspense, true);
  7640. i++;
  7641. }
  7642. } else {
  7643. const s1 = i;
  7644. const s2 = i;
  7645. const keyToNewIndexMap = /* @__PURE__ */ new Map();
  7646. for (i = s2; i <= e2; i++) {
  7647. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  7648. if (nextChild.key != null) {
  7649. if (keyToNewIndexMap.has(nextChild.key)) {
  7650. warn$1(
  7651. `Duplicate keys found during update:`,
  7652. JSON.stringify(nextChild.key),
  7653. `Make sure keys are unique.`
  7654. );
  7655. }
  7656. keyToNewIndexMap.set(nextChild.key, i);
  7657. }
  7658. }
  7659. let j;
  7660. let patched = 0;
  7661. const toBePatched = e2 - s2 + 1;
  7662. let moved = false;
  7663. let maxNewIndexSoFar = 0;
  7664. const newIndexToOldIndexMap = new Array(toBePatched);
  7665. for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0;
  7666. for (i = s1; i <= e1; i++) {
  7667. const prevChild = c1[i];
  7668. if (patched >= toBePatched) {
  7669. unmount(prevChild, parentComponent, parentSuspense, true);
  7670. continue;
  7671. }
  7672. let newIndex;
  7673. if (prevChild.key != null) {
  7674. newIndex = keyToNewIndexMap.get(prevChild.key);
  7675. } else {
  7676. for (j = s2; j <= e2; j++) {
  7677. if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
  7678. newIndex = j;
  7679. break;
  7680. }
  7681. }
  7682. }
  7683. if (newIndex === void 0) {
  7684. unmount(prevChild, parentComponent, parentSuspense, true);
  7685. } else {
  7686. newIndexToOldIndexMap[newIndex - s2] = i + 1;
  7687. if (newIndex >= maxNewIndexSoFar) {
  7688. maxNewIndexSoFar = newIndex;
  7689. } else {
  7690. moved = true;
  7691. }
  7692. patch(
  7693. prevChild,
  7694. c2[newIndex],
  7695. container,
  7696. null,
  7697. parentComponent,
  7698. parentSuspense,
  7699. namespace,
  7700. slotScopeIds,
  7701. optimized
  7702. );
  7703. patched++;
  7704. }
  7705. }
  7706. const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
  7707. j = increasingNewIndexSequence.length - 1;
  7708. for (i = toBePatched - 1; i >= 0; i--) {
  7709. const nextIndex = s2 + i;
  7710. const nextChild = c2[nextIndex];
  7711. const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
  7712. if (newIndexToOldIndexMap[i] === 0) {
  7713. patch(
  7714. null,
  7715. nextChild,
  7716. container,
  7717. anchor,
  7718. parentComponent,
  7719. parentSuspense,
  7720. namespace,
  7721. slotScopeIds,
  7722. optimized
  7723. );
  7724. } else if (moved) {
  7725. if (j < 0 || i !== increasingNewIndexSequence[j]) {
  7726. move(nextChild, container, anchor, 2);
  7727. } else {
  7728. j--;
  7729. }
  7730. }
  7731. }
  7732. }
  7733. };
  7734. const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
  7735. const { el, type, transition, children, shapeFlag } = vnode;
  7736. if (shapeFlag & 6) {
  7737. move(vnode.component.subTree, container, anchor, moveType);
  7738. return;
  7739. }
  7740. if (shapeFlag & 128) {
  7741. vnode.suspense.move(container, anchor, moveType);
  7742. return;
  7743. }
  7744. if (shapeFlag & 64) {
  7745. type.move(vnode, container, anchor, internals);
  7746. return;
  7747. }
  7748. if (type === Fragment) {
  7749. hostInsert(el, container, anchor);
  7750. for (let i = 0; i < children.length; i++) {
  7751. move(children[i], container, anchor, moveType);
  7752. }
  7753. hostInsert(vnode.anchor, container, anchor);
  7754. return;
  7755. }
  7756. if (type === Static) {
  7757. moveStaticNode(vnode, container, anchor);
  7758. return;
  7759. }
  7760. const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
  7761. if (needTransition2) {
  7762. if (moveType === 0) {
  7763. transition.beforeEnter(el);
  7764. hostInsert(el, container, anchor);
  7765. queuePostRenderEffect(() => transition.enter(el), parentSuspense);
  7766. } else {
  7767. const { leave, delayLeave, afterLeave } = transition;
  7768. const remove2 = () => hostInsert(el, container, anchor);
  7769. const performLeave = () => {
  7770. leave(el, () => {
  7771. remove2();
  7772. afterLeave && afterLeave();
  7773. });
  7774. };
  7775. if (delayLeave) {
  7776. delayLeave(el, remove2, performLeave);
  7777. } else {
  7778. performLeave();
  7779. }
  7780. }
  7781. } else {
  7782. hostInsert(el, container, anchor);
  7783. }
  7784. };
  7785. const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
  7786. const {
  7787. type,
  7788. props,
  7789. ref,
  7790. children,
  7791. dynamicChildren,
  7792. shapeFlag,
  7793. patchFlag,
  7794. dirs,
  7795. cacheIndex
  7796. } = vnode;
  7797. if (patchFlag === -2) {
  7798. optimized = false;
  7799. }
  7800. if (ref != null) {
  7801. setRef(ref, null, parentSuspense, vnode, true);
  7802. }
  7803. if (cacheIndex != null) {
  7804. parentComponent.renderCache[cacheIndex] = void 0;
  7805. }
  7806. if (shapeFlag & 256) {
  7807. parentComponent.ctx.deactivate(vnode);
  7808. return;
  7809. }
  7810. const shouldInvokeDirs = shapeFlag & 1 && dirs;
  7811. const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
  7812. let vnodeHook;
  7813. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
  7814. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  7815. }
  7816. if (shapeFlag & 6) {
  7817. unmountComponent(vnode.component, parentSuspense, doRemove);
  7818. } else {
  7819. if (shapeFlag & 128) {
  7820. vnode.suspense.unmount(parentSuspense, doRemove);
  7821. return;
  7822. }
  7823. if (shouldInvokeDirs) {
  7824. invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
  7825. }
  7826. if (shapeFlag & 64) {
  7827. vnode.type.remove(
  7828. vnode,
  7829. parentComponent,
  7830. parentSuspense,
  7831. internals,
  7832. doRemove
  7833. );
  7834. } else if (dynamicChildren && // #5154
  7835. // when v-once is used inside a block, setBlockTracking(-1) marks the
  7836. // parent block with hasOnce: true
  7837. // so that it doesn't take the fast path during unmount - otherwise
  7838. // components nested in v-once are never unmounted.
  7839. !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments
  7840. (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
  7841. unmountChildren(
  7842. dynamicChildren,
  7843. parentComponent,
  7844. parentSuspense,
  7845. false,
  7846. true
  7847. );
  7848. } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
  7849. unmountChildren(children, parentComponent, parentSuspense);
  7850. }
  7851. if (doRemove) {
  7852. remove(vnode);
  7853. }
  7854. }
  7855. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
  7856. queuePostRenderEffect(() => {
  7857. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  7858. shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
  7859. }, parentSuspense);
  7860. }
  7861. };
  7862. const remove = (vnode) => {
  7863. const { type, el, anchor, transition } = vnode;
  7864. if (type === Fragment) {
  7865. if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) {
  7866. vnode.children.forEach((child) => {
  7867. if (child.type === Comment) {
  7868. hostRemove(child.el);
  7869. } else {
  7870. remove(child);
  7871. }
  7872. });
  7873. } else {
  7874. removeFragment(el, anchor);
  7875. }
  7876. return;
  7877. }
  7878. if (type === Static) {
  7879. removeStaticNode(vnode);
  7880. return;
  7881. }
  7882. const performRemove = () => {
  7883. hostRemove(el);
  7884. if (transition && !transition.persisted && transition.afterLeave) {
  7885. transition.afterLeave();
  7886. }
  7887. };
  7888. if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
  7889. const { leave, delayLeave } = transition;
  7890. const performLeave = () => leave(el, performRemove);
  7891. if (delayLeave) {
  7892. delayLeave(vnode.el, performRemove, performLeave);
  7893. } else {
  7894. performLeave();
  7895. }
  7896. } else {
  7897. performRemove();
  7898. }
  7899. };
  7900. const removeFragment = (cur, end) => {
  7901. let next;
  7902. while (cur !== end) {
  7903. next = hostNextSibling(cur);
  7904. hostRemove(cur);
  7905. cur = next;
  7906. }
  7907. hostRemove(end);
  7908. };
  7909. const unmountComponent = (instance, parentSuspense, doRemove) => {
  7910. if (instance.type.__hmrId) {
  7911. unregisterHMR(instance);
  7912. }
  7913. const { bum, scope, job, subTree, um, m, a } = instance;
  7914. invalidateMount(m);
  7915. invalidateMount(a);
  7916. if (bum) {
  7917. invokeArrayFns(bum);
  7918. }
  7919. scope.stop();
  7920. if (job) {
  7921. job.flags |= 8;
  7922. unmount(subTree, instance, parentSuspense, doRemove);
  7923. }
  7924. if (um) {
  7925. queuePostRenderEffect(um, parentSuspense);
  7926. }
  7927. queuePostRenderEffect(() => {
  7928. instance.isUnmounted = true;
  7929. }, parentSuspense);
  7930. if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
  7931. parentSuspense.deps--;
  7932. if (parentSuspense.deps === 0) {
  7933. parentSuspense.resolve();
  7934. }
  7935. }
  7936. {
  7937. devtoolsComponentRemoved(instance);
  7938. }
  7939. };
  7940. const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
  7941. for (let i = start; i < children.length; i++) {
  7942. unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
  7943. }
  7944. };
  7945. const getNextHostNode = (vnode) => {
  7946. if (vnode.shapeFlag & 6) {
  7947. return getNextHostNode(vnode.component.subTree);
  7948. }
  7949. if (vnode.shapeFlag & 128) {
  7950. return vnode.suspense.next();
  7951. }
  7952. const el = hostNextSibling(vnode.anchor || vnode.el);
  7953. const teleportEnd = el && el[TeleportEndKey];
  7954. return teleportEnd ? hostNextSibling(teleportEnd) : el;
  7955. };
  7956. let isFlushing = false;
  7957. const render = (vnode, container, namespace) => {
  7958. if (vnode == null) {
  7959. if (container._vnode) {
  7960. unmount(container._vnode, null, null, true);
  7961. }
  7962. } else {
  7963. patch(
  7964. container._vnode || null,
  7965. vnode,
  7966. container,
  7967. null,
  7968. null,
  7969. null,
  7970. namespace
  7971. );
  7972. }
  7973. container._vnode = vnode;
  7974. if (!isFlushing) {
  7975. isFlushing = true;
  7976. flushPreFlushCbs();
  7977. flushPostFlushCbs();
  7978. isFlushing = false;
  7979. }
  7980. };
  7981. const internals = {
  7982. p: patch,
  7983. um: unmount,
  7984. m: move,
  7985. r: remove,
  7986. mt: mountComponent,
  7987. mc: mountChildren,
  7988. pc: patchChildren,
  7989. pbc: patchBlockChildren,
  7990. n: getNextHostNode,
  7991. o: options
  7992. };
  7993. let hydrate;
  7994. let hydrateNode;
  7995. if (createHydrationFns) {
  7996. [hydrate, hydrateNode] = createHydrationFns(
  7997. internals
  7998. );
  7999. }
  8000. return {
  8001. render,
  8002. hydrate,
  8003. createApp: createAppAPI(render, hydrate)
  8004. };
  8005. }
  8006. function resolveChildrenNamespace({ type, props }, currentNamespace) {
  8007. return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
  8008. }
  8009. function toggleRecurse({ effect, job }, allowed) {
  8010. if (allowed) {
  8011. effect.flags |= 32;
  8012. job.flags |= 4;
  8013. } else {
  8014. effect.flags &= ~32;
  8015. job.flags &= ~4;
  8016. }
  8017. }
  8018. function needTransition(parentSuspense, transition) {
  8019. return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
  8020. }
  8021. function traverseStaticChildren(n1, n2, shallow = false) {
  8022. const ch1 = n1.children;
  8023. const ch2 = n2.children;
  8024. if (isArray(ch1) && isArray(ch2)) {
  8025. for (let i = 0; i < ch1.length; i++) {
  8026. const c1 = ch1[i];
  8027. let c2 = ch2[i];
  8028. if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
  8029. if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
  8030. c2 = ch2[i] = cloneIfMounted(ch2[i]);
  8031. c2.el = c1.el;
  8032. }
  8033. if (!shallow && c2.patchFlag !== -2)
  8034. traverseStaticChildren(c1, c2);
  8035. }
  8036. if (c2.type === Text) {
  8037. c2.el = c1.el;
  8038. }
  8039. if (c2.type === Comment && !c2.el) {
  8040. c2.el = c1.el;
  8041. }
  8042. }
  8043. }
  8044. }
  8045. function getSequence(arr) {
  8046. const p = arr.slice();
  8047. const result = [0];
  8048. let i, j, u, v, c;
  8049. const len = arr.length;
  8050. for (i = 0; i < len; i++) {
  8051. const arrI = arr[i];
  8052. if (arrI !== 0) {
  8053. j = result[result.length - 1];
  8054. if (arr[j] < arrI) {
  8055. p[i] = j;
  8056. result.push(i);
  8057. continue;
  8058. }
  8059. u = 0;
  8060. v = result.length - 1;
  8061. while (u < v) {
  8062. c = u + v >> 1;
  8063. if (arr[result[c]] < arrI) {
  8064. u = c + 1;
  8065. } else {
  8066. v = c;
  8067. }
  8068. }
  8069. if (arrI < arr[result[u]]) {
  8070. if (u > 0) {
  8071. p[i] = result[u - 1];
  8072. }
  8073. result[u] = i;
  8074. }
  8075. }
  8076. }
  8077. u = result.length;
  8078. v = result[u - 1];
  8079. while (u-- > 0) {
  8080. result[u] = v;
  8081. v = p[v];
  8082. }
  8083. return result;
  8084. }
  8085. function locateNonHydratedAsyncRoot(instance) {
  8086. const subComponent = instance.subTree.component;
  8087. if (subComponent) {
  8088. if (subComponent.asyncDep && !subComponent.asyncResolved) {
  8089. return subComponent;
  8090. } else {
  8091. return locateNonHydratedAsyncRoot(subComponent);
  8092. }
  8093. }
  8094. }
  8095. function invalidateMount(hooks) {
  8096. if (hooks) {
  8097. for (let i = 0; i < hooks.length; i++)
  8098. hooks[i].flags |= 8;
  8099. }
  8100. }
  8101. const ssrContextKey = Symbol.for("v-scx");
  8102. const useSSRContext = () => {
  8103. {
  8104. const ctx = inject(ssrContextKey);
  8105. if (!ctx) {
  8106. warn$1(
  8107. `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
  8108. );
  8109. }
  8110. return ctx;
  8111. }
  8112. };
  8113. function watchEffect(effect, options) {
  8114. return doWatch(effect, null, options);
  8115. }
  8116. function watchPostEffect(effect, options) {
  8117. return doWatch(
  8118. effect,
  8119. null,
  8120. extend({}, options, { flush: "post" })
  8121. );
  8122. }
  8123. function watchSyncEffect(effect, options) {
  8124. return doWatch(
  8125. effect,
  8126. null,
  8127. extend({}, options, { flush: "sync" })
  8128. );
  8129. }
  8130. function watch(source, cb, options) {
  8131. if (!isFunction(cb)) {
  8132. warn$1(
  8133. `\`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.`
  8134. );
  8135. }
  8136. return doWatch(source, cb, options);
  8137. }
  8138. function doWatch(source, cb, options = EMPTY_OBJ) {
  8139. const { immediate, deep, flush, once } = options;
  8140. if (!cb) {
  8141. if (immediate !== void 0) {
  8142. warn$1(
  8143. `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
  8144. );
  8145. }
  8146. if (deep !== void 0) {
  8147. warn$1(
  8148. `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
  8149. );
  8150. }
  8151. if (once !== void 0) {
  8152. warn$1(
  8153. `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
  8154. );
  8155. }
  8156. }
  8157. const baseWatchOptions = extend({}, options);
  8158. baseWatchOptions.onWarn = warn$1;
  8159. const runsImmediately = cb && immediate || !cb && flush !== "post";
  8160. let ssrCleanup;
  8161. if (isInSSRComponentSetup) {
  8162. if (flush === "sync") {
  8163. const ctx = useSSRContext();
  8164. ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
  8165. } else if (!runsImmediately) {
  8166. const watchStopHandle = () => {
  8167. };
  8168. watchStopHandle.stop = NOOP;
  8169. watchStopHandle.resume = NOOP;
  8170. watchStopHandle.pause = NOOP;
  8171. return watchStopHandle;
  8172. }
  8173. }
  8174. const instance = currentInstance;
  8175. baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
  8176. let isPre = false;
  8177. if (flush === "post") {
  8178. baseWatchOptions.scheduler = (job) => {
  8179. queuePostRenderEffect(job, instance && instance.suspense);
  8180. };
  8181. } else if (flush !== "sync") {
  8182. isPre = true;
  8183. baseWatchOptions.scheduler = (job, isFirstRun) => {
  8184. if (isFirstRun) {
  8185. job();
  8186. } else {
  8187. queueJob(job);
  8188. }
  8189. };
  8190. }
  8191. baseWatchOptions.augmentJob = (job) => {
  8192. if (cb) {
  8193. job.flags |= 4;
  8194. }
  8195. if (isPre) {
  8196. job.flags |= 2;
  8197. if (instance) {
  8198. job.id = instance.uid;
  8199. job.i = instance;
  8200. }
  8201. }
  8202. };
  8203. const watchHandle = watch$1(source, cb, baseWatchOptions);
  8204. if (isInSSRComponentSetup) {
  8205. if (ssrCleanup) {
  8206. ssrCleanup.push(watchHandle);
  8207. } else if (runsImmediately) {
  8208. watchHandle();
  8209. }
  8210. }
  8211. return watchHandle;
  8212. }
  8213. function instanceWatch(source, value, options) {
  8214. const publicThis = this.proxy;
  8215. const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  8216. let cb;
  8217. if (isFunction(value)) {
  8218. cb = value;
  8219. } else {
  8220. cb = value.handler;
  8221. options = value;
  8222. }
  8223. const reset = setCurrentInstance(this);
  8224. const res = doWatch(getter, cb.bind(publicThis), options);
  8225. reset();
  8226. return res;
  8227. }
  8228. function createPathGetter(ctx, path) {
  8229. const segments = path.split(".");
  8230. return () => {
  8231. let cur = ctx;
  8232. for (let i = 0; i < segments.length && cur; i++) {
  8233. cur = cur[segments[i]];
  8234. }
  8235. return cur;
  8236. };
  8237. }
  8238. function useModel(props, name, options = EMPTY_OBJ) {
  8239. const i = getCurrentInstance();
  8240. if (!i) {
  8241. warn$1(`useModel() called without active instance.`);
  8242. return ref();
  8243. }
  8244. const camelizedName = camelize(name);
  8245. if (!i.propsOptions[0][camelizedName]) {
  8246. warn$1(`useModel() called with prop "${name}" which is not declared.`);
  8247. return ref();
  8248. }
  8249. const hyphenatedName = hyphenate(name);
  8250. const modifiers = getModelModifiers(props, camelizedName);
  8251. const res = customRef((track, trigger) => {
  8252. let localValue;
  8253. let prevSetValue = EMPTY_OBJ;
  8254. let prevEmittedValue;
  8255. watchSyncEffect(() => {
  8256. const propValue = props[camelizedName];
  8257. if (hasChanged(localValue, propValue)) {
  8258. localValue = propValue;
  8259. trigger();
  8260. }
  8261. });
  8262. return {
  8263. get() {
  8264. track();
  8265. return options.get ? options.get(localValue) : localValue;
  8266. },
  8267. set(value) {
  8268. const emittedValue = options.set ? options.set(value) : value;
  8269. if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
  8270. return;
  8271. }
  8272. const rawProps = i.vnode.props;
  8273. if (!(rawProps && // check if parent has passed v-model
  8274. (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
  8275. localValue = value;
  8276. trigger();
  8277. }
  8278. i.emit(`update:${name}`, emittedValue);
  8279. if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
  8280. trigger();
  8281. }
  8282. prevSetValue = value;
  8283. prevEmittedValue = emittedValue;
  8284. }
  8285. };
  8286. });
  8287. res[Symbol.iterator] = () => {
  8288. let i2 = 0;
  8289. return {
  8290. next() {
  8291. if (i2 < 2) {
  8292. return { value: i2++ ? modifiers || EMPTY_OBJ : res, done: false };
  8293. } else {
  8294. return { done: true };
  8295. }
  8296. }
  8297. };
  8298. };
  8299. return res;
  8300. }
  8301. const getModelModifiers = (props, modelName) => {
  8302. return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];
  8303. };
  8304. function emit(instance, event, ...rawArgs) {
  8305. if (instance.isUnmounted) return;
  8306. const props = instance.vnode.props || EMPTY_OBJ;
  8307. {
  8308. const {
  8309. emitsOptions,
  8310. propsOptions: [propsOptions]
  8311. } = instance;
  8312. if (emitsOptions) {
  8313. if (!(event in emitsOptions) && true) {
  8314. if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
  8315. warn$1(
  8316. `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`
  8317. );
  8318. }
  8319. } else {
  8320. const validator = emitsOptions[event];
  8321. if (isFunction(validator)) {
  8322. const isValid = validator(...rawArgs);
  8323. if (!isValid) {
  8324. warn$1(
  8325. `Invalid event arguments: event validation failed for event "${event}".`
  8326. );
  8327. }
  8328. }
  8329. }
  8330. }
  8331. }
  8332. let args = rawArgs;
  8333. const isModelListener = event.startsWith("update:");
  8334. const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
  8335. if (modifiers) {
  8336. if (modifiers.trim) {
  8337. args = rawArgs.map((a) => isString(a) ? a.trim() : a);
  8338. }
  8339. if (modifiers.number) {
  8340. args = rawArgs.map(looseToNumber);
  8341. }
  8342. }
  8343. {
  8344. devtoolsComponentEmit(instance, event, args);
  8345. }
  8346. {
  8347. const lowerCaseEvent = event.toLowerCase();
  8348. if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
  8349. warn$1(
  8350. `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
  8351. instance,
  8352. instance.type
  8353. )} 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(
  8354. event
  8355. )}" instead of "${event}".`
  8356. );
  8357. }
  8358. }
  8359. let handlerName;
  8360. let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
  8361. props[handlerName = toHandlerKey(camelize(event))];
  8362. if (!handler && isModelListener) {
  8363. handler = props[handlerName = toHandlerKey(hyphenate(event))];
  8364. }
  8365. if (handler) {
  8366. callWithAsyncErrorHandling(
  8367. handler,
  8368. instance,
  8369. 6,
  8370. args
  8371. );
  8372. }
  8373. const onceHandler = props[handlerName + `Once`];
  8374. if (onceHandler) {
  8375. if (!instance.emitted) {
  8376. instance.emitted = {};
  8377. } else if (instance.emitted[handlerName]) {
  8378. return;
  8379. }
  8380. instance.emitted[handlerName] = true;
  8381. callWithAsyncErrorHandling(
  8382. onceHandler,
  8383. instance,
  8384. 6,
  8385. args
  8386. );
  8387. }
  8388. }
  8389. function normalizeEmitsOptions(comp, appContext, asMixin = false) {
  8390. const cache = appContext.emitsCache;
  8391. const cached = cache.get(comp);
  8392. if (cached !== void 0) {
  8393. return cached;
  8394. }
  8395. const raw = comp.emits;
  8396. let normalized = {};
  8397. let hasExtends = false;
  8398. if (!isFunction(comp)) {
  8399. const extendEmits = (raw2) => {
  8400. const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
  8401. if (normalizedFromExtend) {
  8402. hasExtends = true;
  8403. extend(normalized, normalizedFromExtend);
  8404. }
  8405. };
  8406. if (!asMixin && appContext.mixins.length) {
  8407. appContext.mixins.forEach(extendEmits);
  8408. }
  8409. if (comp.extends) {
  8410. extendEmits(comp.extends);
  8411. }
  8412. if (comp.mixins) {
  8413. comp.mixins.forEach(extendEmits);
  8414. }
  8415. }
  8416. if (!raw && !hasExtends) {
  8417. if (isObject(comp)) {
  8418. cache.set(comp, null);
  8419. }
  8420. return null;
  8421. }
  8422. if (isArray(raw)) {
  8423. raw.forEach((key) => normalized[key] = null);
  8424. } else {
  8425. extend(normalized, raw);
  8426. }
  8427. if (isObject(comp)) {
  8428. cache.set(comp, normalized);
  8429. }
  8430. return normalized;
  8431. }
  8432. function isEmitListener(options, key) {
  8433. if (!options || !isOn(key)) {
  8434. return false;
  8435. }
  8436. key = key.slice(2).replace(/Once$/, "");
  8437. return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
  8438. }
  8439. let accessedAttrs = false;
  8440. function markAttrsAccessed() {
  8441. accessedAttrs = true;
  8442. }
  8443. function renderComponentRoot(instance) {
  8444. const {
  8445. type: Component,
  8446. vnode,
  8447. proxy,
  8448. withProxy,
  8449. propsOptions: [propsOptions],
  8450. slots,
  8451. attrs,
  8452. emit,
  8453. render,
  8454. renderCache,
  8455. props,
  8456. data,
  8457. setupState,
  8458. ctx,
  8459. inheritAttrs
  8460. } = instance;
  8461. const prev = setCurrentRenderingInstance(instance);
  8462. let result;
  8463. let fallthroughAttrs;
  8464. {
  8465. accessedAttrs = false;
  8466. }
  8467. try {
  8468. if (vnode.shapeFlag & 4) {
  8469. const proxyToUse = withProxy || proxy;
  8470. const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
  8471. get(target, key, receiver) {
  8472. warn$1(
  8473. `Property '${String(
  8474. key
  8475. )}' was accessed via 'this'. Avoid using 'this' in templates.`
  8476. );
  8477. return Reflect.get(target, key, receiver);
  8478. }
  8479. }) : proxyToUse;
  8480. result = normalizeVNode(
  8481. render.call(
  8482. thisProxy,
  8483. proxyToUse,
  8484. renderCache,
  8485. true ? shallowReadonly(props) : props,
  8486. setupState,
  8487. data,
  8488. ctx
  8489. )
  8490. );
  8491. fallthroughAttrs = attrs;
  8492. } else {
  8493. const render2 = Component;
  8494. if (attrs === props) {
  8495. markAttrsAccessed();
  8496. }
  8497. result = normalizeVNode(
  8498. render2.length > 1 ? render2(
  8499. true ? shallowReadonly(props) : props,
  8500. true ? {
  8501. get attrs() {
  8502. markAttrsAccessed();
  8503. return shallowReadonly(attrs);
  8504. },
  8505. slots,
  8506. emit
  8507. } : { attrs, slots, emit }
  8508. ) : render2(
  8509. true ? shallowReadonly(props) : props,
  8510. null
  8511. )
  8512. );
  8513. fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
  8514. }
  8515. } catch (err) {
  8516. blockStack.length = 0;
  8517. handleError(err, instance, 1);
  8518. result = createVNode(Comment);
  8519. }
  8520. let root = result;
  8521. let setRoot = void 0;
  8522. if (result.patchFlag > 0 && result.patchFlag & 2048) {
  8523. [root, setRoot] = getChildRoot(result);
  8524. }
  8525. if (fallthroughAttrs && inheritAttrs !== false) {
  8526. const keys = Object.keys(fallthroughAttrs);
  8527. const { shapeFlag } = root;
  8528. if (keys.length) {
  8529. if (shapeFlag & (1 | 6)) {
  8530. if (propsOptions && keys.some(isModelListener)) {
  8531. fallthroughAttrs = filterModelListeners(
  8532. fallthroughAttrs,
  8533. propsOptions
  8534. );
  8535. }
  8536. root = cloneVNode(root, fallthroughAttrs, false, true);
  8537. } else if (!accessedAttrs && root.type !== Comment) {
  8538. const allAttrs = Object.keys(attrs);
  8539. const eventAttrs = [];
  8540. const extraAttrs = [];
  8541. for (let i = 0, l = allAttrs.length; i < l; i++) {
  8542. const key = allAttrs[i];
  8543. if (isOn(key)) {
  8544. if (!isModelListener(key)) {
  8545. eventAttrs.push(key[2].toLowerCase() + key.slice(3));
  8546. }
  8547. } else {
  8548. extraAttrs.push(key);
  8549. }
  8550. }
  8551. if (extraAttrs.length) {
  8552. warn$1(
  8553. `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
  8554. );
  8555. }
  8556. if (eventAttrs.length) {
  8557. warn$1(
  8558. `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.`
  8559. );
  8560. }
  8561. }
  8562. }
  8563. }
  8564. if (vnode.dirs) {
  8565. if (!isElementRoot(root)) {
  8566. warn$1(
  8567. `Runtime directive used on component with non-element root node. The directives will not function as intended.`
  8568. );
  8569. }
  8570. root = cloneVNode(root, null, false, true);
  8571. root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
  8572. }
  8573. if (vnode.transition) {
  8574. if (!isElementRoot(root)) {
  8575. warn$1(
  8576. `Component inside <Transition> renders non-element root node that cannot be animated.`
  8577. );
  8578. }
  8579. setTransitionHooks(root, vnode.transition);
  8580. }
  8581. if (setRoot) {
  8582. setRoot(root);
  8583. } else {
  8584. result = root;
  8585. }
  8586. setCurrentRenderingInstance(prev);
  8587. return result;
  8588. }
  8589. const getChildRoot = (vnode) => {
  8590. const rawChildren = vnode.children;
  8591. const dynamicChildren = vnode.dynamicChildren;
  8592. const childRoot = filterSingleRoot(rawChildren, false);
  8593. if (!childRoot) {
  8594. return [vnode, void 0];
  8595. } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) {
  8596. return getChildRoot(childRoot);
  8597. }
  8598. const index = rawChildren.indexOf(childRoot);
  8599. const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
  8600. const setRoot = (updatedRoot) => {
  8601. rawChildren[index] = updatedRoot;
  8602. if (dynamicChildren) {
  8603. if (dynamicIndex > -1) {
  8604. dynamicChildren[dynamicIndex] = updatedRoot;
  8605. } else if (updatedRoot.patchFlag > 0) {
  8606. vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
  8607. }
  8608. }
  8609. };
  8610. return [normalizeVNode(childRoot), setRoot];
  8611. };
  8612. function filterSingleRoot(children, recurse = true) {
  8613. let singleRoot;
  8614. for (let i = 0; i < children.length; i++) {
  8615. const child = children[i];
  8616. if (isVNode(child)) {
  8617. if (child.type !== Comment || child.children === "v-if") {
  8618. if (singleRoot) {
  8619. return;
  8620. } else {
  8621. singleRoot = child;
  8622. if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) {
  8623. return filterSingleRoot(singleRoot.children);
  8624. }
  8625. }
  8626. }
  8627. } else {
  8628. return;
  8629. }
  8630. }
  8631. return singleRoot;
  8632. }
  8633. const getFunctionalFallthrough = (attrs) => {
  8634. let res;
  8635. for (const key in attrs) {
  8636. if (key === "class" || key === "style" || isOn(key)) {
  8637. (res || (res = {}))[key] = attrs[key];
  8638. }
  8639. }
  8640. return res;
  8641. };
  8642. const filterModelListeners = (attrs, props) => {
  8643. const res = {};
  8644. for (const key in attrs) {
  8645. if (!isModelListener(key) || !(key.slice(9) in props)) {
  8646. res[key] = attrs[key];
  8647. }
  8648. }
  8649. return res;
  8650. };
  8651. const isElementRoot = (vnode) => {
  8652. return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;
  8653. };
  8654. function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
  8655. const { props: prevProps, children: prevChildren, component } = prevVNode;
  8656. const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
  8657. const emits = component.emitsOptions;
  8658. if ((prevChildren || nextChildren) && isHmrUpdating) {
  8659. return true;
  8660. }
  8661. if (nextVNode.dirs || nextVNode.transition) {
  8662. return true;
  8663. }
  8664. if (optimized && patchFlag >= 0) {
  8665. if (patchFlag & 1024) {
  8666. return true;
  8667. }
  8668. if (patchFlag & 16) {
  8669. if (!prevProps) {
  8670. return !!nextProps;
  8671. }
  8672. return hasPropsChanged(prevProps, nextProps, emits);
  8673. } else if (patchFlag & 8) {
  8674. const dynamicProps = nextVNode.dynamicProps;
  8675. for (let i = 0; i < dynamicProps.length; i++) {
  8676. const key = dynamicProps[i];
  8677. if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
  8678. return true;
  8679. }
  8680. }
  8681. }
  8682. } else {
  8683. if (prevChildren || nextChildren) {
  8684. if (!nextChildren || !nextChildren.$stable) {
  8685. return true;
  8686. }
  8687. }
  8688. if (prevProps === nextProps) {
  8689. return false;
  8690. }
  8691. if (!prevProps) {
  8692. return !!nextProps;
  8693. }
  8694. if (!nextProps) {
  8695. return true;
  8696. }
  8697. return hasPropsChanged(prevProps, nextProps, emits);
  8698. }
  8699. return false;
  8700. }
  8701. function hasPropsChanged(prevProps, nextProps, emitsOptions) {
  8702. const nextKeys = Object.keys(nextProps);
  8703. if (nextKeys.length !== Object.keys(prevProps).length) {
  8704. return true;
  8705. }
  8706. for (let i = 0; i < nextKeys.length; i++) {
  8707. const key = nextKeys[i];
  8708. if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
  8709. return true;
  8710. }
  8711. }
  8712. return false;
  8713. }
  8714. function updateHOCHostEl({ vnode, parent }, el) {
  8715. while (parent) {
  8716. const root = parent.subTree;
  8717. if (root.suspense && root.suspense.activeBranch === vnode) {
  8718. root.el = vnode.el;
  8719. }
  8720. if (root === vnode) {
  8721. (vnode = parent.vnode).el = el;
  8722. parent = parent.parent;
  8723. } else {
  8724. break;
  8725. }
  8726. }
  8727. }
  8728. const isSuspense = (type) => type.__isSuspense;
  8729. let suspenseId = 0;
  8730. const SuspenseImpl = {
  8731. name: "Suspense",
  8732. // In order to make Suspense tree-shakable, we need to avoid importing it
  8733. // directly in the renderer. The renderer checks for the __isSuspense flag
  8734. // on a vnode's type and calls the `process` method, passing in renderer
  8735. // internals.
  8736. __isSuspense: true,
  8737. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
  8738. if (n1 == null) {
  8739. mountSuspense(
  8740. n2,
  8741. container,
  8742. anchor,
  8743. parentComponent,
  8744. parentSuspense,
  8745. namespace,
  8746. slotScopeIds,
  8747. optimized,
  8748. rendererInternals
  8749. );
  8750. } else {
  8751. if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
  8752. n2.suspense = n1.suspense;
  8753. n2.suspense.vnode = n2;
  8754. n2.el = n1.el;
  8755. return;
  8756. }
  8757. patchSuspense(
  8758. n1,
  8759. n2,
  8760. container,
  8761. anchor,
  8762. parentComponent,
  8763. namespace,
  8764. slotScopeIds,
  8765. optimized,
  8766. rendererInternals
  8767. );
  8768. }
  8769. },
  8770. hydrate: hydrateSuspense,
  8771. normalize: normalizeSuspenseChildren
  8772. };
  8773. const Suspense = SuspenseImpl ;
  8774. function triggerEvent(vnode, name) {
  8775. const eventListener = vnode.props && vnode.props[name];
  8776. if (isFunction(eventListener)) {
  8777. eventListener();
  8778. }
  8779. }
  8780. function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
  8781. const {
  8782. p: patch,
  8783. o: { createElement }
  8784. } = rendererInternals;
  8785. const hiddenContainer = createElement("div");
  8786. const suspense = vnode.suspense = createSuspenseBoundary(
  8787. vnode,
  8788. parentSuspense,
  8789. parentComponent,
  8790. container,
  8791. hiddenContainer,
  8792. anchor,
  8793. namespace,
  8794. slotScopeIds,
  8795. optimized,
  8796. rendererInternals
  8797. );
  8798. patch(
  8799. null,
  8800. suspense.pendingBranch = vnode.ssContent,
  8801. hiddenContainer,
  8802. null,
  8803. parentComponent,
  8804. suspense,
  8805. namespace,
  8806. slotScopeIds
  8807. );
  8808. if (suspense.deps > 0) {
  8809. triggerEvent(vnode, "onPending");
  8810. triggerEvent(vnode, "onFallback");
  8811. patch(
  8812. null,
  8813. vnode.ssFallback,
  8814. container,
  8815. anchor,
  8816. parentComponent,
  8817. null,
  8818. // fallback tree will not have suspense context
  8819. namespace,
  8820. slotScopeIds
  8821. );
  8822. setActiveBranch(suspense, vnode.ssFallback);
  8823. } else {
  8824. suspense.resolve(false, true);
  8825. }
  8826. }
  8827. function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
  8828. const suspense = n2.suspense = n1.suspense;
  8829. suspense.vnode = n2;
  8830. n2.el = n1.el;
  8831. const newBranch = n2.ssContent;
  8832. const newFallback = n2.ssFallback;
  8833. const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
  8834. if (pendingBranch) {
  8835. suspense.pendingBranch = newBranch;
  8836. if (isSameVNodeType(newBranch, pendingBranch)) {
  8837. patch(
  8838. pendingBranch,
  8839. newBranch,
  8840. suspense.hiddenContainer,
  8841. null,
  8842. parentComponent,
  8843. suspense,
  8844. namespace,
  8845. slotScopeIds,
  8846. optimized
  8847. );
  8848. if (suspense.deps <= 0) {
  8849. suspense.resolve();
  8850. } else if (isInFallback) {
  8851. if (!isHydrating) {
  8852. patch(
  8853. activeBranch,
  8854. newFallback,
  8855. container,
  8856. anchor,
  8857. parentComponent,
  8858. null,
  8859. // fallback tree will not have suspense context
  8860. namespace,
  8861. slotScopeIds,
  8862. optimized
  8863. );
  8864. setActiveBranch(suspense, newFallback);
  8865. }
  8866. }
  8867. } else {
  8868. suspense.pendingId = suspenseId++;
  8869. if (isHydrating) {
  8870. suspense.isHydrating = false;
  8871. suspense.activeBranch = pendingBranch;
  8872. } else {
  8873. unmount(pendingBranch, parentComponent, suspense);
  8874. }
  8875. suspense.deps = 0;
  8876. suspense.effects.length = 0;
  8877. suspense.hiddenContainer = createElement("div");
  8878. if (isInFallback) {
  8879. patch(
  8880. null,
  8881. newBranch,
  8882. suspense.hiddenContainer,
  8883. null,
  8884. parentComponent,
  8885. suspense,
  8886. namespace,
  8887. slotScopeIds,
  8888. optimized
  8889. );
  8890. if (suspense.deps <= 0) {
  8891. suspense.resolve();
  8892. } else {
  8893. patch(
  8894. activeBranch,
  8895. newFallback,
  8896. container,
  8897. anchor,
  8898. parentComponent,
  8899. null,
  8900. // fallback tree will not have suspense context
  8901. namespace,
  8902. slotScopeIds,
  8903. optimized
  8904. );
  8905. setActiveBranch(suspense, newFallback);
  8906. }
  8907. } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
  8908. patch(
  8909. activeBranch,
  8910. newBranch,
  8911. container,
  8912. anchor,
  8913. parentComponent,
  8914. suspense,
  8915. namespace,
  8916. slotScopeIds,
  8917. optimized
  8918. );
  8919. suspense.resolve(true);
  8920. } else {
  8921. patch(
  8922. null,
  8923. newBranch,
  8924. suspense.hiddenContainer,
  8925. null,
  8926. parentComponent,
  8927. suspense,
  8928. namespace,
  8929. slotScopeIds,
  8930. optimized
  8931. );
  8932. if (suspense.deps <= 0) {
  8933. suspense.resolve();
  8934. }
  8935. }
  8936. }
  8937. } else {
  8938. if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
  8939. patch(
  8940. activeBranch,
  8941. newBranch,
  8942. container,
  8943. anchor,
  8944. parentComponent,
  8945. suspense,
  8946. namespace,
  8947. slotScopeIds,
  8948. optimized
  8949. );
  8950. setActiveBranch(suspense, newBranch);
  8951. } else {
  8952. triggerEvent(n2, "onPending");
  8953. suspense.pendingBranch = newBranch;
  8954. if (newBranch.shapeFlag & 512) {
  8955. suspense.pendingId = newBranch.component.suspenseId;
  8956. } else {
  8957. suspense.pendingId = suspenseId++;
  8958. }
  8959. patch(
  8960. null,
  8961. newBranch,
  8962. suspense.hiddenContainer,
  8963. null,
  8964. parentComponent,
  8965. suspense,
  8966. namespace,
  8967. slotScopeIds,
  8968. optimized
  8969. );
  8970. if (suspense.deps <= 0) {
  8971. suspense.resolve();
  8972. } else {
  8973. const { timeout, pendingId } = suspense;
  8974. if (timeout > 0) {
  8975. setTimeout(() => {
  8976. if (suspense.pendingId === pendingId) {
  8977. suspense.fallback(newFallback);
  8978. }
  8979. }, timeout);
  8980. } else if (timeout === 0) {
  8981. suspense.fallback(newFallback);
  8982. }
  8983. }
  8984. }
  8985. }
  8986. }
  8987. let hasWarned = false;
  8988. function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
  8989. if (!hasWarned) {
  8990. hasWarned = true;
  8991. console[console.info ? "info" : "log"](
  8992. `<Suspense> is an experimental feature and its API will likely change.`
  8993. );
  8994. }
  8995. const {
  8996. p: patch,
  8997. m: move,
  8998. um: unmount,
  8999. n: next,
  9000. o: { parentNode, remove }
  9001. } = rendererInternals;
  9002. let parentSuspenseId;
  9003. const isSuspensible = isVNodeSuspensible(vnode);
  9004. if (isSuspensible) {
  9005. if (parentSuspense && parentSuspense.pendingBranch) {
  9006. parentSuspenseId = parentSuspense.pendingId;
  9007. parentSuspense.deps++;
  9008. }
  9009. }
  9010. const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0;
  9011. {
  9012. assertNumber(timeout, `Suspense timeout`);
  9013. }
  9014. const initialAnchor = anchor;
  9015. const suspense = {
  9016. vnode,
  9017. parent: parentSuspense,
  9018. parentComponent,
  9019. namespace,
  9020. container,
  9021. hiddenContainer,
  9022. deps: 0,
  9023. pendingId: suspenseId++,
  9024. timeout: typeof timeout === "number" ? timeout : -1,
  9025. activeBranch: null,
  9026. pendingBranch: null,
  9027. isInFallback: !isHydrating,
  9028. isHydrating,
  9029. isUnmounted: false,
  9030. effects: [],
  9031. resolve(resume = false, sync = false) {
  9032. {
  9033. if (!resume && !suspense.pendingBranch) {
  9034. throw new Error(
  9035. `suspense.resolve() is called without a pending branch.`
  9036. );
  9037. }
  9038. if (suspense.isUnmounted) {
  9039. throw new Error(
  9040. `suspense.resolve() is called on an already unmounted suspense boundary.`
  9041. );
  9042. }
  9043. }
  9044. const {
  9045. vnode: vnode2,
  9046. activeBranch,
  9047. pendingBranch,
  9048. pendingId,
  9049. effects,
  9050. parentComponent: parentComponent2,
  9051. container: container2
  9052. } = suspense;
  9053. let delayEnter = false;
  9054. if (suspense.isHydrating) {
  9055. suspense.isHydrating = false;
  9056. } else if (!resume) {
  9057. delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
  9058. if (delayEnter) {
  9059. activeBranch.transition.afterLeave = () => {
  9060. if (pendingId === suspense.pendingId) {
  9061. move(
  9062. pendingBranch,
  9063. container2,
  9064. anchor === initialAnchor ? next(activeBranch) : anchor,
  9065. 0
  9066. );
  9067. queuePostFlushCb(effects);
  9068. }
  9069. };
  9070. }
  9071. if (activeBranch) {
  9072. if (parentNode(activeBranch.el) === container2) {
  9073. anchor = next(activeBranch);
  9074. }
  9075. unmount(activeBranch, parentComponent2, suspense, true);
  9076. }
  9077. if (!delayEnter) {
  9078. move(pendingBranch, container2, anchor, 0);
  9079. }
  9080. }
  9081. setActiveBranch(suspense, pendingBranch);
  9082. suspense.pendingBranch = null;
  9083. suspense.isInFallback = false;
  9084. let parent = suspense.parent;
  9085. let hasUnresolvedAncestor = false;
  9086. while (parent) {
  9087. if (parent.pendingBranch) {
  9088. parent.effects.push(...effects);
  9089. hasUnresolvedAncestor = true;
  9090. break;
  9091. }
  9092. parent = parent.parent;
  9093. }
  9094. if (!hasUnresolvedAncestor && !delayEnter) {
  9095. queuePostFlushCb(effects);
  9096. }
  9097. suspense.effects = [];
  9098. if (isSuspensible) {
  9099. if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
  9100. parentSuspense.deps--;
  9101. if (parentSuspense.deps === 0 && !sync) {
  9102. parentSuspense.resolve();
  9103. }
  9104. }
  9105. }
  9106. triggerEvent(vnode2, "onResolve");
  9107. },
  9108. fallback(fallbackVNode) {
  9109. if (!suspense.pendingBranch) {
  9110. return;
  9111. }
  9112. const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
  9113. triggerEvent(vnode2, "onFallback");
  9114. const anchor2 = next(activeBranch);
  9115. const mountFallback = () => {
  9116. if (!suspense.isInFallback) {
  9117. return;
  9118. }
  9119. patch(
  9120. null,
  9121. fallbackVNode,
  9122. container2,
  9123. anchor2,
  9124. parentComponent2,
  9125. null,
  9126. // fallback tree will not have suspense context
  9127. namespace2,
  9128. slotScopeIds,
  9129. optimized
  9130. );
  9131. setActiveBranch(suspense, fallbackVNode);
  9132. };
  9133. const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
  9134. if (delayEnter) {
  9135. activeBranch.transition.afterLeave = mountFallback;
  9136. }
  9137. suspense.isInFallback = true;
  9138. unmount(
  9139. activeBranch,
  9140. parentComponent2,
  9141. null,
  9142. // no suspense so unmount hooks fire now
  9143. true
  9144. // shouldRemove
  9145. );
  9146. if (!delayEnter) {
  9147. mountFallback();
  9148. }
  9149. },
  9150. move(container2, anchor2, type) {
  9151. suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
  9152. suspense.container = container2;
  9153. },
  9154. next() {
  9155. return suspense.activeBranch && next(suspense.activeBranch);
  9156. },
  9157. registerDep(instance, setupRenderEffect, optimized2) {
  9158. const isInPendingSuspense = !!suspense.pendingBranch;
  9159. if (isInPendingSuspense) {
  9160. suspense.deps++;
  9161. }
  9162. const hydratedEl = instance.vnode.el;
  9163. instance.asyncDep.catch((err) => {
  9164. handleError(err, instance, 0);
  9165. }).then((asyncSetupResult) => {
  9166. if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
  9167. return;
  9168. }
  9169. instance.asyncResolved = true;
  9170. const { vnode: vnode2 } = instance;
  9171. {
  9172. pushWarningContext(vnode2);
  9173. }
  9174. handleSetupResult(instance, asyncSetupResult, false);
  9175. if (hydratedEl) {
  9176. vnode2.el = hydratedEl;
  9177. }
  9178. const placeholder = !hydratedEl && instance.subTree.el;
  9179. setupRenderEffect(
  9180. instance,
  9181. vnode2,
  9182. // component may have been moved before resolve.
  9183. // if this is not a hydration, instance.subTree will be the comment
  9184. // placeholder.
  9185. parentNode(hydratedEl || instance.subTree.el),
  9186. // anchor will not be used if this is hydration, so only need to
  9187. // consider the comment placeholder case.
  9188. hydratedEl ? null : next(instance.subTree),
  9189. suspense,
  9190. namespace,
  9191. optimized2
  9192. );
  9193. if (placeholder) {
  9194. remove(placeholder);
  9195. }
  9196. updateHOCHostEl(instance, vnode2.el);
  9197. {
  9198. popWarningContext();
  9199. }
  9200. if (isInPendingSuspense && --suspense.deps === 0) {
  9201. suspense.resolve();
  9202. }
  9203. });
  9204. },
  9205. unmount(parentSuspense2, doRemove) {
  9206. suspense.isUnmounted = true;
  9207. if (suspense.activeBranch) {
  9208. unmount(
  9209. suspense.activeBranch,
  9210. parentComponent,
  9211. parentSuspense2,
  9212. doRemove
  9213. );
  9214. }
  9215. if (suspense.pendingBranch) {
  9216. unmount(
  9217. suspense.pendingBranch,
  9218. parentComponent,
  9219. parentSuspense2,
  9220. doRemove
  9221. );
  9222. }
  9223. }
  9224. };
  9225. return suspense;
  9226. }
  9227. function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
  9228. const suspense = vnode.suspense = createSuspenseBoundary(
  9229. vnode,
  9230. parentSuspense,
  9231. parentComponent,
  9232. node.parentNode,
  9233. // eslint-disable-next-line no-restricted-globals
  9234. document.createElement("div"),
  9235. null,
  9236. namespace,
  9237. slotScopeIds,
  9238. optimized,
  9239. rendererInternals,
  9240. true
  9241. );
  9242. const result = hydrateNode(
  9243. node,
  9244. suspense.pendingBranch = vnode.ssContent,
  9245. parentComponent,
  9246. suspense,
  9247. slotScopeIds,
  9248. optimized
  9249. );
  9250. if (suspense.deps === 0) {
  9251. suspense.resolve(false, true);
  9252. }
  9253. return result;
  9254. }
  9255. function normalizeSuspenseChildren(vnode) {
  9256. const { shapeFlag, children } = vnode;
  9257. const isSlotChildren = shapeFlag & 32;
  9258. vnode.ssContent = normalizeSuspenseSlot(
  9259. isSlotChildren ? children.default : children
  9260. );
  9261. vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment);
  9262. }
  9263. function normalizeSuspenseSlot(s) {
  9264. let block;
  9265. if (isFunction(s)) {
  9266. const trackBlock = isBlockTreeEnabled && s._c;
  9267. if (trackBlock) {
  9268. s._d = false;
  9269. openBlock();
  9270. }
  9271. s = s();
  9272. if (trackBlock) {
  9273. s._d = true;
  9274. block = currentBlock;
  9275. closeBlock();
  9276. }
  9277. }
  9278. if (isArray(s)) {
  9279. const singleChild = filterSingleRoot(s);
  9280. if (!singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) {
  9281. warn$1(`<Suspense> slots expect a single root node.`);
  9282. }
  9283. s = singleChild;
  9284. }
  9285. s = normalizeVNode(s);
  9286. if (block && !s.dynamicChildren) {
  9287. s.dynamicChildren = block.filter((c) => c !== s);
  9288. }
  9289. return s;
  9290. }
  9291. function queueEffectWithSuspense(fn, suspense) {
  9292. if (suspense && suspense.pendingBranch) {
  9293. if (isArray(fn)) {
  9294. suspense.effects.push(...fn);
  9295. } else {
  9296. suspense.effects.push(fn);
  9297. }
  9298. } else {
  9299. queuePostFlushCb(fn);
  9300. }
  9301. }
  9302. function setActiveBranch(suspense, branch) {
  9303. suspense.activeBranch = branch;
  9304. const { vnode, parentComponent } = suspense;
  9305. let el = branch.el;
  9306. while (!el && branch.component) {
  9307. branch = branch.component.subTree;
  9308. el = branch.el;
  9309. }
  9310. vnode.el = el;
  9311. if (parentComponent && parentComponent.subTree === vnode) {
  9312. parentComponent.vnode.el = el;
  9313. updateHOCHostEl(parentComponent, el);
  9314. }
  9315. }
  9316. function isVNodeSuspensible(vnode) {
  9317. const suspensible = vnode.props && vnode.props.suspensible;
  9318. return suspensible != null && suspensible !== false;
  9319. }
  9320. const Fragment = Symbol.for("v-fgt");
  9321. const Text = Symbol.for("v-txt");
  9322. const Comment = Symbol.for("v-cmt");
  9323. const Static = Symbol.for("v-stc");
  9324. const blockStack = [];
  9325. let currentBlock = null;
  9326. function openBlock(disableTracking = false) {
  9327. blockStack.push(currentBlock = disableTracking ? null : []);
  9328. }
  9329. function closeBlock() {
  9330. blockStack.pop();
  9331. currentBlock = blockStack[blockStack.length - 1] || null;
  9332. }
  9333. let isBlockTreeEnabled = 1;
  9334. function setBlockTracking(value) {
  9335. isBlockTreeEnabled += value;
  9336. if (value < 0 && currentBlock) {
  9337. currentBlock.hasOnce = true;
  9338. }
  9339. }
  9340. function setupBlock(vnode) {
  9341. vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
  9342. closeBlock();
  9343. if (isBlockTreeEnabled > 0 && currentBlock) {
  9344. currentBlock.push(vnode);
  9345. }
  9346. return vnode;
  9347. }
  9348. function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
  9349. return setupBlock(
  9350. createBaseVNode(
  9351. type,
  9352. props,
  9353. children,
  9354. patchFlag,
  9355. dynamicProps,
  9356. shapeFlag,
  9357. true
  9358. )
  9359. );
  9360. }
  9361. function createBlock(type, props, children, patchFlag, dynamicProps) {
  9362. return setupBlock(
  9363. createVNode(
  9364. type,
  9365. props,
  9366. children,
  9367. patchFlag,
  9368. dynamicProps,
  9369. true
  9370. )
  9371. );
  9372. }
  9373. function isVNode(value) {
  9374. return value ? value.__v_isVNode === true : false;
  9375. }
  9376. function isSameVNodeType(n1, n2) {
  9377. if (n2.shapeFlag & 6 && n1.component) {
  9378. const dirtyInstances = hmrDirtyComponents.get(n2.type);
  9379. if (dirtyInstances && dirtyInstances.has(n1.component)) {
  9380. n1.shapeFlag &= ~256;
  9381. n2.shapeFlag &= ~512;
  9382. return false;
  9383. }
  9384. }
  9385. return n1.type === n2.type && n1.key === n2.key;
  9386. }
  9387. let vnodeArgsTransformer;
  9388. function transformVNodeArgs(transformer) {
  9389. vnodeArgsTransformer = transformer;
  9390. }
  9391. const createVNodeWithArgsTransform = (...args) => {
  9392. return _createVNode(
  9393. ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args
  9394. );
  9395. };
  9396. const normalizeKey = ({ key }) => key != null ? key : null;
  9397. const normalizeRef = ({
  9398. ref,
  9399. ref_key,
  9400. ref_for
  9401. }) => {
  9402. if (typeof ref === "number") {
  9403. ref = "" + ref;
  9404. }
  9405. return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
  9406. };
  9407. function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
  9408. const vnode = {
  9409. __v_isVNode: true,
  9410. __v_skip: true,
  9411. type,
  9412. props,
  9413. key: props && normalizeKey(props),
  9414. ref: props && normalizeRef(props),
  9415. scopeId: currentScopeId,
  9416. slotScopeIds: null,
  9417. children,
  9418. component: null,
  9419. suspense: null,
  9420. ssContent: null,
  9421. ssFallback: null,
  9422. dirs: null,
  9423. transition: null,
  9424. el: null,
  9425. anchor: null,
  9426. target: null,
  9427. targetStart: null,
  9428. targetAnchor: null,
  9429. staticCount: 0,
  9430. shapeFlag,
  9431. patchFlag,
  9432. dynamicProps,
  9433. dynamicChildren: null,
  9434. appContext: null,
  9435. ctx: currentRenderingInstance
  9436. };
  9437. if (needFullChildrenNormalization) {
  9438. normalizeChildren(vnode, children);
  9439. if (shapeFlag & 128) {
  9440. type.normalize(vnode);
  9441. }
  9442. } else if (children) {
  9443. vnode.shapeFlag |= isString(children) ? 8 : 16;
  9444. }
  9445. if (vnode.key !== vnode.key) {
  9446. warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
  9447. }
  9448. if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
  9449. !isBlockNode && // has current parent block
  9450. currentBlock && // presence of a patch flag indicates this node needs patching on updates.
  9451. // component nodes also should always be patched, because even if the
  9452. // component doesn't need to update, it needs to persist the instance on to
  9453. // the next vnode so that it can be properly unmounted later.
  9454. (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
  9455. // vnode should not be considered dynamic due to handler caching.
  9456. vnode.patchFlag !== 32) {
  9457. currentBlock.push(vnode);
  9458. }
  9459. return vnode;
  9460. }
  9461. const createVNode = createVNodeWithArgsTransform ;
  9462. function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
  9463. if (!type || type === NULL_DYNAMIC_COMPONENT) {
  9464. if (!type) {
  9465. warn$1(`Invalid vnode type when creating vnode: ${type}.`);
  9466. }
  9467. type = Comment;
  9468. }
  9469. if (isVNode(type)) {
  9470. const cloned = cloneVNode(
  9471. type,
  9472. props,
  9473. true
  9474. /* mergeRef: true */
  9475. );
  9476. if (children) {
  9477. normalizeChildren(cloned, children);
  9478. }
  9479. if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
  9480. if (cloned.shapeFlag & 6) {
  9481. currentBlock[currentBlock.indexOf(type)] = cloned;
  9482. } else {
  9483. currentBlock.push(cloned);
  9484. }
  9485. }
  9486. cloned.patchFlag = -2;
  9487. return cloned;
  9488. }
  9489. if (isClassComponent(type)) {
  9490. type = type.__vccOpts;
  9491. }
  9492. if (props) {
  9493. props = guardReactiveProps(props);
  9494. let { class: klass, style } = props;
  9495. if (klass && !isString(klass)) {
  9496. props.class = normalizeClass(klass);
  9497. }
  9498. if (isObject(style)) {
  9499. if (isProxy(style) && !isArray(style)) {
  9500. style = extend({}, style);
  9501. }
  9502. props.style = normalizeStyle(style);
  9503. }
  9504. }
  9505. const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
  9506. if (shapeFlag & 4 && isProxy(type)) {
  9507. type = toRaw(type);
  9508. warn$1(
  9509. `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\`.`,
  9510. `
  9511. Component that was made reactive: `,
  9512. type
  9513. );
  9514. }
  9515. return createBaseVNode(
  9516. type,
  9517. props,
  9518. children,
  9519. patchFlag,
  9520. dynamicProps,
  9521. shapeFlag,
  9522. isBlockNode,
  9523. true
  9524. );
  9525. }
  9526. function guardReactiveProps(props) {
  9527. if (!props) return null;
  9528. return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
  9529. }
  9530. function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
  9531. const { props, ref, patchFlag, children, transition } = vnode;
  9532. const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
  9533. const cloned = {
  9534. __v_isVNode: true,
  9535. __v_skip: true,
  9536. type: vnode.type,
  9537. props: mergedProps,
  9538. key: mergedProps && normalizeKey(mergedProps),
  9539. ref: extraProps && extraProps.ref ? (
  9540. // #2078 in the case of <component :is="vnode" ref="extra"/>
  9541. // if the vnode itself already has a ref, cloneVNode will need to merge
  9542. // the refs so the single vnode can be set on multiple refs
  9543. mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps)
  9544. ) : ref,
  9545. scopeId: vnode.scopeId,
  9546. slotScopeIds: vnode.slotScopeIds,
  9547. children: patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children,
  9548. target: vnode.target,
  9549. targetStart: vnode.targetStart,
  9550. targetAnchor: vnode.targetAnchor,
  9551. staticCount: vnode.staticCount,
  9552. shapeFlag: vnode.shapeFlag,
  9553. // if the vnode is cloned with extra props, we can no longer assume its
  9554. // existing patch flag to be reliable and need to add the FULL_PROPS flag.
  9555. // note: preserve flag for fragments since they use the flag for children
  9556. // fast paths only.
  9557. patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
  9558. dynamicProps: vnode.dynamicProps,
  9559. dynamicChildren: vnode.dynamicChildren,
  9560. appContext: vnode.appContext,
  9561. dirs: vnode.dirs,
  9562. transition,
  9563. // These should technically only be non-null on mounted VNodes. However,
  9564. // they *should* be copied for kept-alive vnodes. So we just always copy
  9565. // them since them being non-null during a mount doesn't affect the logic as
  9566. // they will simply be overwritten.
  9567. component: vnode.component,
  9568. suspense: vnode.suspense,
  9569. ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
  9570. ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
  9571. el: vnode.el,
  9572. anchor: vnode.anchor,
  9573. ctx: vnode.ctx,
  9574. ce: vnode.ce
  9575. };
  9576. if (transition && cloneTransition) {
  9577. setTransitionHooks(
  9578. cloned,
  9579. transition.clone(cloned)
  9580. );
  9581. }
  9582. return cloned;
  9583. }
  9584. function deepCloneVNode(vnode) {
  9585. const cloned = cloneVNode(vnode);
  9586. if (isArray(vnode.children)) {
  9587. cloned.children = vnode.children.map(deepCloneVNode);
  9588. }
  9589. return cloned;
  9590. }
  9591. function createTextVNode(text = " ", flag = 0) {
  9592. return createVNode(Text, null, text, flag);
  9593. }
  9594. function createStaticVNode(content, numberOfNodes) {
  9595. const vnode = createVNode(Static, null, content);
  9596. vnode.staticCount = numberOfNodes;
  9597. return vnode;
  9598. }
  9599. function createCommentVNode(text = "", asBlock = false) {
  9600. return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
  9601. }
  9602. function normalizeVNode(child) {
  9603. if (child == null || typeof child === "boolean") {
  9604. return createVNode(Comment);
  9605. } else if (isArray(child)) {
  9606. return createVNode(
  9607. Fragment,
  9608. null,
  9609. // #3666, avoid reference pollution when reusing vnode
  9610. child.slice()
  9611. );
  9612. } else if (isVNode(child)) {
  9613. return cloneIfMounted(child);
  9614. } else {
  9615. return createVNode(Text, null, String(child));
  9616. }
  9617. }
  9618. function cloneIfMounted(child) {
  9619. return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
  9620. }
  9621. function normalizeChildren(vnode, children) {
  9622. let type = 0;
  9623. const { shapeFlag } = vnode;
  9624. if (children == null) {
  9625. children = null;
  9626. } else if (isArray(children)) {
  9627. type = 16;
  9628. } else if (typeof children === "object") {
  9629. if (shapeFlag & (1 | 64)) {
  9630. const slot = children.default;
  9631. if (slot) {
  9632. slot._c && (slot._d = false);
  9633. normalizeChildren(vnode, slot());
  9634. slot._c && (slot._d = true);
  9635. }
  9636. return;
  9637. } else {
  9638. type = 32;
  9639. const slotFlag = children._;
  9640. if (!slotFlag && !isInternalObject(children)) {
  9641. children._ctx = currentRenderingInstance;
  9642. } else if (slotFlag === 3 && currentRenderingInstance) {
  9643. if (currentRenderingInstance.slots._ === 1) {
  9644. children._ = 1;
  9645. } else {
  9646. children._ = 2;
  9647. vnode.patchFlag |= 1024;
  9648. }
  9649. }
  9650. }
  9651. } else if (isFunction(children)) {
  9652. children = { default: children, _ctx: currentRenderingInstance };
  9653. type = 32;
  9654. } else {
  9655. children = String(children);
  9656. if (shapeFlag & 64) {
  9657. type = 16;
  9658. children = [createTextVNode(children)];
  9659. } else {
  9660. type = 8;
  9661. }
  9662. }
  9663. vnode.children = children;
  9664. vnode.shapeFlag |= type;
  9665. }
  9666. function mergeProps(...args) {
  9667. const ret = {};
  9668. for (let i = 0; i < args.length; i++) {
  9669. const toMerge = args[i];
  9670. for (const key in toMerge) {
  9671. if (key === "class") {
  9672. if (ret.class !== toMerge.class) {
  9673. ret.class = normalizeClass([ret.class, toMerge.class]);
  9674. }
  9675. } else if (key === "style") {
  9676. ret.style = normalizeStyle([ret.style, toMerge.style]);
  9677. } else if (isOn(key)) {
  9678. const existing = ret[key];
  9679. const incoming = toMerge[key];
  9680. if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
  9681. ret[key] = existing ? [].concat(existing, incoming) : incoming;
  9682. }
  9683. } else if (key !== "") {
  9684. ret[key] = toMerge[key];
  9685. }
  9686. }
  9687. }
  9688. return ret;
  9689. }
  9690. function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
  9691. callWithAsyncErrorHandling(hook, instance, 7, [
  9692. vnode,
  9693. prevVNode
  9694. ]);
  9695. }
  9696. const emptyAppContext = createAppContext();
  9697. let uid = 0;
  9698. function createComponentInstance(vnode, parent, suspense) {
  9699. const type = vnode.type;
  9700. const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  9701. const instance = {
  9702. uid: uid++,
  9703. vnode,
  9704. type,
  9705. parent,
  9706. appContext,
  9707. root: null,
  9708. // to be immediately set
  9709. next: null,
  9710. subTree: null,
  9711. // will be set synchronously right after creation
  9712. effect: null,
  9713. update: null,
  9714. // will be set synchronously right after creation
  9715. job: null,
  9716. scope: new EffectScope(
  9717. true
  9718. /* detached */
  9719. ),
  9720. render: null,
  9721. proxy: null,
  9722. exposed: null,
  9723. exposeProxy: null,
  9724. withProxy: null,
  9725. provides: parent ? parent.provides : Object.create(appContext.provides),
  9726. ids: parent ? parent.ids : ["", 0, 0],
  9727. accessCache: null,
  9728. renderCache: [],
  9729. // local resolved assets
  9730. components: null,
  9731. directives: null,
  9732. // resolved props and emits options
  9733. propsOptions: normalizePropsOptions(type, appContext),
  9734. emitsOptions: normalizeEmitsOptions(type, appContext),
  9735. // emit
  9736. emit: null,
  9737. // to be set immediately
  9738. emitted: null,
  9739. // props default value
  9740. propsDefaults: EMPTY_OBJ,
  9741. // inheritAttrs
  9742. inheritAttrs: type.inheritAttrs,
  9743. // state
  9744. ctx: EMPTY_OBJ,
  9745. data: EMPTY_OBJ,
  9746. props: EMPTY_OBJ,
  9747. attrs: EMPTY_OBJ,
  9748. slots: EMPTY_OBJ,
  9749. refs: EMPTY_OBJ,
  9750. setupState: EMPTY_OBJ,
  9751. setupContext: null,
  9752. // suspense related
  9753. suspense,
  9754. suspenseId: suspense ? suspense.pendingId : 0,
  9755. asyncDep: null,
  9756. asyncResolved: false,
  9757. // lifecycle hooks
  9758. // not using enums here because it results in computed properties
  9759. isMounted: false,
  9760. isUnmounted: false,
  9761. isDeactivated: false,
  9762. bc: null,
  9763. c: null,
  9764. bm: null,
  9765. m: null,
  9766. bu: null,
  9767. u: null,
  9768. um: null,
  9769. bum: null,
  9770. da: null,
  9771. a: null,
  9772. rtg: null,
  9773. rtc: null,
  9774. ec: null,
  9775. sp: null
  9776. };
  9777. {
  9778. instance.ctx = createDevRenderContext(instance);
  9779. }
  9780. instance.root = parent ? parent.root : instance;
  9781. instance.emit = emit.bind(null, instance);
  9782. if (vnode.ce) {
  9783. vnode.ce(instance);
  9784. }
  9785. return instance;
  9786. }
  9787. let currentInstance = null;
  9788. const getCurrentInstance = () => currentInstance || currentRenderingInstance;
  9789. let internalSetCurrentInstance;
  9790. let setInSSRSetupState;
  9791. {
  9792. const g = getGlobalThis();
  9793. const registerGlobalSetter = (key, setter) => {
  9794. let setters;
  9795. if (!(setters = g[key])) setters = g[key] = [];
  9796. setters.push(setter);
  9797. return (v) => {
  9798. if (setters.length > 1) setters.forEach((set) => set(v));
  9799. else setters[0](v);
  9800. };
  9801. };
  9802. internalSetCurrentInstance = registerGlobalSetter(
  9803. `__VUE_INSTANCE_SETTERS__`,
  9804. (v) => currentInstance = v
  9805. );
  9806. setInSSRSetupState = registerGlobalSetter(
  9807. `__VUE_SSR_SETTERS__`,
  9808. (v) => isInSSRComponentSetup = v
  9809. );
  9810. }
  9811. const setCurrentInstance = (instance) => {
  9812. const prev = currentInstance;
  9813. internalSetCurrentInstance(instance);
  9814. instance.scope.on();
  9815. return () => {
  9816. instance.scope.off();
  9817. internalSetCurrentInstance(prev);
  9818. };
  9819. };
  9820. const unsetCurrentInstance = () => {
  9821. currentInstance && currentInstance.scope.off();
  9822. internalSetCurrentInstance(null);
  9823. };
  9824. const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
  9825. function validateComponentName(name, { isNativeTag }) {
  9826. if (isBuiltInTag(name) || isNativeTag(name)) {
  9827. warn$1(
  9828. "Do not use built-in or reserved HTML elements as component id: " + name
  9829. );
  9830. }
  9831. }
  9832. function isStatefulComponent(instance) {
  9833. return instance.vnode.shapeFlag & 4;
  9834. }
  9835. let isInSSRComponentSetup = false;
  9836. function setupComponent(instance, isSSR = false, optimized = false) {
  9837. isSSR && setInSSRSetupState(isSSR);
  9838. const { props, children } = instance.vnode;
  9839. const isStateful = isStatefulComponent(instance);
  9840. initProps(instance, props, isStateful, isSSR);
  9841. initSlots(instance, children, optimized);
  9842. const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  9843. isSSR && setInSSRSetupState(false);
  9844. return setupResult;
  9845. }
  9846. function setupStatefulComponent(instance, isSSR) {
  9847. var _a;
  9848. const Component = instance.type;
  9849. {
  9850. if (Component.name) {
  9851. validateComponentName(Component.name, instance.appContext.config);
  9852. }
  9853. if (Component.components) {
  9854. const names = Object.keys(Component.components);
  9855. for (let i = 0; i < names.length; i++) {
  9856. validateComponentName(names[i], instance.appContext.config);
  9857. }
  9858. }
  9859. if (Component.directives) {
  9860. const names = Object.keys(Component.directives);
  9861. for (let i = 0; i < names.length; i++) {
  9862. validateDirectiveName(names[i]);
  9863. }
  9864. }
  9865. if (Component.compilerOptions && isRuntimeOnly()) {
  9866. warn$1(
  9867. `"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.`
  9868. );
  9869. }
  9870. }
  9871. instance.accessCache = /* @__PURE__ */ Object.create(null);
  9872. instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
  9873. {
  9874. exposePropsOnRenderContext(instance);
  9875. }
  9876. const { setup } = Component;
  9877. if (setup) {
  9878. pauseTracking();
  9879. const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
  9880. const reset = setCurrentInstance(instance);
  9881. const setupResult = callWithErrorHandling(
  9882. setup,
  9883. instance,
  9884. 0,
  9885. [
  9886. shallowReadonly(instance.props) ,
  9887. setupContext
  9888. ]
  9889. );
  9890. const isAsyncSetup = isPromise(setupResult);
  9891. resetTracking();
  9892. reset();
  9893. if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
  9894. markAsyncBoundary(instance);
  9895. }
  9896. if (isAsyncSetup) {
  9897. setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
  9898. if (isSSR) {
  9899. return setupResult.then((resolvedResult) => {
  9900. handleSetupResult(instance, resolvedResult, isSSR);
  9901. }).catch((e) => {
  9902. handleError(e, instance, 0);
  9903. });
  9904. } else {
  9905. instance.asyncDep = setupResult;
  9906. if (!instance.suspense) {
  9907. const name = (_a = Component.name) != null ? _a : "Anonymous";
  9908. warn$1(
  9909. `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.`
  9910. );
  9911. }
  9912. }
  9913. } else {
  9914. handleSetupResult(instance, setupResult, isSSR);
  9915. }
  9916. } else {
  9917. finishComponentSetup(instance, isSSR);
  9918. }
  9919. }
  9920. function handleSetupResult(instance, setupResult, isSSR) {
  9921. if (isFunction(setupResult)) {
  9922. if (instance.type.__ssrInlineRender) {
  9923. instance.ssrRender = setupResult;
  9924. } else {
  9925. instance.render = setupResult;
  9926. }
  9927. } else if (isObject(setupResult)) {
  9928. if (isVNode(setupResult)) {
  9929. warn$1(
  9930. `setup() should not return VNodes directly - return a render function instead.`
  9931. );
  9932. }
  9933. {
  9934. instance.devtoolsRawSetupState = setupResult;
  9935. }
  9936. instance.setupState = proxyRefs(setupResult);
  9937. {
  9938. exposeSetupStateOnRenderContext(instance);
  9939. }
  9940. } else if (setupResult !== void 0) {
  9941. warn$1(
  9942. `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`
  9943. );
  9944. }
  9945. finishComponentSetup(instance, isSSR);
  9946. }
  9947. let compile;
  9948. let installWithProxy;
  9949. function registerRuntimeCompiler(_compile) {
  9950. compile = _compile;
  9951. installWithProxy = (i) => {
  9952. if (i.render._rc) {
  9953. i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
  9954. }
  9955. };
  9956. }
  9957. const isRuntimeOnly = () => !compile;
  9958. function finishComponentSetup(instance, isSSR, skipOptions) {
  9959. const Component = instance.type;
  9960. if (!instance.render) {
  9961. if (!isSSR && compile && !Component.render) {
  9962. const template = Component.template || resolveMergedOptions(instance).template;
  9963. if (template) {
  9964. {
  9965. startMeasure(instance, `compile`);
  9966. }
  9967. const { isCustomElement, compilerOptions } = instance.appContext.config;
  9968. const { delimiters, compilerOptions: componentCompilerOptions } = Component;
  9969. const finalCompilerOptions = extend(
  9970. extend(
  9971. {
  9972. isCustomElement,
  9973. delimiters
  9974. },
  9975. compilerOptions
  9976. ),
  9977. componentCompilerOptions
  9978. );
  9979. Component.render = compile(template, finalCompilerOptions);
  9980. {
  9981. endMeasure(instance, `compile`);
  9982. }
  9983. }
  9984. }
  9985. instance.render = Component.render || NOOP;
  9986. if (installWithProxy) {
  9987. installWithProxy(instance);
  9988. }
  9989. }
  9990. {
  9991. const reset = setCurrentInstance(instance);
  9992. pauseTracking();
  9993. try {
  9994. applyOptions(instance);
  9995. } finally {
  9996. resetTracking();
  9997. reset();
  9998. }
  9999. }
  10000. if (!Component.render && instance.render === NOOP && !isSSR) {
  10001. if (!compile && Component.template) {
  10002. warn$1(
  10003. `Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Use "vue.esm-browser.js" instead.` )
  10004. );
  10005. } else {
  10006. warn$1(`Component is missing template or render function: `, Component);
  10007. }
  10008. }
  10009. }
  10010. const attrsProxyHandlers = {
  10011. get(target, key) {
  10012. markAttrsAccessed();
  10013. track(target, "get", "");
  10014. return target[key];
  10015. },
  10016. set() {
  10017. warn$1(`setupContext.attrs is readonly.`);
  10018. return false;
  10019. },
  10020. deleteProperty() {
  10021. warn$1(`setupContext.attrs is readonly.`);
  10022. return false;
  10023. }
  10024. } ;
  10025. function getSlotsProxy(instance) {
  10026. return new Proxy(instance.slots, {
  10027. get(target, key) {
  10028. track(instance, "get", "$slots");
  10029. return target[key];
  10030. }
  10031. });
  10032. }
  10033. function createSetupContext(instance) {
  10034. const expose = (exposed) => {
  10035. {
  10036. if (instance.exposed) {
  10037. warn$1(`expose() should be called only once per setup().`);
  10038. }
  10039. if (exposed != null) {
  10040. let exposedType = typeof exposed;
  10041. if (exposedType === "object") {
  10042. if (isArray(exposed)) {
  10043. exposedType = "array";
  10044. } else if (isRef(exposed)) {
  10045. exposedType = "ref";
  10046. }
  10047. }
  10048. if (exposedType !== "object") {
  10049. warn$1(
  10050. `expose() should be passed a plain object, received ${exposedType}.`
  10051. );
  10052. }
  10053. }
  10054. }
  10055. instance.exposed = exposed || {};
  10056. };
  10057. {
  10058. let attrsProxy;
  10059. let slotsProxy;
  10060. return Object.freeze({
  10061. get attrs() {
  10062. return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));
  10063. },
  10064. get slots() {
  10065. return slotsProxy || (slotsProxy = getSlotsProxy(instance));
  10066. },
  10067. get emit() {
  10068. return (event, ...args) => instance.emit(event, ...args);
  10069. },
  10070. expose
  10071. });
  10072. }
  10073. }
  10074. function getComponentPublicInstance(instance) {
  10075. if (instance.exposed) {
  10076. return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
  10077. get(target, key) {
  10078. if (key in target) {
  10079. return target[key];
  10080. } else if (key in publicPropertiesMap) {
  10081. return publicPropertiesMap[key](instance);
  10082. }
  10083. },
  10084. has(target, key) {
  10085. return key in target || key in publicPropertiesMap;
  10086. }
  10087. }));
  10088. } else {
  10089. return instance.proxy;
  10090. }
  10091. }
  10092. const classifyRE = /(?:^|[-_])(\w)/g;
  10093. const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
  10094. function getComponentName(Component, includeInferred = true) {
  10095. return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
  10096. }
  10097. function formatComponentName(instance, Component, isRoot = false) {
  10098. let name = getComponentName(Component);
  10099. if (!name && Component.__file) {
  10100. const match = Component.__file.match(/([^/\\]+)\.\w+$/);
  10101. if (match) {
  10102. name = match[1];
  10103. }
  10104. }
  10105. if (!name && instance && instance.parent) {
  10106. const inferFromRegistry = (registry) => {
  10107. for (const key in registry) {
  10108. if (registry[key] === Component) {
  10109. return key;
  10110. }
  10111. }
  10112. };
  10113. name = inferFromRegistry(
  10114. instance.components || instance.parent.type.components
  10115. ) || inferFromRegistry(instance.appContext.components);
  10116. }
  10117. return name ? classify(name) : isRoot ? `App` : `Anonymous`;
  10118. }
  10119. function isClassComponent(value) {
  10120. return isFunction(value) && "__vccOpts" in value;
  10121. }
  10122. const computed = (getterOrOptions, debugOptions) => {
  10123. const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
  10124. {
  10125. const i = getCurrentInstance();
  10126. if (i && i.appContext.config.warnRecursiveComputed) {
  10127. c._warnRecursive = true;
  10128. }
  10129. }
  10130. return c;
  10131. };
  10132. function h(type, propsOrChildren, children) {
  10133. const l = arguments.length;
  10134. if (l === 2) {
  10135. if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
  10136. if (isVNode(propsOrChildren)) {
  10137. return createVNode(type, null, [propsOrChildren]);
  10138. }
  10139. return createVNode(type, propsOrChildren);
  10140. } else {
  10141. return createVNode(type, null, propsOrChildren);
  10142. }
  10143. } else {
  10144. if (l > 3) {
  10145. children = Array.prototype.slice.call(arguments, 2);
  10146. } else if (l === 3 && isVNode(children)) {
  10147. children = [children];
  10148. }
  10149. return createVNode(type, propsOrChildren, children);
  10150. }
  10151. }
  10152. function initCustomFormatter() {
  10153. if (typeof window === "undefined") {
  10154. return;
  10155. }
  10156. const vueStyle = { style: "color:#3ba776" };
  10157. const numberStyle = { style: "color:#1677ff" };
  10158. const stringStyle = { style: "color:#f5222d" };
  10159. const keywordStyle = { style: "color:#eb2f96" };
  10160. const formatter = {
  10161. __vue_custom_formatter: true,
  10162. header(obj) {
  10163. if (!isObject(obj)) {
  10164. return null;
  10165. }
  10166. if (obj.__isVue) {
  10167. return ["div", vueStyle, `VueInstance`];
  10168. } else if (isRef(obj)) {
  10169. return [
  10170. "div",
  10171. {},
  10172. ["span", vueStyle, genRefFlag(obj)],
  10173. "<",
  10174. // avoid debugger accessing value affecting behavior
  10175. formatValue("_value" in obj ? obj._value : obj),
  10176. `>`
  10177. ];
  10178. } else if (isReactive(obj)) {
  10179. return [
  10180. "div",
  10181. {},
  10182. ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"],
  10183. "<",
  10184. formatValue(obj),
  10185. `>${isReadonly(obj) ? ` (readonly)` : ``}`
  10186. ];
  10187. } else if (isReadonly(obj)) {
  10188. return [
  10189. "div",
  10190. {},
  10191. ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"],
  10192. "<",
  10193. formatValue(obj),
  10194. ">"
  10195. ];
  10196. }
  10197. return null;
  10198. },
  10199. hasBody(obj) {
  10200. return obj && obj.__isVue;
  10201. },
  10202. body(obj) {
  10203. if (obj && obj.__isVue) {
  10204. return [
  10205. "div",
  10206. {},
  10207. ...formatInstance(obj.$)
  10208. ];
  10209. }
  10210. }
  10211. };
  10212. function formatInstance(instance) {
  10213. const blocks = [];
  10214. if (instance.type.props && instance.props) {
  10215. blocks.push(createInstanceBlock("props", toRaw(instance.props)));
  10216. }
  10217. if (instance.setupState !== EMPTY_OBJ) {
  10218. blocks.push(createInstanceBlock("setup", instance.setupState));
  10219. }
  10220. if (instance.data !== EMPTY_OBJ) {
  10221. blocks.push(createInstanceBlock("data", toRaw(instance.data)));
  10222. }
  10223. const computed = extractKeys(instance, "computed");
  10224. if (computed) {
  10225. blocks.push(createInstanceBlock("computed", computed));
  10226. }
  10227. const injected = extractKeys(instance, "inject");
  10228. if (injected) {
  10229. blocks.push(createInstanceBlock("injected", injected));
  10230. }
  10231. blocks.push([
  10232. "div",
  10233. {},
  10234. [
  10235. "span",
  10236. {
  10237. style: keywordStyle.style + ";opacity:0.66"
  10238. },
  10239. "$ (internal): "
  10240. ],
  10241. ["object", { object: instance }]
  10242. ]);
  10243. return blocks;
  10244. }
  10245. function createInstanceBlock(type, target) {
  10246. target = extend({}, target);
  10247. if (!Object.keys(target).length) {
  10248. return ["span", {}];
  10249. }
  10250. return [
  10251. "div",
  10252. { style: "line-height:1.25em;margin-bottom:0.6em" },
  10253. [
  10254. "div",
  10255. {
  10256. style: "color:#476582"
  10257. },
  10258. type
  10259. ],
  10260. [
  10261. "div",
  10262. {
  10263. style: "padding-left:1.25em"
  10264. },
  10265. ...Object.keys(target).map((key) => {
  10266. return [
  10267. "div",
  10268. {},
  10269. ["span", keywordStyle, key + ": "],
  10270. formatValue(target[key], false)
  10271. ];
  10272. })
  10273. ]
  10274. ];
  10275. }
  10276. function formatValue(v, asRaw = true) {
  10277. if (typeof v === "number") {
  10278. return ["span", numberStyle, v];
  10279. } else if (typeof v === "string") {
  10280. return ["span", stringStyle, JSON.stringify(v)];
  10281. } else if (typeof v === "boolean") {
  10282. return ["span", keywordStyle, v];
  10283. } else if (isObject(v)) {
  10284. return ["object", { object: asRaw ? toRaw(v) : v }];
  10285. } else {
  10286. return ["span", stringStyle, String(v)];
  10287. }
  10288. }
  10289. function extractKeys(instance, type) {
  10290. const Comp = instance.type;
  10291. if (isFunction(Comp)) {
  10292. return;
  10293. }
  10294. const extracted = {};
  10295. for (const key in instance.ctx) {
  10296. if (isKeyOfType(Comp, key, type)) {
  10297. extracted[key] = instance.ctx[key];
  10298. }
  10299. }
  10300. return extracted;
  10301. }
  10302. function isKeyOfType(Comp, key, type) {
  10303. const opts = Comp[type];
  10304. if (isArray(opts) && opts.includes(key) || isObject(opts) && key in opts) {
  10305. return true;
  10306. }
  10307. if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {
  10308. return true;
  10309. }
  10310. if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) {
  10311. return true;
  10312. }
  10313. }
  10314. function genRefFlag(v) {
  10315. if (isShallow(v)) {
  10316. return `ShallowRef`;
  10317. }
  10318. if (v.effect) {
  10319. return `ComputedRef`;
  10320. }
  10321. return `Ref`;
  10322. }
  10323. if (window.devtoolsFormatters) {
  10324. window.devtoolsFormatters.push(formatter);
  10325. } else {
  10326. window.devtoolsFormatters = [formatter];
  10327. }
  10328. }
  10329. function withMemo(memo, render, cache, index) {
  10330. const cached = cache[index];
  10331. if (cached && isMemoSame(cached, memo)) {
  10332. return cached;
  10333. }
  10334. const ret = render();
  10335. ret.memo = memo.slice();
  10336. ret.cacheIndex = index;
  10337. return cache[index] = ret;
  10338. }
  10339. function isMemoSame(cached, memo) {
  10340. const prev = cached.memo;
  10341. if (prev.length != memo.length) {
  10342. return false;
  10343. }
  10344. for (let i = 0; i < prev.length; i++) {
  10345. if (hasChanged(prev[i], memo[i])) {
  10346. return false;
  10347. }
  10348. }
  10349. if (isBlockTreeEnabled > 0 && currentBlock) {
  10350. currentBlock.push(cached);
  10351. }
  10352. return true;
  10353. }
  10354. const version = "3.5.12";
  10355. const warn = warn$1 ;
  10356. const ErrorTypeStrings = ErrorTypeStrings$1 ;
  10357. const devtools = devtools$1 ;
  10358. const setDevtoolsHook = setDevtoolsHook$1 ;
  10359. const _ssrUtils = {
  10360. createComponentInstance,
  10361. setupComponent,
  10362. renderComponentRoot,
  10363. setCurrentRenderingInstance,
  10364. isVNode: isVNode,
  10365. normalizeVNode,
  10366. getComponentPublicInstance,
  10367. ensureValidVNode,
  10368. pushWarningContext,
  10369. popWarningContext
  10370. };
  10371. const ssrUtils = _ssrUtils ;
  10372. const resolveFilter = null;
  10373. const compatUtils = null;
  10374. const DeprecationTypes = null;
  10375. let policy = void 0;
  10376. const tt = typeof window !== "undefined" && window.trustedTypes;
  10377. if (tt) {
  10378. try {
  10379. policy = /* @__PURE__ */ tt.createPolicy("vue", {
  10380. createHTML: (val) => val
  10381. });
  10382. } catch (e) {
  10383. warn(`Error creating trusted types policy: ${e}`);
  10384. }
  10385. }
  10386. const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val;
  10387. const svgNS = "http://www.w3.org/2000/svg";
  10388. const mathmlNS = "http://www.w3.org/1998/Math/MathML";
  10389. const doc = typeof document !== "undefined" ? document : null;
  10390. const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
  10391. const nodeOps = {
  10392. insert: (child, parent, anchor) => {
  10393. parent.insertBefore(child, anchor || null);
  10394. },
  10395. remove: (child) => {
  10396. const parent = child.parentNode;
  10397. if (parent) {
  10398. parent.removeChild(child);
  10399. }
  10400. },
  10401. createElement: (tag, namespace, is, props) => {
  10402. const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag);
  10403. if (tag === "select" && props && props.multiple != null) {
  10404. el.setAttribute("multiple", props.multiple);
  10405. }
  10406. return el;
  10407. },
  10408. createText: (text) => doc.createTextNode(text),
  10409. createComment: (text) => doc.createComment(text),
  10410. setText: (node, text) => {
  10411. node.nodeValue = text;
  10412. },
  10413. setElementText: (el, text) => {
  10414. el.textContent = text;
  10415. },
  10416. parentNode: (node) => node.parentNode,
  10417. nextSibling: (node) => node.nextSibling,
  10418. querySelector: (selector) => doc.querySelector(selector),
  10419. setScopeId(el, id) {
  10420. el.setAttribute(id, "");
  10421. },
  10422. // __UNSAFE__
  10423. // Reason: innerHTML.
  10424. // Static content here can only come from compiled templates.
  10425. // As long as the user only uses trusted templates, this is safe.
  10426. insertStaticContent(content, parent, anchor, namespace, start, end) {
  10427. const before = anchor ? anchor.previousSibling : parent.lastChild;
  10428. if (start && (start === end || start.nextSibling)) {
  10429. while (true) {
  10430. parent.insertBefore(start.cloneNode(true), anchor);
  10431. if (start === end || !(start = start.nextSibling)) break;
  10432. }
  10433. } else {
  10434. templateContainer.innerHTML = unsafeToTrustedHTML(
  10435. namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content
  10436. );
  10437. const template = templateContainer.content;
  10438. if (namespace === "svg" || namespace === "mathml") {
  10439. const wrapper = template.firstChild;
  10440. while (wrapper.firstChild) {
  10441. template.appendChild(wrapper.firstChild);
  10442. }
  10443. template.removeChild(wrapper);
  10444. }
  10445. parent.insertBefore(template, anchor);
  10446. }
  10447. return [
  10448. // first
  10449. before ? before.nextSibling : parent.firstChild,
  10450. // last
  10451. anchor ? anchor.previousSibling : parent.lastChild
  10452. ];
  10453. }
  10454. };
  10455. const TRANSITION = "transition";
  10456. const ANIMATION = "animation";
  10457. const vtcKey = Symbol("_vtc");
  10458. const DOMTransitionPropsValidators = {
  10459. name: String,
  10460. type: String,
  10461. css: {
  10462. type: Boolean,
  10463. default: true
  10464. },
  10465. duration: [String, Number, Object],
  10466. enterFromClass: String,
  10467. enterActiveClass: String,
  10468. enterToClass: String,
  10469. appearFromClass: String,
  10470. appearActiveClass: String,
  10471. appearToClass: String,
  10472. leaveFromClass: String,
  10473. leaveActiveClass: String,
  10474. leaveToClass: String
  10475. };
  10476. const TransitionPropsValidators = /* @__PURE__ */ extend(
  10477. {},
  10478. BaseTransitionPropsValidators,
  10479. DOMTransitionPropsValidators
  10480. );
  10481. const decorate$1 = (t) => {
  10482. t.displayName = "Transition";
  10483. t.props = TransitionPropsValidators;
  10484. return t;
  10485. };
  10486. const Transition = /* @__PURE__ */ decorate$1(
  10487. (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots)
  10488. );
  10489. const callHook = (hook, args = []) => {
  10490. if (isArray(hook)) {
  10491. hook.forEach((h2) => h2(...args));
  10492. } else if (hook) {
  10493. hook(...args);
  10494. }
  10495. };
  10496. const hasExplicitCallback = (hook) => {
  10497. return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
  10498. };
  10499. function resolveTransitionProps(rawProps) {
  10500. const baseProps = {};
  10501. for (const key in rawProps) {
  10502. if (!(key in DOMTransitionPropsValidators)) {
  10503. baseProps[key] = rawProps[key];
  10504. }
  10505. }
  10506. if (rawProps.css === false) {
  10507. return baseProps;
  10508. }
  10509. const {
  10510. name = "v",
  10511. type,
  10512. duration,
  10513. enterFromClass = `${name}-enter-from`,
  10514. enterActiveClass = `${name}-enter-active`,
  10515. enterToClass = `${name}-enter-to`,
  10516. appearFromClass = enterFromClass,
  10517. appearActiveClass = enterActiveClass,
  10518. appearToClass = enterToClass,
  10519. leaveFromClass = `${name}-leave-from`,
  10520. leaveActiveClass = `${name}-leave-active`,
  10521. leaveToClass = `${name}-leave-to`
  10522. } = rawProps;
  10523. const durations = normalizeDuration(duration);
  10524. const enterDuration = durations && durations[0];
  10525. const leaveDuration = durations && durations[1];
  10526. const {
  10527. onBeforeEnter,
  10528. onEnter,
  10529. onEnterCancelled,
  10530. onLeave,
  10531. onLeaveCancelled,
  10532. onBeforeAppear = onBeforeEnter,
  10533. onAppear = onEnter,
  10534. onAppearCancelled = onEnterCancelled
  10535. } = baseProps;
  10536. const finishEnter = (el, isAppear, done) => {
  10537. removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
  10538. removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
  10539. done && done();
  10540. };
  10541. const finishLeave = (el, done) => {
  10542. el._isLeaving = false;
  10543. removeTransitionClass(el, leaveFromClass);
  10544. removeTransitionClass(el, leaveToClass);
  10545. removeTransitionClass(el, leaveActiveClass);
  10546. done && done();
  10547. };
  10548. const makeEnterHook = (isAppear) => {
  10549. return (el, done) => {
  10550. const hook = isAppear ? onAppear : onEnter;
  10551. const resolve = () => finishEnter(el, isAppear, done);
  10552. callHook(hook, [el, resolve]);
  10553. nextFrame(() => {
  10554. removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
  10555. addTransitionClass(el, isAppear ? appearToClass : enterToClass);
  10556. if (!hasExplicitCallback(hook)) {
  10557. whenTransitionEnds(el, type, enterDuration, resolve);
  10558. }
  10559. });
  10560. };
  10561. };
  10562. return extend(baseProps, {
  10563. onBeforeEnter(el) {
  10564. callHook(onBeforeEnter, [el]);
  10565. addTransitionClass(el, enterFromClass);
  10566. addTransitionClass(el, enterActiveClass);
  10567. },
  10568. onBeforeAppear(el) {
  10569. callHook(onBeforeAppear, [el]);
  10570. addTransitionClass(el, appearFromClass);
  10571. addTransitionClass(el, appearActiveClass);
  10572. },
  10573. onEnter: makeEnterHook(false),
  10574. onAppear: makeEnterHook(true),
  10575. onLeave(el, done) {
  10576. el._isLeaving = true;
  10577. const resolve = () => finishLeave(el, done);
  10578. addTransitionClass(el, leaveFromClass);
  10579. addTransitionClass(el, leaveActiveClass);
  10580. forceReflow();
  10581. nextFrame(() => {
  10582. if (!el._isLeaving) {
  10583. return;
  10584. }
  10585. removeTransitionClass(el, leaveFromClass);
  10586. addTransitionClass(el, leaveToClass);
  10587. if (!hasExplicitCallback(onLeave)) {
  10588. whenTransitionEnds(el, type, leaveDuration, resolve);
  10589. }
  10590. });
  10591. callHook(onLeave, [el, resolve]);
  10592. },
  10593. onEnterCancelled(el) {
  10594. finishEnter(el, false);
  10595. callHook(onEnterCancelled, [el]);
  10596. },
  10597. onAppearCancelled(el) {
  10598. finishEnter(el, true);
  10599. callHook(onAppearCancelled, [el]);
  10600. },
  10601. onLeaveCancelled(el) {
  10602. finishLeave(el);
  10603. callHook(onLeaveCancelled, [el]);
  10604. }
  10605. });
  10606. }
  10607. function normalizeDuration(duration) {
  10608. if (duration == null) {
  10609. return null;
  10610. } else if (isObject(duration)) {
  10611. return [NumberOf(duration.enter), NumberOf(duration.leave)];
  10612. } else {
  10613. const n = NumberOf(duration);
  10614. return [n, n];
  10615. }
  10616. }
  10617. function NumberOf(val) {
  10618. const res = toNumber(val);
  10619. {
  10620. assertNumber(res, "<transition> explicit duration");
  10621. }
  10622. return res;
  10623. }
  10624. function addTransitionClass(el, cls) {
  10625. cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
  10626. (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
  10627. }
  10628. function removeTransitionClass(el, cls) {
  10629. cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
  10630. const _vtc = el[vtcKey];
  10631. if (_vtc) {
  10632. _vtc.delete(cls);
  10633. if (!_vtc.size) {
  10634. el[vtcKey] = void 0;
  10635. }
  10636. }
  10637. }
  10638. function nextFrame(cb) {
  10639. requestAnimationFrame(() => {
  10640. requestAnimationFrame(cb);
  10641. });
  10642. }
  10643. let endId = 0;
  10644. function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
  10645. const id = el._endId = ++endId;
  10646. const resolveIfNotStale = () => {
  10647. if (id === el._endId) {
  10648. resolve();
  10649. }
  10650. };
  10651. if (explicitTimeout != null) {
  10652. return setTimeout(resolveIfNotStale, explicitTimeout);
  10653. }
  10654. const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
  10655. if (!type) {
  10656. return resolve();
  10657. }
  10658. const endEvent = type + "end";
  10659. let ended = 0;
  10660. const end = () => {
  10661. el.removeEventListener(endEvent, onEnd);
  10662. resolveIfNotStale();
  10663. };
  10664. const onEnd = (e) => {
  10665. if (e.target === el && ++ended >= propCount) {
  10666. end();
  10667. }
  10668. };
  10669. setTimeout(() => {
  10670. if (ended < propCount) {
  10671. end();
  10672. }
  10673. }, timeout + 1);
  10674. el.addEventListener(endEvent, onEnd);
  10675. }
  10676. function getTransitionInfo(el, expectedType) {
  10677. const styles = window.getComputedStyle(el);
  10678. const getStyleProperties = (key) => (styles[key] || "").split(", ");
  10679. const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
  10680. const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
  10681. const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  10682. const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
  10683. const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
  10684. const animationTimeout = getTimeout(animationDelays, animationDurations);
  10685. let type = null;
  10686. let timeout = 0;
  10687. let propCount = 0;
  10688. if (expectedType === TRANSITION) {
  10689. if (transitionTimeout > 0) {
  10690. type = TRANSITION;
  10691. timeout = transitionTimeout;
  10692. propCount = transitionDurations.length;
  10693. }
  10694. } else if (expectedType === ANIMATION) {
  10695. if (animationTimeout > 0) {
  10696. type = ANIMATION;
  10697. timeout = animationTimeout;
  10698. propCount = animationDurations.length;
  10699. }
  10700. } else {
  10701. timeout = Math.max(transitionTimeout, animationTimeout);
  10702. type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
  10703. propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
  10704. }
  10705. const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
  10706. getStyleProperties(`${TRANSITION}Property`).toString()
  10707. );
  10708. return {
  10709. type,
  10710. timeout,
  10711. propCount,
  10712. hasTransform
  10713. };
  10714. }
  10715. function getTimeout(delays, durations) {
  10716. while (delays.length < durations.length) {
  10717. delays = delays.concat(delays);
  10718. }
  10719. return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
  10720. }
  10721. function toMs(s) {
  10722. if (s === "auto") return 0;
  10723. return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
  10724. }
  10725. function forceReflow() {
  10726. return document.body.offsetHeight;
  10727. }
  10728. function patchClass(el, value, isSVG) {
  10729. const transitionClasses = el[vtcKey];
  10730. if (transitionClasses) {
  10731. value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
  10732. }
  10733. if (value == null) {
  10734. el.removeAttribute("class");
  10735. } else if (isSVG) {
  10736. el.setAttribute("class", value);
  10737. } else {
  10738. el.className = value;
  10739. }
  10740. }
  10741. const vShowOriginalDisplay = Symbol("_vod");
  10742. const vShowHidden = Symbol("_vsh");
  10743. const vShow = {
  10744. beforeMount(el, { value }, { transition }) {
  10745. el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
  10746. if (transition && value) {
  10747. transition.beforeEnter(el);
  10748. } else {
  10749. setDisplay(el, value);
  10750. }
  10751. },
  10752. mounted(el, { value }, { transition }) {
  10753. if (transition && value) {
  10754. transition.enter(el);
  10755. }
  10756. },
  10757. updated(el, { value, oldValue }, { transition }) {
  10758. if (!value === !oldValue) return;
  10759. if (transition) {
  10760. if (value) {
  10761. transition.beforeEnter(el);
  10762. setDisplay(el, true);
  10763. transition.enter(el);
  10764. } else {
  10765. transition.leave(el, () => {
  10766. setDisplay(el, false);
  10767. });
  10768. }
  10769. } else {
  10770. setDisplay(el, value);
  10771. }
  10772. },
  10773. beforeUnmount(el, { value }) {
  10774. setDisplay(el, value);
  10775. }
  10776. };
  10777. {
  10778. vShow.name = "show";
  10779. }
  10780. function setDisplay(el, value) {
  10781. el.style.display = value ? el[vShowOriginalDisplay] : "none";
  10782. el[vShowHidden] = !value;
  10783. }
  10784. function initVShowForSSR() {
  10785. vShow.getSSRProps = ({ value }) => {
  10786. if (!value) {
  10787. return { style: { display: "none" } };
  10788. }
  10789. };
  10790. }
  10791. const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
  10792. function useCssVars(getter) {
  10793. const instance = getCurrentInstance();
  10794. if (!instance) {
  10795. warn(`useCssVars is called without current active component instance.`);
  10796. return;
  10797. }
  10798. const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
  10799. Array.from(
  10800. document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
  10801. ).forEach((node) => setVarsOnNode(node, vars));
  10802. };
  10803. {
  10804. instance.getCssVars = () => getter(instance.proxy);
  10805. }
  10806. const setVars = () => {
  10807. const vars = getter(instance.proxy);
  10808. if (instance.ce) {
  10809. setVarsOnNode(instance.ce, vars);
  10810. } else {
  10811. setVarsOnVNode(instance.subTree, vars);
  10812. }
  10813. updateTeleports(vars);
  10814. };
  10815. onBeforeMount(() => {
  10816. watchPostEffect(setVars);
  10817. });
  10818. onMounted(() => {
  10819. const ob = new MutationObserver(setVars);
  10820. ob.observe(instance.subTree.el.parentNode, { childList: true });
  10821. onUnmounted(() => ob.disconnect());
  10822. });
  10823. }
  10824. function setVarsOnVNode(vnode, vars) {
  10825. if (vnode.shapeFlag & 128) {
  10826. const suspense = vnode.suspense;
  10827. vnode = suspense.activeBranch;
  10828. if (suspense.pendingBranch && !suspense.isHydrating) {
  10829. suspense.effects.push(() => {
  10830. setVarsOnVNode(suspense.activeBranch, vars);
  10831. });
  10832. }
  10833. }
  10834. while (vnode.component) {
  10835. vnode = vnode.component.subTree;
  10836. }
  10837. if (vnode.shapeFlag & 1 && vnode.el) {
  10838. setVarsOnNode(vnode.el, vars);
  10839. } else if (vnode.type === Fragment) {
  10840. vnode.children.forEach((c) => setVarsOnVNode(c, vars));
  10841. } else if (vnode.type === Static) {
  10842. let { el, anchor } = vnode;
  10843. while (el) {
  10844. setVarsOnNode(el, vars);
  10845. if (el === anchor) break;
  10846. el = el.nextSibling;
  10847. }
  10848. }
  10849. }
  10850. function setVarsOnNode(el, vars) {
  10851. if (el.nodeType === 1) {
  10852. const style = el.style;
  10853. let cssText = "";
  10854. for (const key in vars) {
  10855. style.setProperty(`--${key}`, vars[key]);
  10856. cssText += `--${key}: ${vars[key]};`;
  10857. }
  10858. style[CSS_VAR_TEXT] = cssText;
  10859. }
  10860. }
  10861. const displayRE = /(^|;)\s*display\s*:/;
  10862. function patchStyle(el, prev, next) {
  10863. const style = el.style;
  10864. const isCssString = isString(next);
  10865. let hasControlledDisplay = false;
  10866. if (next && !isCssString) {
  10867. if (prev) {
  10868. if (!isString(prev)) {
  10869. for (const key in prev) {
  10870. if (next[key] == null) {
  10871. setStyle(style, key, "");
  10872. }
  10873. }
  10874. } else {
  10875. for (const prevStyle of prev.split(";")) {
  10876. const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
  10877. if (next[key] == null) {
  10878. setStyle(style, key, "");
  10879. }
  10880. }
  10881. }
  10882. }
  10883. for (const key in next) {
  10884. if (key === "display") {
  10885. hasControlledDisplay = true;
  10886. }
  10887. setStyle(style, key, next[key]);
  10888. }
  10889. } else {
  10890. if (isCssString) {
  10891. if (prev !== next) {
  10892. const cssVarText = style[CSS_VAR_TEXT];
  10893. if (cssVarText) {
  10894. next += ";" + cssVarText;
  10895. }
  10896. style.cssText = next;
  10897. hasControlledDisplay = displayRE.test(next);
  10898. }
  10899. } else if (prev) {
  10900. el.removeAttribute("style");
  10901. }
  10902. }
  10903. if (vShowOriginalDisplay in el) {
  10904. el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
  10905. if (el[vShowHidden]) {
  10906. style.display = "none";
  10907. }
  10908. }
  10909. }
  10910. const semicolonRE = /[^\\];\s*$/;
  10911. const importantRE = /\s*!important$/;
  10912. function setStyle(style, name, val) {
  10913. if (isArray(val)) {
  10914. val.forEach((v) => setStyle(style, name, v));
  10915. } else {
  10916. if (val == null) val = "";
  10917. {
  10918. if (semicolonRE.test(val)) {
  10919. warn(
  10920. `Unexpected semicolon at the end of '${name}' style value: '${val}'`
  10921. );
  10922. }
  10923. }
  10924. if (name.startsWith("--")) {
  10925. style.setProperty(name, val);
  10926. } else {
  10927. const prefixed = autoPrefix(style, name);
  10928. if (importantRE.test(val)) {
  10929. style.setProperty(
  10930. hyphenate(prefixed),
  10931. val.replace(importantRE, ""),
  10932. "important"
  10933. );
  10934. } else {
  10935. style[prefixed] = val;
  10936. }
  10937. }
  10938. }
  10939. }
  10940. const prefixes = ["Webkit", "Moz", "ms"];
  10941. const prefixCache = {};
  10942. function autoPrefix(style, rawName) {
  10943. const cached = prefixCache[rawName];
  10944. if (cached) {
  10945. return cached;
  10946. }
  10947. let name = camelize(rawName);
  10948. if (name !== "filter" && name in style) {
  10949. return prefixCache[rawName] = name;
  10950. }
  10951. name = capitalize(name);
  10952. for (let i = 0; i < prefixes.length; i++) {
  10953. const prefixed = prefixes[i] + name;
  10954. if (prefixed in style) {
  10955. return prefixCache[rawName] = prefixed;
  10956. }
  10957. }
  10958. return rawName;
  10959. }
  10960. const xlinkNS = "http://www.w3.org/1999/xlink";
  10961. function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
  10962. if (isSVG && key.startsWith("xlink:")) {
  10963. if (value == null) {
  10964. el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
  10965. } else {
  10966. el.setAttributeNS(xlinkNS, key, value);
  10967. }
  10968. } else {
  10969. if (value == null || isBoolean && !includeBooleanAttr(value)) {
  10970. el.removeAttribute(key);
  10971. } else {
  10972. el.setAttribute(
  10973. key,
  10974. isBoolean ? "" : isSymbol(value) ? String(value) : value
  10975. );
  10976. }
  10977. }
  10978. }
  10979. function patchDOMProp(el, key, value, parentComponent, attrName) {
  10980. if (key === "innerHTML" || key === "textContent") {
  10981. if (value != null) {
  10982. el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
  10983. }
  10984. return;
  10985. }
  10986. const tag = el.tagName;
  10987. if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
  10988. !tag.includes("-")) {
  10989. const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
  10990. const newValue = value == null ? (
  10991. // #11647: value should be set as empty string for null and undefined,
  10992. // but <input type="checkbox"> should be set as 'on'.
  10993. el.type === "checkbox" ? "on" : ""
  10994. ) : String(value);
  10995. if (oldValue !== newValue || !("_value" in el)) {
  10996. el.value = newValue;
  10997. }
  10998. if (value == null) {
  10999. el.removeAttribute(key);
  11000. }
  11001. el._value = value;
  11002. return;
  11003. }
  11004. let needRemove = false;
  11005. if (value === "" || value == null) {
  11006. const type = typeof el[key];
  11007. if (type === "boolean") {
  11008. value = includeBooleanAttr(value);
  11009. } else if (value == null && type === "string") {
  11010. value = "";
  11011. needRemove = true;
  11012. } else if (type === "number") {
  11013. value = 0;
  11014. needRemove = true;
  11015. }
  11016. }
  11017. try {
  11018. el[key] = value;
  11019. } catch (e) {
  11020. if (!needRemove) {
  11021. warn(
  11022. `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
  11023. e
  11024. );
  11025. }
  11026. }
  11027. needRemove && el.removeAttribute(attrName || key);
  11028. }
  11029. function addEventListener(el, event, handler, options) {
  11030. el.addEventListener(event, handler, options);
  11031. }
  11032. function removeEventListener(el, event, handler, options) {
  11033. el.removeEventListener(event, handler, options);
  11034. }
  11035. const veiKey = Symbol("_vei");
  11036. function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
  11037. const invokers = el[veiKey] || (el[veiKey] = {});
  11038. const existingInvoker = invokers[rawName];
  11039. if (nextValue && existingInvoker) {
  11040. existingInvoker.value = sanitizeEventValue(nextValue, rawName) ;
  11041. } else {
  11042. const [name, options] = parseName(rawName);
  11043. if (nextValue) {
  11044. const invoker = invokers[rawName] = createInvoker(
  11045. sanitizeEventValue(nextValue, rawName) ,
  11046. instance
  11047. );
  11048. addEventListener(el, name, invoker, options);
  11049. } else if (existingInvoker) {
  11050. removeEventListener(el, name, existingInvoker, options);
  11051. invokers[rawName] = void 0;
  11052. }
  11053. }
  11054. }
  11055. const optionsModifierRE = /(?:Once|Passive|Capture)$/;
  11056. function parseName(name) {
  11057. let options;
  11058. if (optionsModifierRE.test(name)) {
  11059. options = {};
  11060. let m;
  11061. while (m = name.match(optionsModifierRE)) {
  11062. name = name.slice(0, name.length - m[0].length);
  11063. options[m[0].toLowerCase()] = true;
  11064. }
  11065. }
  11066. const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
  11067. return [event, options];
  11068. }
  11069. let cachedNow = 0;
  11070. const p = /* @__PURE__ */ Promise.resolve();
  11071. const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
  11072. function createInvoker(initialValue, instance) {
  11073. const invoker = (e) => {
  11074. if (!e._vts) {
  11075. e._vts = Date.now();
  11076. } else if (e._vts <= invoker.attached) {
  11077. return;
  11078. }
  11079. callWithAsyncErrorHandling(
  11080. patchStopImmediatePropagation(e, invoker.value),
  11081. instance,
  11082. 5,
  11083. [e]
  11084. );
  11085. };
  11086. invoker.value = initialValue;
  11087. invoker.attached = getNow();
  11088. return invoker;
  11089. }
  11090. function sanitizeEventValue(value, propName) {
  11091. if (isFunction(value) || isArray(value)) {
  11092. return value;
  11093. }
  11094. warn(
  11095. `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?
  11096. Expected function or array of functions, received type ${typeof value}.`
  11097. );
  11098. return NOOP;
  11099. }
  11100. function patchStopImmediatePropagation(e, value) {
  11101. if (isArray(value)) {
  11102. const originalStop = e.stopImmediatePropagation;
  11103. e.stopImmediatePropagation = () => {
  11104. originalStop.call(e);
  11105. e._stopped = true;
  11106. };
  11107. return value.map(
  11108. (fn) => (e2) => !e2._stopped && fn && fn(e2)
  11109. );
  11110. } else {
  11111. return value;
  11112. }
  11113. }
  11114. const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
  11115. key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
  11116. const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
  11117. const isSVG = namespace === "svg";
  11118. if (key === "class") {
  11119. patchClass(el, nextValue, isSVG);
  11120. } else if (key === "style") {
  11121. patchStyle(el, prevValue, nextValue);
  11122. } else if (isOn(key)) {
  11123. if (!isModelListener(key)) {
  11124. patchEvent(el, key, prevValue, nextValue, parentComponent);
  11125. }
  11126. } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
  11127. patchDOMProp(el, key, nextValue);
  11128. if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
  11129. patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
  11130. }
  11131. } else if (
  11132. // #11081 force set props for possible async custom element
  11133. el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
  11134. ) {
  11135. patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
  11136. } else {
  11137. if (key === "true-value") {
  11138. el._trueValue = nextValue;
  11139. } else if (key === "false-value") {
  11140. el._falseValue = nextValue;
  11141. }
  11142. patchAttr(el, key, nextValue, isSVG);
  11143. }
  11144. };
  11145. function shouldSetAsProp(el, key, value, isSVG) {
  11146. if (isSVG) {
  11147. if (key === "innerHTML" || key === "textContent") {
  11148. return true;
  11149. }
  11150. if (key in el && isNativeOn(key) && isFunction(value)) {
  11151. return true;
  11152. }
  11153. return false;
  11154. }
  11155. if (key === "spellcheck" || key === "draggable" || key === "translate") {
  11156. return false;
  11157. }
  11158. if (key === "form") {
  11159. return false;
  11160. }
  11161. if (key === "list" && el.tagName === "INPUT") {
  11162. return false;
  11163. }
  11164. if (key === "type" && el.tagName === "TEXTAREA") {
  11165. return false;
  11166. }
  11167. if (key === "width" || key === "height") {
  11168. const tag = el.tagName;
  11169. if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
  11170. return false;
  11171. }
  11172. }
  11173. if (isNativeOn(key) && isString(value)) {
  11174. return false;
  11175. }
  11176. return key in el;
  11177. }
  11178. const REMOVAL = {};
  11179. /*! #__NO_SIDE_EFFECTS__ */
  11180. // @__NO_SIDE_EFFECTS__
  11181. function defineCustomElement(options, extraOptions, _createApp) {
  11182. const Comp = defineComponent(options, extraOptions);
  11183. if (isPlainObject(Comp)) extend(Comp, extraOptions);
  11184. class VueCustomElement extends VueElement {
  11185. constructor(initialProps) {
  11186. super(Comp, initialProps, _createApp);
  11187. }
  11188. }
  11189. VueCustomElement.def = Comp;
  11190. return VueCustomElement;
  11191. }
  11192. /*! #__NO_SIDE_EFFECTS__ */
  11193. const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
  11194. return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
  11195. };
  11196. const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
  11197. };
  11198. class VueElement extends BaseClass {
  11199. constructor(_def, _props = {}, _createApp = createApp) {
  11200. super();
  11201. this._def = _def;
  11202. this._props = _props;
  11203. this._createApp = _createApp;
  11204. this._isVueCE = true;
  11205. /**
  11206. * @internal
  11207. */
  11208. this._instance = null;
  11209. /**
  11210. * @internal
  11211. */
  11212. this._app = null;
  11213. /**
  11214. * @internal
  11215. */
  11216. this._nonce = this._def.nonce;
  11217. this._connected = false;
  11218. this._resolved = false;
  11219. this._numberProps = null;
  11220. this._styleChildren = /* @__PURE__ */ new WeakSet();
  11221. this._ob = null;
  11222. if (this.shadowRoot && _createApp !== createApp) {
  11223. this._root = this.shadowRoot;
  11224. } else {
  11225. if (this.shadowRoot) {
  11226. warn(
  11227. `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
  11228. );
  11229. }
  11230. if (_def.shadowRoot !== false) {
  11231. this.attachShadow({ mode: "open" });
  11232. this._root = this.shadowRoot;
  11233. } else {
  11234. this._root = this;
  11235. }
  11236. }
  11237. if (!this._def.__asyncLoader) {
  11238. this._resolveProps(this._def);
  11239. }
  11240. }
  11241. connectedCallback() {
  11242. if (!this.isConnected) return;
  11243. if (!this.shadowRoot) {
  11244. this._parseSlots();
  11245. }
  11246. this._connected = true;
  11247. let parent = this;
  11248. while (parent = parent && (parent.parentNode || parent.host)) {
  11249. if (parent instanceof VueElement) {
  11250. this._parent = parent;
  11251. break;
  11252. }
  11253. }
  11254. if (!this._instance) {
  11255. if (this._resolved) {
  11256. this._setParent();
  11257. this._update();
  11258. } else {
  11259. if (parent && parent._pendingResolve) {
  11260. this._pendingResolve = parent._pendingResolve.then(() => {
  11261. this._pendingResolve = void 0;
  11262. this._resolveDef();
  11263. });
  11264. } else {
  11265. this._resolveDef();
  11266. }
  11267. }
  11268. }
  11269. }
  11270. _setParent(parent = this._parent) {
  11271. if (parent) {
  11272. this._instance.parent = parent._instance;
  11273. this._instance.provides = parent._instance.provides;
  11274. }
  11275. }
  11276. disconnectedCallback() {
  11277. this._connected = false;
  11278. nextTick(() => {
  11279. if (!this._connected) {
  11280. if (this._ob) {
  11281. this._ob.disconnect();
  11282. this._ob = null;
  11283. }
  11284. this._app && this._app.unmount();
  11285. if (this._instance) this._instance.ce = void 0;
  11286. this._app = this._instance = null;
  11287. }
  11288. });
  11289. }
  11290. /**
  11291. * resolve inner component definition (handle possible async component)
  11292. */
  11293. _resolveDef() {
  11294. if (this._pendingResolve) {
  11295. return;
  11296. }
  11297. for (let i = 0; i < this.attributes.length; i++) {
  11298. this._setAttr(this.attributes[i].name);
  11299. }
  11300. this._ob = new MutationObserver((mutations) => {
  11301. for (const m of mutations) {
  11302. this._setAttr(m.attributeName);
  11303. }
  11304. });
  11305. this._ob.observe(this, { attributes: true });
  11306. const resolve = (def, isAsync = false) => {
  11307. this._resolved = true;
  11308. this._pendingResolve = void 0;
  11309. const { props, styles } = def;
  11310. let numberProps;
  11311. if (props && !isArray(props)) {
  11312. for (const key in props) {
  11313. const opt = props[key];
  11314. if (opt === Number || opt && opt.type === Number) {
  11315. if (key in this._props) {
  11316. this._props[key] = toNumber(this._props[key]);
  11317. }
  11318. (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
  11319. }
  11320. }
  11321. }
  11322. this._numberProps = numberProps;
  11323. if (isAsync) {
  11324. this._resolveProps(def);
  11325. }
  11326. if (this.shadowRoot) {
  11327. this._applyStyles(styles);
  11328. } else if (styles) {
  11329. warn(
  11330. "Custom element style injection is not supported when using shadowRoot: false"
  11331. );
  11332. }
  11333. this._mount(def);
  11334. };
  11335. const asyncDef = this._def.__asyncLoader;
  11336. if (asyncDef) {
  11337. this._pendingResolve = asyncDef().then(
  11338. (def) => resolve(this._def = def, true)
  11339. );
  11340. } else {
  11341. resolve(this._def);
  11342. }
  11343. }
  11344. _mount(def) {
  11345. if (!def.name) {
  11346. def.name = "VueElement";
  11347. }
  11348. this._app = this._createApp(def);
  11349. if (def.configureApp) {
  11350. def.configureApp(this._app);
  11351. }
  11352. this._app._ceVNode = this._createVNode();
  11353. this._app.mount(this._root);
  11354. const exposed = this._instance && this._instance.exposed;
  11355. if (!exposed) return;
  11356. for (const key in exposed) {
  11357. if (!hasOwn(this, key)) {
  11358. Object.defineProperty(this, key, {
  11359. // unwrap ref to be consistent with public instance behavior
  11360. get: () => unref(exposed[key])
  11361. });
  11362. } else {
  11363. warn(`Exposed property "${key}" already exists on custom element.`);
  11364. }
  11365. }
  11366. }
  11367. _resolveProps(def) {
  11368. const { props } = def;
  11369. const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
  11370. for (const key of Object.keys(this)) {
  11371. if (key[0] !== "_" && declaredPropKeys.includes(key)) {
  11372. this._setProp(key, this[key]);
  11373. }
  11374. }
  11375. for (const key of declaredPropKeys.map(camelize)) {
  11376. Object.defineProperty(this, key, {
  11377. get() {
  11378. return this._getProp(key);
  11379. },
  11380. set(val) {
  11381. this._setProp(key, val, true, true);
  11382. }
  11383. });
  11384. }
  11385. }
  11386. _setAttr(key) {
  11387. if (key.startsWith("data-v-")) return;
  11388. const has = this.hasAttribute(key);
  11389. let value = has ? this.getAttribute(key) : REMOVAL;
  11390. const camelKey = camelize(key);
  11391. if (has && this._numberProps && this._numberProps[camelKey]) {
  11392. value = toNumber(value);
  11393. }
  11394. this._setProp(camelKey, value, false, true);
  11395. }
  11396. /**
  11397. * @internal
  11398. */
  11399. _getProp(key) {
  11400. return this._props[key];
  11401. }
  11402. /**
  11403. * @internal
  11404. */
  11405. _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
  11406. if (val !== this._props[key]) {
  11407. if (val === REMOVAL) {
  11408. delete this._props[key];
  11409. } else {
  11410. this._props[key] = val;
  11411. if (key === "key" && this._app) {
  11412. this._app._ceVNode.key = val;
  11413. }
  11414. }
  11415. if (shouldUpdate && this._instance) {
  11416. this._update();
  11417. }
  11418. if (shouldReflect) {
  11419. if (val === true) {
  11420. this.setAttribute(hyphenate(key), "");
  11421. } else if (typeof val === "string" || typeof val === "number") {
  11422. this.setAttribute(hyphenate(key), val + "");
  11423. } else if (!val) {
  11424. this.removeAttribute(hyphenate(key));
  11425. }
  11426. }
  11427. }
  11428. }
  11429. _update() {
  11430. render(this._createVNode(), this._root);
  11431. }
  11432. _createVNode() {
  11433. const baseProps = {};
  11434. if (!this.shadowRoot) {
  11435. baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
  11436. }
  11437. const vnode = createVNode(this._def, extend(baseProps, this._props));
  11438. if (!this._instance) {
  11439. vnode.ce = (instance) => {
  11440. this._instance = instance;
  11441. instance.ce = this;
  11442. instance.isCE = true;
  11443. {
  11444. instance.ceReload = (newStyles) => {
  11445. if (this._styles) {
  11446. this._styles.forEach((s) => this._root.removeChild(s));
  11447. this._styles.length = 0;
  11448. }
  11449. this._applyStyles(newStyles);
  11450. this._instance = null;
  11451. this._update();
  11452. };
  11453. }
  11454. const dispatch = (event, args) => {
  11455. this.dispatchEvent(
  11456. new CustomEvent(
  11457. event,
  11458. isPlainObject(args[0]) ? extend({ detail: args }, args[0]) : { detail: args }
  11459. )
  11460. );
  11461. };
  11462. instance.emit = (event, ...args) => {
  11463. dispatch(event, args);
  11464. if (hyphenate(event) !== event) {
  11465. dispatch(hyphenate(event), args);
  11466. }
  11467. };
  11468. this._setParent();
  11469. };
  11470. }
  11471. return vnode;
  11472. }
  11473. _applyStyles(styles, owner) {
  11474. if (!styles) return;
  11475. if (owner) {
  11476. if (owner === this._def || this._styleChildren.has(owner)) {
  11477. return;
  11478. }
  11479. this._styleChildren.add(owner);
  11480. }
  11481. const nonce = this._nonce;
  11482. for (let i = styles.length - 1; i >= 0; i--) {
  11483. const s = document.createElement("style");
  11484. if (nonce) s.setAttribute("nonce", nonce);
  11485. s.textContent = styles[i];
  11486. this.shadowRoot.prepend(s);
  11487. {
  11488. if (owner) {
  11489. if (owner.__hmrId) {
  11490. if (!this._childStyles) this._childStyles = /* @__PURE__ */ new Map();
  11491. let entry = this._childStyles.get(owner.__hmrId);
  11492. if (!entry) {
  11493. this._childStyles.set(owner.__hmrId, entry = []);
  11494. }
  11495. entry.push(s);
  11496. }
  11497. } else {
  11498. (this._styles || (this._styles = [])).push(s);
  11499. }
  11500. }
  11501. }
  11502. }
  11503. /**
  11504. * Only called when shadowRoot is false
  11505. */
  11506. _parseSlots() {
  11507. const slots = this._slots = {};
  11508. let n;
  11509. while (n = this.firstChild) {
  11510. const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default";
  11511. (slots[slotName] || (slots[slotName] = [])).push(n);
  11512. this.removeChild(n);
  11513. }
  11514. }
  11515. /**
  11516. * Only called when shadowRoot is false
  11517. */
  11518. _renderSlots() {
  11519. const outlets = (this._teleportTarget || this).querySelectorAll("slot");
  11520. const scopeId = this._instance.type.__scopeId;
  11521. for (let i = 0; i < outlets.length; i++) {
  11522. const o = outlets[i];
  11523. const slotName = o.getAttribute("name") || "default";
  11524. const content = this._slots[slotName];
  11525. const parent = o.parentNode;
  11526. if (content) {
  11527. for (const n of content) {
  11528. if (scopeId && n.nodeType === 1) {
  11529. const id = scopeId + "-s";
  11530. const walker = document.createTreeWalker(n, 1);
  11531. n.setAttribute(id, "");
  11532. let child;
  11533. while (child = walker.nextNode()) {
  11534. child.setAttribute(id, "");
  11535. }
  11536. }
  11537. parent.insertBefore(n, o);
  11538. }
  11539. } else {
  11540. while (o.firstChild) parent.insertBefore(o.firstChild, o);
  11541. }
  11542. parent.removeChild(o);
  11543. }
  11544. }
  11545. /**
  11546. * @internal
  11547. */
  11548. _injectChildStyle(comp) {
  11549. this._applyStyles(comp.styles, comp);
  11550. }
  11551. /**
  11552. * @internal
  11553. */
  11554. _removeChildStyle(comp) {
  11555. {
  11556. this._styleChildren.delete(comp);
  11557. if (this._childStyles && comp.__hmrId) {
  11558. const oldStyles = this._childStyles.get(comp.__hmrId);
  11559. if (oldStyles) {
  11560. oldStyles.forEach((s) => this._root.removeChild(s));
  11561. oldStyles.length = 0;
  11562. }
  11563. }
  11564. }
  11565. }
  11566. }
  11567. function useHost(caller) {
  11568. const instance = getCurrentInstance();
  11569. const el = instance && instance.ce;
  11570. if (el) {
  11571. return el;
  11572. } else {
  11573. if (!instance) {
  11574. warn(
  11575. `${caller || "useHost"} called without an active component instance.`
  11576. );
  11577. } else {
  11578. warn(
  11579. `${caller || "useHost"} can only be used in components defined via defineCustomElement.`
  11580. );
  11581. }
  11582. }
  11583. return null;
  11584. }
  11585. function useShadowRoot() {
  11586. const el = useHost("useShadowRoot") ;
  11587. return el && el.shadowRoot;
  11588. }
  11589. function useCssModule(name = "$style") {
  11590. {
  11591. const instance = getCurrentInstance();
  11592. if (!instance) {
  11593. warn(`useCssModule must be called inside setup()`);
  11594. return EMPTY_OBJ;
  11595. }
  11596. const modules = instance.type.__cssModules;
  11597. if (!modules) {
  11598. warn(`Current instance does not have CSS modules injected.`);
  11599. return EMPTY_OBJ;
  11600. }
  11601. const mod = modules[name];
  11602. if (!mod) {
  11603. warn(`Current instance does not have CSS module named "${name}".`);
  11604. return EMPTY_OBJ;
  11605. }
  11606. return mod;
  11607. }
  11608. }
  11609. const positionMap = /* @__PURE__ */ new WeakMap();
  11610. const newPositionMap = /* @__PURE__ */ new WeakMap();
  11611. const moveCbKey = Symbol("_moveCb");
  11612. const enterCbKey = Symbol("_enterCb");
  11613. const decorate = (t) => {
  11614. delete t.props.mode;
  11615. return t;
  11616. };
  11617. const TransitionGroupImpl = /* @__PURE__ */ decorate({
  11618. name: "TransitionGroup",
  11619. props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
  11620. tag: String,
  11621. moveClass: String
  11622. }),
  11623. setup(props, { slots }) {
  11624. const instance = getCurrentInstance();
  11625. const state = useTransitionState();
  11626. let prevChildren;
  11627. let children;
  11628. onUpdated(() => {
  11629. if (!prevChildren.length) {
  11630. return;
  11631. }
  11632. const moveClass = props.moveClass || `${props.name || "v"}-move`;
  11633. if (!hasCSSTransform(
  11634. prevChildren[0].el,
  11635. instance.vnode.el,
  11636. moveClass
  11637. )) {
  11638. return;
  11639. }
  11640. prevChildren.forEach(callPendingCbs);
  11641. prevChildren.forEach(recordPosition);
  11642. const movedChildren = prevChildren.filter(applyTranslation);
  11643. forceReflow();
  11644. movedChildren.forEach((c) => {
  11645. const el = c.el;
  11646. const style = el.style;
  11647. addTransitionClass(el, moveClass);
  11648. style.transform = style.webkitTransform = style.transitionDuration = "";
  11649. const cb = el[moveCbKey] = (e) => {
  11650. if (e && e.target !== el) {
  11651. return;
  11652. }
  11653. if (!e || /transform$/.test(e.propertyName)) {
  11654. el.removeEventListener("transitionend", cb);
  11655. el[moveCbKey] = null;
  11656. removeTransitionClass(el, moveClass);
  11657. }
  11658. };
  11659. el.addEventListener("transitionend", cb);
  11660. });
  11661. });
  11662. return () => {
  11663. const rawProps = toRaw(props);
  11664. const cssTransitionProps = resolveTransitionProps(rawProps);
  11665. let tag = rawProps.tag || Fragment;
  11666. prevChildren = [];
  11667. if (children) {
  11668. for (let i = 0; i < children.length; i++) {
  11669. const child = children[i];
  11670. if (child.el && child.el instanceof Element) {
  11671. prevChildren.push(child);
  11672. setTransitionHooks(
  11673. child,
  11674. resolveTransitionHooks(
  11675. child,
  11676. cssTransitionProps,
  11677. state,
  11678. instance
  11679. )
  11680. );
  11681. positionMap.set(
  11682. child,
  11683. child.el.getBoundingClientRect()
  11684. );
  11685. }
  11686. }
  11687. }
  11688. children = slots.default ? getTransitionRawChildren(slots.default()) : [];
  11689. for (let i = 0; i < children.length; i++) {
  11690. const child = children[i];
  11691. if (child.key != null) {
  11692. setTransitionHooks(
  11693. child,
  11694. resolveTransitionHooks(child, cssTransitionProps, state, instance)
  11695. );
  11696. } else if (child.type !== Text) {
  11697. warn(`<TransitionGroup> children must be keyed.`);
  11698. }
  11699. }
  11700. return createVNode(tag, null, children);
  11701. };
  11702. }
  11703. });
  11704. const TransitionGroup = TransitionGroupImpl;
  11705. function callPendingCbs(c) {
  11706. const el = c.el;
  11707. if (el[moveCbKey]) {
  11708. el[moveCbKey]();
  11709. }
  11710. if (el[enterCbKey]) {
  11711. el[enterCbKey]();
  11712. }
  11713. }
  11714. function recordPosition(c) {
  11715. newPositionMap.set(c, c.el.getBoundingClientRect());
  11716. }
  11717. function applyTranslation(c) {
  11718. const oldPos = positionMap.get(c);
  11719. const newPos = newPositionMap.get(c);
  11720. const dx = oldPos.left - newPos.left;
  11721. const dy = oldPos.top - newPos.top;
  11722. if (dx || dy) {
  11723. const s = c.el.style;
  11724. s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
  11725. s.transitionDuration = "0s";
  11726. return c;
  11727. }
  11728. }
  11729. function hasCSSTransform(el, root, moveClass) {
  11730. const clone = el.cloneNode();
  11731. const _vtc = el[vtcKey];
  11732. if (_vtc) {
  11733. _vtc.forEach((cls) => {
  11734. cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
  11735. });
  11736. }
  11737. moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c));
  11738. clone.style.display = "none";
  11739. const container = root.nodeType === 1 ? root : root.parentNode;
  11740. container.appendChild(clone);
  11741. const { hasTransform } = getTransitionInfo(clone);
  11742. container.removeChild(clone);
  11743. return hasTransform;
  11744. }
  11745. const getModelAssigner = (vnode) => {
  11746. const fn = vnode.props["onUpdate:modelValue"] || false;
  11747. return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn;
  11748. };
  11749. function onCompositionStart(e) {
  11750. e.target.composing = true;
  11751. }
  11752. function onCompositionEnd(e) {
  11753. const target = e.target;
  11754. if (target.composing) {
  11755. target.composing = false;
  11756. target.dispatchEvent(new Event("input"));
  11757. }
  11758. }
  11759. const assignKey = Symbol("_assign");
  11760. const vModelText = {
  11761. created(el, { modifiers: { lazy, trim, number } }, vnode) {
  11762. el[assignKey] = getModelAssigner(vnode);
  11763. const castToNumber = number || vnode.props && vnode.props.type === "number";
  11764. addEventListener(el, lazy ? "change" : "input", (e) => {
  11765. if (e.target.composing) return;
  11766. let domValue = el.value;
  11767. if (trim) {
  11768. domValue = domValue.trim();
  11769. }
  11770. if (castToNumber) {
  11771. domValue = looseToNumber(domValue);
  11772. }
  11773. el[assignKey](domValue);
  11774. });
  11775. if (trim) {
  11776. addEventListener(el, "change", () => {
  11777. el.value = el.value.trim();
  11778. });
  11779. }
  11780. if (!lazy) {
  11781. addEventListener(el, "compositionstart", onCompositionStart);
  11782. addEventListener(el, "compositionend", onCompositionEnd);
  11783. addEventListener(el, "change", onCompositionEnd);
  11784. }
  11785. },
  11786. // set value on mounted so it's after min/max for type="range"
  11787. mounted(el, { value }) {
  11788. el.value = value == null ? "" : value;
  11789. },
  11790. beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
  11791. el[assignKey] = getModelAssigner(vnode);
  11792. if (el.composing) return;
  11793. const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
  11794. const newValue = value == null ? "" : value;
  11795. if (elValue === newValue) {
  11796. return;
  11797. }
  11798. if (document.activeElement === el && el.type !== "range") {
  11799. if (lazy && value === oldValue) {
  11800. return;
  11801. }
  11802. if (trim && el.value.trim() === newValue) {
  11803. return;
  11804. }
  11805. }
  11806. el.value = newValue;
  11807. }
  11808. };
  11809. const vModelCheckbox = {
  11810. // #4096 array checkboxes need to be deep traversed
  11811. deep: true,
  11812. created(el, _, vnode) {
  11813. el[assignKey] = getModelAssigner(vnode);
  11814. addEventListener(el, "change", () => {
  11815. const modelValue = el._modelValue;
  11816. const elementValue = getValue(el);
  11817. const checked = el.checked;
  11818. const assign = el[assignKey];
  11819. if (isArray(modelValue)) {
  11820. const index = looseIndexOf(modelValue, elementValue);
  11821. const found = index !== -1;
  11822. if (checked && !found) {
  11823. assign(modelValue.concat(elementValue));
  11824. } else if (!checked && found) {
  11825. const filtered = [...modelValue];
  11826. filtered.splice(index, 1);
  11827. assign(filtered);
  11828. }
  11829. } else if (isSet(modelValue)) {
  11830. const cloned = new Set(modelValue);
  11831. if (checked) {
  11832. cloned.add(elementValue);
  11833. } else {
  11834. cloned.delete(elementValue);
  11835. }
  11836. assign(cloned);
  11837. } else {
  11838. assign(getCheckboxValue(el, checked));
  11839. }
  11840. });
  11841. },
  11842. // set initial checked on mount to wait for true-value/false-value
  11843. mounted: setChecked,
  11844. beforeUpdate(el, binding, vnode) {
  11845. el[assignKey] = getModelAssigner(vnode);
  11846. setChecked(el, binding, vnode);
  11847. }
  11848. };
  11849. function setChecked(el, { value, oldValue }, vnode) {
  11850. el._modelValue = value;
  11851. let checked;
  11852. if (isArray(value)) {
  11853. checked = looseIndexOf(value, vnode.props.value) > -1;
  11854. } else if (isSet(value)) {
  11855. checked = value.has(vnode.props.value);
  11856. } else {
  11857. if (value === oldValue) return;
  11858. checked = looseEqual(value, getCheckboxValue(el, true));
  11859. }
  11860. if (el.checked !== checked) {
  11861. el.checked = checked;
  11862. }
  11863. }
  11864. const vModelRadio = {
  11865. created(el, { value }, vnode) {
  11866. el.checked = looseEqual(value, vnode.props.value);
  11867. el[assignKey] = getModelAssigner(vnode);
  11868. addEventListener(el, "change", () => {
  11869. el[assignKey](getValue(el));
  11870. });
  11871. },
  11872. beforeUpdate(el, { value, oldValue }, vnode) {
  11873. el[assignKey] = getModelAssigner(vnode);
  11874. if (value !== oldValue) {
  11875. el.checked = looseEqual(value, vnode.props.value);
  11876. }
  11877. }
  11878. };
  11879. const vModelSelect = {
  11880. // <select multiple> value need to be deep traversed
  11881. deep: true,
  11882. created(el, { value, modifiers: { number } }, vnode) {
  11883. const isSetModel = isSet(value);
  11884. addEventListener(el, "change", () => {
  11885. const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
  11886. (o) => number ? looseToNumber(getValue(o)) : getValue(o)
  11887. );
  11888. el[assignKey](
  11889. el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
  11890. );
  11891. el._assigning = true;
  11892. nextTick(() => {
  11893. el._assigning = false;
  11894. });
  11895. });
  11896. el[assignKey] = getModelAssigner(vnode);
  11897. },
  11898. // set value in mounted & updated because <select> relies on its children
  11899. // <option>s.
  11900. mounted(el, { value }) {
  11901. setSelected(el, value);
  11902. },
  11903. beforeUpdate(el, _binding, vnode) {
  11904. el[assignKey] = getModelAssigner(vnode);
  11905. },
  11906. updated(el, { value }) {
  11907. if (!el._assigning) {
  11908. setSelected(el, value);
  11909. }
  11910. }
  11911. };
  11912. function setSelected(el, value) {
  11913. const isMultiple = el.multiple;
  11914. const isArrayValue = isArray(value);
  11915. if (isMultiple && !isArrayValue && !isSet(value)) {
  11916. warn(
  11917. `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.`
  11918. );
  11919. return;
  11920. }
  11921. for (let i = 0, l = el.options.length; i < l; i++) {
  11922. const option = el.options[i];
  11923. const optionValue = getValue(option);
  11924. if (isMultiple) {
  11925. if (isArrayValue) {
  11926. const optionType = typeof optionValue;
  11927. if (optionType === "string" || optionType === "number") {
  11928. option.selected = value.some((v) => String(v) === String(optionValue));
  11929. } else {
  11930. option.selected = looseIndexOf(value, optionValue) > -1;
  11931. }
  11932. } else {
  11933. option.selected = value.has(optionValue);
  11934. }
  11935. } else if (looseEqual(getValue(option), value)) {
  11936. if (el.selectedIndex !== i) el.selectedIndex = i;
  11937. return;
  11938. }
  11939. }
  11940. if (!isMultiple && el.selectedIndex !== -1) {
  11941. el.selectedIndex = -1;
  11942. }
  11943. }
  11944. function getValue(el) {
  11945. return "_value" in el ? el._value : el.value;
  11946. }
  11947. function getCheckboxValue(el, checked) {
  11948. const key = checked ? "_trueValue" : "_falseValue";
  11949. return key in el ? el[key] : checked;
  11950. }
  11951. const vModelDynamic = {
  11952. created(el, binding, vnode) {
  11953. callModelHook(el, binding, vnode, null, "created");
  11954. },
  11955. mounted(el, binding, vnode) {
  11956. callModelHook(el, binding, vnode, null, "mounted");
  11957. },
  11958. beforeUpdate(el, binding, vnode, prevVNode) {
  11959. callModelHook(el, binding, vnode, prevVNode, "beforeUpdate");
  11960. },
  11961. updated(el, binding, vnode, prevVNode) {
  11962. callModelHook(el, binding, vnode, prevVNode, "updated");
  11963. }
  11964. };
  11965. function resolveDynamicModel(tagName, type) {
  11966. switch (tagName) {
  11967. case "SELECT":
  11968. return vModelSelect;
  11969. case "TEXTAREA":
  11970. return vModelText;
  11971. default:
  11972. switch (type) {
  11973. case "checkbox":
  11974. return vModelCheckbox;
  11975. case "radio":
  11976. return vModelRadio;
  11977. default:
  11978. return vModelText;
  11979. }
  11980. }
  11981. }
  11982. function callModelHook(el, binding, vnode, prevVNode, hook) {
  11983. const modelToUse = resolveDynamicModel(
  11984. el.tagName,
  11985. vnode.props && vnode.props.type
  11986. );
  11987. const fn = modelToUse[hook];
  11988. fn && fn(el, binding, vnode, prevVNode);
  11989. }
  11990. function initVModelForSSR() {
  11991. vModelText.getSSRProps = ({ value }) => ({ value });
  11992. vModelRadio.getSSRProps = ({ value }, vnode) => {
  11993. if (vnode.props && looseEqual(vnode.props.value, value)) {
  11994. return { checked: true };
  11995. }
  11996. };
  11997. vModelCheckbox.getSSRProps = ({ value }, vnode) => {
  11998. if (isArray(value)) {
  11999. if (vnode.props && looseIndexOf(value, vnode.props.value) > -1) {
  12000. return { checked: true };
  12001. }
  12002. } else if (isSet(value)) {
  12003. if (vnode.props && value.has(vnode.props.value)) {
  12004. return { checked: true };
  12005. }
  12006. } else if (value) {
  12007. return { checked: true };
  12008. }
  12009. };
  12010. vModelDynamic.getSSRProps = (binding, vnode) => {
  12011. if (typeof vnode.type !== "string") {
  12012. return;
  12013. }
  12014. const modelToUse = resolveDynamicModel(
  12015. // resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase
  12016. vnode.type.toUpperCase(),
  12017. vnode.props && vnode.props.type
  12018. );
  12019. if (modelToUse.getSSRProps) {
  12020. return modelToUse.getSSRProps(binding, vnode);
  12021. }
  12022. };
  12023. }
  12024. const systemModifiers = ["ctrl", "shift", "alt", "meta"];
  12025. const modifierGuards = {
  12026. stop: (e) => e.stopPropagation(),
  12027. prevent: (e) => e.preventDefault(),
  12028. self: (e) => e.target !== e.currentTarget,
  12029. ctrl: (e) => !e.ctrlKey,
  12030. shift: (e) => !e.shiftKey,
  12031. alt: (e) => !e.altKey,
  12032. meta: (e) => !e.metaKey,
  12033. left: (e) => "button" in e && e.button !== 0,
  12034. middle: (e) => "button" in e && e.button !== 1,
  12035. right: (e) => "button" in e && e.button !== 2,
  12036. exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
  12037. };
  12038. const withModifiers = (fn, modifiers) => {
  12039. const cache = fn._withMods || (fn._withMods = {});
  12040. const cacheKey = modifiers.join(".");
  12041. return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
  12042. for (let i = 0; i < modifiers.length; i++) {
  12043. const guard = modifierGuards[modifiers[i]];
  12044. if (guard && guard(event, modifiers)) return;
  12045. }
  12046. return fn(event, ...args);
  12047. });
  12048. };
  12049. const keyNames = {
  12050. esc: "escape",
  12051. space: " ",
  12052. up: "arrow-up",
  12053. left: "arrow-left",
  12054. right: "arrow-right",
  12055. down: "arrow-down",
  12056. delete: "backspace"
  12057. };
  12058. const withKeys = (fn, modifiers) => {
  12059. const cache = fn._withKeys || (fn._withKeys = {});
  12060. const cacheKey = modifiers.join(".");
  12061. return cache[cacheKey] || (cache[cacheKey] = (event) => {
  12062. if (!("key" in event)) {
  12063. return;
  12064. }
  12065. const eventKey = hyphenate(event.key);
  12066. if (modifiers.some(
  12067. (k) => k === eventKey || keyNames[k] === eventKey
  12068. )) {
  12069. return fn(event);
  12070. }
  12071. });
  12072. };
  12073. const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
  12074. let renderer;
  12075. let enabledHydration = false;
  12076. function ensureRenderer() {
  12077. return renderer || (renderer = createRenderer(rendererOptions));
  12078. }
  12079. function ensureHydrationRenderer() {
  12080. renderer = enabledHydration ? renderer : createHydrationRenderer(rendererOptions);
  12081. enabledHydration = true;
  12082. return renderer;
  12083. }
  12084. const render = (...args) => {
  12085. ensureRenderer().render(...args);
  12086. };
  12087. const hydrate = (...args) => {
  12088. ensureHydrationRenderer().hydrate(...args);
  12089. };
  12090. const createApp = (...args) => {
  12091. const app = ensureRenderer().createApp(...args);
  12092. {
  12093. injectNativeTagCheck(app);
  12094. injectCompilerOptionsCheck(app);
  12095. }
  12096. const { mount } = app;
  12097. app.mount = (containerOrSelector) => {
  12098. const container = normalizeContainer(containerOrSelector);
  12099. if (!container) return;
  12100. const component = app._component;
  12101. if (!isFunction(component) && !component.render && !component.template) {
  12102. component.template = container.innerHTML;
  12103. }
  12104. if (container.nodeType === 1) {
  12105. container.textContent = "";
  12106. }
  12107. const proxy = mount(container, false, resolveRootNamespace(container));
  12108. if (container instanceof Element) {
  12109. container.removeAttribute("v-cloak");
  12110. container.setAttribute("data-v-app", "");
  12111. }
  12112. return proxy;
  12113. };
  12114. return app;
  12115. };
  12116. const createSSRApp = (...args) => {
  12117. const app = ensureHydrationRenderer().createApp(...args);
  12118. {
  12119. injectNativeTagCheck(app);
  12120. injectCompilerOptionsCheck(app);
  12121. }
  12122. const { mount } = app;
  12123. app.mount = (containerOrSelector) => {
  12124. const container = normalizeContainer(containerOrSelector);
  12125. if (container) {
  12126. return mount(container, true, resolveRootNamespace(container));
  12127. }
  12128. };
  12129. return app;
  12130. };
  12131. function resolveRootNamespace(container) {
  12132. if (container instanceof SVGElement) {
  12133. return "svg";
  12134. }
  12135. if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
  12136. return "mathml";
  12137. }
  12138. }
  12139. function injectNativeTagCheck(app) {
  12140. Object.defineProperty(app.config, "isNativeTag", {
  12141. value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
  12142. writable: false
  12143. });
  12144. }
  12145. function injectCompilerOptionsCheck(app) {
  12146. if (isRuntimeOnly()) {
  12147. const isCustomElement = app.config.isCustomElement;
  12148. Object.defineProperty(app.config, "isCustomElement", {
  12149. get() {
  12150. return isCustomElement;
  12151. },
  12152. set() {
  12153. warn(
  12154. `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.`
  12155. );
  12156. }
  12157. });
  12158. const compilerOptions = app.config.compilerOptions;
  12159. 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.
  12160. - For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.
  12161. - For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
  12162. - 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`;
  12163. Object.defineProperty(app.config, "compilerOptions", {
  12164. get() {
  12165. warn(msg);
  12166. return compilerOptions;
  12167. },
  12168. set() {
  12169. warn(msg);
  12170. }
  12171. });
  12172. }
  12173. }
  12174. function normalizeContainer(container) {
  12175. if (isString(container)) {
  12176. const res = document.querySelector(container);
  12177. if (!res) {
  12178. warn(
  12179. `Failed to mount app: mount target selector "${container}" returned null.`
  12180. );
  12181. }
  12182. return res;
  12183. }
  12184. if (window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") {
  12185. warn(
  12186. `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`
  12187. );
  12188. }
  12189. return container;
  12190. }
  12191. let ssrDirectiveInitialized = false;
  12192. const initDirectivesForSSR = () => {
  12193. if (!ssrDirectiveInitialized) {
  12194. ssrDirectiveInitialized = true;
  12195. initVModelForSSR();
  12196. initVShowForSSR();
  12197. }
  12198. } ;
  12199. 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, 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 };