vue.runtime.global.js 379 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357
  1. /**
  2. * vue v3.5.12
  3. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  4. * @license MIT
  5. **/
  6. var Vue = (function (exports) {
  7. 'use strict';
  8. /*! #__NO_SIDE_EFFECTS__ */
  9. // @__NO_SIDE_EFFECTS__
  10. function makeMap(str) {
  11. const map = /* @__PURE__ */ Object.create(null);
  12. for (const key of str.split(",")) map[key] = 1;
  13. return (val) => val in map;
  14. }
  15. const EMPTY_OBJ = Object.freeze({}) ;
  16. const EMPTY_ARR = Object.freeze([]) ;
  17. const NOOP = () => {
  18. };
  19. const NO = () => false;
  20. const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
  21. (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
  22. const isModelListener = (key) => key.startsWith("onUpdate:");
  23. const extend = Object.assign;
  24. const remove = (arr, el) => {
  25. const i = arr.indexOf(el);
  26. if (i > -1) {
  27. arr.splice(i, 1);
  28. }
  29. };
  30. const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
  31. const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
  32. const isArray = Array.isArray;
  33. const isMap = (val) => toTypeString(val) === "[object Map]";
  34. const isSet = (val) => toTypeString(val) === "[object Set]";
  35. const isDate = (val) => toTypeString(val) === "[object Date]";
  36. const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
  37. const isFunction = (val) => typeof val === "function";
  38. const isString = (val) => typeof val === "string";
  39. const isSymbol = (val) => typeof val === "symbol";
  40. const isObject = (val) => val !== null && typeof val === "object";
  41. const isPromise = (val) => {
  42. return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
  43. };
  44. const objectToString = Object.prototype.toString;
  45. const toTypeString = (value) => objectToString.call(value);
  46. const toRawType = (value) => {
  47. return toTypeString(value).slice(8, -1);
  48. };
  49. const isPlainObject = (val) => toTypeString(val) === "[object Object]";
  50. const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
  51. const isReservedProp = /* @__PURE__ */ makeMap(
  52. // the leading comma is intentional so empty string "" is also included
  53. ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
  54. );
  55. const isBuiltInDirective = /* @__PURE__ */ makeMap(
  56. "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
  57. );
  58. const cacheStringFunction = (fn) => {
  59. const cache = /* @__PURE__ */ Object.create(null);
  60. return (str) => {
  61. const hit = cache[str];
  62. return hit || (cache[str] = fn(str));
  63. };
  64. };
  65. const camelizeRE = /-(\w)/g;
  66. const camelize = cacheStringFunction(
  67. (str) => {
  68. return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
  69. }
  70. );
  71. const hyphenateRE = /\B([A-Z])/g;
  72. const hyphenate = cacheStringFunction(
  73. (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
  74. );
  75. const capitalize = cacheStringFunction((str) => {
  76. return str.charAt(0).toUpperCase() + str.slice(1);
  77. });
  78. const toHandlerKey = cacheStringFunction(
  79. (str) => {
  80. const s = str ? `on${capitalize(str)}` : ``;
  81. return s;
  82. }
  83. );
  84. const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
  85. const invokeArrayFns = (fns, ...arg) => {
  86. for (let i = 0; i < fns.length; i++) {
  87. fns[i](...arg);
  88. }
  89. };
  90. const def = (obj, key, value, writable = false) => {
  91. Object.defineProperty(obj, key, {
  92. configurable: true,
  93. enumerable: false,
  94. writable,
  95. value
  96. });
  97. };
  98. const looseToNumber = (val) => {
  99. const n = parseFloat(val);
  100. return isNaN(n) ? val : n;
  101. };
  102. const toNumber = (val) => {
  103. const n = isString(val) ? Number(val) : NaN;
  104. return isNaN(n) ? val : n;
  105. };
  106. let _globalThis;
  107. const getGlobalThis = () => {
  108. return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
  109. };
  110. 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";
  111. const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
  112. function normalizeStyle(value) {
  113. if (isArray(value)) {
  114. const res = {};
  115. for (let i = 0; i < value.length; i++) {
  116. const item = value[i];
  117. const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
  118. if (normalized) {
  119. for (const key in normalized) {
  120. res[key] = normalized[key];
  121. }
  122. }
  123. }
  124. return res;
  125. } else if (isString(value) || isObject(value)) {
  126. return value;
  127. }
  128. }
  129. const listDelimiterRE = /;(?![^(]*\))/g;
  130. const propertyDelimiterRE = /:([^]+)/;
  131. const styleCommentRE = /\/\*[^]*?\*\//g;
  132. function parseStringStyle(cssText) {
  133. const ret = {};
  134. cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
  135. if (item) {
  136. const tmp = item.split(propertyDelimiterRE);
  137. tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
  138. }
  139. });
  140. return ret;
  141. }
  142. function stringifyStyle(styles) {
  143. let ret = "";
  144. if (!styles || isString(styles)) {
  145. return ret;
  146. }
  147. for (const key in styles) {
  148. const value = styles[key];
  149. if (isString(value) || typeof value === "number") {
  150. const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
  151. ret += `${normalizedKey}:${value};`;
  152. }
  153. }
  154. return ret;
  155. }
  156. function normalizeClass(value) {
  157. let res = "";
  158. if (isString(value)) {
  159. res = value;
  160. } else if (isArray(value)) {
  161. for (let i = 0; i < value.length; i++) {
  162. const normalized = normalizeClass(value[i]);
  163. if (normalized) {
  164. res += normalized + " ";
  165. }
  166. }
  167. } else if (isObject(value)) {
  168. for (const name in value) {
  169. if (value[name]) {
  170. res += name + " ";
  171. }
  172. }
  173. }
  174. return res.trim();
  175. }
  176. function normalizeProps(props) {
  177. if (!props) return null;
  178. let { class: klass, style } = props;
  179. if (klass && !isString(klass)) {
  180. props.class = normalizeClass(klass);
  181. }
  182. if (style) {
  183. props.style = normalizeStyle(style);
  184. }
  185. return props;
  186. }
  187. 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";
  188. 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";
  189. 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";
  190. const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
  191. const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
  192. const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
  193. const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
  194. const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
  195. const isBooleanAttr = /* @__PURE__ */ makeMap(
  196. specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
  197. );
  198. function includeBooleanAttr(value) {
  199. return !!value || value === "";
  200. }
  201. const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
  202. `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`
  203. );
  204. const isKnownSvgAttr = /* @__PURE__ */ makeMap(
  205. `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`
  206. );
  207. function isRenderableAttrValue(value) {
  208. if (value == null) {
  209. return false;
  210. }
  211. const type = typeof value;
  212. return type === "string" || type === "number" || type === "boolean";
  213. }
  214. const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;
  215. function getEscapedCssVarName(key, doubleEscape) {
  216. return key.replace(
  217. cssVarNameEscapeSymbolsRE,
  218. (s) => `\\${s}`
  219. );
  220. }
  221. function looseCompareArrays(a, b) {
  222. if (a.length !== b.length) return false;
  223. let equal = true;
  224. for (let i = 0; equal && i < a.length; i++) {
  225. equal = looseEqual(a[i], b[i]);
  226. }
  227. return equal;
  228. }
  229. function looseEqual(a, b) {
  230. if (a === b) return true;
  231. let aValidType = isDate(a);
  232. let bValidType = isDate(b);
  233. if (aValidType || bValidType) {
  234. return aValidType && bValidType ? a.getTime() === b.getTime() : false;
  235. }
  236. aValidType = isSymbol(a);
  237. bValidType = isSymbol(b);
  238. if (aValidType || bValidType) {
  239. return a === b;
  240. }
  241. aValidType = isArray(a);
  242. bValidType = isArray(b);
  243. if (aValidType || bValidType) {
  244. return aValidType && bValidType ? looseCompareArrays(a, b) : false;
  245. }
  246. aValidType = isObject(a);
  247. bValidType = isObject(b);
  248. if (aValidType || bValidType) {
  249. if (!aValidType || !bValidType) {
  250. return false;
  251. }
  252. const aKeysCount = Object.keys(a).length;
  253. const bKeysCount = Object.keys(b).length;
  254. if (aKeysCount !== bKeysCount) {
  255. return false;
  256. }
  257. for (const key in a) {
  258. const aHasKey = a.hasOwnProperty(key);
  259. const bHasKey = b.hasOwnProperty(key);
  260. if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
  261. return false;
  262. }
  263. }
  264. }
  265. return String(a) === String(b);
  266. }
  267. function looseIndexOf(arr, val) {
  268. return arr.findIndex((item) => looseEqual(item, val));
  269. }
  270. const isRef$1 = (val) => {
  271. return !!(val && val["__v_isRef"] === true);
  272. };
  273. const toDisplayString = (val) => {
  274. 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);
  275. };
  276. const replacer = (_key, val) => {
  277. if (isRef$1(val)) {
  278. return replacer(_key, val.value);
  279. } else if (isMap(val)) {
  280. return {
  281. [`Map(${val.size})`]: [...val.entries()].reduce(
  282. (entries, [key, val2], i) => {
  283. entries[stringifySymbol(key, i) + " =>"] = val2;
  284. return entries;
  285. },
  286. {}
  287. )
  288. };
  289. } else if (isSet(val)) {
  290. return {
  291. [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
  292. };
  293. } else if (isSymbol(val)) {
  294. return stringifySymbol(val);
  295. } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
  296. return String(val);
  297. }
  298. return val;
  299. };
  300. const stringifySymbol = (v, i = "") => {
  301. var _a;
  302. return (
  303. // Symbol.description in es2019+ so we need to cast here to pass
  304. // the lib: es2016 check
  305. isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v
  306. );
  307. };
  308. function warn$2(msg, ...args) {
  309. console.warn(`[Vue warn] ${msg}`, ...args);
  310. }
  311. let activeEffectScope;
  312. class EffectScope {
  313. constructor(detached = false) {
  314. this.detached = detached;
  315. /**
  316. * @internal
  317. */
  318. this._active = true;
  319. /**
  320. * @internal
  321. */
  322. this.effects = [];
  323. /**
  324. * @internal
  325. */
  326. this.cleanups = [];
  327. this._isPaused = false;
  328. this.parent = activeEffectScope;
  329. if (!detached && activeEffectScope) {
  330. this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
  331. this
  332. ) - 1;
  333. }
  334. }
  335. get active() {
  336. return this._active;
  337. }
  338. pause() {
  339. if (this._active) {
  340. this._isPaused = true;
  341. let i, l;
  342. if (this.scopes) {
  343. for (i = 0, l = this.scopes.length; i < l; i++) {
  344. this.scopes[i].pause();
  345. }
  346. }
  347. for (i = 0, l = this.effects.length; i < l; i++) {
  348. this.effects[i].pause();
  349. }
  350. }
  351. }
  352. /**
  353. * Resumes the effect scope, including all child scopes and effects.
  354. */
  355. resume() {
  356. if (this._active) {
  357. if (this._isPaused) {
  358. this._isPaused = false;
  359. let i, l;
  360. if (this.scopes) {
  361. for (i = 0, l = this.scopes.length; i < l; i++) {
  362. this.scopes[i].resume();
  363. }
  364. }
  365. for (i = 0, l = this.effects.length; i < l; i++) {
  366. this.effects[i].resume();
  367. }
  368. }
  369. }
  370. }
  371. run(fn) {
  372. if (this._active) {
  373. const currentEffectScope = activeEffectScope;
  374. try {
  375. activeEffectScope = this;
  376. return fn();
  377. } finally {
  378. activeEffectScope = currentEffectScope;
  379. }
  380. } else {
  381. warn$2(`cannot run an inactive effect scope.`);
  382. }
  383. }
  384. /**
  385. * This should only be called on non-detached scopes
  386. * @internal
  387. */
  388. on() {
  389. activeEffectScope = this;
  390. }
  391. /**
  392. * This should only be called on non-detached scopes
  393. * @internal
  394. */
  395. off() {
  396. activeEffectScope = this.parent;
  397. }
  398. stop(fromParent) {
  399. if (this._active) {
  400. let i, l;
  401. for (i = 0, l = this.effects.length; i < l; i++) {
  402. this.effects[i].stop();
  403. }
  404. for (i = 0, l = this.cleanups.length; i < l; i++) {
  405. this.cleanups[i]();
  406. }
  407. if (this.scopes) {
  408. for (i = 0, l = this.scopes.length; i < l; i++) {
  409. this.scopes[i].stop(true);
  410. }
  411. }
  412. if (!this.detached && this.parent && !fromParent) {
  413. const last = this.parent.scopes.pop();
  414. if (last && last !== this) {
  415. this.parent.scopes[this.index] = last;
  416. last.index = this.index;
  417. }
  418. }
  419. this.parent = void 0;
  420. this._active = false;
  421. }
  422. }
  423. }
  424. function effectScope(detached) {
  425. return new EffectScope(detached);
  426. }
  427. function getCurrentScope() {
  428. return activeEffectScope;
  429. }
  430. function onScopeDispose(fn, failSilently = false) {
  431. if (activeEffectScope) {
  432. activeEffectScope.cleanups.push(fn);
  433. } else if (!failSilently) {
  434. warn$2(
  435. `onScopeDispose() is called when there is no active effect scope to be associated with.`
  436. );
  437. }
  438. }
  439. let activeSub;
  440. const pausedQueueEffects = /* @__PURE__ */ new WeakSet();
  441. class ReactiveEffect {
  442. constructor(fn) {
  443. this.fn = fn;
  444. /**
  445. * @internal
  446. */
  447. this.deps = void 0;
  448. /**
  449. * @internal
  450. */
  451. this.depsTail = void 0;
  452. /**
  453. * @internal
  454. */
  455. this.flags = 1 | 4;
  456. /**
  457. * @internal
  458. */
  459. this.next = void 0;
  460. /**
  461. * @internal
  462. */
  463. this.cleanup = void 0;
  464. this.scheduler = void 0;
  465. if (activeEffectScope && activeEffectScope.active) {
  466. activeEffectScope.effects.push(this);
  467. }
  468. }
  469. pause() {
  470. this.flags |= 64;
  471. }
  472. resume() {
  473. if (this.flags & 64) {
  474. this.flags &= ~64;
  475. if (pausedQueueEffects.has(this)) {
  476. pausedQueueEffects.delete(this);
  477. this.trigger();
  478. }
  479. }
  480. }
  481. /**
  482. * @internal
  483. */
  484. notify() {
  485. if (this.flags & 2 && !(this.flags & 32)) {
  486. return;
  487. }
  488. if (!(this.flags & 8)) {
  489. batch(this);
  490. }
  491. }
  492. run() {
  493. if (!(this.flags & 1)) {
  494. return this.fn();
  495. }
  496. this.flags |= 2;
  497. cleanupEffect(this);
  498. prepareDeps(this);
  499. const prevEffect = activeSub;
  500. const prevShouldTrack = shouldTrack;
  501. activeSub = this;
  502. shouldTrack = true;
  503. try {
  504. return this.fn();
  505. } finally {
  506. if (activeSub !== this) {
  507. warn$2(
  508. "Active effect was not restored correctly - this is likely a Vue internal bug."
  509. );
  510. }
  511. cleanupDeps(this);
  512. activeSub = prevEffect;
  513. shouldTrack = prevShouldTrack;
  514. this.flags &= ~2;
  515. }
  516. }
  517. stop() {
  518. if (this.flags & 1) {
  519. for (let link = this.deps; link; link = link.nextDep) {
  520. removeSub(link);
  521. }
  522. this.deps = this.depsTail = void 0;
  523. cleanupEffect(this);
  524. this.onStop && this.onStop();
  525. this.flags &= ~1;
  526. }
  527. }
  528. trigger() {
  529. if (this.flags & 64) {
  530. pausedQueueEffects.add(this);
  531. } else if (this.scheduler) {
  532. this.scheduler();
  533. } else {
  534. this.runIfDirty();
  535. }
  536. }
  537. /**
  538. * @internal
  539. */
  540. runIfDirty() {
  541. if (isDirty(this)) {
  542. this.run();
  543. }
  544. }
  545. get dirty() {
  546. return isDirty(this);
  547. }
  548. }
  549. let batchDepth = 0;
  550. let batchedSub;
  551. let batchedComputed;
  552. function batch(sub, isComputed = false) {
  553. sub.flags |= 8;
  554. if (isComputed) {
  555. sub.next = batchedComputed;
  556. batchedComputed = sub;
  557. return;
  558. }
  559. sub.next = batchedSub;
  560. batchedSub = sub;
  561. }
  562. function startBatch() {
  563. batchDepth++;
  564. }
  565. function endBatch() {
  566. if (--batchDepth > 0) {
  567. return;
  568. }
  569. if (batchedComputed) {
  570. let e = batchedComputed;
  571. batchedComputed = void 0;
  572. while (e) {
  573. const next = e.next;
  574. e.next = void 0;
  575. e.flags &= ~8;
  576. e = next;
  577. }
  578. }
  579. let error;
  580. while (batchedSub) {
  581. let e = batchedSub;
  582. batchedSub = void 0;
  583. while (e) {
  584. const next = e.next;
  585. e.next = void 0;
  586. e.flags &= ~8;
  587. if (e.flags & 1) {
  588. try {
  589. ;
  590. e.trigger();
  591. } catch (err) {
  592. if (!error) error = err;
  593. }
  594. }
  595. e = next;
  596. }
  597. }
  598. if (error) throw error;
  599. }
  600. function prepareDeps(sub) {
  601. for (let link = sub.deps; link; link = link.nextDep) {
  602. link.version = -1;
  603. link.prevActiveLink = link.dep.activeLink;
  604. link.dep.activeLink = link;
  605. }
  606. }
  607. function cleanupDeps(sub) {
  608. let head;
  609. let tail = sub.depsTail;
  610. let link = tail;
  611. while (link) {
  612. const prev = link.prevDep;
  613. if (link.version === -1) {
  614. if (link === tail) tail = prev;
  615. removeSub(link);
  616. removeDep(link);
  617. } else {
  618. head = link;
  619. }
  620. link.dep.activeLink = link.prevActiveLink;
  621. link.prevActiveLink = void 0;
  622. link = prev;
  623. }
  624. sub.deps = head;
  625. sub.depsTail = tail;
  626. }
  627. function isDirty(sub) {
  628. for (let link = sub.deps; link; link = link.nextDep) {
  629. if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) {
  630. return true;
  631. }
  632. }
  633. if (sub._dirty) {
  634. return true;
  635. }
  636. return false;
  637. }
  638. function refreshComputed(computed) {
  639. if (computed.flags & 4 && !(computed.flags & 16)) {
  640. return;
  641. }
  642. computed.flags &= ~16;
  643. if (computed.globalVersion === globalVersion) {
  644. return;
  645. }
  646. computed.globalVersion = globalVersion;
  647. const dep = computed.dep;
  648. computed.flags |= 2;
  649. if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) {
  650. computed.flags &= ~2;
  651. return;
  652. }
  653. const prevSub = activeSub;
  654. const prevShouldTrack = shouldTrack;
  655. activeSub = computed;
  656. shouldTrack = true;
  657. try {
  658. prepareDeps(computed);
  659. const value = computed.fn(computed._value);
  660. if (dep.version === 0 || hasChanged(value, computed._value)) {
  661. computed._value = value;
  662. dep.version++;
  663. }
  664. } catch (err) {
  665. dep.version++;
  666. throw err;
  667. } finally {
  668. activeSub = prevSub;
  669. shouldTrack = prevShouldTrack;
  670. cleanupDeps(computed);
  671. computed.flags &= ~2;
  672. }
  673. }
  674. function removeSub(link, soft = false) {
  675. const { dep, prevSub, nextSub } = link;
  676. if (prevSub) {
  677. prevSub.nextSub = nextSub;
  678. link.prevSub = void 0;
  679. }
  680. if (nextSub) {
  681. nextSub.prevSub = prevSub;
  682. link.nextSub = void 0;
  683. }
  684. if (dep.subsHead === link) {
  685. dep.subsHead = nextSub;
  686. }
  687. if (dep.subs === link) {
  688. dep.subs = prevSub;
  689. if (!prevSub && dep.computed) {
  690. dep.computed.flags &= ~4;
  691. for (let l = dep.computed.deps; l; l = l.nextDep) {
  692. removeSub(l, true);
  693. }
  694. }
  695. }
  696. if (!soft && !--dep.sc && dep.map) {
  697. dep.map.delete(dep.key);
  698. }
  699. }
  700. function removeDep(link) {
  701. const { prevDep, nextDep } = link;
  702. if (prevDep) {
  703. prevDep.nextDep = nextDep;
  704. link.prevDep = void 0;
  705. }
  706. if (nextDep) {
  707. nextDep.prevDep = prevDep;
  708. link.nextDep = void 0;
  709. }
  710. }
  711. function effect(fn, options) {
  712. if (fn.effect instanceof ReactiveEffect) {
  713. fn = fn.effect.fn;
  714. }
  715. const e = new ReactiveEffect(fn);
  716. if (options) {
  717. extend(e, options);
  718. }
  719. try {
  720. e.run();
  721. } catch (err) {
  722. e.stop();
  723. throw err;
  724. }
  725. const runner = e.run.bind(e);
  726. runner.effect = e;
  727. return runner;
  728. }
  729. function stop(runner) {
  730. runner.effect.stop();
  731. }
  732. let shouldTrack = true;
  733. const trackStack = [];
  734. function pauseTracking() {
  735. trackStack.push(shouldTrack);
  736. shouldTrack = false;
  737. }
  738. function resetTracking() {
  739. const last = trackStack.pop();
  740. shouldTrack = last === void 0 ? true : last;
  741. }
  742. function cleanupEffect(e) {
  743. const { cleanup } = e;
  744. e.cleanup = void 0;
  745. if (cleanup) {
  746. const prevSub = activeSub;
  747. activeSub = void 0;
  748. try {
  749. cleanup();
  750. } finally {
  751. activeSub = prevSub;
  752. }
  753. }
  754. }
  755. let globalVersion = 0;
  756. class Link {
  757. constructor(sub, dep) {
  758. this.sub = sub;
  759. this.dep = dep;
  760. this.version = dep.version;
  761. this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
  762. }
  763. }
  764. class Dep {
  765. constructor(computed) {
  766. this.computed = computed;
  767. this.version = 0;
  768. /**
  769. * Link between this dep and the current active effect
  770. */
  771. this.activeLink = void 0;
  772. /**
  773. * Doubly linked list representing the subscribing effects (tail)
  774. */
  775. this.subs = void 0;
  776. /**
  777. * For object property deps cleanup
  778. */
  779. this.map = void 0;
  780. this.key = void 0;
  781. /**
  782. * Subscriber counter
  783. */
  784. this.sc = 0;
  785. {
  786. this.subsHead = void 0;
  787. }
  788. }
  789. track(debugInfo) {
  790. if (!activeSub || !shouldTrack || activeSub === this.computed) {
  791. return;
  792. }
  793. let link = this.activeLink;
  794. if (link === void 0 || link.sub !== activeSub) {
  795. link = this.activeLink = new Link(activeSub, this);
  796. if (!activeSub.deps) {
  797. activeSub.deps = activeSub.depsTail = link;
  798. } else {
  799. link.prevDep = activeSub.depsTail;
  800. activeSub.depsTail.nextDep = link;
  801. activeSub.depsTail = link;
  802. }
  803. addSub(link);
  804. } else if (link.version === -1) {
  805. link.version = this.version;
  806. if (link.nextDep) {
  807. const next = link.nextDep;
  808. next.prevDep = link.prevDep;
  809. if (link.prevDep) {
  810. link.prevDep.nextDep = next;
  811. }
  812. link.prevDep = activeSub.depsTail;
  813. link.nextDep = void 0;
  814. activeSub.depsTail.nextDep = link;
  815. activeSub.depsTail = link;
  816. if (activeSub.deps === link) {
  817. activeSub.deps = next;
  818. }
  819. }
  820. }
  821. if (activeSub.onTrack) {
  822. activeSub.onTrack(
  823. extend(
  824. {
  825. effect: activeSub
  826. },
  827. debugInfo
  828. )
  829. );
  830. }
  831. return link;
  832. }
  833. trigger(debugInfo) {
  834. this.version++;
  835. globalVersion++;
  836. this.notify(debugInfo);
  837. }
  838. notify(debugInfo) {
  839. startBatch();
  840. try {
  841. if (true) {
  842. for (let head = this.subsHead; head; head = head.nextSub) {
  843. if (head.sub.onTrigger && !(head.sub.flags & 8)) {
  844. head.sub.onTrigger(
  845. extend(
  846. {
  847. effect: head.sub
  848. },
  849. debugInfo
  850. )
  851. );
  852. }
  853. }
  854. }
  855. for (let link = this.subs; link; link = link.prevSub) {
  856. if (link.sub.notify()) {
  857. ;
  858. link.sub.dep.notify();
  859. }
  860. }
  861. } finally {
  862. endBatch();
  863. }
  864. }
  865. }
  866. function addSub(link) {
  867. link.dep.sc++;
  868. if (link.sub.flags & 4) {
  869. const computed = link.dep.computed;
  870. if (computed && !link.dep.subs) {
  871. computed.flags |= 4 | 16;
  872. for (let l = computed.deps; l; l = l.nextDep) {
  873. addSub(l);
  874. }
  875. }
  876. const currentTail = link.dep.subs;
  877. if (currentTail !== link) {
  878. link.prevSub = currentTail;
  879. if (currentTail) currentTail.nextSub = link;
  880. }
  881. if (link.dep.subsHead === void 0) {
  882. link.dep.subsHead = link;
  883. }
  884. link.dep.subs = link;
  885. }
  886. }
  887. const targetMap = /* @__PURE__ */ new WeakMap();
  888. const ITERATE_KEY = Symbol(
  889. "Object iterate"
  890. );
  891. const MAP_KEY_ITERATE_KEY = Symbol(
  892. "Map keys iterate"
  893. );
  894. const ARRAY_ITERATE_KEY = Symbol(
  895. "Array iterate"
  896. );
  897. function track(target, type, key) {
  898. if (shouldTrack && activeSub) {
  899. let depsMap = targetMap.get(target);
  900. if (!depsMap) {
  901. targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
  902. }
  903. let dep = depsMap.get(key);
  904. if (!dep) {
  905. depsMap.set(key, dep = new Dep());
  906. dep.map = depsMap;
  907. dep.key = key;
  908. }
  909. {
  910. dep.track({
  911. target,
  912. type,
  913. key
  914. });
  915. }
  916. }
  917. }
  918. function trigger(target, type, key, newValue, oldValue, oldTarget) {
  919. const depsMap = targetMap.get(target);
  920. if (!depsMap) {
  921. globalVersion++;
  922. return;
  923. }
  924. const run = (dep) => {
  925. if (dep) {
  926. {
  927. dep.trigger({
  928. target,
  929. type,
  930. key,
  931. newValue,
  932. oldValue,
  933. oldTarget
  934. });
  935. }
  936. }
  937. };
  938. startBatch();
  939. if (type === "clear") {
  940. depsMap.forEach(run);
  941. } else {
  942. const targetIsArray = isArray(target);
  943. const isArrayIndex = targetIsArray && isIntegerKey(key);
  944. if (targetIsArray && key === "length") {
  945. const newLength = Number(newValue);
  946. depsMap.forEach((dep, key2) => {
  947. if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {
  948. run(dep);
  949. }
  950. });
  951. } else {
  952. if (key !== void 0 || depsMap.has(void 0)) {
  953. run(depsMap.get(key));
  954. }
  955. if (isArrayIndex) {
  956. run(depsMap.get(ARRAY_ITERATE_KEY));
  957. }
  958. switch (type) {
  959. case "add":
  960. if (!targetIsArray) {
  961. run(depsMap.get(ITERATE_KEY));
  962. if (isMap(target)) {
  963. run(depsMap.get(MAP_KEY_ITERATE_KEY));
  964. }
  965. } else if (isArrayIndex) {
  966. run(depsMap.get("length"));
  967. }
  968. break;
  969. case "delete":
  970. if (!targetIsArray) {
  971. run(depsMap.get(ITERATE_KEY));
  972. if (isMap(target)) {
  973. run(depsMap.get(MAP_KEY_ITERATE_KEY));
  974. }
  975. }
  976. break;
  977. case "set":
  978. if (isMap(target)) {
  979. run(depsMap.get(ITERATE_KEY));
  980. }
  981. break;
  982. }
  983. }
  984. }
  985. endBatch();
  986. }
  987. function getDepFromReactive(object, key) {
  988. const depMap = targetMap.get(object);
  989. return depMap && depMap.get(key);
  990. }
  991. function reactiveReadArray(array) {
  992. const raw = toRaw(array);
  993. if (raw === array) return raw;
  994. track(raw, "iterate", ARRAY_ITERATE_KEY);
  995. return isShallow(array) ? raw : raw.map(toReactive);
  996. }
  997. function shallowReadArray(arr) {
  998. track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
  999. return arr;
  1000. }
  1001. const arrayInstrumentations = {
  1002. __proto__: null,
  1003. [Symbol.iterator]() {
  1004. return iterator(this, Symbol.iterator, toReactive);
  1005. },
  1006. concat(...args) {
  1007. return reactiveReadArray(this).concat(
  1008. ...args.map((x) => isArray(x) ? reactiveReadArray(x) : x)
  1009. );
  1010. },
  1011. entries() {
  1012. return iterator(this, "entries", (value) => {
  1013. value[1] = toReactive(value[1]);
  1014. return value;
  1015. });
  1016. },
  1017. every(fn, thisArg) {
  1018. return apply(this, "every", fn, thisArg, void 0, arguments);
  1019. },
  1020. filter(fn, thisArg) {
  1021. return apply(this, "filter", fn, thisArg, (v) => v.map(toReactive), arguments);
  1022. },
  1023. find(fn, thisArg) {
  1024. return apply(this, "find", fn, thisArg, toReactive, arguments);
  1025. },
  1026. findIndex(fn, thisArg) {
  1027. return apply(this, "findIndex", fn, thisArg, void 0, arguments);
  1028. },
  1029. findLast(fn, thisArg) {
  1030. return apply(this, "findLast", fn, thisArg, toReactive, arguments);
  1031. },
  1032. findLastIndex(fn, thisArg) {
  1033. return apply(this, "findLastIndex", fn, thisArg, void 0, arguments);
  1034. },
  1035. // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
  1036. forEach(fn, thisArg) {
  1037. return apply(this, "forEach", fn, thisArg, void 0, arguments);
  1038. },
  1039. includes(...args) {
  1040. return searchProxy(this, "includes", args);
  1041. },
  1042. indexOf(...args) {
  1043. return searchProxy(this, "indexOf", args);
  1044. },
  1045. join(separator) {
  1046. return reactiveReadArray(this).join(separator);
  1047. },
  1048. // keys() iterator only reads `length`, no optimisation required
  1049. lastIndexOf(...args) {
  1050. return searchProxy(this, "lastIndexOf", args);
  1051. },
  1052. map(fn, thisArg) {
  1053. return apply(this, "map", fn, thisArg, void 0, arguments);
  1054. },
  1055. pop() {
  1056. return noTracking(this, "pop");
  1057. },
  1058. push(...args) {
  1059. return noTracking(this, "push", args);
  1060. },
  1061. reduce(fn, ...args) {
  1062. return reduce(this, "reduce", fn, args);
  1063. },
  1064. reduceRight(fn, ...args) {
  1065. return reduce(this, "reduceRight", fn, args);
  1066. },
  1067. shift() {
  1068. return noTracking(this, "shift");
  1069. },
  1070. // slice could use ARRAY_ITERATE but also seems to beg for range tracking
  1071. some(fn, thisArg) {
  1072. return apply(this, "some", fn, thisArg, void 0, arguments);
  1073. },
  1074. splice(...args) {
  1075. return noTracking(this, "splice", args);
  1076. },
  1077. toReversed() {
  1078. return reactiveReadArray(this).toReversed();
  1079. },
  1080. toSorted(comparer) {
  1081. return reactiveReadArray(this).toSorted(comparer);
  1082. },
  1083. toSpliced(...args) {
  1084. return reactiveReadArray(this).toSpliced(...args);
  1085. },
  1086. unshift(...args) {
  1087. return noTracking(this, "unshift", args);
  1088. },
  1089. values() {
  1090. return iterator(this, "values", toReactive);
  1091. }
  1092. };
  1093. function iterator(self, method, wrapValue) {
  1094. const arr = shallowReadArray(self);
  1095. const iter = arr[method]();
  1096. if (arr !== self && !isShallow(self)) {
  1097. iter._next = iter.next;
  1098. iter.next = () => {
  1099. const result = iter._next();
  1100. if (result.value) {
  1101. result.value = wrapValue(result.value);
  1102. }
  1103. return result;
  1104. };
  1105. }
  1106. return iter;
  1107. }
  1108. const arrayProto = Array.prototype;
  1109. function apply(self, method, fn, thisArg, wrappedRetFn, args) {
  1110. const arr = shallowReadArray(self);
  1111. const needsWrap = arr !== self && !isShallow(self);
  1112. const methodFn = arr[method];
  1113. if (methodFn !== arrayProto[method]) {
  1114. const result2 = methodFn.apply(self, args);
  1115. return needsWrap ? toReactive(result2) : result2;
  1116. }
  1117. let wrappedFn = fn;
  1118. if (arr !== self) {
  1119. if (needsWrap) {
  1120. wrappedFn = function(item, index) {
  1121. return fn.call(this, toReactive(item), index, self);
  1122. };
  1123. } else if (fn.length > 2) {
  1124. wrappedFn = function(item, index) {
  1125. return fn.call(this, item, index, self);
  1126. };
  1127. }
  1128. }
  1129. const result = methodFn.call(arr, wrappedFn, thisArg);
  1130. return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result;
  1131. }
  1132. function reduce(self, method, fn, args) {
  1133. const arr = shallowReadArray(self);
  1134. let wrappedFn = fn;
  1135. if (arr !== self) {
  1136. if (!isShallow(self)) {
  1137. wrappedFn = function(acc, item, index) {
  1138. return fn.call(this, acc, toReactive(item), index, self);
  1139. };
  1140. } else if (fn.length > 3) {
  1141. wrappedFn = function(acc, item, index) {
  1142. return fn.call(this, acc, item, index, self);
  1143. };
  1144. }
  1145. }
  1146. return arr[method](wrappedFn, ...args);
  1147. }
  1148. function searchProxy(self, method, args) {
  1149. const arr = toRaw(self);
  1150. track(arr, "iterate", ARRAY_ITERATE_KEY);
  1151. const res = arr[method](...args);
  1152. if ((res === -1 || res === false) && isProxy(args[0])) {
  1153. args[0] = toRaw(args[0]);
  1154. return arr[method](...args);
  1155. }
  1156. return res;
  1157. }
  1158. function noTracking(self, method, args = []) {
  1159. pauseTracking();
  1160. startBatch();
  1161. const res = toRaw(self)[method].apply(self, args);
  1162. endBatch();
  1163. resetTracking();
  1164. return res;
  1165. }
  1166. const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
  1167. const builtInSymbols = new Set(
  1168. /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
  1169. );
  1170. function hasOwnProperty(key) {
  1171. if (!isSymbol(key)) key = String(key);
  1172. const obj = toRaw(this);
  1173. track(obj, "has", key);
  1174. return obj.hasOwnProperty(key);
  1175. }
  1176. class BaseReactiveHandler {
  1177. constructor(_isReadonly = false, _isShallow = false) {
  1178. this._isReadonly = _isReadonly;
  1179. this._isShallow = _isShallow;
  1180. }
  1181. get(target, key, receiver) {
  1182. const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
  1183. if (key === "__v_isReactive") {
  1184. return !isReadonly2;
  1185. } else if (key === "__v_isReadonly") {
  1186. return isReadonly2;
  1187. } else if (key === "__v_isShallow") {
  1188. return isShallow2;
  1189. } else if (key === "__v_raw") {
  1190. if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
  1191. // this means the receiver is a user proxy of the reactive proxy
  1192. Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
  1193. return target;
  1194. }
  1195. return;
  1196. }
  1197. const targetIsArray = isArray(target);
  1198. if (!isReadonly2) {
  1199. let fn;
  1200. if (targetIsArray && (fn = arrayInstrumentations[key])) {
  1201. return fn;
  1202. }
  1203. if (key === "hasOwnProperty") {
  1204. return hasOwnProperty;
  1205. }
  1206. }
  1207. const res = Reflect.get(
  1208. target,
  1209. key,
  1210. // if this is a proxy wrapping a ref, return methods using the raw ref
  1211. // as receiver so that we don't have to call `toRaw` on the ref in all
  1212. // its class methods
  1213. isRef(target) ? target : receiver
  1214. );
  1215. if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
  1216. return res;
  1217. }
  1218. if (!isReadonly2) {
  1219. track(target, "get", key);
  1220. }
  1221. if (isShallow2) {
  1222. return res;
  1223. }
  1224. if (isRef(res)) {
  1225. return targetIsArray && isIntegerKey(key) ? res : res.value;
  1226. }
  1227. if (isObject(res)) {
  1228. return isReadonly2 ? readonly(res) : reactive(res);
  1229. }
  1230. return res;
  1231. }
  1232. }
  1233. class MutableReactiveHandler extends BaseReactiveHandler {
  1234. constructor(isShallow2 = false) {
  1235. super(false, isShallow2);
  1236. }
  1237. set(target, key, value, receiver) {
  1238. let oldValue = target[key];
  1239. if (!this._isShallow) {
  1240. const isOldValueReadonly = isReadonly(oldValue);
  1241. if (!isShallow(value) && !isReadonly(value)) {
  1242. oldValue = toRaw(oldValue);
  1243. value = toRaw(value);
  1244. }
  1245. if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
  1246. if (isOldValueReadonly) {
  1247. return false;
  1248. } else {
  1249. oldValue.value = value;
  1250. return true;
  1251. }
  1252. }
  1253. }
  1254. const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
  1255. const result = Reflect.set(
  1256. target,
  1257. key,
  1258. value,
  1259. isRef(target) ? target : receiver
  1260. );
  1261. if (target === toRaw(receiver)) {
  1262. if (!hadKey) {
  1263. trigger(target, "add", key, value);
  1264. } else if (hasChanged(value, oldValue)) {
  1265. trigger(target, "set", key, value, oldValue);
  1266. }
  1267. }
  1268. return result;
  1269. }
  1270. deleteProperty(target, key) {
  1271. const hadKey = hasOwn(target, key);
  1272. const oldValue = target[key];
  1273. const result = Reflect.deleteProperty(target, key);
  1274. if (result && hadKey) {
  1275. trigger(target, "delete", key, void 0, oldValue);
  1276. }
  1277. return result;
  1278. }
  1279. has(target, key) {
  1280. const result = Reflect.has(target, key);
  1281. if (!isSymbol(key) || !builtInSymbols.has(key)) {
  1282. track(target, "has", key);
  1283. }
  1284. return result;
  1285. }
  1286. ownKeys(target) {
  1287. track(
  1288. target,
  1289. "iterate",
  1290. isArray(target) ? "length" : ITERATE_KEY
  1291. );
  1292. return Reflect.ownKeys(target);
  1293. }
  1294. }
  1295. class ReadonlyReactiveHandler extends BaseReactiveHandler {
  1296. constructor(isShallow2 = false) {
  1297. super(true, isShallow2);
  1298. }
  1299. set(target, key) {
  1300. {
  1301. warn$2(
  1302. `Set operation on key "${String(key)}" failed: target is readonly.`,
  1303. target
  1304. );
  1305. }
  1306. return true;
  1307. }
  1308. deleteProperty(target, key) {
  1309. {
  1310. warn$2(
  1311. `Delete operation on key "${String(key)}" failed: target is readonly.`,
  1312. target
  1313. );
  1314. }
  1315. return true;
  1316. }
  1317. }
  1318. const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
  1319. const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
  1320. const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
  1321. const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
  1322. const toShallow = (value) => value;
  1323. const getProto = (v) => Reflect.getPrototypeOf(v);
  1324. function createIterableMethod(method, isReadonly2, isShallow2) {
  1325. return function(...args) {
  1326. const target = this["__v_raw"];
  1327. const rawTarget = toRaw(target);
  1328. const targetIsMap = isMap(rawTarget);
  1329. const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
  1330. const isKeyOnly = method === "keys" && targetIsMap;
  1331. const innerIterator = target[method](...args);
  1332. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  1333. !isReadonly2 && track(
  1334. rawTarget,
  1335. "iterate",
  1336. isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
  1337. );
  1338. return {
  1339. // iterator protocol
  1340. next() {
  1341. const { value, done } = innerIterator.next();
  1342. return done ? { value, done } : {
  1343. value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
  1344. done
  1345. };
  1346. },
  1347. // iterable protocol
  1348. [Symbol.iterator]() {
  1349. return this;
  1350. }
  1351. };
  1352. };
  1353. }
  1354. function createReadonlyMethod(type) {
  1355. return function(...args) {
  1356. {
  1357. const key = args[0] ? `on key "${args[0]}" ` : ``;
  1358. warn$2(
  1359. `${capitalize(type)} operation ${key}failed: target is readonly.`,
  1360. toRaw(this)
  1361. );
  1362. }
  1363. return type === "delete" ? false : type === "clear" ? void 0 : this;
  1364. };
  1365. }
  1366. function createInstrumentations(readonly, shallow) {
  1367. const instrumentations = {
  1368. get(key) {
  1369. const target = this["__v_raw"];
  1370. const rawTarget = toRaw(target);
  1371. const rawKey = toRaw(key);
  1372. if (!readonly) {
  1373. if (hasChanged(key, rawKey)) {
  1374. track(rawTarget, "get", key);
  1375. }
  1376. track(rawTarget, "get", rawKey);
  1377. }
  1378. const { has } = getProto(rawTarget);
  1379. const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
  1380. if (has.call(rawTarget, key)) {
  1381. return wrap(target.get(key));
  1382. } else if (has.call(rawTarget, rawKey)) {
  1383. return wrap(target.get(rawKey));
  1384. } else if (target !== rawTarget) {
  1385. target.get(key);
  1386. }
  1387. },
  1388. get size() {
  1389. const target = this["__v_raw"];
  1390. !readonly && track(toRaw(target), "iterate", ITERATE_KEY);
  1391. return Reflect.get(target, "size", target);
  1392. },
  1393. has(key) {
  1394. const target = this["__v_raw"];
  1395. const rawTarget = toRaw(target);
  1396. const rawKey = toRaw(key);
  1397. if (!readonly) {
  1398. if (hasChanged(key, rawKey)) {
  1399. track(rawTarget, "has", key);
  1400. }
  1401. track(rawTarget, "has", rawKey);
  1402. }
  1403. return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
  1404. },
  1405. forEach(callback, thisArg) {
  1406. const observed = this;
  1407. const target = observed["__v_raw"];
  1408. const rawTarget = toRaw(target);
  1409. const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
  1410. !readonly && track(rawTarget, "iterate", ITERATE_KEY);
  1411. return target.forEach((value, key) => {
  1412. return callback.call(thisArg, wrap(value), wrap(key), observed);
  1413. });
  1414. }
  1415. };
  1416. extend(
  1417. instrumentations,
  1418. readonly ? {
  1419. add: createReadonlyMethod("add"),
  1420. set: createReadonlyMethod("set"),
  1421. delete: createReadonlyMethod("delete"),
  1422. clear: createReadonlyMethod("clear")
  1423. } : {
  1424. add(value) {
  1425. if (!shallow && !isShallow(value) && !isReadonly(value)) {
  1426. value = toRaw(value);
  1427. }
  1428. const target = toRaw(this);
  1429. const proto = getProto(target);
  1430. const hadKey = proto.has.call(target, value);
  1431. if (!hadKey) {
  1432. target.add(value);
  1433. trigger(target, "add", value, value);
  1434. }
  1435. return this;
  1436. },
  1437. set(key, value) {
  1438. if (!shallow && !isShallow(value) && !isReadonly(value)) {
  1439. value = toRaw(value);
  1440. }
  1441. const target = toRaw(this);
  1442. const { has, get } = getProto(target);
  1443. let hadKey = has.call(target, key);
  1444. if (!hadKey) {
  1445. key = toRaw(key);
  1446. hadKey = has.call(target, key);
  1447. } else {
  1448. checkIdentityKeys(target, has, key);
  1449. }
  1450. const oldValue = get.call(target, key);
  1451. target.set(key, value);
  1452. if (!hadKey) {
  1453. trigger(target, "add", key, value);
  1454. } else if (hasChanged(value, oldValue)) {
  1455. trigger(target, "set", key, value, oldValue);
  1456. }
  1457. return this;
  1458. },
  1459. delete(key) {
  1460. const target = toRaw(this);
  1461. const { has, get } = getProto(target);
  1462. let hadKey = has.call(target, key);
  1463. if (!hadKey) {
  1464. key = toRaw(key);
  1465. hadKey = has.call(target, key);
  1466. } else {
  1467. checkIdentityKeys(target, has, key);
  1468. }
  1469. const oldValue = get ? get.call(target, key) : void 0;
  1470. const result = target.delete(key);
  1471. if (hadKey) {
  1472. trigger(target, "delete", key, void 0, oldValue);
  1473. }
  1474. return result;
  1475. },
  1476. clear() {
  1477. const target = toRaw(this);
  1478. const hadItems = target.size !== 0;
  1479. const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
  1480. const result = target.clear();
  1481. if (hadItems) {
  1482. trigger(
  1483. target,
  1484. "clear",
  1485. void 0,
  1486. void 0,
  1487. oldTarget
  1488. );
  1489. }
  1490. return result;
  1491. }
  1492. }
  1493. );
  1494. const iteratorMethods = [
  1495. "keys",
  1496. "values",
  1497. "entries",
  1498. Symbol.iterator
  1499. ];
  1500. iteratorMethods.forEach((method) => {
  1501. instrumentations[method] = createIterableMethod(method, readonly, shallow);
  1502. });
  1503. return instrumentations;
  1504. }
  1505. function createInstrumentationGetter(isReadonly2, shallow) {
  1506. const instrumentations = createInstrumentations(isReadonly2, shallow);
  1507. return (target, key, receiver) => {
  1508. if (key === "__v_isReactive") {
  1509. return !isReadonly2;
  1510. } else if (key === "__v_isReadonly") {
  1511. return isReadonly2;
  1512. } else if (key === "__v_raw") {
  1513. return target;
  1514. }
  1515. return Reflect.get(
  1516. hasOwn(instrumentations, key) && key in target ? instrumentations : target,
  1517. key,
  1518. receiver
  1519. );
  1520. };
  1521. }
  1522. const mutableCollectionHandlers = {
  1523. get: /* @__PURE__ */ createInstrumentationGetter(false, false)
  1524. };
  1525. const shallowCollectionHandlers = {
  1526. get: /* @__PURE__ */ createInstrumentationGetter(false, true)
  1527. };
  1528. const readonlyCollectionHandlers = {
  1529. get: /* @__PURE__ */ createInstrumentationGetter(true, false)
  1530. };
  1531. const shallowReadonlyCollectionHandlers = {
  1532. get: /* @__PURE__ */ createInstrumentationGetter(true, true)
  1533. };
  1534. function checkIdentityKeys(target, has, key) {
  1535. const rawKey = toRaw(key);
  1536. if (rawKey !== key && has.call(target, rawKey)) {
  1537. const type = toRawType(target);
  1538. warn$2(
  1539. `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.`
  1540. );
  1541. }
  1542. }
  1543. const reactiveMap = /* @__PURE__ */ new WeakMap();
  1544. const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
  1545. const readonlyMap = /* @__PURE__ */ new WeakMap();
  1546. const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
  1547. function targetTypeMap(rawType) {
  1548. switch (rawType) {
  1549. case "Object":
  1550. case "Array":
  1551. return 1 /* COMMON */;
  1552. case "Map":
  1553. case "Set":
  1554. case "WeakMap":
  1555. case "WeakSet":
  1556. return 2 /* COLLECTION */;
  1557. default:
  1558. return 0 /* INVALID */;
  1559. }
  1560. }
  1561. function getTargetType(value) {
  1562. return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
  1563. }
  1564. function reactive(target) {
  1565. if (isReadonly(target)) {
  1566. return target;
  1567. }
  1568. return createReactiveObject(
  1569. target,
  1570. false,
  1571. mutableHandlers,
  1572. mutableCollectionHandlers,
  1573. reactiveMap
  1574. );
  1575. }
  1576. function shallowReactive(target) {
  1577. return createReactiveObject(
  1578. target,
  1579. false,
  1580. shallowReactiveHandlers,
  1581. shallowCollectionHandlers,
  1582. shallowReactiveMap
  1583. );
  1584. }
  1585. function readonly(target) {
  1586. return createReactiveObject(
  1587. target,
  1588. true,
  1589. readonlyHandlers,
  1590. readonlyCollectionHandlers,
  1591. readonlyMap
  1592. );
  1593. }
  1594. function shallowReadonly(target) {
  1595. return createReactiveObject(
  1596. target,
  1597. true,
  1598. shallowReadonlyHandlers,
  1599. shallowReadonlyCollectionHandlers,
  1600. shallowReadonlyMap
  1601. );
  1602. }
  1603. function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
  1604. if (!isObject(target)) {
  1605. {
  1606. warn$2(
  1607. `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String(
  1608. target
  1609. )}`
  1610. );
  1611. }
  1612. return target;
  1613. }
  1614. if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
  1615. return target;
  1616. }
  1617. const existingProxy = proxyMap.get(target);
  1618. if (existingProxy) {
  1619. return existingProxy;
  1620. }
  1621. const targetType = getTargetType(target);
  1622. if (targetType === 0 /* INVALID */) {
  1623. return target;
  1624. }
  1625. const proxy = new Proxy(
  1626. target,
  1627. targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
  1628. );
  1629. proxyMap.set(target, proxy);
  1630. return proxy;
  1631. }
  1632. function isReactive(value) {
  1633. if (isReadonly(value)) {
  1634. return isReactive(value["__v_raw"]);
  1635. }
  1636. return !!(value && value["__v_isReactive"]);
  1637. }
  1638. function isReadonly(value) {
  1639. return !!(value && value["__v_isReadonly"]);
  1640. }
  1641. function isShallow(value) {
  1642. return !!(value && value["__v_isShallow"]);
  1643. }
  1644. function isProxy(value) {
  1645. return value ? !!value["__v_raw"] : false;
  1646. }
  1647. function toRaw(observed) {
  1648. const raw = observed && observed["__v_raw"];
  1649. return raw ? toRaw(raw) : observed;
  1650. }
  1651. function markRaw(value) {
  1652. if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
  1653. def(value, "__v_skip", true);
  1654. }
  1655. return value;
  1656. }
  1657. const toReactive = (value) => isObject(value) ? reactive(value) : value;
  1658. const toReadonly = (value) => isObject(value) ? readonly(value) : value;
  1659. function isRef(r) {
  1660. return r ? r["__v_isRef"] === true : false;
  1661. }
  1662. function ref(value) {
  1663. return createRef(value, false);
  1664. }
  1665. function shallowRef(value) {
  1666. return createRef(value, true);
  1667. }
  1668. function createRef(rawValue, shallow) {
  1669. if (isRef(rawValue)) {
  1670. return rawValue;
  1671. }
  1672. return new RefImpl(rawValue, shallow);
  1673. }
  1674. class RefImpl {
  1675. constructor(value, isShallow2) {
  1676. this.dep = new Dep();
  1677. this["__v_isRef"] = true;
  1678. this["__v_isShallow"] = false;
  1679. this._rawValue = isShallow2 ? value : toRaw(value);
  1680. this._value = isShallow2 ? value : toReactive(value);
  1681. this["__v_isShallow"] = isShallow2;
  1682. }
  1683. get value() {
  1684. {
  1685. this.dep.track({
  1686. target: this,
  1687. type: "get",
  1688. key: "value"
  1689. });
  1690. }
  1691. return this._value;
  1692. }
  1693. set value(newValue) {
  1694. const oldValue = this._rawValue;
  1695. const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue);
  1696. newValue = useDirectValue ? newValue : toRaw(newValue);
  1697. if (hasChanged(newValue, oldValue)) {
  1698. this._rawValue = newValue;
  1699. this._value = useDirectValue ? newValue : toReactive(newValue);
  1700. {
  1701. this.dep.trigger({
  1702. target: this,
  1703. type: "set",
  1704. key: "value",
  1705. newValue,
  1706. oldValue
  1707. });
  1708. }
  1709. }
  1710. }
  1711. }
  1712. function triggerRef(ref2) {
  1713. if (ref2.dep) {
  1714. {
  1715. ref2.dep.trigger({
  1716. target: ref2,
  1717. type: "set",
  1718. key: "value",
  1719. newValue: ref2._value
  1720. });
  1721. }
  1722. }
  1723. }
  1724. function unref(ref2) {
  1725. return isRef(ref2) ? ref2.value : ref2;
  1726. }
  1727. function toValue(source) {
  1728. return isFunction(source) ? source() : unref(source);
  1729. }
  1730. const shallowUnwrapHandlers = {
  1731. get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
  1732. set: (target, key, value, receiver) => {
  1733. const oldValue = target[key];
  1734. if (isRef(oldValue) && !isRef(value)) {
  1735. oldValue.value = value;
  1736. return true;
  1737. } else {
  1738. return Reflect.set(target, key, value, receiver);
  1739. }
  1740. }
  1741. };
  1742. function proxyRefs(objectWithRefs) {
  1743. return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
  1744. }
  1745. class CustomRefImpl {
  1746. constructor(factory) {
  1747. this["__v_isRef"] = true;
  1748. this._value = void 0;
  1749. const dep = this.dep = new Dep();
  1750. const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep));
  1751. this._get = get;
  1752. this._set = set;
  1753. }
  1754. get value() {
  1755. return this._value = this._get();
  1756. }
  1757. set value(newVal) {
  1758. this._set(newVal);
  1759. }
  1760. }
  1761. function customRef(factory) {
  1762. return new CustomRefImpl(factory);
  1763. }
  1764. function toRefs(object) {
  1765. if (!isProxy(object)) {
  1766. warn$2(`toRefs() expects a reactive object but received a plain one.`);
  1767. }
  1768. const ret = isArray(object) ? new Array(object.length) : {};
  1769. for (const key in object) {
  1770. ret[key] = propertyToRef(object, key);
  1771. }
  1772. return ret;
  1773. }
  1774. class ObjectRefImpl {
  1775. constructor(_object, _key, _defaultValue) {
  1776. this._object = _object;
  1777. this._key = _key;
  1778. this._defaultValue = _defaultValue;
  1779. this["__v_isRef"] = true;
  1780. this._value = void 0;
  1781. }
  1782. get value() {
  1783. const val = this._object[this._key];
  1784. return this._value = val === void 0 ? this._defaultValue : val;
  1785. }
  1786. set value(newVal) {
  1787. this._object[this._key] = newVal;
  1788. }
  1789. get dep() {
  1790. return getDepFromReactive(toRaw(this._object), this._key);
  1791. }
  1792. }
  1793. class GetterRefImpl {
  1794. constructor(_getter) {
  1795. this._getter = _getter;
  1796. this["__v_isRef"] = true;
  1797. this["__v_isReadonly"] = true;
  1798. this._value = void 0;
  1799. }
  1800. get value() {
  1801. return this._value = this._getter();
  1802. }
  1803. }
  1804. function toRef(source, key, defaultValue) {
  1805. if (isRef(source)) {
  1806. return source;
  1807. } else if (isFunction(source)) {
  1808. return new GetterRefImpl(source);
  1809. } else if (isObject(source) && arguments.length > 1) {
  1810. return propertyToRef(source, key, defaultValue);
  1811. } else {
  1812. return ref(source);
  1813. }
  1814. }
  1815. function propertyToRef(source, key, defaultValue) {
  1816. const val = source[key];
  1817. return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
  1818. }
  1819. class ComputedRefImpl {
  1820. constructor(fn, setter, isSSR) {
  1821. this.fn = fn;
  1822. this.setter = setter;
  1823. /**
  1824. * @internal
  1825. */
  1826. this._value = void 0;
  1827. /**
  1828. * @internal
  1829. */
  1830. this.dep = new Dep(this);
  1831. /**
  1832. * @internal
  1833. */
  1834. this.__v_isRef = true;
  1835. // TODO isolatedDeclarations "__v_isReadonly"
  1836. // A computed is also a subscriber that tracks other deps
  1837. /**
  1838. * @internal
  1839. */
  1840. this.deps = void 0;
  1841. /**
  1842. * @internal
  1843. */
  1844. this.depsTail = void 0;
  1845. /**
  1846. * @internal
  1847. */
  1848. this.flags = 16;
  1849. /**
  1850. * @internal
  1851. */
  1852. this.globalVersion = globalVersion - 1;
  1853. /**
  1854. * @internal
  1855. */
  1856. this.next = void 0;
  1857. // for backwards compat
  1858. this.effect = this;
  1859. this["__v_isReadonly"] = !setter;
  1860. this.isSSR = isSSR;
  1861. }
  1862. /**
  1863. * @internal
  1864. */
  1865. notify() {
  1866. this.flags |= 16;
  1867. if (!(this.flags & 8) && // avoid infinite self recursion
  1868. activeSub !== this) {
  1869. batch(this, true);
  1870. return true;
  1871. }
  1872. }
  1873. get value() {
  1874. const link = this.dep.track({
  1875. target: this,
  1876. type: "get",
  1877. key: "value"
  1878. }) ;
  1879. refreshComputed(this);
  1880. if (link) {
  1881. link.version = this.dep.version;
  1882. }
  1883. return this._value;
  1884. }
  1885. set value(newValue) {
  1886. if (this.setter) {
  1887. this.setter(newValue);
  1888. } else {
  1889. warn$2("Write operation failed: computed value is readonly");
  1890. }
  1891. }
  1892. }
  1893. function computed$1(getterOrOptions, debugOptions, isSSR = false) {
  1894. let getter;
  1895. let setter;
  1896. if (isFunction(getterOrOptions)) {
  1897. getter = getterOrOptions;
  1898. } else {
  1899. getter = getterOrOptions.get;
  1900. setter = getterOrOptions.set;
  1901. }
  1902. const cRef = new ComputedRefImpl(getter, setter, isSSR);
  1903. if (debugOptions && !isSSR) {
  1904. cRef.onTrack = debugOptions.onTrack;
  1905. cRef.onTrigger = debugOptions.onTrigger;
  1906. }
  1907. return cRef;
  1908. }
  1909. const TrackOpTypes = {
  1910. "GET": "get",
  1911. "HAS": "has",
  1912. "ITERATE": "iterate"
  1913. };
  1914. const TriggerOpTypes = {
  1915. "SET": "set",
  1916. "ADD": "add",
  1917. "DELETE": "delete",
  1918. "CLEAR": "clear"
  1919. };
  1920. const INITIAL_WATCHER_VALUE = {};
  1921. const cleanupMap = /* @__PURE__ */ new WeakMap();
  1922. let activeWatcher = void 0;
  1923. function getCurrentWatcher() {
  1924. return activeWatcher;
  1925. }
  1926. function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
  1927. if (owner) {
  1928. let cleanups = cleanupMap.get(owner);
  1929. if (!cleanups) cleanupMap.set(owner, cleanups = []);
  1930. cleanups.push(cleanupFn);
  1931. } else if (!failSilently) {
  1932. warn$2(
  1933. `onWatcherCleanup() was called when there was no active watcher to associate with.`
  1934. );
  1935. }
  1936. }
  1937. function watch$1(source, cb, options = EMPTY_OBJ) {
  1938. const { immediate, deep, once, scheduler, augmentJob, call } = options;
  1939. const warnInvalidSource = (s) => {
  1940. (options.onWarn || warn$2)(
  1941. `Invalid watch source: `,
  1942. s,
  1943. `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
  1944. );
  1945. };
  1946. const reactiveGetter = (source2) => {
  1947. if (deep) return source2;
  1948. if (isShallow(source2) || deep === false || deep === 0)
  1949. return traverse(source2, 1);
  1950. return traverse(source2);
  1951. };
  1952. let effect;
  1953. let getter;
  1954. let cleanup;
  1955. let boundCleanup;
  1956. let forceTrigger = false;
  1957. let isMultiSource = false;
  1958. if (isRef(source)) {
  1959. getter = () => source.value;
  1960. forceTrigger = isShallow(source);
  1961. } else if (isReactive(source)) {
  1962. getter = () => reactiveGetter(source);
  1963. forceTrigger = true;
  1964. } else if (isArray(source)) {
  1965. isMultiSource = true;
  1966. forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
  1967. getter = () => source.map((s) => {
  1968. if (isRef(s)) {
  1969. return s.value;
  1970. } else if (isReactive(s)) {
  1971. return reactiveGetter(s);
  1972. } else if (isFunction(s)) {
  1973. return call ? call(s, 2) : s();
  1974. } else {
  1975. warnInvalidSource(s);
  1976. }
  1977. });
  1978. } else if (isFunction(source)) {
  1979. if (cb) {
  1980. getter = call ? () => call(source, 2) : source;
  1981. } else {
  1982. getter = () => {
  1983. if (cleanup) {
  1984. pauseTracking();
  1985. try {
  1986. cleanup();
  1987. } finally {
  1988. resetTracking();
  1989. }
  1990. }
  1991. const currentEffect = activeWatcher;
  1992. activeWatcher = effect;
  1993. try {
  1994. return call ? call(source, 3, [boundCleanup]) : source(boundCleanup);
  1995. } finally {
  1996. activeWatcher = currentEffect;
  1997. }
  1998. };
  1999. }
  2000. } else {
  2001. getter = NOOP;
  2002. warnInvalidSource(source);
  2003. }
  2004. if (cb && deep) {
  2005. const baseGetter = getter;
  2006. const depth = deep === true ? Infinity : deep;
  2007. getter = () => traverse(baseGetter(), depth);
  2008. }
  2009. const scope = getCurrentScope();
  2010. const watchHandle = () => {
  2011. effect.stop();
  2012. if (scope) {
  2013. remove(scope.effects, effect);
  2014. }
  2015. };
  2016. if (once && cb) {
  2017. const _cb = cb;
  2018. cb = (...args) => {
  2019. _cb(...args);
  2020. watchHandle();
  2021. };
  2022. }
  2023. let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
  2024. const job = (immediateFirstRun) => {
  2025. if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {
  2026. return;
  2027. }
  2028. if (cb) {
  2029. const newValue = effect.run();
  2030. if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
  2031. if (cleanup) {
  2032. cleanup();
  2033. }
  2034. const currentWatcher = activeWatcher;
  2035. activeWatcher = effect;
  2036. try {
  2037. const args = [
  2038. newValue,
  2039. // pass undefined as the old value when it's changed for the first time
  2040. oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
  2041. boundCleanup
  2042. ];
  2043. call ? call(cb, 3, args) : (
  2044. // @ts-expect-error
  2045. cb(...args)
  2046. );
  2047. oldValue = newValue;
  2048. } finally {
  2049. activeWatcher = currentWatcher;
  2050. }
  2051. }
  2052. } else {
  2053. effect.run();
  2054. }
  2055. };
  2056. if (augmentJob) {
  2057. augmentJob(job);
  2058. }
  2059. effect = new ReactiveEffect(getter);
  2060. effect.scheduler = scheduler ? () => scheduler(job, false) : job;
  2061. boundCleanup = (fn) => onWatcherCleanup(fn, false, effect);
  2062. cleanup = effect.onStop = () => {
  2063. const cleanups = cleanupMap.get(effect);
  2064. if (cleanups) {
  2065. if (call) {
  2066. call(cleanups, 4);
  2067. } else {
  2068. for (const cleanup2 of cleanups) cleanup2();
  2069. }
  2070. cleanupMap.delete(effect);
  2071. }
  2072. };
  2073. {
  2074. effect.onTrack = options.onTrack;
  2075. effect.onTrigger = options.onTrigger;
  2076. }
  2077. if (cb) {
  2078. if (immediate) {
  2079. job(true);
  2080. } else {
  2081. oldValue = effect.run();
  2082. }
  2083. } else if (scheduler) {
  2084. scheduler(job.bind(null, true), true);
  2085. } else {
  2086. effect.run();
  2087. }
  2088. watchHandle.pause = effect.pause.bind(effect);
  2089. watchHandle.resume = effect.resume.bind(effect);
  2090. watchHandle.stop = watchHandle;
  2091. return watchHandle;
  2092. }
  2093. function traverse(value, depth = Infinity, seen) {
  2094. if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
  2095. return value;
  2096. }
  2097. seen = seen || /* @__PURE__ */ new Set();
  2098. if (seen.has(value)) {
  2099. return value;
  2100. }
  2101. seen.add(value);
  2102. depth--;
  2103. if (isRef(value)) {
  2104. traverse(value.value, depth, seen);
  2105. } else if (isArray(value)) {
  2106. for (let i = 0; i < value.length; i++) {
  2107. traverse(value[i], depth, seen);
  2108. }
  2109. } else if (isSet(value) || isMap(value)) {
  2110. value.forEach((v) => {
  2111. traverse(v, depth, seen);
  2112. });
  2113. } else if (isPlainObject(value)) {
  2114. for (const key in value) {
  2115. traverse(value[key], depth, seen);
  2116. }
  2117. for (const key of Object.getOwnPropertySymbols(value)) {
  2118. if (Object.prototype.propertyIsEnumerable.call(value, key)) {
  2119. traverse(value[key], depth, seen);
  2120. }
  2121. }
  2122. }
  2123. return value;
  2124. }
  2125. const stack = [];
  2126. function pushWarningContext(vnode) {
  2127. stack.push(vnode);
  2128. }
  2129. function popWarningContext() {
  2130. stack.pop();
  2131. }
  2132. let isWarning = false;
  2133. function warn$1(msg, ...args) {
  2134. if (isWarning) return;
  2135. isWarning = true;
  2136. pauseTracking();
  2137. const instance = stack.length ? stack[stack.length - 1].component : null;
  2138. const appWarnHandler = instance && instance.appContext.config.warnHandler;
  2139. const trace = getComponentTrace();
  2140. if (appWarnHandler) {
  2141. callWithErrorHandling(
  2142. appWarnHandler,
  2143. instance,
  2144. 11,
  2145. [
  2146. // eslint-disable-next-line no-restricted-syntax
  2147. msg + args.map((a) => {
  2148. var _a, _b;
  2149. return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
  2150. }).join(""),
  2151. instance && instance.proxy,
  2152. trace.map(
  2153. ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
  2154. ).join("\n"),
  2155. trace
  2156. ]
  2157. );
  2158. } else {
  2159. const warnArgs = [`[Vue warn]: ${msg}`, ...args];
  2160. if (trace.length && // avoid spamming console during tests
  2161. true) {
  2162. warnArgs.push(`
  2163. `, ...formatTrace(trace));
  2164. }
  2165. console.warn(...warnArgs);
  2166. }
  2167. resetTracking();
  2168. isWarning = false;
  2169. }
  2170. function getComponentTrace() {
  2171. let currentVNode = stack[stack.length - 1];
  2172. if (!currentVNode) {
  2173. return [];
  2174. }
  2175. const normalizedStack = [];
  2176. while (currentVNode) {
  2177. const last = normalizedStack[0];
  2178. if (last && last.vnode === currentVNode) {
  2179. last.recurseCount++;
  2180. } else {
  2181. normalizedStack.push({
  2182. vnode: currentVNode,
  2183. recurseCount: 0
  2184. });
  2185. }
  2186. const parentInstance = currentVNode.component && currentVNode.component.parent;
  2187. currentVNode = parentInstance && parentInstance.vnode;
  2188. }
  2189. return normalizedStack;
  2190. }
  2191. function formatTrace(trace) {
  2192. const logs = [];
  2193. trace.forEach((entry, i) => {
  2194. logs.push(...i === 0 ? [] : [`
  2195. `], ...formatTraceEntry(entry));
  2196. });
  2197. return logs;
  2198. }
  2199. function formatTraceEntry({ vnode, recurseCount }) {
  2200. const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
  2201. const isRoot = vnode.component ? vnode.component.parent == null : false;
  2202. const open = ` at <${formatComponentName(
  2203. vnode.component,
  2204. vnode.type,
  2205. isRoot
  2206. )}`;
  2207. const close = `>` + postfix;
  2208. return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
  2209. }
  2210. function formatProps(props) {
  2211. const res = [];
  2212. const keys = Object.keys(props);
  2213. keys.slice(0, 3).forEach((key) => {
  2214. res.push(...formatProp(key, props[key]));
  2215. });
  2216. if (keys.length > 3) {
  2217. res.push(` ...`);
  2218. }
  2219. return res;
  2220. }
  2221. function formatProp(key, value, raw) {
  2222. if (isString(value)) {
  2223. value = JSON.stringify(value);
  2224. return raw ? value : [`${key}=${value}`];
  2225. } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
  2226. return raw ? value : [`${key}=${value}`];
  2227. } else if (isRef(value)) {
  2228. value = formatProp(key, toRaw(value.value), true);
  2229. return raw ? value : [`${key}=Ref<`, value, `>`];
  2230. } else if (isFunction(value)) {
  2231. return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
  2232. } else {
  2233. value = toRaw(value);
  2234. return raw ? value : [`${key}=`, value];
  2235. }
  2236. }
  2237. function assertNumber(val, type) {
  2238. if (val === void 0) {
  2239. return;
  2240. } else if (typeof val !== "number") {
  2241. warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`);
  2242. } else if (isNaN(val)) {
  2243. warn$1(`${type} is NaN - the duration expression might be incorrect.`);
  2244. }
  2245. }
  2246. const ErrorCodes = {
  2247. "SETUP_FUNCTION": 0,
  2248. "0": "SETUP_FUNCTION",
  2249. "RENDER_FUNCTION": 1,
  2250. "1": "RENDER_FUNCTION",
  2251. "NATIVE_EVENT_HANDLER": 5,
  2252. "5": "NATIVE_EVENT_HANDLER",
  2253. "COMPONENT_EVENT_HANDLER": 6,
  2254. "6": "COMPONENT_EVENT_HANDLER",
  2255. "VNODE_HOOK": 7,
  2256. "7": "VNODE_HOOK",
  2257. "DIRECTIVE_HOOK": 8,
  2258. "8": "DIRECTIVE_HOOK",
  2259. "TRANSITION_HOOK": 9,
  2260. "9": "TRANSITION_HOOK",
  2261. "APP_ERROR_HANDLER": 10,
  2262. "10": "APP_ERROR_HANDLER",
  2263. "APP_WARN_HANDLER": 11,
  2264. "11": "APP_WARN_HANDLER",
  2265. "FUNCTION_REF": 12,
  2266. "12": "FUNCTION_REF",
  2267. "ASYNC_COMPONENT_LOADER": 13,
  2268. "13": "ASYNC_COMPONENT_LOADER",
  2269. "SCHEDULER": 14,
  2270. "14": "SCHEDULER",
  2271. "COMPONENT_UPDATE": 15,
  2272. "15": "COMPONENT_UPDATE",
  2273. "APP_UNMOUNT_CLEANUP": 16,
  2274. "16": "APP_UNMOUNT_CLEANUP"
  2275. };
  2276. const ErrorTypeStrings$1 = {
  2277. ["sp"]: "serverPrefetch hook",
  2278. ["bc"]: "beforeCreate hook",
  2279. ["c"]: "created hook",
  2280. ["bm"]: "beforeMount hook",
  2281. ["m"]: "mounted hook",
  2282. ["bu"]: "beforeUpdate hook",
  2283. ["u"]: "updated",
  2284. ["bum"]: "beforeUnmount hook",
  2285. ["um"]: "unmounted hook",
  2286. ["a"]: "activated hook",
  2287. ["da"]: "deactivated hook",
  2288. ["ec"]: "errorCaptured hook",
  2289. ["rtc"]: "renderTracked hook",
  2290. ["rtg"]: "renderTriggered hook",
  2291. [0]: "setup function",
  2292. [1]: "render function",
  2293. [2]: "watcher getter",
  2294. [3]: "watcher callback",
  2295. [4]: "watcher cleanup function",
  2296. [5]: "native event handler",
  2297. [6]: "component event handler",
  2298. [7]: "vnode hook",
  2299. [8]: "directive hook",
  2300. [9]: "transition hook",
  2301. [10]: "app errorHandler",
  2302. [11]: "app warnHandler",
  2303. [12]: "ref function",
  2304. [13]: "async component loader",
  2305. [14]: "scheduler flush",
  2306. [15]: "component update",
  2307. [16]: "app unmount cleanup function"
  2308. };
  2309. function callWithErrorHandling(fn, instance, type, args) {
  2310. try {
  2311. return args ? fn(...args) : fn();
  2312. } catch (err) {
  2313. handleError(err, instance, type);
  2314. }
  2315. }
  2316. function callWithAsyncErrorHandling(fn, instance, type, args) {
  2317. if (isFunction(fn)) {
  2318. const res = callWithErrorHandling(fn, instance, type, args);
  2319. if (res && isPromise(res)) {
  2320. res.catch((err) => {
  2321. handleError(err, instance, type);
  2322. });
  2323. }
  2324. return res;
  2325. }
  2326. if (isArray(fn)) {
  2327. const values = [];
  2328. for (let i = 0; i < fn.length; i++) {
  2329. values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
  2330. }
  2331. return values;
  2332. } else {
  2333. warn$1(
  2334. `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`
  2335. );
  2336. }
  2337. }
  2338. function handleError(err, instance, type, throwInDev = true) {
  2339. const contextVNode = instance ? instance.vnode : null;
  2340. const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
  2341. if (instance) {
  2342. let cur = instance.parent;
  2343. const exposedInstance = instance.proxy;
  2344. const errorInfo = ErrorTypeStrings$1[type] ;
  2345. while (cur) {
  2346. const errorCapturedHooks = cur.ec;
  2347. if (errorCapturedHooks) {
  2348. for (let i = 0; i < errorCapturedHooks.length; i++) {
  2349. if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
  2350. return;
  2351. }
  2352. }
  2353. }
  2354. cur = cur.parent;
  2355. }
  2356. if (errorHandler) {
  2357. pauseTracking();
  2358. callWithErrorHandling(errorHandler, null, 10, [
  2359. err,
  2360. exposedInstance,
  2361. errorInfo
  2362. ]);
  2363. resetTracking();
  2364. return;
  2365. }
  2366. }
  2367. logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
  2368. }
  2369. function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {
  2370. {
  2371. const info = ErrorTypeStrings$1[type];
  2372. if (contextVNode) {
  2373. pushWarningContext(contextVNode);
  2374. }
  2375. warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
  2376. if (contextVNode) {
  2377. popWarningContext();
  2378. }
  2379. if (throwInDev) {
  2380. throw err;
  2381. } else {
  2382. console.error(err);
  2383. }
  2384. }
  2385. }
  2386. const queue = [];
  2387. let flushIndex = -1;
  2388. const pendingPostFlushCbs = [];
  2389. let activePostFlushCbs = null;
  2390. let postFlushIndex = 0;
  2391. const resolvedPromise = /* @__PURE__ */ Promise.resolve();
  2392. let currentFlushPromise = null;
  2393. const RECURSION_LIMIT = 100;
  2394. function nextTick(fn) {
  2395. const p = currentFlushPromise || resolvedPromise;
  2396. return fn ? p.then(this ? fn.bind(this) : fn) : p;
  2397. }
  2398. function findInsertionIndex(id) {
  2399. let start = flushIndex + 1;
  2400. let end = queue.length;
  2401. while (start < end) {
  2402. const middle = start + end >>> 1;
  2403. const middleJob = queue[middle];
  2404. const middleJobId = getId(middleJob);
  2405. if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
  2406. start = middle + 1;
  2407. } else {
  2408. end = middle;
  2409. }
  2410. }
  2411. return start;
  2412. }
  2413. function queueJob(job) {
  2414. if (!(job.flags & 1)) {
  2415. const jobId = getId(job);
  2416. const lastJob = queue[queue.length - 1];
  2417. if (!lastJob || // fast path when the job id is larger than the tail
  2418. !(job.flags & 2) && jobId >= getId(lastJob)) {
  2419. queue.push(job);
  2420. } else {
  2421. queue.splice(findInsertionIndex(jobId), 0, job);
  2422. }
  2423. job.flags |= 1;
  2424. queueFlush();
  2425. }
  2426. }
  2427. function queueFlush() {
  2428. if (!currentFlushPromise) {
  2429. currentFlushPromise = resolvedPromise.then(flushJobs);
  2430. }
  2431. }
  2432. function queuePostFlushCb(cb) {
  2433. if (!isArray(cb)) {
  2434. if (activePostFlushCbs && cb.id === -1) {
  2435. activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
  2436. } else if (!(cb.flags & 1)) {
  2437. pendingPostFlushCbs.push(cb);
  2438. cb.flags |= 1;
  2439. }
  2440. } else {
  2441. pendingPostFlushCbs.push(...cb);
  2442. }
  2443. queueFlush();
  2444. }
  2445. function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
  2446. {
  2447. seen = seen || /* @__PURE__ */ new Map();
  2448. }
  2449. for (; i < queue.length; i++) {
  2450. const cb = queue[i];
  2451. if (cb && cb.flags & 2) {
  2452. if (instance && cb.id !== instance.uid) {
  2453. continue;
  2454. }
  2455. if (checkRecursiveUpdates(seen, cb)) {
  2456. continue;
  2457. }
  2458. queue.splice(i, 1);
  2459. i--;
  2460. if (cb.flags & 4) {
  2461. cb.flags &= ~1;
  2462. }
  2463. cb();
  2464. if (!(cb.flags & 4)) {
  2465. cb.flags &= ~1;
  2466. }
  2467. }
  2468. }
  2469. }
  2470. function flushPostFlushCbs(seen) {
  2471. if (pendingPostFlushCbs.length) {
  2472. const deduped = [...new Set(pendingPostFlushCbs)].sort(
  2473. (a, b) => getId(a) - getId(b)
  2474. );
  2475. pendingPostFlushCbs.length = 0;
  2476. if (activePostFlushCbs) {
  2477. activePostFlushCbs.push(...deduped);
  2478. return;
  2479. }
  2480. activePostFlushCbs = deduped;
  2481. {
  2482. seen = seen || /* @__PURE__ */ new Map();
  2483. }
  2484. for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
  2485. const cb = activePostFlushCbs[postFlushIndex];
  2486. if (checkRecursiveUpdates(seen, cb)) {
  2487. continue;
  2488. }
  2489. if (cb.flags & 4) {
  2490. cb.flags &= ~1;
  2491. }
  2492. if (!(cb.flags & 8)) cb();
  2493. cb.flags &= ~1;
  2494. }
  2495. activePostFlushCbs = null;
  2496. postFlushIndex = 0;
  2497. }
  2498. }
  2499. const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
  2500. function flushJobs(seen) {
  2501. {
  2502. seen = seen || /* @__PURE__ */ new Map();
  2503. }
  2504. const check = (job) => checkRecursiveUpdates(seen, job) ;
  2505. try {
  2506. for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
  2507. const job = queue[flushIndex];
  2508. if (job && !(job.flags & 8)) {
  2509. if (check(job)) {
  2510. continue;
  2511. }
  2512. if (job.flags & 4) {
  2513. job.flags &= ~1;
  2514. }
  2515. callWithErrorHandling(
  2516. job,
  2517. job.i,
  2518. job.i ? 15 : 14
  2519. );
  2520. if (!(job.flags & 4)) {
  2521. job.flags &= ~1;
  2522. }
  2523. }
  2524. }
  2525. } finally {
  2526. for (; flushIndex < queue.length; flushIndex++) {
  2527. const job = queue[flushIndex];
  2528. if (job) {
  2529. job.flags &= ~1;
  2530. }
  2531. }
  2532. flushIndex = -1;
  2533. queue.length = 0;
  2534. flushPostFlushCbs(seen);
  2535. currentFlushPromise = null;
  2536. if (queue.length || pendingPostFlushCbs.length) {
  2537. flushJobs(seen);
  2538. }
  2539. }
  2540. }
  2541. function checkRecursiveUpdates(seen, fn) {
  2542. const count = seen.get(fn) || 0;
  2543. if (count > RECURSION_LIMIT) {
  2544. const instance = fn.i;
  2545. const componentName = instance && getComponentName(instance.type);
  2546. handleError(
  2547. `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.`,
  2548. null,
  2549. 10
  2550. );
  2551. return true;
  2552. }
  2553. seen.set(fn, count + 1);
  2554. return false;
  2555. }
  2556. let isHmrUpdating = false;
  2557. const hmrDirtyComponents = /* @__PURE__ */ new Map();
  2558. {
  2559. getGlobalThis().__VUE_HMR_RUNTIME__ = {
  2560. createRecord: tryWrap(createRecord),
  2561. rerender: tryWrap(rerender),
  2562. reload: tryWrap(reload)
  2563. };
  2564. }
  2565. const map = /* @__PURE__ */ new Map();
  2566. function registerHMR(instance) {
  2567. const id = instance.type.__hmrId;
  2568. let record = map.get(id);
  2569. if (!record) {
  2570. createRecord(id, instance.type);
  2571. record = map.get(id);
  2572. }
  2573. record.instances.add(instance);
  2574. }
  2575. function unregisterHMR(instance) {
  2576. map.get(instance.type.__hmrId).instances.delete(instance);
  2577. }
  2578. function createRecord(id, initialDef) {
  2579. if (map.has(id)) {
  2580. return false;
  2581. }
  2582. map.set(id, {
  2583. initialDef: normalizeClassComponent(initialDef),
  2584. instances: /* @__PURE__ */ new Set()
  2585. });
  2586. return true;
  2587. }
  2588. function normalizeClassComponent(component) {
  2589. return isClassComponent(component) ? component.__vccOpts : component;
  2590. }
  2591. function rerender(id, newRender) {
  2592. const record = map.get(id);
  2593. if (!record) {
  2594. return;
  2595. }
  2596. record.initialDef.render = newRender;
  2597. [...record.instances].forEach((instance) => {
  2598. if (newRender) {
  2599. instance.render = newRender;
  2600. normalizeClassComponent(instance.type).render = newRender;
  2601. }
  2602. instance.renderCache = [];
  2603. isHmrUpdating = true;
  2604. instance.update();
  2605. isHmrUpdating = false;
  2606. });
  2607. }
  2608. function reload(id, newComp) {
  2609. const record = map.get(id);
  2610. if (!record) return;
  2611. newComp = normalizeClassComponent(newComp);
  2612. updateComponentDef(record.initialDef, newComp);
  2613. const instances = [...record.instances];
  2614. for (let i = 0; i < instances.length; i++) {
  2615. const instance = instances[i];
  2616. const oldComp = normalizeClassComponent(instance.type);
  2617. let dirtyInstances = hmrDirtyComponents.get(oldComp);
  2618. if (!dirtyInstances) {
  2619. if (oldComp !== record.initialDef) {
  2620. updateComponentDef(oldComp, newComp);
  2621. }
  2622. hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
  2623. }
  2624. dirtyInstances.add(instance);
  2625. instance.appContext.propsCache.delete(instance.type);
  2626. instance.appContext.emitsCache.delete(instance.type);
  2627. instance.appContext.optionsCache.delete(instance.type);
  2628. if (instance.ceReload) {
  2629. dirtyInstances.add(instance);
  2630. instance.ceReload(newComp.styles);
  2631. dirtyInstances.delete(instance);
  2632. } else if (instance.parent) {
  2633. queueJob(() => {
  2634. isHmrUpdating = true;
  2635. instance.parent.update();
  2636. isHmrUpdating = false;
  2637. dirtyInstances.delete(instance);
  2638. });
  2639. } else if (instance.appContext.reload) {
  2640. instance.appContext.reload();
  2641. } else if (typeof window !== "undefined") {
  2642. window.location.reload();
  2643. } else {
  2644. console.warn(
  2645. "[HMR] Root or manually mounted instance modified. Full reload required."
  2646. );
  2647. }
  2648. if (instance.root.ce && instance !== instance.root) {
  2649. instance.root.ce._removeChildStyle(oldComp);
  2650. }
  2651. }
  2652. queuePostFlushCb(() => {
  2653. hmrDirtyComponents.clear();
  2654. });
  2655. }
  2656. function updateComponentDef(oldComp, newComp) {
  2657. extend(oldComp, newComp);
  2658. for (const key in oldComp) {
  2659. if (key !== "__file" && !(key in newComp)) {
  2660. delete oldComp[key];
  2661. }
  2662. }
  2663. }
  2664. function tryWrap(fn) {
  2665. return (id, arg) => {
  2666. try {
  2667. return fn(id, arg);
  2668. } catch (e) {
  2669. console.error(e);
  2670. console.warn(
  2671. `[HMR] Something went wrong during Vue component hot-reload. Full reload required.`
  2672. );
  2673. }
  2674. };
  2675. }
  2676. let devtools$1;
  2677. let buffer = [];
  2678. let devtoolsNotInstalled = false;
  2679. function emit$1(event, ...args) {
  2680. if (devtools$1) {
  2681. devtools$1.emit(event, ...args);
  2682. } else if (!devtoolsNotInstalled) {
  2683. buffer.push({ event, args });
  2684. }
  2685. }
  2686. function setDevtoolsHook$1(hook, target) {
  2687. var _a, _b;
  2688. devtools$1 = hook;
  2689. if (devtools$1) {
  2690. devtools$1.enabled = true;
  2691. buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args));
  2692. buffer = [];
  2693. } else if (
  2694. // handle late devtools injection - only do this if we are in an actual
  2695. // browser environment to avoid the timer handle stalling test runner exit
  2696. // (#4815)
  2697. typeof window !== "undefined" && // some envs mock window but not fully
  2698. window.HTMLElement && // also exclude jsdom
  2699. // eslint-disable-next-line no-restricted-syntax
  2700. !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))
  2701. ) {
  2702. const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
  2703. replay.push((newHook) => {
  2704. setDevtoolsHook$1(newHook, target);
  2705. });
  2706. setTimeout(() => {
  2707. if (!devtools$1) {
  2708. target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
  2709. devtoolsNotInstalled = true;
  2710. buffer = [];
  2711. }
  2712. }, 3e3);
  2713. } else {
  2714. devtoolsNotInstalled = true;
  2715. buffer = [];
  2716. }
  2717. }
  2718. function devtoolsInitApp(app, version) {
  2719. emit$1("app:init" /* APP_INIT */, app, version, {
  2720. Fragment,
  2721. Text,
  2722. Comment,
  2723. Static
  2724. });
  2725. }
  2726. function devtoolsUnmountApp(app) {
  2727. emit$1("app:unmount" /* APP_UNMOUNT */, app);
  2728. }
  2729. const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook("component:added" /* COMPONENT_ADDED */);
  2730. const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */);
  2731. const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
  2732. "component:removed" /* COMPONENT_REMOVED */
  2733. );
  2734. const devtoolsComponentRemoved = (component) => {
  2735. if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered
  2736. !devtools$1.cleanupBuffer(component)) {
  2737. _devtoolsComponentRemoved(component);
  2738. }
  2739. };
  2740. /*! #__NO_SIDE_EFFECTS__ */
  2741. // @__NO_SIDE_EFFECTS__
  2742. function createDevtoolsComponentHook(hook) {
  2743. return (component) => {
  2744. emit$1(
  2745. hook,
  2746. component.appContext.app,
  2747. component.uid,
  2748. component.parent ? component.parent.uid : void 0,
  2749. component
  2750. );
  2751. };
  2752. }
  2753. const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:start" /* PERFORMANCE_START */);
  2754. const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:end" /* PERFORMANCE_END */);
  2755. function createDevtoolsPerformanceHook(hook) {
  2756. return (component, type, time) => {
  2757. emit$1(hook, component.appContext.app, component.uid, component, type, time);
  2758. };
  2759. }
  2760. function devtoolsComponentEmit(component, event, params) {
  2761. emit$1(
  2762. "component:emit" /* COMPONENT_EMIT */,
  2763. component.appContext.app,
  2764. component,
  2765. event,
  2766. params
  2767. );
  2768. }
  2769. let currentRenderingInstance = null;
  2770. let currentScopeId = null;
  2771. function setCurrentRenderingInstance(instance) {
  2772. const prev = currentRenderingInstance;
  2773. currentRenderingInstance = instance;
  2774. currentScopeId = instance && instance.type.__scopeId || null;
  2775. return prev;
  2776. }
  2777. function pushScopeId(id) {
  2778. currentScopeId = id;
  2779. }
  2780. function popScopeId() {
  2781. currentScopeId = null;
  2782. }
  2783. const withScopeId = (_id) => withCtx;
  2784. function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
  2785. if (!ctx) return fn;
  2786. if (fn._n) {
  2787. return fn;
  2788. }
  2789. const renderFnWithContext = (...args) => {
  2790. if (renderFnWithContext._d) {
  2791. setBlockTracking(-1);
  2792. }
  2793. const prevInstance = setCurrentRenderingInstance(ctx);
  2794. let res;
  2795. try {
  2796. res = fn(...args);
  2797. } finally {
  2798. setCurrentRenderingInstance(prevInstance);
  2799. if (renderFnWithContext._d) {
  2800. setBlockTracking(1);
  2801. }
  2802. }
  2803. {
  2804. devtoolsComponentUpdated(ctx);
  2805. }
  2806. return res;
  2807. };
  2808. renderFnWithContext._n = true;
  2809. renderFnWithContext._c = true;
  2810. renderFnWithContext._d = true;
  2811. return renderFnWithContext;
  2812. }
  2813. function validateDirectiveName(name) {
  2814. if (isBuiltInDirective(name)) {
  2815. warn$1("Do not use built-in directive ids as custom directive id: " + name);
  2816. }
  2817. }
  2818. function withDirectives(vnode, directives) {
  2819. if (currentRenderingInstance === null) {
  2820. warn$1(`withDirectives can only be used inside render functions.`);
  2821. return vnode;
  2822. }
  2823. const instance = getComponentPublicInstance(currentRenderingInstance);
  2824. const bindings = vnode.dirs || (vnode.dirs = []);
  2825. for (let i = 0; i < directives.length; i++) {
  2826. let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
  2827. if (dir) {
  2828. if (isFunction(dir)) {
  2829. dir = {
  2830. mounted: dir,
  2831. updated: dir
  2832. };
  2833. }
  2834. if (dir.deep) {
  2835. traverse(value);
  2836. }
  2837. bindings.push({
  2838. dir,
  2839. instance,
  2840. value,
  2841. oldValue: void 0,
  2842. arg,
  2843. modifiers
  2844. });
  2845. }
  2846. }
  2847. return vnode;
  2848. }
  2849. function invokeDirectiveHook(vnode, prevVNode, instance, name) {
  2850. const bindings = vnode.dirs;
  2851. const oldBindings = prevVNode && prevVNode.dirs;
  2852. for (let i = 0; i < bindings.length; i++) {
  2853. const binding = bindings[i];
  2854. if (oldBindings) {
  2855. binding.oldValue = oldBindings[i].value;
  2856. }
  2857. let hook = binding.dir[name];
  2858. if (hook) {
  2859. pauseTracking();
  2860. callWithAsyncErrorHandling(hook, instance, 8, [
  2861. vnode.el,
  2862. binding,
  2863. vnode,
  2864. prevVNode
  2865. ]);
  2866. resetTracking();
  2867. }
  2868. }
  2869. }
  2870. const TeleportEndKey = Symbol("_vte");
  2871. const isTeleport = (type) => type.__isTeleport;
  2872. const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
  2873. const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
  2874. const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
  2875. const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
  2876. const resolveTarget = (props, select) => {
  2877. const targetSelector = props && props.to;
  2878. if (isString(targetSelector)) {
  2879. if (!select) {
  2880. warn$1(
  2881. `Current renderer does not support string target for Teleports. (missing querySelector renderer option)`
  2882. );
  2883. return null;
  2884. } else {
  2885. const target = select(targetSelector);
  2886. if (!target && !isTeleportDisabled(props)) {
  2887. warn$1(
  2888. `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.`
  2889. );
  2890. }
  2891. return target;
  2892. }
  2893. } else {
  2894. if (!targetSelector && !isTeleportDisabled(props)) {
  2895. warn$1(`Invalid Teleport target: ${targetSelector}`);
  2896. }
  2897. return targetSelector;
  2898. }
  2899. };
  2900. const TeleportImpl = {
  2901. name: "Teleport",
  2902. __isTeleport: true,
  2903. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
  2904. const {
  2905. mc: mountChildren,
  2906. pc: patchChildren,
  2907. pbc: patchBlockChildren,
  2908. o: { insert, querySelector, createText, createComment }
  2909. } = internals;
  2910. const disabled = isTeleportDisabled(n2.props);
  2911. let { shapeFlag, children, dynamicChildren } = n2;
  2912. if (isHmrUpdating) {
  2913. optimized = false;
  2914. dynamicChildren = null;
  2915. }
  2916. if (n1 == null) {
  2917. const placeholder = n2.el = createComment("teleport start") ;
  2918. const mainAnchor = n2.anchor = createComment("teleport end") ;
  2919. insert(placeholder, container, anchor);
  2920. insert(mainAnchor, container, anchor);
  2921. const mount = (container2, anchor2) => {
  2922. if (shapeFlag & 16) {
  2923. if (parentComponent && parentComponent.isCE) {
  2924. parentComponent.ce._teleportTarget = container2;
  2925. }
  2926. mountChildren(
  2927. children,
  2928. container2,
  2929. anchor2,
  2930. parentComponent,
  2931. parentSuspense,
  2932. namespace,
  2933. slotScopeIds,
  2934. optimized
  2935. );
  2936. }
  2937. };
  2938. const mountToTarget = () => {
  2939. const target = n2.target = resolveTarget(n2.props, querySelector);
  2940. const targetAnchor = prepareAnchor(target, n2, createText, insert);
  2941. if (target) {
  2942. if (namespace !== "svg" && isTargetSVG(target)) {
  2943. namespace = "svg";
  2944. } else if (namespace !== "mathml" && isTargetMathML(target)) {
  2945. namespace = "mathml";
  2946. }
  2947. if (!disabled) {
  2948. mount(target, targetAnchor);
  2949. updateCssVars(n2, false);
  2950. }
  2951. } else if (!disabled) {
  2952. warn$1(
  2953. "Invalid Teleport target on mount:",
  2954. target,
  2955. `(${typeof target})`
  2956. );
  2957. }
  2958. };
  2959. if (disabled) {
  2960. mount(container, mainAnchor);
  2961. updateCssVars(n2, true);
  2962. }
  2963. if (isTeleportDeferred(n2.props)) {
  2964. queuePostRenderEffect(mountToTarget, parentSuspense);
  2965. } else {
  2966. mountToTarget();
  2967. }
  2968. } else {
  2969. n2.el = n1.el;
  2970. n2.targetStart = n1.targetStart;
  2971. const mainAnchor = n2.anchor = n1.anchor;
  2972. const target = n2.target = n1.target;
  2973. const targetAnchor = n2.targetAnchor = n1.targetAnchor;
  2974. const wasDisabled = isTeleportDisabled(n1.props);
  2975. const currentContainer = wasDisabled ? container : target;
  2976. const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
  2977. if (namespace === "svg" || isTargetSVG(target)) {
  2978. namespace = "svg";
  2979. } else if (namespace === "mathml" || isTargetMathML(target)) {
  2980. namespace = "mathml";
  2981. }
  2982. if (dynamicChildren) {
  2983. patchBlockChildren(
  2984. n1.dynamicChildren,
  2985. dynamicChildren,
  2986. currentContainer,
  2987. parentComponent,
  2988. parentSuspense,
  2989. namespace,
  2990. slotScopeIds
  2991. );
  2992. traverseStaticChildren(n1, n2, true);
  2993. } else if (!optimized) {
  2994. patchChildren(
  2995. n1,
  2996. n2,
  2997. currentContainer,
  2998. currentAnchor,
  2999. parentComponent,
  3000. parentSuspense,
  3001. namespace,
  3002. slotScopeIds,
  3003. false
  3004. );
  3005. }
  3006. if (disabled) {
  3007. if (!wasDisabled) {
  3008. moveTeleport(
  3009. n2,
  3010. container,
  3011. mainAnchor,
  3012. internals,
  3013. 1
  3014. );
  3015. } else {
  3016. if (n2.props && n1.props && n2.props.to !== n1.props.to) {
  3017. n2.props.to = n1.props.to;
  3018. }
  3019. }
  3020. } else {
  3021. if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
  3022. const nextTarget = n2.target = resolveTarget(
  3023. n2.props,
  3024. querySelector
  3025. );
  3026. if (nextTarget) {
  3027. moveTeleport(
  3028. n2,
  3029. nextTarget,
  3030. null,
  3031. internals,
  3032. 0
  3033. );
  3034. } else {
  3035. warn$1(
  3036. "Invalid Teleport target on update:",
  3037. target,
  3038. `(${typeof target})`
  3039. );
  3040. }
  3041. } else if (wasDisabled) {
  3042. moveTeleport(
  3043. n2,
  3044. target,
  3045. targetAnchor,
  3046. internals,
  3047. 1
  3048. );
  3049. }
  3050. }
  3051. updateCssVars(n2, disabled);
  3052. }
  3053. },
  3054. remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
  3055. const {
  3056. shapeFlag,
  3057. children,
  3058. anchor,
  3059. targetStart,
  3060. targetAnchor,
  3061. target,
  3062. props
  3063. } = vnode;
  3064. if (target) {
  3065. hostRemove(targetStart);
  3066. hostRemove(targetAnchor);
  3067. }
  3068. doRemove && hostRemove(anchor);
  3069. if (shapeFlag & 16) {
  3070. const shouldRemove = doRemove || !isTeleportDisabled(props);
  3071. for (let i = 0; i < children.length; i++) {
  3072. const child = children[i];
  3073. unmount(
  3074. child,
  3075. parentComponent,
  3076. parentSuspense,
  3077. shouldRemove,
  3078. !!child.dynamicChildren
  3079. );
  3080. }
  3081. }
  3082. },
  3083. move: moveTeleport,
  3084. hydrate: hydrateTeleport
  3085. };
  3086. function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
  3087. if (moveType === 0) {
  3088. insert(vnode.targetAnchor, container, parentAnchor);
  3089. }
  3090. const { el, anchor, shapeFlag, children, props } = vnode;
  3091. const isReorder = moveType === 2;
  3092. if (isReorder) {
  3093. insert(el, container, parentAnchor);
  3094. }
  3095. if (!isReorder || isTeleportDisabled(props)) {
  3096. if (shapeFlag & 16) {
  3097. for (let i = 0; i < children.length; i++) {
  3098. move(
  3099. children[i],
  3100. container,
  3101. parentAnchor,
  3102. 2
  3103. );
  3104. }
  3105. }
  3106. }
  3107. if (isReorder) {
  3108. insert(anchor, container, parentAnchor);
  3109. }
  3110. }
  3111. function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
  3112. o: { nextSibling, parentNode, querySelector, insert, createText }
  3113. }, hydrateChildren) {
  3114. const target = vnode.target = resolveTarget(
  3115. vnode.props,
  3116. querySelector
  3117. );
  3118. if (target) {
  3119. const disabled = isTeleportDisabled(vnode.props);
  3120. const targetNode = target._lpa || target.firstChild;
  3121. if (vnode.shapeFlag & 16) {
  3122. if (disabled) {
  3123. vnode.anchor = hydrateChildren(
  3124. nextSibling(node),
  3125. vnode,
  3126. parentNode(node),
  3127. parentComponent,
  3128. parentSuspense,
  3129. slotScopeIds,
  3130. optimized
  3131. );
  3132. vnode.targetStart = targetNode;
  3133. vnode.targetAnchor = targetNode && nextSibling(targetNode);
  3134. } else {
  3135. vnode.anchor = nextSibling(node);
  3136. let targetAnchor = targetNode;
  3137. while (targetAnchor) {
  3138. if (targetAnchor && targetAnchor.nodeType === 8) {
  3139. if (targetAnchor.data === "teleport start anchor") {
  3140. vnode.targetStart = targetAnchor;
  3141. } else if (targetAnchor.data === "teleport anchor") {
  3142. vnode.targetAnchor = targetAnchor;
  3143. target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
  3144. break;
  3145. }
  3146. }
  3147. targetAnchor = nextSibling(targetAnchor);
  3148. }
  3149. if (!vnode.targetAnchor) {
  3150. prepareAnchor(target, vnode, createText, insert);
  3151. }
  3152. hydrateChildren(
  3153. targetNode && nextSibling(targetNode),
  3154. vnode,
  3155. target,
  3156. parentComponent,
  3157. parentSuspense,
  3158. slotScopeIds,
  3159. optimized
  3160. );
  3161. }
  3162. }
  3163. updateCssVars(vnode, disabled);
  3164. }
  3165. return vnode.anchor && nextSibling(vnode.anchor);
  3166. }
  3167. const Teleport = TeleportImpl;
  3168. function updateCssVars(vnode, isDisabled) {
  3169. const ctx = vnode.ctx;
  3170. if (ctx && ctx.ut) {
  3171. let node, anchor;
  3172. if (isDisabled) {
  3173. node = vnode.el;
  3174. anchor = vnode.anchor;
  3175. } else {
  3176. node = vnode.targetStart;
  3177. anchor = vnode.targetAnchor;
  3178. }
  3179. while (node && node !== anchor) {
  3180. if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
  3181. node = node.nextSibling;
  3182. }
  3183. ctx.ut();
  3184. }
  3185. }
  3186. function prepareAnchor(target, vnode, createText, insert) {
  3187. const targetStart = vnode.targetStart = createText("");
  3188. const targetAnchor = vnode.targetAnchor = createText("");
  3189. targetStart[TeleportEndKey] = targetAnchor;
  3190. if (target) {
  3191. insert(targetStart, target);
  3192. insert(targetAnchor, target);
  3193. }
  3194. return targetAnchor;
  3195. }
  3196. const leaveCbKey = Symbol("_leaveCb");
  3197. const enterCbKey$1 = Symbol("_enterCb");
  3198. function useTransitionState() {
  3199. const state = {
  3200. isMounted: false,
  3201. isLeaving: false,
  3202. isUnmounting: false,
  3203. leavingVNodes: /* @__PURE__ */ new Map()
  3204. };
  3205. onMounted(() => {
  3206. state.isMounted = true;
  3207. });
  3208. onBeforeUnmount(() => {
  3209. state.isUnmounting = true;
  3210. });
  3211. return state;
  3212. }
  3213. const TransitionHookValidator = [Function, Array];
  3214. const BaseTransitionPropsValidators = {
  3215. mode: String,
  3216. appear: Boolean,
  3217. persisted: Boolean,
  3218. // enter
  3219. onBeforeEnter: TransitionHookValidator,
  3220. onEnter: TransitionHookValidator,
  3221. onAfterEnter: TransitionHookValidator,
  3222. onEnterCancelled: TransitionHookValidator,
  3223. // leave
  3224. onBeforeLeave: TransitionHookValidator,
  3225. onLeave: TransitionHookValidator,
  3226. onAfterLeave: TransitionHookValidator,
  3227. onLeaveCancelled: TransitionHookValidator,
  3228. // appear
  3229. onBeforeAppear: TransitionHookValidator,
  3230. onAppear: TransitionHookValidator,
  3231. onAfterAppear: TransitionHookValidator,
  3232. onAppearCancelled: TransitionHookValidator
  3233. };
  3234. const recursiveGetSubtree = (instance) => {
  3235. const subTree = instance.subTree;
  3236. return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
  3237. };
  3238. const BaseTransitionImpl = {
  3239. name: `BaseTransition`,
  3240. props: BaseTransitionPropsValidators,
  3241. setup(props, { slots }) {
  3242. const instance = getCurrentInstance();
  3243. const state = useTransitionState();
  3244. return () => {
  3245. const children = slots.default && getTransitionRawChildren(slots.default(), true);
  3246. if (!children || !children.length) {
  3247. return;
  3248. }
  3249. const child = findNonCommentChild(children);
  3250. const rawProps = toRaw(props);
  3251. const { mode } = rawProps;
  3252. if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
  3253. warn$1(`invalid <transition> mode: ${mode}`);
  3254. }
  3255. if (state.isLeaving) {
  3256. return emptyPlaceholder(child);
  3257. }
  3258. const innerChild = getInnerChild$1(child);
  3259. if (!innerChild) {
  3260. return emptyPlaceholder(child);
  3261. }
  3262. let enterHooks = resolveTransitionHooks(
  3263. innerChild,
  3264. rawProps,
  3265. state,
  3266. instance,
  3267. // #11061, ensure enterHooks is fresh after clone
  3268. (hooks) => enterHooks = hooks
  3269. );
  3270. if (innerChild.type !== Comment) {
  3271. setTransitionHooks(innerChild, enterHooks);
  3272. }
  3273. const oldChild = instance.subTree;
  3274. const oldInnerChild = oldChild && getInnerChild$1(oldChild);
  3275. if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
  3276. const leavingHooks = resolveTransitionHooks(
  3277. oldInnerChild,
  3278. rawProps,
  3279. state,
  3280. instance
  3281. );
  3282. setTransitionHooks(oldInnerChild, leavingHooks);
  3283. if (mode === "out-in" && innerChild.type !== Comment) {
  3284. state.isLeaving = true;
  3285. leavingHooks.afterLeave = () => {
  3286. state.isLeaving = false;
  3287. if (!(instance.job.flags & 8)) {
  3288. instance.update();
  3289. }
  3290. delete leavingHooks.afterLeave;
  3291. };
  3292. return emptyPlaceholder(child);
  3293. } else if (mode === "in-out" && innerChild.type !== Comment) {
  3294. leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
  3295. const leavingVNodesCache = getLeavingNodesForType(
  3296. state,
  3297. oldInnerChild
  3298. );
  3299. leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
  3300. el[leaveCbKey] = () => {
  3301. earlyRemove();
  3302. el[leaveCbKey] = void 0;
  3303. delete enterHooks.delayedLeave;
  3304. };
  3305. enterHooks.delayedLeave = delayedLeave;
  3306. };
  3307. }
  3308. }
  3309. return child;
  3310. };
  3311. }
  3312. };
  3313. function findNonCommentChild(children) {
  3314. let child = children[0];
  3315. if (children.length > 1) {
  3316. let hasFound = false;
  3317. for (const c of children) {
  3318. if (c.type !== Comment) {
  3319. if (hasFound) {
  3320. warn$1(
  3321. "<transition> can only be used on a single element or component. Use <transition-group> for lists."
  3322. );
  3323. break;
  3324. }
  3325. child = c;
  3326. hasFound = true;
  3327. }
  3328. }
  3329. }
  3330. return child;
  3331. }
  3332. const BaseTransition = BaseTransitionImpl;
  3333. function getLeavingNodesForType(state, vnode) {
  3334. const { leavingVNodes } = state;
  3335. let leavingVNodesCache = leavingVNodes.get(vnode.type);
  3336. if (!leavingVNodesCache) {
  3337. leavingVNodesCache = /* @__PURE__ */ Object.create(null);
  3338. leavingVNodes.set(vnode.type, leavingVNodesCache);
  3339. }
  3340. return leavingVNodesCache;
  3341. }
  3342. function resolveTransitionHooks(vnode, props, state, instance, postClone) {
  3343. const {
  3344. appear,
  3345. mode,
  3346. persisted = false,
  3347. onBeforeEnter,
  3348. onEnter,
  3349. onAfterEnter,
  3350. onEnterCancelled,
  3351. onBeforeLeave,
  3352. onLeave,
  3353. onAfterLeave,
  3354. onLeaveCancelled,
  3355. onBeforeAppear,
  3356. onAppear,
  3357. onAfterAppear,
  3358. onAppearCancelled
  3359. } = props;
  3360. const key = String(vnode.key);
  3361. const leavingVNodesCache = getLeavingNodesForType(state, vnode);
  3362. const callHook = (hook, args) => {
  3363. hook && callWithAsyncErrorHandling(
  3364. hook,
  3365. instance,
  3366. 9,
  3367. args
  3368. );
  3369. };
  3370. const callAsyncHook = (hook, args) => {
  3371. const done = args[1];
  3372. callHook(hook, args);
  3373. if (isArray(hook)) {
  3374. if (hook.every((hook2) => hook2.length <= 1)) done();
  3375. } else if (hook.length <= 1) {
  3376. done();
  3377. }
  3378. };
  3379. const hooks = {
  3380. mode,
  3381. persisted,
  3382. beforeEnter(el) {
  3383. let hook = onBeforeEnter;
  3384. if (!state.isMounted) {
  3385. if (appear) {
  3386. hook = onBeforeAppear || onBeforeEnter;
  3387. } else {
  3388. return;
  3389. }
  3390. }
  3391. if (el[leaveCbKey]) {
  3392. el[leaveCbKey](
  3393. true
  3394. /* cancelled */
  3395. );
  3396. }
  3397. const leavingVNode = leavingVNodesCache[key];
  3398. if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
  3399. leavingVNode.el[leaveCbKey]();
  3400. }
  3401. callHook(hook, [el]);
  3402. },
  3403. enter(el) {
  3404. let hook = onEnter;
  3405. let afterHook = onAfterEnter;
  3406. let cancelHook = onEnterCancelled;
  3407. if (!state.isMounted) {
  3408. if (appear) {
  3409. hook = onAppear || onEnter;
  3410. afterHook = onAfterAppear || onAfterEnter;
  3411. cancelHook = onAppearCancelled || onEnterCancelled;
  3412. } else {
  3413. return;
  3414. }
  3415. }
  3416. let called = false;
  3417. const done = el[enterCbKey$1] = (cancelled) => {
  3418. if (called) return;
  3419. called = true;
  3420. if (cancelled) {
  3421. callHook(cancelHook, [el]);
  3422. } else {
  3423. callHook(afterHook, [el]);
  3424. }
  3425. if (hooks.delayedLeave) {
  3426. hooks.delayedLeave();
  3427. }
  3428. el[enterCbKey$1] = void 0;
  3429. };
  3430. if (hook) {
  3431. callAsyncHook(hook, [el, done]);
  3432. } else {
  3433. done();
  3434. }
  3435. },
  3436. leave(el, remove) {
  3437. const key2 = String(vnode.key);
  3438. if (el[enterCbKey$1]) {
  3439. el[enterCbKey$1](
  3440. true
  3441. /* cancelled */
  3442. );
  3443. }
  3444. if (state.isUnmounting) {
  3445. return remove();
  3446. }
  3447. callHook(onBeforeLeave, [el]);
  3448. let called = false;
  3449. const done = el[leaveCbKey] = (cancelled) => {
  3450. if (called) return;
  3451. called = true;
  3452. remove();
  3453. if (cancelled) {
  3454. callHook(onLeaveCancelled, [el]);
  3455. } else {
  3456. callHook(onAfterLeave, [el]);
  3457. }
  3458. el[leaveCbKey] = void 0;
  3459. if (leavingVNodesCache[key2] === vnode) {
  3460. delete leavingVNodesCache[key2];
  3461. }
  3462. };
  3463. leavingVNodesCache[key2] = vnode;
  3464. if (onLeave) {
  3465. callAsyncHook(onLeave, [el, done]);
  3466. } else {
  3467. done();
  3468. }
  3469. },
  3470. clone(vnode2) {
  3471. const hooks2 = resolveTransitionHooks(
  3472. vnode2,
  3473. props,
  3474. state,
  3475. instance,
  3476. postClone
  3477. );
  3478. if (postClone) postClone(hooks2);
  3479. return hooks2;
  3480. }
  3481. };
  3482. return hooks;
  3483. }
  3484. function emptyPlaceholder(vnode) {
  3485. if (isKeepAlive(vnode)) {
  3486. vnode = cloneVNode(vnode);
  3487. vnode.children = null;
  3488. return vnode;
  3489. }
  3490. }
  3491. function getInnerChild$1(vnode) {
  3492. if (!isKeepAlive(vnode)) {
  3493. if (isTeleport(vnode.type) && vnode.children) {
  3494. return findNonCommentChild(vnode.children);
  3495. }
  3496. return vnode;
  3497. }
  3498. if (vnode.component) {
  3499. return vnode.component.subTree;
  3500. }
  3501. const { shapeFlag, children } = vnode;
  3502. if (children) {
  3503. if (shapeFlag & 16) {
  3504. return children[0];
  3505. }
  3506. if (shapeFlag & 32 && isFunction(children.default)) {
  3507. return children.default();
  3508. }
  3509. }
  3510. }
  3511. function setTransitionHooks(vnode, hooks) {
  3512. if (vnode.shapeFlag & 6 && vnode.component) {
  3513. vnode.transition = hooks;
  3514. setTransitionHooks(vnode.component.subTree, hooks);
  3515. } else if (vnode.shapeFlag & 128) {
  3516. vnode.ssContent.transition = hooks.clone(vnode.ssContent);
  3517. vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
  3518. } else {
  3519. vnode.transition = hooks;
  3520. }
  3521. }
  3522. function getTransitionRawChildren(children, keepComment = false, parentKey) {
  3523. let ret = [];
  3524. let keyedFragmentCount = 0;
  3525. for (let i = 0; i < children.length; i++) {
  3526. let child = children[i];
  3527. const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);
  3528. if (child.type === Fragment) {
  3529. if (child.patchFlag & 128) keyedFragmentCount++;
  3530. ret = ret.concat(
  3531. getTransitionRawChildren(child.children, keepComment, key)
  3532. );
  3533. } else if (keepComment || child.type !== Comment) {
  3534. ret.push(key != null ? cloneVNode(child, { key }) : child);
  3535. }
  3536. }
  3537. if (keyedFragmentCount > 1) {
  3538. for (let i = 0; i < ret.length; i++) {
  3539. ret[i].patchFlag = -2;
  3540. }
  3541. }
  3542. return ret;
  3543. }
  3544. /*! #__NO_SIDE_EFFECTS__ */
  3545. // @__NO_SIDE_EFFECTS__
  3546. function defineComponent(options, extraOptions) {
  3547. return isFunction(options) ? (
  3548. // #8236: extend call and options.name access are considered side-effects
  3549. // by Rollup, so we have to wrap it in a pure-annotated IIFE.
  3550. /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
  3551. ) : options;
  3552. }
  3553. function useId() {
  3554. const i = getCurrentInstance();
  3555. if (i) {
  3556. return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
  3557. } else {
  3558. warn$1(
  3559. `useId() is called when there is no active component instance to be associated with.`
  3560. );
  3561. }
  3562. return "";
  3563. }
  3564. function markAsyncBoundary(instance) {
  3565. instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
  3566. }
  3567. const knownTemplateRefs = /* @__PURE__ */ new WeakSet();
  3568. function useTemplateRef(key) {
  3569. const i = getCurrentInstance();
  3570. const r = shallowRef(null);
  3571. if (i) {
  3572. const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
  3573. let desc;
  3574. if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {
  3575. warn$1(`useTemplateRef('${key}') already exists.`);
  3576. } else {
  3577. Object.defineProperty(refs, key, {
  3578. enumerable: true,
  3579. get: () => r.value,
  3580. set: (val) => r.value = val
  3581. });
  3582. }
  3583. } else {
  3584. warn$1(
  3585. `useTemplateRef() is called when there is no active component instance to be associated with.`
  3586. );
  3587. }
  3588. const ret = readonly(r) ;
  3589. {
  3590. knownTemplateRefs.add(ret);
  3591. }
  3592. return ret;
  3593. }
  3594. function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
  3595. if (isArray(rawRef)) {
  3596. rawRef.forEach(
  3597. (r, i) => setRef(
  3598. r,
  3599. oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
  3600. parentSuspense,
  3601. vnode,
  3602. isUnmount
  3603. )
  3604. );
  3605. return;
  3606. }
  3607. if (isAsyncWrapper(vnode) && !isUnmount) {
  3608. return;
  3609. }
  3610. const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
  3611. const value = isUnmount ? null : refValue;
  3612. const { i: owner, r: ref } = rawRef;
  3613. if (!owner) {
  3614. warn$1(
  3615. `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`
  3616. );
  3617. return;
  3618. }
  3619. const oldRef = oldRawRef && oldRawRef.r;
  3620. const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
  3621. const setupState = owner.setupState;
  3622. const rawSetupState = toRaw(setupState);
  3623. const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
  3624. {
  3625. if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
  3626. warn$1(
  3627. `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
  3628. );
  3629. }
  3630. if (knownTemplateRefs.has(rawSetupState[key])) {
  3631. return false;
  3632. }
  3633. }
  3634. return hasOwn(rawSetupState, key);
  3635. };
  3636. if (oldRef != null && oldRef !== ref) {
  3637. if (isString(oldRef)) {
  3638. refs[oldRef] = null;
  3639. if (canSetSetupRef(oldRef)) {
  3640. setupState[oldRef] = null;
  3641. }
  3642. } else if (isRef(oldRef)) {
  3643. oldRef.value = null;
  3644. }
  3645. }
  3646. if (isFunction(ref)) {
  3647. callWithErrorHandling(ref, owner, 12, [value, refs]);
  3648. } else {
  3649. const _isString = isString(ref);
  3650. const _isRef = isRef(ref);
  3651. if (_isString || _isRef) {
  3652. const doSet = () => {
  3653. if (rawRef.f) {
  3654. const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
  3655. if (isUnmount) {
  3656. isArray(existing) && remove(existing, refValue);
  3657. } else {
  3658. if (!isArray(existing)) {
  3659. if (_isString) {
  3660. refs[ref] = [refValue];
  3661. if (canSetSetupRef(ref)) {
  3662. setupState[ref] = refs[ref];
  3663. }
  3664. } else {
  3665. ref.value = [refValue];
  3666. if (rawRef.k) refs[rawRef.k] = ref.value;
  3667. }
  3668. } else if (!existing.includes(refValue)) {
  3669. existing.push(refValue);
  3670. }
  3671. }
  3672. } else if (_isString) {
  3673. refs[ref] = value;
  3674. if (canSetSetupRef(ref)) {
  3675. setupState[ref] = value;
  3676. }
  3677. } else if (_isRef) {
  3678. ref.value = value;
  3679. if (rawRef.k) refs[rawRef.k] = value;
  3680. } else {
  3681. warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
  3682. }
  3683. };
  3684. if (value) {
  3685. doSet.id = -1;
  3686. queuePostRenderEffect(doSet, parentSuspense);
  3687. } else {
  3688. doSet();
  3689. }
  3690. } else {
  3691. warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
  3692. }
  3693. }
  3694. }
  3695. let hasLoggedMismatchError = false;
  3696. const logMismatchError = () => {
  3697. if (hasLoggedMismatchError) {
  3698. return;
  3699. }
  3700. console.error("Hydration completed but contains mismatches.");
  3701. hasLoggedMismatchError = true;
  3702. };
  3703. const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
  3704. const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
  3705. const getContainerType = (container) => {
  3706. if (container.nodeType !== 1) return void 0;
  3707. if (isSVGContainer(container)) return "svg";
  3708. if (isMathMLContainer(container)) return "mathml";
  3709. return void 0;
  3710. };
  3711. const isComment = (node) => node.nodeType === 8;
  3712. function createHydrationFunctions(rendererInternals) {
  3713. const {
  3714. mt: mountComponent,
  3715. p: patch,
  3716. o: {
  3717. patchProp,
  3718. createText,
  3719. nextSibling,
  3720. parentNode,
  3721. remove,
  3722. insert,
  3723. createComment
  3724. }
  3725. } = rendererInternals;
  3726. const hydrate = (vnode, container) => {
  3727. if (!container.hasChildNodes()) {
  3728. warn$1(
  3729. `Attempting to hydrate existing markup but container is empty. Performing full mount instead.`
  3730. );
  3731. patch(null, vnode, container);
  3732. flushPostFlushCbs();
  3733. container._vnode = vnode;
  3734. return;
  3735. }
  3736. hydrateNode(container.firstChild, vnode, null, null, null);
  3737. flushPostFlushCbs();
  3738. container._vnode = vnode;
  3739. };
  3740. const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
  3741. optimized = optimized || !!vnode.dynamicChildren;
  3742. const isFragmentStart = isComment(node) && node.data === "[";
  3743. const onMismatch = () => handleMismatch(
  3744. node,
  3745. vnode,
  3746. parentComponent,
  3747. parentSuspense,
  3748. slotScopeIds,
  3749. isFragmentStart
  3750. );
  3751. const { type, ref, shapeFlag, patchFlag } = vnode;
  3752. let domType = node.nodeType;
  3753. vnode.el = node;
  3754. {
  3755. def(node, "__vnode", vnode, true);
  3756. def(node, "__vueParentComponent", parentComponent, true);
  3757. }
  3758. if (patchFlag === -2) {
  3759. optimized = false;
  3760. vnode.dynamicChildren = null;
  3761. }
  3762. let nextNode = null;
  3763. switch (type) {
  3764. case Text:
  3765. if (domType !== 3) {
  3766. if (vnode.children === "") {
  3767. insert(vnode.el = createText(""), parentNode(node), node);
  3768. nextNode = node;
  3769. } else {
  3770. nextNode = onMismatch();
  3771. }
  3772. } else {
  3773. if (node.data !== vnode.children) {
  3774. warn$1(
  3775. `Hydration text mismatch in`,
  3776. node.parentNode,
  3777. `
  3778. - rendered on server: ${JSON.stringify(
  3779. node.data
  3780. )}
  3781. - expected on client: ${JSON.stringify(vnode.children)}`
  3782. );
  3783. logMismatchError();
  3784. node.data = vnode.children;
  3785. }
  3786. nextNode = nextSibling(node);
  3787. }
  3788. break;
  3789. case Comment:
  3790. if (isTemplateNode(node)) {
  3791. nextNode = nextSibling(node);
  3792. replaceNode(
  3793. vnode.el = node.content.firstChild,
  3794. node,
  3795. parentComponent
  3796. );
  3797. } else if (domType !== 8 || isFragmentStart) {
  3798. nextNode = onMismatch();
  3799. } else {
  3800. nextNode = nextSibling(node);
  3801. }
  3802. break;
  3803. case Static:
  3804. if (isFragmentStart) {
  3805. node = nextSibling(node);
  3806. domType = node.nodeType;
  3807. }
  3808. if (domType === 1 || domType === 3) {
  3809. nextNode = node;
  3810. const needToAdoptContent = !vnode.children.length;
  3811. for (let i = 0; i < vnode.staticCount; i++) {
  3812. if (needToAdoptContent)
  3813. vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data;
  3814. if (i === vnode.staticCount - 1) {
  3815. vnode.anchor = nextNode;
  3816. }
  3817. nextNode = nextSibling(nextNode);
  3818. }
  3819. return isFragmentStart ? nextSibling(nextNode) : nextNode;
  3820. } else {
  3821. onMismatch();
  3822. }
  3823. break;
  3824. case Fragment:
  3825. if (!isFragmentStart) {
  3826. nextNode = onMismatch();
  3827. } else {
  3828. nextNode = hydrateFragment(
  3829. node,
  3830. vnode,
  3831. parentComponent,
  3832. parentSuspense,
  3833. slotScopeIds,
  3834. optimized
  3835. );
  3836. }
  3837. break;
  3838. default:
  3839. if (shapeFlag & 1) {
  3840. if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
  3841. nextNode = onMismatch();
  3842. } else {
  3843. nextNode = hydrateElement(
  3844. node,
  3845. vnode,
  3846. parentComponent,
  3847. parentSuspense,
  3848. slotScopeIds,
  3849. optimized
  3850. );
  3851. }
  3852. } else if (shapeFlag & 6) {
  3853. vnode.slotScopeIds = slotScopeIds;
  3854. const container = parentNode(node);
  3855. if (isFragmentStart) {
  3856. nextNode = locateClosingAnchor(node);
  3857. } else if (isComment(node) && node.data === "teleport start") {
  3858. nextNode = locateClosingAnchor(node, node.data, "teleport end");
  3859. } else {
  3860. nextNode = nextSibling(node);
  3861. }
  3862. mountComponent(
  3863. vnode,
  3864. container,
  3865. null,
  3866. parentComponent,
  3867. parentSuspense,
  3868. getContainerType(container),
  3869. optimized
  3870. );
  3871. if (isAsyncWrapper(vnode)) {
  3872. let subTree;
  3873. if (isFragmentStart) {
  3874. subTree = createVNode(Fragment);
  3875. subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
  3876. } else {
  3877. subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
  3878. }
  3879. subTree.el = node;
  3880. vnode.component.subTree = subTree;
  3881. }
  3882. } else if (shapeFlag & 64) {
  3883. if (domType !== 8) {
  3884. nextNode = onMismatch();
  3885. } else {
  3886. nextNode = vnode.type.hydrate(
  3887. node,
  3888. vnode,
  3889. parentComponent,
  3890. parentSuspense,
  3891. slotScopeIds,
  3892. optimized,
  3893. rendererInternals,
  3894. hydrateChildren
  3895. );
  3896. }
  3897. } else if (shapeFlag & 128) {
  3898. nextNode = vnode.type.hydrate(
  3899. node,
  3900. vnode,
  3901. parentComponent,
  3902. parentSuspense,
  3903. getContainerType(parentNode(node)),
  3904. slotScopeIds,
  3905. optimized,
  3906. rendererInternals,
  3907. hydrateNode
  3908. );
  3909. } else {
  3910. warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
  3911. }
  3912. }
  3913. if (ref != null) {
  3914. setRef(ref, null, parentSuspense, vnode);
  3915. }
  3916. return nextNode;
  3917. };
  3918. const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  3919. optimized = optimized || !!vnode.dynamicChildren;
  3920. const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
  3921. const forcePatch = type === "input" || type === "option";
  3922. {
  3923. if (dirs) {
  3924. invokeDirectiveHook(vnode, null, parentComponent, "created");
  3925. }
  3926. let needCallTransitionHooks = false;
  3927. if (isTemplateNode(el)) {
  3928. needCallTransitionHooks = needTransition(
  3929. null,
  3930. // no need check parentSuspense in hydration
  3931. transition
  3932. ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
  3933. const content = el.content.firstChild;
  3934. if (needCallTransitionHooks) {
  3935. transition.beforeEnter(content);
  3936. }
  3937. replaceNode(content, el, parentComponent);
  3938. vnode.el = el = content;
  3939. }
  3940. if (shapeFlag & 16 && // skip if element has innerHTML / textContent
  3941. !(props && (props.innerHTML || props.textContent))) {
  3942. let next = hydrateChildren(
  3943. el.firstChild,
  3944. vnode,
  3945. el,
  3946. parentComponent,
  3947. parentSuspense,
  3948. slotScopeIds,
  3949. optimized
  3950. );
  3951. let hasWarned = false;
  3952. while (next) {
  3953. if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
  3954. if (!hasWarned) {
  3955. warn$1(
  3956. `Hydration children mismatch on`,
  3957. el,
  3958. `
  3959. Server rendered element contains more child nodes than client vdom.`
  3960. );
  3961. hasWarned = true;
  3962. }
  3963. logMismatchError();
  3964. }
  3965. const cur = next;
  3966. next = next.nextSibling;
  3967. remove(cur);
  3968. }
  3969. } else if (shapeFlag & 8) {
  3970. let clientText = vnode.children;
  3971. if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
  3972. clientText = clientText.slice(1);
  3973. }
  3974. if (el.textContent !== clientText) {
  3975. if (!isMismatchAllowed(el, 0 /* TEXT */)) {
  3976. warn$1(
  3977. `Hydration text content mismatch on`,
  3978. el,
  3979. `
  3980. - rendered on server: ${el.textContent}
  3981. - expected on client: ${vnode.children}`
  3982. );
  3983. logMismatchError();
  3984. }
  3985. el.textContent = vnode.children;
  3986. }
  3987. }
  3988. if (props) {
  3989. {
  3990. const isCustomElement = el.tagName.includes("-");
  3991. for (const key in props) {
  3992. if (// #11189 skip if this node has directives that have created hooks
  3993. // as it could have mutated the DOM in any possible way
  3994. !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
  3995. logMismatchError();
  3996. }
  3997. if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
  3998. key[0] === "." || isCustomElement) {
  3999. patchProp(el, key, null, props[key], void 0, parentComponent);
  4000. }
  4001. }
  4002. }
  4003. }
  4004. let vnodeHooks;
  4005. if (vnodeHooks = props && props.onVnodeBeforeMount) {
  4006. invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  4007. }
  4008. if (dirs) {
  4009. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  4010. }
  4011. if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
  4012. queueEffectWithSuspense(() => {
  4013. vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  4014. needCallTransitionHooks && transition.enter(el);
  4015. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  4016. }, parentSuspense);
  4017. }
  4018. }
  4019. return el.nextSibling;
  4020. };
  4021. const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  4022. optimized = optimized || !!parentVNode.dynamicChildren;
  4023. const children = parentVNode.children;
  4024. const l = children.length;
  4025. let hasWarned = false;
  4026. for (let i = 0; i < l; i++) {
  4027. const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
  4028. const isText = vnode.type === Text;
  4029. if (node) {
  4030. if (isText && !optimized) {
  4031. if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
  4032. insert(
  4033. createText(
  4034. node.data.slice(vnode.children.length)
  4035. ),
  4036. container,
  4037. nextSibling(node)
  4038. );
  4039. node.data = vnode.children;
  4040. }
  4041. }
  4042. node = hydrateNode(
  4043. node,
  4044. vnode,
  4045. parentComponent,
  4046. parentSuspense,
  4047. slotScopeIds,
  4048. optimized
  4049. );
  4050. } else if (isText && !vnode.children) {
  4051. insert(vnode.el = createText(""), container);
  4052. } else {
  4053. if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
  4054. if (!hasWarned) {
  4055. warn$1(
  4056. `Hydration children mismatch on`,
  4057. container,
  4058. `
  4059. Server rendered element contains fewer child nodes than client vdom.`
  4060. );
  4061. hasWarned = true;
  4062. }
  4063. logMismatchError();
  4064. }
  4065. patch(
  4066. null,
  4067. vnode,
  4068. container,
  4069. null,
  4070. parentComponent,
  4071. parentSuspense,
  4072. getContainerType(container),
  4073. slotScopeIds
  4074. );
  4075. }
  4076. }
  4077. return node;
  4078. };
  4079. const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  4080. const { slotScopeIds: fragmentSlotScopeIds } = vnode;
  4081. if (fragmentSlotScopeIds) {
  4082. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  4083. }
  4084. const container = parentNode(node);
  4085. const next = hydrateChildren(
  4086. nextSibling(node),
  4087. vnode,
  4088. container,
  4089. parentComponent,
  4090. parentSuspense,
  4091. slotScopeIds,
  4092. optimized
  4093. );
  4094. if (next && isComment(next) && next.data === "]") {
  4095. return nextSibling(vnode.anchor = next);
  4096. } else {
  4097. logMismatchError();
  4098. insert(vnode.anchor = createComment(`]`), container, next);
  4099. return next;
  4100. }
  4101. };
  4102. const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
  4103. if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) {
  4104. warn$1(
  4105. `Hydration node mismatch:
  4106. - rendered on server:`,
  4107. node,
  4108. node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
  4109. `
  4110. - expected on client:`,
  4111. vnode.type
  4112. );
  4113. logMismatchError();
  4114. }
  4115. vnode.el = null;
  4116. if (isFragment) {
  4117. const end = locateClosingAnchor(node);
  4118. while (true) {
  4119. const next2 = nextSibling(node);
  4120. if (next2 && next2 !== end) {
  4121. remove(next2);
  4122. } else {
  4123. break;
  4124. }
  4125. }
  4126. }
  4127. const next = nextSibling(node);
  4128. const container = parentNode(node);
  4129. remove(node);
  4130. patch(
  4131. null,
  4132. vnode,
  4133. container,
  4134. next,
  4135. parentComponent,
  4136. parentSuspense,
  4137. getContainerType(container),
  4138. slotScopeIds
  4139. );
  4140. return next;
  4141. };
  4142. const locateClosingAnchor = (node, open = "[", close = "]") => {
  4143. let match = 0;
  4144. while (node) {
  4145. node = nextSibling(node);
  4146. if (node && isComment(node)) {
  4147. if (node.data === open) match++;
  4148. if (node.data === close) {
  4149. if (match === 0) {
  4150. return nextSibling(node);
  4151. } else {
  4152. match--;
  4153. }
  4154. }
  4155. }
  4156. }
  4157. return node;
  4158. };
  4159. const replaceNode = (newNode, oldNode, parentComponent) => {
  4160. const parentNode2 = oldNode.parentNode;
  4161. if (parentNode2) {
  4162. parentNode2.replaceChild(newNode, oldNode);
  4163. }
  4164. let parent = parentComponent;
  4165. while (parent) {
  4166. if (parent.vnode.el === oldNode) {
  4167. parent.vnode.el = parent.subTree.el = newNode;
  4168. }
  4169. parent = parent.parent;
  4170. }
  4171. };
  4172. const isTemplateNode = (node) => {
  4173. return node.nodeType === 1 && node.tagName === "TEMPLATE";
  4174. };
  4175. return [hydrate, hydrateNode];
  4176. }
  4177. function propHasMismatch(el, key, clientValue, vnode, instance) {
  4178. let mismatchType;
  4179. let mismatchKey;
  4180. let actual;
  4181. let expected;
  4182. if (key === "class") {
  4183. actual = el.getAttribute("class");
  4184. expected = normalizeClass(clientValue);
  4185. if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
  4186. mismatchType = 2 /* CLASS */;
  4187. mismatchKey = `class`;
  4188. }
  4189. } else if (key === "style") {
  4190. actual = el.getAttribute("style") || "";
  4191. expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
  4192. const actualMap = toStyleMap(actual);
  4193. const expectedMap = toStyleMap(expected);
  4194. if (vnode.dirs) {
  4195. for (const { dir, value } of vnode.dirs) {
  4196. if (dir.name === "show" && !value) {
  4197. expectedMap.set("display", "none");
  4198. }
  4199. }
  4200. }
  4201. if (instance) {
  4202. resolveCssVars(instance, vnode, expectedMap);
  4203. }
  4204. if (!isMapEqual(actualMap, expectedMap)) {
  4205. mismatchType = 3 /* STYLE */;
  4206. mismatchKey = "style";
  4207. }
  4208. } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
  4209. if (isBooleanAttr(key)) {
  4210. actual = el.hasAttribute(key);
  4211. expected = includeBooleanAttr(clientValue);
  4212. } else if (clientValue == null) {
  4213. actual = el.hasAttribute(key);
  4214. expected = false;
  4215. } else {
  4216. if (el.hasAttribute(key)) {
  4217. actual = el.getAttribute(key);
  4218. } else if (key === "value" && el.tagName === "TEXTAREA") {
  4219. actual = el.value;
  4220. } else {
  4221. actual = false;
  4222. }
  4223. expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
  4224. }
  4225. if (actual !== expected) {
  4226. mismatchType = 4 /* ATTRIBUTE */;
  4227. mismatchKey = key;
  4228. }
  4229. }
  4230. if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) {
  4231. const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
  4232. const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`;
  4233. const postSegment = `
  4234. - rendered on server: ${format(actual)}
  4235. - expected on client: ${format(expected)}
  4236. Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
  4237. You should fix the source of the mismatch.`;
  4238. {
  4239. warn$1(preSegment, el, postSegment);
  4240. }
  4241. return true;
  4242. }
  4243. return false;
  4244. }
  4245. function toClassSet(str) {
  4246. return new Set(str.trim().split(/\s+/));
  4247. }
  4248. function isSetEqual(a, b) {
  4249. if (a.size !== b.size) {
  4250. return false;
  4251. }
  4252. for (const s of a) {
  4253. if (!b.has(s)) {
  4254. return false;
  4255. }
  4256. }
  4257. return true;
  4258. }
  4259. function toStyleMap(str) {
  4260. const styleMap = /* @__PURE__ */ new Map();
  4261. for (const item of str.split(";")) {
  4262. let [key, value] = item.split(":");
  4263. key = key.trim();
  4264. value = value && value.trim();
  4265. if (key && value) {
  4266. styleMap.set(key, value);
  4267. }
  4268. }
  4269. return styleMap;
  4270. }
  4271. function isMapEqual(a, b) {
  4272. if (a.size !== b.size) {
  4273. return false;
  4274. }
  4275. for (const [key, value] of a) {
  4276. if (value !== b.get(key)) {
  4277. return false;
  4278. }
  4279. }
  4280. return true;
  4281. }
  4282. function resolveCssVars(instance, vnode, expectedMap) {
  4283. const root = instance.subTree;
  4284. if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
  4285. const cssVars = instance.getCssVars();
  4286. for (const key in cssVars) {
  4287. expectedMap.set(
  4288. `--${getEscapedCssVarName(key)}`,
  4289. String(cssVars[key])
  4290. );
  4291. }
  4292. }
  4293. if (vnode === root && instance.parent) {
  4294. resolveCssVars(instance.parent, instance.vnode, expectedMap);
  4295. }
  4296. }
  4297. const allowMismatchAttr = "data-allow-mismatch";
  4298. const MismatchTypeString = {
  4299. [0 /* TEXT */]: "text",
  4300. [1 /* CHILDREN */]: "children",
  4301. [2 /* CLASS */]: "class",
  4302. [3 /* STYLE */]: "style",
  4303. [4 /* ATTRIBUTE */]: "attribute"
  4304. };
  4305. function isMismatchAllowed(el, allowedType) {
  4306. if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) {
  4307. while (el && !el.hasAttribute(allowMismatchAttr)) {
  4308. el = el.parentElement;
  4309. }
  4310. }
  4311. const allowedAttr = el && el.getAttribute(allowMismatchAttr);
  4312. if (allowedAttr == null) {
  4313. return false;
  4314. } else if (allowedAttr === "") {
  4315. return true;
  4316. } else {
  4317. const list = allowedAttr.split(",");
  4318. if (allowedType === 0 /* TEXT */ && list.includes("children")) {
  4319. return true;
  4320. }
  4321. return allowedAttr.split(",").includes(MismatchTypeString[allowedType]);
  4322. }
  4323. }
  4324. const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
  4325. const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
  4326. const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
  4327. const id = requestIdleCallback(hydrate, { timeout });
  4328. return () => cancelIdleCallback(id);
  4329. };
  4330. function elementIsVisibleInViewport(el) {
  4331. const { top, left, bottom, right } = el.getBoundingClientRect();
  4332. const { innerHeight, innerWidth } = window;
  4333. return (top > 0 && top < innerHeight || bottom > 0 && bottom < innerHeight) && (left > 0 && left < innerWidth || right > 0 && right < innerWidth);
  4334. }
  4335. const hydrateOnVisible = (opts) => (hydrate, forEach) => {
  4336. const ob = new IntersectionObserver((entries) => {
  4337. for (const e of entries) {
  4338. if (!e.isIntersecting) continue;
  4339. ob.disconnect();
  4340. hydrate();
  4341. break;
  4342. }
  4343. }, opts);
  4344. forEach((el) => {
  4345. if (!(el instanceof Element)) return;
  4346. if (elementIsVisibleInViewport(el)) {
  4347. hydrate();
  4348. ob.disconnect();
  4349. return false;
  4350. }
  4351. ob.observe(el);
  4352. });
  4353. return () => ob.disconnect();
  4354. };
  4355. const hydrateOnMediaQuery = (query) => (hydrate) => {
  4356. if (query) {
  4357. const mql = matchMedia(query);
  4358. if (mql.matches) {
  4359. hydrate();
  4360. } else {
  4361. mql.addEventListener("change", hydrate, { once: true });
  4362. return () => mql.removeEventListener("change", hydrate);
  4363. }
  4364. }
  4365. };
  4366. const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
  4367. if (isString(interactions)) interactions = [interactions];
  4368. let hasHydrated = false;
  4369. const doHydrate = (e) => {
  4370. if (!hasHydrated) {
  4371. hasHydrated = true;
  4372. teardown();
  4373. hydrate();
  4374. e.target.dispatchEvent(new e.constructor(e.type, e));
  4375. }
  4376. };
  4377. const teardown = () => {
  4378. forEach((el) => {
  4379. for (const i of interactions) {
  4380. el.removeEventListener(i, doHydrate);
  4381. }
  4382. });
  4383. };
  4384. forEach((el) => {
  4385. for (const i of interactions) {
  4386. el.addEventListener(i, doHydrate, { once: true });
  4387. }
  4388. });
  4389. return teardown;
  4390. };
  4391. function forEachElement(node, cb) {
  4392. if (isComment(node) && node.data === "[") {
  4393. let depth = 1;
  4394. let next = node.nextSibling;
  4395. while (next) {
  4396. if (next.nodeType === 1) {
  4397. const result = cb(next);
  4398. if (result === false) {
  4399. break;
  4400. }
  4401. } else if (isComment(next)) {
  4402. if (next.data === "]") {
  4403. if (--depth === 0) break;
  4404. } else if (next.data === "[") {
  4405. depth++;
  4406. }
  4407. }
  4408. next = next.nextSibling;
  4409. }
  4410. } else {
  4411. cb(node);
  4412. }
  4413. }
  4414. const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
  4415. /*! #__NO_SIDE_EFFECTS__ */
  4416. // @__NO_SIDE_EFFECTS__
  4417. function defineAsyncComponent(source) {
  4418. if (isFunction(source)) {
  4419. source = { loader: source };
  4420. }
  4421. const {
  4422. loader,
  4423. loadingComponent,
  4424. errorComponent,
  4425. delay = 200,
  4426. hydrate: hydrateStrategy,
  4427. timeout,
  4428. // undefined = never times out
  4429. suspensible = true,
  4430. onError: userOnError
  4431. } = source;
  4432. let pendingRequest = null;
  4433. let resolvedComp;
  4434. let retries = 0;
  4435. const retry = () => {
  4436. retries++;
  4437. pendingRequest = null;
  4438. return load();
  4439. };
  4440. const load = () => {
  4441. let thisRequest;
  4442. return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
  4443. err = err instanceof Error ? err : new Error(String(err));
  4444. if (userOnError) {
  4445. return new Promise((resolve, reject) => {
  4446. const userRetry = () => resolve(retry());
  4447. const userFail = () => reject(err);
  4448. userOnError(err, userRetry, userFail, retries + 1);
  4449. });
  4450. } else {
  4451. throw err;
  4452. }
  4453. }).then((comp) => {
  4454. if (thisRequest !== pendingRequest && pendingRequest) {
  4455. return pendingRequest;
  4456. }
  4457. if (!comp) {
  4458. warn$1(
  4459. `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
  4460. );
  4461. }
  4462. if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
  4463. comp = comp.default;
  4464. }
  4465. if (comp && !isObject(comp) && !isFunction(comp)) {
  4466. throw new Error(`Invalid async component load result: ${comp}`);
  4467. }
  4468. resolvedComp = comp;
  4469. return comp;
  4470. }));
  4471. };
  4472. return defineComponent({
  4473. name: "AsyncComponentWrapper",
  4474. __asyncLoader: load,
  4475. __asyncHydrate(el, instance, hydrate) {
  4476. const doHydrate = hydrateStrategy ? () => {
  4477. const teardown = hydrateStrategy(
  4478. hydrate,
  4479. (cb) => forEachElement(el, cb)
  4480. );
  4481. if (teardown) {
  4482. (instance.bum || (instance.bum = [])).push(teardown);
  4483. }
  4484. } : hydrate;
  4485. if (resolvedComp) {
  4486. doHydrate();
  4487. } else {
  4488. load().then(() => !instance.isUnmounted && doHydrate());
  4489. }
  4490. },
  4491. get __asyncResolved() {
  4492. return resolvedComp;
  4493. },
  4494. setup() {
  4495. const instance = currentInstance;
  4496. markAsyncBoundary(instance);
  4497. if (resolvedComp) {
  4498. return () => createInnerComp(resolvedComp, instance);
  4499. }
  4500. const onError = (err) => {
  4501. pendingRequest = null;
  4502. handleError(
  4503. err,
  4504. instance,
  4505. 13,
  4506. !errorComponent
  4507. );
  4508. };
  4509. if (suspensible && instance.suspense || false) {
  4510. return load().then((comp) => {
  4511. return () => createInnerComp(comp, instance);
  4512. }).catch((err) => {
  4513. onError(err);
  4514. return () => errorComponent ? createVNode(errorComponent, {
  4515. error: err
  4516. }) : null;
  4517. });
  4518. }
  4519. const loaded = ref(false);
  4520. const error = ref();
  4521. const delayed = ref(!!delay);
  4522. if (delay) {
  4523. setTimeout(() => {
  4524. delayed.value = false;
  4525. }, delay);
  4526. }
  4527. if (timeout != null) {
  4528. setTimeout(() => {
  4529. if (!loaded.value && !error.value) {
  4530. const err = new Error(
  4531. `Async component timed out after ${timeout}ms.`
  4532. );
  4533. onError(err);
  4534. error.value = err;
  4535. }
  4536. }, timeout);
  4537. }
  4538. load().then(() => {
  4539. loaded.value = true;
  4540. if (instance.parent && isKeepAlive(instance.parent.vnode)) {
  4541. instance.parent.update();
  4542. }
  4543. }).catch((err) => {
  4544. onError(err);
  4545. error.value = err;
  4546. });
  4547. return () => {
  4548. if (loaded.value && resolvedComp) {
  4549. return createInnerComp(resolvedComp, instance);
  4550. } else if (error.value && errorComponent) {
  4551. return createVNode(errorComponent, {
  4552. error: error.value
  4553. });
  4554. } else if (loadingComponent && !delayed.value) {
  4555. return createVNode(loadingComponent);
  4556. }
  4557. };
  4558. }
  4559. });
  4560. }
  4561. function createInnerComp(comp, parent) {
  4562. const { ref: ref2, props, children, ce } = parent.vnode;
  4563. const vnode = createVNode(comp, props, children);
  4564. vnode.ref = ref2;
  4565. vnode.ce = ce;
  4566. delete parent.vnode.ce;
  4567. return vnode;
  4568. }
  4569. const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
  4570. const KeepAliveImpl = {
  4571. name: `KeepAlive`,
  4572. // Marker for special handling inside the renderer. We are not using a ===
  4573. // check directly on KeepAlive in the renderer, because importing it directly
  4574. // would prevent it from being tree-shaken.
  4575. __isKeepAlive: true,
  4576. props: {
  4577. include: [String, RegExp, Array],
  4578. exclude: [String, RegExp, Array],
  4579. max: [String, Number]
  4580. },
  4581. setup(props, { slots }) {
  4582. const instance = getCurrentInstance();
  4583. const sharedContext = instance.ctx;
  4584. const cache = /* @__PURE__ */ new Map();
  4585. const keys = /* @__PURE__ */ new Set();
  4586. let current = null;
  4587. {
  4588. instance.__v_cache = cache;
  4589. }
  4590. const parentSuspense = instance.suspense;
  4591. const {
  4592. renderer: {
  4593. p: patch,
  4594. m: move,
  4595. um: _unmount,
  4596. o: { createElement }
  4597. }
  4598. } = sharedContext;
  4599. const storageContainer = createElement("div");
  4600. sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
  4601. const instance2 = vnode.component;
  4602. move(vnode, container, anchor, 0, parentSuspense);
  4603. patch(
  4604. instance2.vnode,
  4605. vnode,
  4606. container,
  4607. anchor,
  4608. instance2,
  4609. parentSuspense,
  4610. namespace,
  4611. vnode.slotScopeIds,
  4612. optimized
  4613. );
  4614. queuePostRenderEffect(() => {
  4615. instance2.isDeactivated = false;
  4616. if (instance2.a) {
  4617. invokeArrayFns(instance2.a);
  4618. }
  4619. const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
  4620. if (vnodeHook) {
  4621. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  4622. }
  4623. }, parentSuspense);
  4624. {
  4625. devtoolsComponentAdded(instance2);
  4626. }
  4627. };
  4628. sharedContext.deactivate = (vnode) => {
  4629. const instance2 = vnode.component;
  4630. invalidateMount(instance2.m);
  4631. invalidateMount(instance2.a);
  4632. move(vnode, storageContainer, null, 1, parentSuspense);
  4633. queuePostRenderEffect(() => {
  4634. if (instance2.da) {
  4635. invokeArrayFns(instance2.da);
  4636. }
  4637. const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
  4638. if (vnodeHook) {
  4639. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  4640. }
  4641. instance2.isDeactivated = true;
  4642. }, parentSuspense);
  4643. {
  4644. devtoolsComponentAdded(instance2);
  4645. }
  4646. };
  4647. function unmount(vnode) {
  4648. resetShapeFlag(vnode);
  4649. _unmount(vnode, instance, parentSuspense, true);
  4650. }
  4651. function pruneCache(filter) {
  4652. cache.forEach((vnode, key) => {
  4653. const name = getComponentName(vnode.type);
  4654. if (name && !filter(name)) {
  4655. pruneCacheEntry(key);
  4656. }
  4657. });
  4658. }
  4659. function pruneCacheEntry(key) {
  4660. const cached = cache.get(key);
  4661. if (cached && (!current || !isSameVNodeType(cached, current))) {
  4662. unmount(cached);
  4663. } else if (current) {
  4664. resetShapeFlag(current);
  4665. }
  4666. cache.delete(key);
  4667. keys.delete(key);
  4668. }
  4669. watch(
  4670. () => [props.include, props.exclude],
  4671. ([include, exclude]) => {
  4672. include && pruneCache((name) => matches(include, name));
  4673. exclude && pruneCache((name) => !matches(exclude, name));
  4674. },
  4675. // prune post-render after `current` has been updated
  4676. { flush: "post", deep: true }
  4677. );
  4678. let pendingCacheKey = null;
  4679. const cacheSubtree = () => {
  4680. if (pendingCacheKey != null) {
  4681. if (isSuspense(instance.subTree.type)) {
  4682. queuePostRenderEffect(() => {
  4683. cache.set(pendingCacheKey, getInnerChild(instance.subTree));
  4684. }, instance.subTree.suspense);
  4685. } else {
  4686. cache.set(pendingCacheKey, getInnerChild(instance.subTree));
  4687. }
  4688. }
  4689. };
  4690. onMounted(cacheSubtree);
  4691. onUpdated(cacheSubtree);
  4692. onBeforeUnmount(() => {
  4693. cache.forEach((cached) => {
  4694. const { subTree, suspense } = instance;
  4695. const vnode = getInnerChild(subTree);
  4696. if (cached.type === vnode.type && cached.key === vnode.key) {
  4697. resetShapeFlag(vnode);
  4698. const da = vnode.component.da;
  4699. da && queuePostRenderEffect(da, suspense);
  4700. return;
  4701. }
  4702. unmount(cached);
  4703. });
  4704. });
  4705. return () => {
  4706. pendingCacheKey = null;
  4707. if (!slots.default) {
  4708. return current = null;
  4709. }
  4710. const children = slots.default();
  4711. const rawVNode = children[0];
  4712. if (children.length > 1) {
  4713. {
  4714. warn$1(`KeepAlive should contain exactly one component child.`);
  4715. }
  4716. current = null;
  4717. return children;
  4718. } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
  4719. current = null;
  4720. return rawVNode;
  4721. }
  4722. let vnode = getInnerChild(rawVNode);
  4723. if (vnode.type === Comment) {
  4724. current = null;
  4725. return vnode;
  4726. }
  4727. const comp = vnode.type;
  4728. const name = getComponentName(
  4729. isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
  4730. );
  4731. const { include, exclude, max } = props;
  4732. if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
  4733. vnode.shapeFlag &= ~256;
  4734. current = vnode;
  4735. return rawVNode;
  4736. }
  4737. const key = vnode.key == null ? comp : vnode.key;
  4738. const cachedVNode = cache.get(key);
  4739. if (vnode.el) {
  4740. vnode = cloneVNode(vnode);
  4741. if (rawVNode.shapeFlag & 128) {
  4742. rawVNode.ssContent = vnode;
  4743. }
  4744. }
  4745. pendingCacheKey = key;
  4746. if (cachedVNode) {
  4747. vnode.el = cachedVNode.el;
  4748. vnode.component = cachedVNode.component;
  4749. if (vnode.transition) {
  4750. setTransitionHooks(vnode, vnode.transition);
  4751. }
  4752. vnode.shapeFlag |= 512;
  4753. keys.delete(key);
  4754. keys.add(key);
  4755. } else {
  4756. keys.add(key);
  4757. if (max && keys.size > parseInt(max, 10)) {
  4758. pruneCacheEntry(keys.values().next().value);
  4759. }
  4760. }
  4761. vnode.shapeFlag |= 256;
  4762. current = vnode;
  4763. return isSuspense(rawVNode.type) ? rawVNode : vnode;
  4764. };
  4765. }
  4766. };
  4767. const KeepAlive = KeepAliveImpl;
  4768. function matches(pattern, name) {
  4769. if (isArray(pattern)) {
  4770. return pattern.some((p) => matches(p, name));
  4771. } else if (isString(pattern)) {
  4772. return pattern.split(",").includes(name);
  4773. } else if (isRegExp(pattern)) {
  4774. pattern.lastIndex = 0;
  4775. return pattern.test(name);
  4776. }
  4777. return false;
  4778. }
  4779. function onActivated(hook, target) {
  4780. registerKeepAliveHook(hook, "a", target);
  4781. }
  4782. function onDeactivated(hook, target) {
  4783. registerKeepAliveHook(hook, "da", target);
  4784. }
  4785. function registerKeepAliveHook(hook, type, target = currentInstance) {
  4786. const wrappedHook = hook.__wdc || (hook.__wdc = () => {
  4787. let current = target;
  4788. while (current) {
  4789. if (current.isDeactivated) {
  4790. return;
  4791. }
  4792. current = current.parent;
  4793. }
  4794. return hook();
  4795. });
  4796. injectHook(type, wrappedHook, target);
  4797. if (target) {
  4798. let current = target.parent;
  4799. while (current && current.parent) {
  4800. if (isKeepAlive(current.parent.vnode)) {
  4801. injectToKeepAliveRoot(wrappedHook, type, target, current);
  4802. }
  4803. current = current.parent;
  4804. }
  4805. }
  4806. }
  4807. function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  4808. const injected = injectHook(
  4809. type,
  4810. hook,
  4811. keepAliveRoot,
  4812. true
  4813. /* prepend */
  4814. );
  4815. onUnmounted(() => {
  4816. remove(keepAliveRoot[type], injected);
  4817. }, target);
  4818. }
  4819. function resetShapeFlag(vnode) {
  4820. vnode.shapeFlag &= ~256;
  4821. vnode.shapeFlag &= ~512;
  4822. }
  4823. function getInnerChild(vnode) {
  4824. return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
  4825. }
  4826. function injectHook(type, hook, target = currentInstance, prepend = false) {
  4827. if (target) {
  4828. const hooks = target[type] || (target[type] = []);
  4829. const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
  4830. pauseTracking();
  4831. const reset = setCurrentInstance(target);
  4832. const res = callWithAsyncErrorHandling(hook, target, type, args);
  4833. reset();
  4834. resetTracking();
  4835. return res;
  4836. });
  4837. if (prepend) {
  4838. hooks.unshift(wrappedHook);
  4839. } else {
  4840. hooks.push(wrappedHook);
  4841. }
  4842. return wrappedHook;
  4843. } else {
  4844. const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
  4845. warn$1(
  4846. `${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.` )
  4847. );
  4848. }
  4849. }
  4850. const createHook = (lifecycle) => (hook, target = currentInstance) => {
  4851. if (!isInSSRComponentSetup || lifecycle === "sp") {
  4852. injectHook(lifecycle, (...args) => hook(...args), target);
  4853. }
  4854. };
  4855. const onBeforeMount = createHook("bm");
  4856. const onMounted = createHook("m");
  4857. const onBeforeUpdate = createHook(
  4858. "bu"
  4859. );
  4860. const onUpdated = createHook("u");
  4861. const onBeforeUnmount = createHook(
  4862. "bum"
  4863. );
  4864. const onUnmounted = createHook("um");
  4865. const onServerPrefetch = createHook(
  4866. "sp"
  4867. );
  4868. const onRenderTriggered = createHook("rtg");
  4869. const onRenderTracked = createHook("rtc");
  4870. function onErrorCaptured(hook, target = currentInstance) {
  4871. injectHook("ec", hook, target);
  4872. }
  4873. const COMPONENTS = "components";
  4874. const DIRECTIVES = "directives";
  4875. function resolveComponent(name, maybeSelfReference) {
  4876. return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
  4877. }
  4878. const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
  4879. function resolveDynamicComponent(component) {
  4880. if (isString(component)) {
  4881. return resolveAsset(COMPONENTS, component, false) || component;
  4882. } else {
  4883. return component || NULL_DYNAMIC_COMPONENT;
  4884. }
  4885. }
  4886. function resolveDirective(name) {
  4887. return resolveAsset(DIRECTIVES, name);
  4888. }
  4889. function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
  4890. const instance = currentRenderingInstance || currentInstance;
  4891. if (instance) {
  4892. const Component = instance.type;
  4893. if (type === COMPONENTS) {
  4894. const selfName = getComponentName(
  4895. Component,
  4896. false
  4897. );
  4898. if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
  4899. return Component;
  4900. }
  4901. }
  4902. const res = (
  4903. // local registration
  4904. // check instance[type] first which is resolved for options API
  4905. resolve(instance[type] || Component[type], name) || // global registration
  4906. resolve(instance.appContext[type], name)
  4907. );
  4908. if (!res && maybeSelfReference) {
  4909. return Component;
  4910. }
  4911. if (warnMissing && !res) {
  4912. const extra = type === COMPONENTS ? `
  4913. If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
  4914. warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
  4915. }
  4916. return res;
  4917. } else {
  4918. warn$1(
  4919. `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
  4920. );
  4921. }
  4922. }
  4923. function resolve(registry, name) {
  4924. return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
  4925. }
  4926. function renderList(source, renderItem, cache, index) {
  4927. let ret;
  4928. const cached = cache && cache[index];
  4929. const sourceIsArray = isArray(source);
  4930. if (sourceIsArray || isString(source)) {
  4931. const sourceIsReactiveArray = sourceIsArray && isReactive(source);
  4932. let needsWrap = false;
  4933. if (sourceIsReactiveArray) {
  4934. needsWrap = !isShallow(source);
  4935. source = shallowReadArray(source);
  4936. }
  4937. ret = new Array(source.length);
  4938. for (let i = 0, l = source.length; i < l; i++) {
  4939. ret[i] = renderItem(
  4940. needsWrap ? toReactive(source[i]) : source[i],
  4941. i,
  4942. void 0,
  4943. cached && cached[i]
  4944. );
  4945. }
  4946. } else if (typeof source === "number") {
  4947. if (!Number.isInteger(source)) {
  4948. warn$1(`The v-for range expect an integer value but got ${source}.`);
  4949. }
  4950. ret = new Array(source);
  4951. for (let i = 0; i < source; i++) {
  4952. ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
  4953. }
  4954. } else if (isObject(source)) {
  4955. if (source[Symbol.iterator]) {
  4956. ret = Array.from(
  4957. source,
  4958. (item, i) => renderItem(item, i, void 0, cached && cached[i])
  4959. );
  4960. } else {
  4961. const keys = Object.keys(source);
  4962. ret = new Array(keys.length);
  4963. for (let i = 0, l = keys.length; i < l; i++) {
  4964. const key = keys[i];
  4965. ret[i] = renderItem(source[key], key, i, cached && cached[i]);
  4966. }
  4967. }
  4968. } else {
  4969. ret = [];
  4970. }
  4971. if (cache) {
  4972. cache[index] = ret;
  4973. }
  4974. return ret;
  4975. }
  4976. function createSlots(slots, dynamicSlots) {
  4977. for (let i = 0; i < dynamicSlots.length; i++) {
  4978. const slot = dynamicSlots[i];
  4979. if (isArray(slot)) {
  4980. for (let j = 0; j < slot.length; j++) {
  4981. slots[slot[j].name] = slot[j].fn;
  4982. }
  4983. } else if (slot) {
  4984. slots[slot.name] = slot.key ? (...args) => {
  4985. const res = slot.fn(...args);
  4986. if (res) res.key = slot.key;
  4987. return res;
  4988. } : slot.fn;
  4989. }
  4990. }
  4991. return slots;
  4992. }
  4993. function renderSlot(slots, name, props = {}, fallback, noSlotted) {
  4994. if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
  4995. if (name !== "default") props.name = name;
  4996. return openBlock(), createBlock(
  4997. Fragment,
  4998. null,
  4999. [createVNode("slot", props, fallback && fallback())],
  5000. 64
  5001. );
  5002. }
  5003. let slot = slots[name];
  5004. if (slot && slot.length > 1) {
  5005. warn$1(
  5006. `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.`
  5007. );
  5008. slot = () => [];
  5009. }
  5010. if (slot && slot._c) {
  5011. slot._d = false;
  5012. }
  5013. openBlock();
  5014. const validSlotContent = slot && ensureValidVNode(slot(props));
  5015. const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
  5016. // key attached in the `createSlots` helper, respect that
  5017. validSlotContent && validSlotContent.key;
  5018. const rendered = createBlock(
  5019. Fragment,
  5020. {
  5021. key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
  5022. (!validSlotContent && fallback ? "_fb" : "")
  5023. },
  5024. validSlotContent || (fallback ? fallback() : []),
  5025. validSlotContent && slots._ === 1 ? 64 : -2
  5026. );
  5027. if (!noSlotted && rendered.scopeId) {
  5028. rendered.slotScopeIds = [rendered.scopeId + "-s"];
  5029. }
  5030. if (slot && slot._c) {
  5031. slot._d = true;
  5032. }
  5033. return rendered;
  5034. }
  5035. function ensureValidVNode(vnodes) {
  5036. return vnodes.some((child) => {
  5037. if (!isVNode(child)) return true;
  5038. if (child.type === Comment) return false;
  5039. if (child.type === Fragment && !ensureValidVNode(child.children))
  5040. return false;
  5041. return true;
  5042. }) ? vnodes : null;
  5043. }
  5044. function toHandlers(obj, preserveCaseIfNecessary) {
  5045. const ret = {};
  5046. if (!isObject(obj)) {
  5047. warn$1(`v-on with no argument expects an object value.`);
  5048. return ret;
  5049. }
  5050. for (const key in obj) {
  5051. ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];
  5052. }
  5053. return ret;
  5054. }
  5055. const getPublicInstance = (i) => {
  5056. if (!i) return null;
  5057. if (isStatefulComponent(i)) return getComponentPublicInstance(i);
  5058. return getPublicInstance(i.parent);
  5059. };
  5060. const publicPropertiesMap = (
  5061. // Move PURE marker to new line to workaround compiler discarding it
  5062. // due to type annotation
  5063. /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
  5064. $: (i) => i,
  5065. $el: (i) => i.vnode.el,
  5066. $data: (i) => i.data,
  5067. $props: (i) => shallowReadonly(i.props) ,
  5068. $attrs: (i) => shallowReadonly(i.attrs) ,
  5069. $slots: (i) => shallowReadonly(i.slots) ,
  5070. $refs: (i) => shallowReadonly(i.refs) ,
  5071. $parent: (i) => getPublicInstance(i.parent),
  5072. $root: (i) => getPublicInstance(i.root),
  5073. $host: (i) => i.ce,
  5074. $emit: (i) => i.emit,
  5075. $options: (i) => resolveMergedOptions(i) ,
  5076. $forceUpdate: (i) => i.f || (i.f = () => {
  5077. queueJob(i.update);
  5078. }),
  5079. $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
  5080. $watch: (i) => instanceWatch.bind(i)
  5081. })
  5082. );
  5083. const isReservedPrefix = (key) => key === "_" || key === "$";
  5084. const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
  5085. const PublicInstanceProxyHandlers = {
  5086. get({ _: instance }, key) {
  5087. if (key === "__v_skip") {
  5088. return true;
  5089. }
  5090. const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
  5091. if (key === "__isVue") {
  5092. return true;
  5093. }
  5094. let normalizedProps;
  5095. if (key[0] !== "$") {
  5096. const n = accessCache[key];
  5097. if (n !== void 0) {
  5098. switch (n) {
  5099. case 1 /* SETUP */:
  5100. return setupState[key];
  5101. case 2 /* DATA */:
  5102. return data[key];
  5103. case 4 /* CONTEXT */:
  5104. return ctx[key];
  5105. case 3 /* PROPS */:
  5106. return props[key];
  5107. }
  5108. } else if (hasSetupBinding(setupState, key)) {
  5109. accessCache[key] = 1 /* SETUP */;
  5110. return setupState[key];
  5111. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  5112. accessCache[key] = 2 /* DATA */;
  5113. return data[key];
  5114. } else if (
  5115. // only cache other properties when instance has declared (thus stable)
  5116. // props
  5117. (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)
  5118. ) {
  5119. accessCache[key] = 3 /* PROPS */;
  5120. return props[key];
  5121. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  5122. accessCache[key] = 4 /* CONTEXT */;
  5123. return ctx[key];
  5124. } else if (shouldCacheAccess) {
  5125. accessCache[key] = 0 /* OTHER */;
  5126. }
  5127. }
  5128. const publicGetter = publicPropertiesMap[key];
  5129. let cssModule, globalProperties;
  5130. if (publicGetter) {
  5131. if (key === "$attrs") {
  5132. track(instance.attrs, "get", "");
  5133. markAttrsAccessed();
  5134. } else if (key === "$slots") {
  5135. track(instance, "get", key);
  5136. }
  5137. return publicGetter(instance);
  5138. } else if (
  5139. // css module (injected by vue-loader)
  5140. (cssModule = type.__cssModules) && (cssModule = cssModule[key])
  5141. ) {
  5142. return cssModule;
  5143. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  5144. accessCache[key] = 4 /* CONTEXT */;
  5145. return ctx[key];
  5146. } else if (
  5147. // global properties
  5148. globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)
  5149. ) {
  5150. {
  5151. return globalProperties[key];
  5152. }
  5153. } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading
  5154. // to infinite warning loop
  5155. key.indexOf("__v") !== 0)) {
  5156. if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
  5157. warn$1(
  5158. `Property ${JSON.stringify(
  5159. key
  5160. )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
  5161. );
  5162. } else if (instance === currentRenderingInstance) {
  5163. warn$1(
  5164. `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`
  5165. );
  5166. }
  5167. }
  5168. },
  5169. set({ _: instance }, key, value) {
  5170. const { data, setupState, ctx } = instance;
  5171. if (hasSetupBinding(setupState, key)) {
  5172. setupState[key] = value;
  5173. return true;
  5174. } else if (setupState.__isScriptSetup && hasOwn(setupState, key)) {
  5175. warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
  5176. return false;
  5177. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  5178. data[key] = value;
  5179. return true;
  5180. } else if (hasOwn(instance.props, key)) {
  5181. warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
  5182. return false;
  5183. }
  5184. if (key[0] === "$" && key.slice(1) in instance) {
  5185. warn$1(
  5186. `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`
  5187. );
  5188. return false;
  5189. } else {
  5190. if (key in instance.appContext.config.globalProperties) {
  5191. Object.defineProperty(ctx, key, {
  5192. enumerable: true,
  5193. configurable: true,
  5194. value
  5195. });
  5196. } else {
  5197. ctx[key] = value;
  5198. }
  5199. }
  5200. return true;
  5201. },
  5202. has({
  5203. _: { data, setupState, accessCache, ctx, appContext, propsOptions }
  5204. }, key) {
  5205. let normalizedProps;
  5206. 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);
  5207. },
  5208. defineProperty(target, key, descriptor) {
  5209. if (descriptor.get != null) {
  5210. target._.accessCache[key] = 0;
  5211. } else if (hasOwn(descriptor, "value")) {
  5212. this.set(target, key, descriptor.value, null);
  5213. }
  5214. return Reflect.defineProperty(target, key, descriptor);
  5215. }
  5216. };
  5217. {
  5218. PublicInstanceProxyHandlers.ownKeys = (target) => {
  5219. warn$1(
  5220. `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`
  5221. );
  5222. return Reflect.ownKeys(target);
  5223. };
  5224. }
  5225. const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend({}, PublicInstanceProxyHandlers, {
  5226. get(target, key) {
  5227. if (key === Symbol.unscopables) {
  5228. return;
  5229. }
  5230. return PublicInstanceProxyHandlers.get(target, key, target);
  5231. },
  5232. has(_, key) {
  5233. const has = key[0] !== "_" && !isGloballyAllowed(key);
  5234. if (!has && PublicInstanceProxyHandlers.has(_, key)) {
  5235. warn$1(
  5236. `Property ${JSON.stringify(
  5237. key
  5238. )} should not start with _ which is a reserved prefix for Vue internals.`
  5239. );
  5240. }
  5241. return has;
  5242. }
  5243. });
  5244. function createDevRenderContext(instance) {
  5245. const target = {};
  5246. Object.defineProperty(target, `_`, {
  5247. configurable: true,
  5248. enumerable: false,
  5249. get: () => instance
  5250. });
  5251. Object.keys(publicPropertiesMap).forEach((key) => {
  5252. Object.defineProperty(target, key, {
  5253. configurable: true,
  5254. enumerable: false,
  5255. get: () => publicPropertiesMap[key](instance),
  5256. // intercepted by the proxy so no need for implementation,
  5257. // but needed to prevent set errors
  5258. set: NOOP
  5259. });
  5260. });
  5261. return target;
  5262. }
  5263. function exposePropsOnRenderContext(instance) {
  5264. const {
  5265. ctx,
  5266. propsOptions: [propsOptions]
  5267. } = instance;
  5268. if (propsOptions) {
  5269. Object.keys(propsOptions).forEach((key) => {
  5270. Object.defineProperty(ctx, key, {
  5271. enumerable: true,
  5272. configurable: true,
  5273. get: () => instance.props[key],
  5274. set: NOOP
  5275. });
  5276. });
  5277. }
  5278. }
  5279. function exposeSetupStateOnRenderContext(instance) {
  5280. const { ctx, setupState } = instance;
  5281. Object.keys(toRaw(setupState)).forEach((key) => {
  5282. if (!setupState.__isScriptSetup) {
  5283. if (isReservedPrefix(key[0])) {
  5284. warn$1(
  5285. `setup() return property ${JSON.stringify(
  5286. key
  5287. )} should not start with "$" or "_" which are reserved prefixes for Vue internals.`
  5288. );
  5289. return;
  5290. }
  5291. Object.defineProperty(ctx, key, {
  5292. enumerable: true,
  5293. configurable: true,
  5294. get: () => setupState[key],
  5295. set: NOOP
  5296. });
  5297. }
  5298. });
  5299. }
  5300. const warnRuntimeUsage = (method) => warn$1(
  5301. `${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.`
  5302. );
  5303. function defineProps() {
  5304. {
  5305. warnRuntimeUsage(`defineProps`);
  5306. }
  5307. return null;
  5308. }
  5309. function defineEmits() {
  5310. {
  5311. warnRuntimeUsage(`defineEmits`);
  5312. }
  5313. return null;
  5314. }
  5315. function defineExpose(exposed) {
  5316. {
  5317. warnRuntimeUsage(`defineExpose`);
  5318. }
  5319. }
  5320. function defineOptions(options) {
  5321. {
  5322. warnRuntimeUsage(`defineOptions`);
  5323. }
  5324. }
  5325. function defineSlots() {
  5326. {
  5327. warnRuntimeUsage(`defineSlots`);
  5328. }
  5329. return null;
  5330. }
  5331. function defineModel() {
  5332. {
  5333. warnRuntimeUsage("defineModel");
  5334. }
  5335. }
  5336. function withDefaults(props, defaults) {
  5337. {
  5338. warnRuntimeUsage(`withDefaults`);
  5339. }
  5340. return null;
  5341. }
  5342. function useSlots() {
  5343. return getContext().slots;
  5344. }
  5345. function useAttrs() {
  5346. return getContext().attrs;
  5347. }
  5348. function getContext() {
  5349. const i = getCurrentInstance();
  5350. if (!i) {
  5351. warn$1(`useContext() called without active instance.`);
  5352. }
  5353. return i.setupContext || (i.setupContext = createSetupContext(i));
  5354. }
  5355. function normalizePropsOrEmits(props) {
  5356. return isArray(props) ? props.reduce(
  5357. (normalized, p) => (normalized[p] = null, normalized),
  5358. {}
  5359. ) : props;
  5360. }
  5361. function mergeDefaults(raw, defaults) {
  5362. const props = normalizePropsOrEmits(raw);
  5363. for (const key in defaults) {
  5364. if (key.startsWith("__skip")) continue;
  5365. let opt = props[key];
  5366. if (opt) {
  5367. if (isArray(opt) || isFunction(opt)) {
  5368. opt = props[key] = { type: opt, default: defaults[key] };
  5369. } else {
  5370. opt.default = defaults[key];
  5371. }
  5372. } else if (opt === null) {
  5373. opt = props[key] = { default: defaults[key] };
  5374. } else {
  5375. warn$1(`props default key "${key}" has no corresponding declaration.`);
  5376. }
  5377. if (opt && defaults[`__skip_${key}`]) {
  5378. opt.skipFactory = true;
  5379. }
  5380. }
  5381. return props;
  5382. }
  5383. function mergeModels(a, b) {
  5384. if (!a || !b) return a || b;
  5385. if (isArray(a) && isArray(b)) return a.concat(b);
  5386. return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
  5387. }
  5388. function createPropsRestProxy(props, excludedKeys) {
  5389. const ret = {};
  5390. for (const key in props) {
  5391. if (!excludedKeys.includes(key)) {
  5392. Object.defineProperty(ret, key, {
  5393. enumerable: true,
  5394. get: () => props[key]
  5395. });
  5396. }
  5397. }
  5398. return ret;
  5399. }
  5400. function withAsyncContext(getAwaitable) {
  5401. const ctx = getCurrentInstance();
  5402. if (!ctx) {
  5403. warn$1(
  5404. `withAsyncContext called without active current instance. This is likely a bug.`
  5405. );
  5406. }
  5407. let awaitable = getAwaitable();
  5408. unsetCurrentInstance();
  5409. if (isPromise(awaitable)) {
  5410. awaitable = awaitable.catch((e) => {
  5411. setCurrentInstance(ctx);
  5412. throw e;
  5413. });
  5414. }
  5415. return [awaitable, () => setCurrentInstance(ctx)];
  5416. }
  5417. function createDuplicateChecker() {
  5418. const cache = /* @__PURE__ */ Object.create(null);
  5419. return (type, key) => {
  5420. if (cache[key]) {
  5421. warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`);
  5422. } else {
  5423. cache[key] = type;
  5424. }
  5425. };
  5426. }
  5427. let shouldCacheAccess = true;
  5428. function applyOptions(instance) {
  5429. const options = resolveMergedOptions(instance);
  5430. const publicThis = instance.proxy;
  5431. const ctx = instance.ctx;
  5432. shouldCacheAccess = false;
  5433. if (options.beforeCreate) {
  5434. callHook$1(options.beforeCreate, instance, "bc");
  5435. }
  5436. const {
  5437. // state
  5438. data: dataOptions,
  5439. computed: computedOptions,
  5440. methods,
  5441. watch: watchOptions,
  5442. provide: provideOptions,
  5443. inject: injectOptions,
  5444. // lifecycle
  5445. created,
  5446. beforeMount,
  5447. mounted,
  5448. beforeUpdate,
  5449. updated,
  5450. activated,
  5451. deactivated,
  5452. beforeDestroy,
  5453. beforeUnmount,
  5454. destroyed,
  5455. unmounted,
  5456. render,
  5457. renderTracked,
  5458. renderTriggered,
  5459. errorCaptured,
  5460. serverPrefetch,
  5461. // public API
  5462. expose,
  5463. inheritAttrs,
  5464. // assets
  5465. components,
  5466. directives,
  5467. filters
  5468. } = options;
  5469. const checkDuplicateProperties = createDuplicateChecker() ;
  5470. {
  5471. const [propsOptions] = instance.propsOptions;
  5472. if (propsOptions) {
  5473. for (const key in propsOptions) {
  5474. checkDuplicateProperties("Props" /* PROPS */, key);
  5475. }
  5476. }
  5477. }
  5478. if (injectOptions) {
  5479. resolveInjections(injectOptions, ctx, checkDuplicateProperties);
  5480. }
  5481. if (methods) {
  5482. for (const key in methods) {
  5483. const methodHandler = methods[key];
  5484. if (isFunction(methodHandler)) {
  5485. {
  5486. Object.defineProperty(ctx, key, {
  5487. value: methodHandler.bind(publicThis),
  5488. configurable: true,
  5489. enumerable: true,
  5490. writable: true
  5491. });
  5492. }
  5493. {
  5494. checkDuplicateProperties("Methods" /* METHODS */, key);
  5495. }
  5496. } else {
  5497. warn$1(
  5498. `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`
  5499. );
  5500. }
  5501. }
  5502. }
  5503. if (dataOptions) {
  5504. if (!isFunction(dataOptions)) {
  5505. warn$1(
  5506. `The data option must be a function. Plain object usage is no longer supported.`
  5507. );
  5508. }
  5509. const data = dataOptions.call(publicThis, publicThis);
  5510. if (isPromise(data)) {
  5511. warn$1(
  5512. `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`
  5513. );
  5514. }
  5515. if (!isObject(data)) {
  5516. warn$1(`data() should return an object.`);
  5517. } else {
  5518. instance.data = reactive(data);
  5519. {
  5520. for (const key in data) {
  5521. checkDuplicateProperties("Data" /* DATA */, key);
  5522. if (!isReservedPrefix(key[0])) {
  5523. Object.defineProperty(ctx, key, {
  5524. configurable: true,
  5525. enumerable: true,
  5526. get: () => data[key],
  5527. set: NOOP
  5528. });
  5529. }
  5530. }
  5531. }
  5532. }
  5533. }
  5534. shouldCacheAccess = true;
  5535. if (computedOptions) {
  5536. for (const key in computedOptions) {
  5537. const opt = computedOptions[key];
  5538. const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
  5539. if (get === NOOP) {
  5540. warn$1(`Computed property "${key}" has no getter.`);
  5541. }
  5542. const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
  5543. warn$1(
  5544. `Write operation failed: computed property "${key}" is readonly.`
  5545. );
  5546. } ;
  5547. const c = computed({
  5548. get,
  5549. set
  5550. });
  5551. Object.defineProperty(ctx, key, {
  5552. enumerable: true,
  5553. configurable: true,
  5554. get: () => c.value,
  5555. set: (v) => c.value = v
  5556. });
  5557. {
  5558. checkDuplicateProperties("Computed" /* COMPUTED */, key);
  5559. }
  5560. }
  5561. }
  5562. if (watchOptions) {
  5563. for (const key in watchOptions) {
  5564. createWatcher(watchOptions[key], ctx, publicThis, key);
  5565. }
  5566. }
  5567. if (provideOptions) {
  5568. const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
  5569. Reflect.ownKeys(provides).forEach((key) => {
  5570. provide(key, provides[key]);
  5571. });
  5572. }
  5573. if (created) {
  5574. callHook$1(created, instance, "c");
  5575. }
  5576. function registerLifecycleHook(register, hook) {
  5577. if (isArray(hook)) {
  5578. hook.forEach((_hook) => register(_hook.bind(publicThis)));
  5579. } else if (hook) {
  5580. register(hook.bind(publicThis));
  5581. }
  5582. }
  5583. registerLifecycleHook(onBeforeMount, beforeMount);
  5584. registerLifecycleHook(onMounted, mounted);
  5585. registerLifecycleHook(onBeforeUpdate, beforeUpdate);
  5586. registerLifecycleHook(onUpdated, updated);
  5587. registerLifecycleHook(onActivated, activated);
  5588. registerLifecycleHook(onDeactivated, deactivated);
  5589. registerLifecycleHook(onErrorCaptured, errorCaptured);
  5590. registerLifecycleHook(onRenderTracked, renderTracked);
  5591. registerLifecycleHook(onRenderTriggered, renderTriggered);
  5592. registerLifecycleHook(onBeforeUnmount, beforeUnmount);
  5593. registerLifecycleHook(onUnmounted, unmounted);
  5594. registerLifecycleHook(onServerPrefetch, serverPrefetch);
  5595. if (isArray(expose)) {
  5596. if (expose.length) {
  5597. const exposed = instance.exposed || (instance.exposed = {});
  5598. expose.forEach((key) => {
  5599. Object.defineProperty(exposed, key, {
  5600. get: () => publicThis[key],
  5601. set: (val) => publicThis[key] = val
  5602. });
  5603. });
  5604. } else if (!instance.exposed) {
  5605. instance.exposed = {};
  5606. }
  5607. }
  5608. if (render && instance.render === NOOP) {
  5609. instance.render = render;
  5610. }
  5611. if (inheritAttrs != null) {
  5612. instance.inheritAttrs = inheritAttrs;
  5613. }
  5614. if (components) instance.components = components;
  5615. if (directives) instance.directives = directives;
  5616. }
  5617. function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
  5618. if (isArray(injectOptions)) {
  5619. injectOptions = normalizeInject(injectOptions);
  5620. }
  5621. for (const key in injectOptions) {
  5622. const opt = injectOptions[key];
  5623. let injected;
  5624. if (isObject(opt)) {
  5625. if ("default" in opt) {
  5626. injected = inject(
  5627. opt.from || key,
  5628. opt.default,
  5629. true
  5630. );
  5631. } else {
  5632. injected = inject(opt.from || key);
  5633. }
  5634. } else {
  5635. injected = inject(opt);
  5636. }
  5637. if (isRef(injected)) {
  5638. Object.defineProperty(ctx, key, {
  5639. enumerable: true,
  5640. configurable: true,
  5641. get: () => injected.value,
  5642. set: (v) => injected.value = v
  5643. });
  5644. } else {
  5645. ctx[key] = injected;
  5646. }
  5647. {
  5648. checkDuplicateProperties("Inject" /* INJECT */, key);
  5649. }
  5650. }
  5651. }
  5652. function callHook$1(hook, instance, type) {
  5653. callWithAsyncErrorHandling(
  5654. isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy),
  5655. instance,
  5656. type
  5657. );
  5658. }
  5659. function createWatcher(raw, ctx, publicThis, key) {
  5660. let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  5661. if (isString(raw)) {
  5662. const handler = ctx[raw];
  5663. if (isFunction(handler)) {
  5664. {
  5665. watch(getter, handler);
  5666. }
  5667. } else {
  5668. warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
  5669. }
  5670. } else if (isFunction(raw)) {
  5671. {
  5672. watch(getter, raw.bind(publicThis));
  5673. }
  5674. } else if (isObject(raw)) {
  5675. if (isArray(raw)) {
  5676. raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
  5677. } else {
  5678. const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
  5679. if (isFunction(handler)) {
  5680. watch(getter, handler, raw);
  5681. } else {
  5682. warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
  5683. }
  5684. }
  5685. } else {
  5686. warn$1(`Invalid watch option: "${key}"`, raw);
  5687. }
  5688. }
  5689. function resolveMergedOptions(instance) {
  5690. const base = instance.type;
  5691. const { mixins, extends: extendsOptions } = base;
  5692. const {
  5693. mixins: globalMixins,
  5694. optionsCache: cache,
  5695. config: { optionMergeStrategies }
  5696. } = instance.appContext;
  5697. const cached = cache.get(base);
  5698. let resolved;
  5699. if (cached) {
  5700. resolved = cached;
  5701. } else if (!globalMixins.length && !mixins && !extendsOptions) {
  5702. {
  5703. resolved = base;
  5704. }
  5705. } else {
  5706. resolved = {};
  5707. if (globalMixins.length) {
  5708. globalMixins.forEach(
  5709. (m) => mergeOptions(resolved, m, optionMergeStrategies, true)
  5710. );
  5711. }
  5712. mergeOptions(resolved, base, optionMergeStrategies);
  5713. }
  5714. if (isObject(base)) {
  5715. cache.set(base, resolved);
  5716. }
  5717. return resolved;
  5718. }
  5719. function mergeOptions(to, from, strats, asMixin = false) {
  5720. const { mixins, extends: extendsOptions } = from;
  5721. if (extendsOptions) {
  5722. mergeOptions(to, extendsOptions, strats, true);
  5723. }
  5724. if (mixins) {
  5725. mixins.forEach(
  5726. (m) => mergeOptions(to, m, strats, true)
  5727. );
  5728. }
  5729. for (const key in from) {
  5730. if (asMixin && key === "expose") {
  5731. warn$1(
  5732. `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`
  5733. );
  5734. } else {
  5735. const strat = internalOptionMergeStrats[key] || strats && strats[key];
  5736. to[key] = strat ? strat(to[key], from[key]) : from[key];
  5737. }
  5738. }
  5739. return to;
  5740. }
  5741. const internalOptionMergeStrats = {
  5742. data: mergeDataFn,
  5743. props: mergeEmitsOrPropsOptions,
  5744. emits: mergeEmitsOrPropsOptions,
  5745. // objects
  5746. methods: mergeObjectOptions,
  5747. computed: mergeObjectOptions,
  5748. // lifecycle
  5749. beforeCreate: mergeAsArray,
  5750. created: mergeAsArray,
  5751. beforeMount: mergeAsArray,
  5752. mounted: mergeAsArray,
  5753. beforeUpdate: mergeAsArray,
  5754. updated: mergeAsArray,
  5755. beforeDestroy: mergeAsArray,
  5756. beforeUnmount: mergeAsArray,
  5757. destroyed: mergeAsArray,
  5758. unmounted: mergeAsArray,
  5759. activated: mergeAsArray,
  5760. deactivated: mergeAsArray,
  5761. errorCaptured: mergeAsArray,
  5762. serverPrefetch: mergeAsArray,
  5763. // assets
  5764. components: mergeObjectOptions,
  5765. directives: mergeObjectOptions,
  5766. // watch
  5767. watch: mergeWatchOptions,
  5768. // provide / inject
  5769. provide: mergeDataFn,
  5770. inject: mergeInject
  5771. };
  5772. function mergeDataFn(to, from) {
  5773. if (!from) {
  5774. return to;
  5775. }
  5776. if (!to) {
  5777. return from;
  5778. }
  5779. return function mergedDataFn() {
  5780. return (extend)(
  5781. isFunction(to) ? to.call(this, this) : to,
  5782. isFunction(from) ? from.call(this, this) : from
  5783. );
  5784. };
  5785. }
  5786. function mergeInject(to, from) {
  5787. return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
  5788. }
  5789. function normalizeInject(raw) {
  5790. if (isArray(raw)) {
  5791. const res = {};
  5792. for (let i = 0; i < raw.length; i++) {
  5793. res[raw[i]] = raw[i];
  5794. }
  5795. return res;
  5796. }
  5797. return raw;
  5798. }
  5799. function mergeAsArray(to, from) {
  5800. return to ? [...new Set([].concat(to, from))] : from;
  5801. }
  5802. function mergeObjectOptions(to, from) {
  5803. return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
  5804. }
  5805. function mergeEmitsOrPropsOptions(to, from) {
  5806. if (to) {
  5807. if (isArray(to) && isArray(from)) {
  5808. return [.../* @__PURE__ */ new Set([...to, ...from])];
  5809. }
  5810. return extend(
  5811. /* @__PURE__ */ Object.create(null),
  5812. normalizePropsOrEmits(to),
  5813. normalizePropsOrEmits(from != null ? from : {})
  5814. );
  5815. } else {
  5816. return from;
  5817. }
  5818. }
  5819. function mergeWatchOptions(to, from) {
  5820. if (!to) return from;
  5821. if (!from) return to;
  5822. const merged = extend(/* @__PURE__ */ Object.create(null), to);
  5823. for (const key in from) {
  5824. merged[key] = mergeAsArray(to[key], from[key]);
  5825. }
  5826. return merged;
  5827. }
  5828. function createAppContext() {
  5829. return {
  5830. app: null,
  5831. config: {
  5832. isNativeTag: NO,
  5833. performance: false,
  5834. globalProperties: {},
  5835. optionMergeStrategies: {},
  5836. errorHandler: void 0,
  5837. warnHandler: void 0,
  5838. compilerOptions: {}
  5839. },
  5840. mixins: [],
  5841. components: {},
  5842. directives: {},
  5843. provides: /* @__PURE__ */ Object.create(null),
  5844. optionsCache: /* @__PURE__ */ new WeakMap(),
  5845. propsCache: /* @__PURE__ */ new WeakMap(),
  5846. emitsCache: /* @__PURE__ */ new WeakMap()
  5847. };
  5848. }
  5849. let uid$1 = 0;
  5850. function createAppAPI(render, hydrate) {
  5851. return function createApp(rootComponent, rootProps = null) {
  5852. if (!isFunction(rootComponent)) {
  5853. rootComponent = extend({}, rootComponent);
  5854. }
  5855. if (rootProps != null && !isObject(rootProps)) {
  5856. warn$1(`root props passed to app.mount() must be an object.`);
  5857. rootProps = null;
  5858. }
  5859. const context = createAppContext();
  5860. const installedPlugins = /* @__PURE__ */ new WeakSet();
  5861. const pluginCleanupFns = [];
  5862. let isMounted = false;
  5863. const app = context.app = {
  5864. _uid: uid$1++,
  5865. _component: rootComponent,
  5866. _props: rootProps,
  5867. _container: null,
  5868. _context: context,
  5869. _instance: null,
  5870. version,
  5871. get config() {
  5872. return context.config;
  5873. },
  5874. set config(v) {
  5875. {
  5876. warn$1(
  5877. `app.config cannot be replaced. Modify individual options instead.`
  5878. );
  5879. }
  5880. },
  5881. use(plugin, ...options) {
  5882. if (installedPlugins.has(plugin)) {
  5883. warn$1(`Plugin has already been applied to target app.`);
  5884. } else if (plugin && isFunction(plugin.install)) {
  5885. installedPlugins.add(plugin);
  5886. plugin.install(app, ...options);
  5887. } else if (isFunction(plugin)) {
  5888. installedPlugins.add(plugin);
  5889. plugin(app, ...options);
  5890. } else {
  5891. warn$1(
  5892. `A plugin must either be a function or an object with an "install" function.`
  5893. );
  5894. }
  5895. return app;
  5896. },
  5897. mixin(mixin) {
  5898. {
  5899. if (!context.mixins.includes(mixin)) {
  5900. context.mixins.push(mixin);
  5901. } else {
  5902. warn$1(
  5903. "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
  5904. );
  5905. }
  5906. }
  5907. return app;
  5908. },
  5909. component(name, component) {
  5910. {
  5911. validateComponentName(name, context.config);
  5912. }
  5913. if (!component) {
  5914. return context.components[name];
  5915. }
  5916. if (context.components[name]) {
  5917. warn$1(`Component "${name}" has already been registered in target app.`);
  5918. }
  5919. context.components[name] = component;
  5920. return app;
  5921. },
  5922. directive(name, directive) {
  5923. {
  5924. validateDirectiveName(name);
  5925. }
  5926. if (!directive) {
  5927. return context.directives[name];
  5928. }
  5929. if (context.directives[name]) {
  5930. warn$1(`Directive "${name}" has already been registered in target app.`);
  5931. }
  5932. context.directives[name] = directive;
  5933. return app;
  5934. },
  5935. mount(rootContainer, isHydrate, namespace) {
  5936. if (!isMounted) {
  5937. if (rootContainer.__vue_app__) {
  5938. warn$1(
  5939. `There is already an app instance mounted on the host container.
  5940. If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
  5941. );
  5942. }
  5943. const vnode = app._ceVNode || createVNode(rootComponent, rootProps);
  5944. vnode.appContext = context;
  5945. if (namespace === true) {
  5946. namespace = "svg";
  5947. } else if (namespace === false) {
  5948. namespace = void 0;
  5949. }
  5950. {
  5951. context.reload = () => {
  5952. render(
  5953. cloneVNode(vnode),
  5954. rootContainer,
  5955. namespace
  5956. );
  5957. };
  5958. }
  5959. if (isHydrate && hydrate) {
  5960. hydrate(vnode, rootContainer);
  5961. } else {
  5962. render(vnode, rootContainer, namespace);
  5963. }
  5964. isMounted = true;
  5965. app._container = rootContainer;
  5966. rootContainer.__vue_app__ = app;
  5967. {
  5968. app._instance = vnode.component;
  5969. devtoolsInitApp(app, version);
  5970. }
  5971. return getComponentPublicInstance(vnode.component);
  5972. } else {
  5973. warn$1(
  5974. `App has already been mounted.
  5975. 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)\``
  5976. );
  5977. }
  5978. },
  5979. onUnmount(cleanupFn) {
  5980. if (typeof cleanupFn !== "function") {
  5981. warn$1(
  5982. `Expected function as first argument to app.onUnmount(), but got ${typeof cleanupFn}`
  5983. );
  5984. }
  5985. pluginCleanupFns.push(cleanupFn);
  5986. },
  5987. unmount() {
  5988. if (isMounted) {
  5989. callWithAsyncErrorHandling(
  5990. pluginCleanupFns,
  5991. app._instance,
  5992. 16
  5993. );
  5994. render(null, app._container);
  5995. {
  5996. app._instance = null;
  5997. devtoolsUnmountApp(app);
  5998. }
  5999. delete app._container.__vue_app__;
  6000. } else {
  6001. warn$1(`Cannot unmount an app that is not mounted.`);
  6002. }
  6003. },
  6004. provide(key, value) {
  6005. if (key in context.provides) {
  6006. warn$1(
  6007. `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
  6008. );
  6009. }
  6010. context.provides[key] = value;
  6011. return app;
  6012. },
  6013. runWithContext(fn) {
  6014. const lastApp = currentApp;
  6015. currentApp = app;
  6016. try {
  6017. return fn();
  6018. } finally {
  6019. currentApp = lastApp;
  6020. }
  6021. }
  6022. };
  6023. return app;
  6024. };
  6025. }
  6026. let currentApp = null;
  6027. function provide(key, value) {
  6028. if (!currentInstance) {
  6029. {
  6030. warn$1(`provide() can only be used inside setup().`);
  6031. }
  6032. } else {
  6033. let provides = currentInstance.provides;
  6034. const parentProvides = currentInstance.parent && currentInstance.parent.provides;
  6035. if (parentProvides === provides) {
  6036. provides = currentInstance.provides = Object.create(parentProvides);
  6037. }
  6038. provides[key] = value;
  6039. }
  6040. }
  6041. function inject(key, defaultValue, treatDefaultAsFactory = false) {
  6042. const instance = currentInstance || currentRenderingInstance;
  6043. if (instance || currentApp) {
  6044. const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
  6045. if (provides && key in provides) {
  6046. return provides[key];
  6047. } else if (arguments.length > 1) {
  6048. return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
  6049. } else {
  6050. warn$1(`injection "${String(key)}" not found.`);
  6051. }
  6052. } else {
  6053. warn$1(`inject() can only be used inside setup() or functional components.`);
  6054. }
  6055. }
  6056. function hasInjectionContext() {
  6057. return !!(currentInstance || currentRenderingInstance || currentApp);
  6058. }
  6059. const internalObjectProto = {};
  6060. const createInternalObject = () => Object.create(internalObjectProto);
  6061. const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
  6062. function initProps(instance, rawProps, isStateful, isSSR = false) {
  6063. const props = {};
  6064. const attrs = createInternalObject();
  6065. instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  6066. setFullProps(instance, rawProps, props, attrs);
  6067. for (const key in instance.propsOptions[0]) {
  6068. if (!(key in props)) {
  6069. props[key] = void 0;
  6070. }
  6071. }
  6072. {
  6073. validateProps(rawProps || {}, props, instance);
  6074. }
  6075. if (isStateful) {
  6076. instance.props = isSSR ? props : shallowReactive(props);
  6077. } else {
  6078. if (!instance.type.props) {
  6079. instance.props = attrs;
  6080. } else {
  6081. instance.props = props;
  6082. }
  6083. }
  6084. instance.attrs = attrs;
  6085. }
  6086. function isInHmrContext(instance) {
  6087. while (instance) {
  6088. if (instance.type.__hmrId) return true;
  6089. instance = instance.parent;
  6090. }
  6091. }
  6092. function updateProps(instance, rawProps, rawPrevProps, optimized) {
  6093. const {
  6094. props,
  6095. attrs,
  6096. vnode: { patchFlag }
  6097. } = instance;
  6098. const rawCurrentProps = toRaw(props);
  6099. const [options] = instance.propsOptions;
  6100. let hasAttrsChanged = false;
  6101. if (
  6102. // always force full diff in dev
  6103. // - #1942 if hmr is enabled with sfc component
  6104. // - vite#872 non-sfc component used by sfc component
  6105. !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
  6106. ) {
  6107. if (patchFlag & 8) {
  6108. const propsToUpdate = instance.vnode.dynamicProps;
  6109. for (let i = 0; i < propsToUpdate.length; i++) {
  6110. let key = propsToUpdate[i];
  6111. if (isEmitListener(instance.emitsOptions, key)) {
  6112. continue;
  6113. }
  6114. const value = rawProps[key];
  6115. if (options) {
  6116. if (hasOwn(attrs, key)) {
  6117. if (value !== attrs[key]) {
  6118. attrs[key] = value;
  6119. hasAttrsChanged = true;
  6120. }
  6121. } else {
  6122. const camelizedKey = camelize(key);
  6123. props[camelizedKey] = resolvePropValue(
  6124. options,
  6125. rawCurrentProps,
  6126. camelizedKey,
  6127. value,
  6128. instance,
  6129. false
  6130. );
  6131. }
  6132. } else {
  6133. if (value !== attrs[key]) {
  6134. attrs[key] = value;
  6135. hasAttrsChanged = true;
  6136. }
  6137. }
  6138. }
  6139. }
  6140. } else {
  6141. if (setFullProps(instance, rawProps, props, attrs)) {
  6142. hasAttrsChanged = true;
  6143. }
  6144. let kebabKey;
  6145. for (const key in rawCurrentProps) {
  6146. if (!rawProps || // for camelCase
  6147. !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
  6148. // and converted to camelCase (#955)
  6149. ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
  6150. if (options) {
  6151. if (rawPrevProps && // for camelCase
  6152. (rawPrevProps[key] !== void 0 || // for kebab-case
  6153. rawPrevProps[kebabKey] !== void 0)) {
  6154. props[key] = resolvePropValue(
  6155. options,
  6156. rawCurrentProps,
  6157. key,
  6158. void 0,
  6159. instance,
  6160. true
  6161. );
  6162. }
  6163. } else {
  6164. delete props[key];
  6165. }
  6166. }
  6167. }
  6168. if (attrs !== rawCurrentProps) {
  6169. for (const key in attrs) {
  6170. if (!rawProps || !hasOwn(rawProps, key) && true) {
  6171. delete attrs[key];
  6172. hasAttrsChanged = true;
  6173. }
  6174. }
  6175. }
  6176. }
  6177. if (hasAttrsChanged) {
  6178. trigger(instance.attrs, "set", "");
  6179. }
  6180. {
  6181. validateProps(rawProps || {}, props, instance);
  6182. }
  6183. }
  6184. function setFullProps(instance, rawProps, props, attrs) {
  6185. const [options, needCastKeys] = instance.propsOptions;
  6186. let hasAttrsChanged = false;
  6187. let rawCastValues;
  6188. if (rawProps) {
  6189. for (let key in rawProps) {
  6190. if (isReservedProp(key)) {
  6191. continue;
  6192. }
  6193. const value = rawProps[key];
  6194. let camelKey;
  6195. if (options && hasOwn(options, camelKey = camelize(key))) {
  6196. if (!needCastKeys || !needCastKeys.includes(camelKey)) {
  6197. props[camelKey] = value;
  6198. } else {
  6199. (rawCastValues || (rawCastValues = {}))[camelKey] = value;
  6200. }
  6201. } else if (!isEmitListener(instance.emitsOptions, key)) {
  6202. if (!(key in attrs) || value !== attrs[key]) {
  6203. attrs[key] = value;
  6204. hasAttrsChanged = true;
  6205. }
  6206. }
  6207. }
  6208. }
  6209. if (needCastKeys) {
  6210. const rawCurrentProps = toRaw(props);
  6211. const castValues = rawCastValues || EMPTY_OBJ;
  6212. for (let i = 0; i < needCastKeys.length; i++) {
  6213. const key = needCastKeys[i];
  6214. props[key] = resolvePropValue(
  6215. options,
  6216. rawCurrentProps,
  6217. key,
  6218. castValues[key],
  6219. instance,
  6220. !hasOwn(castValues, key)
  6221. );
  6222. }
  6223. }
  6224. return hasAttrsChanged;
  6225. }
  6226. function resolvePropValue(options, props, key, value, instance, isAbsent) {
  6227. const opt = options[key];
  6228. if (opt != null) {
  6229. const hasDefault = hasOwn(opt, "default");
  6230. if (hasDefault && value === void 0) {
  6231. const defaultValue = opt.default;
  6232. if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
  6233. const { propsDefaults } = instance;
  6234. if (key in propsDefaults) {
  6235. value = propsDefaults[key];
  6236. } else {
  6237. const reset = setCurrentInstance(instance);
  6238. value = propsDefaults[key] = defaultValue.call(
  6239. null,
  6240. props
  6241. );
  6242. reset();
  6243. }
  6244. } else {
  6245. value = defaultValue;
  6246. }
  6247. if (instance.ce) {
  6248. instance.ce._setProp(key, value);
  6249. }
  6250. }
  6251. if (opt[0 /* shouldCast */]) {
  6252. if (isAbsent && !hasDefault) {
  6253. value = false;
  6254. } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) {
  6255. value = true;
  6256. }
  6257. }
  6258. }
  6259. return value;
  6260. }
  6261. const mixinPropsCache = /* @__PURE__ */ new WeakMap();
  6262. function normalizePropsOptions(comp, appContext, asMixin = false) {
  6263. const cache = asMixin ? mixinPropsCache : appContext.propsCache;
  6264. const cached = cache.get(comp);
  6265. if (cached) {
  6266. return cached;
  6267. }
  6268. const raw = comp.props;
  6269. const normalized = {};
  6270. const needCastKeys = [];
  6271. let hasExtends = false;
  6272. if (!isFunction(comp)) {
  6273. const extendProps = (raw2) => {
  6274. hasExtends = true;
  6275. const [props, keys] = normalizePropsOptions(raw2, appContext, true);
  6276. extend(normalized, props);
  6277. if (keys) needCastKeys.push(...keys);
  6278. };
  6279. if (!asMixin && appContext.mixins.length) {
  6280. appContext.mixins.forEach(extendProps);
  6281. }
  6282. if (comp.extends) {
  6283. extendProps(comp.extends);
  6284. }
  6285. if (comp.mixins) {
  6286. comp.mixins.forEach(extendProps);
  6287. }
  6288. }
  6289. if (!raw && !hasExtends) {
  6290. if (isObject(comp)) {
  6291. cache.set(comp, EMPTY_ARR);
  6292. }
  6293. return EMPTY_ARR;
  6294. }
  6295. if (isArray(raw)) {
  6296. for (let i = 0; i < raw.length; i++) {
  6297. if (!isString(raw[i])) {
  6298. warn$1(`props must be strings when using array syntax.`, raw[i]);
  6299. }
  6300. const normalizedKey = camelize(raw[i]);
  6301. if (validatePropName(normalizedKey)) {
  6302. normalized[normalizedKey] = EMPTY_OBJ;
  6303. }
  6304. }
  6305. } else if (raw) {
  6306. if (!isObject(raw)) {
  6307. warn$1(`invalid props options`, raw);
  6308. }
  6309. for (const key in raw) {
  6310. const normalizedKey = camelize(key);
  6311. if (validatePropName(normalizedKey)) {
  6312. const opt = raw[key];
  6313. const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
  6314. const propType = prop.type;
  6315. let shouldCast = false;
  6316. let shouldCastTrue = true;
  6317. if (isArray(propType)) {
  6318. for (let index = 0; index < propType.length; ++index) {
  6319. const type = propType[index];
  6320. const typeName = isFunction(type) && type.name;
  6321. if (typeName === "Boolean") {
  6322. shouldCast = true;
  6323. break;
  6324. } else if (typeName === "String") {
  6325. shouldCastTrue = false;
  6326. }
  6327. }
  6328. } else {
  6329. shouldCast = isFunction(propType) && propType.name === "Boolean";
  6330. }
  6331. prop[0 /* shouldCast */] = shouldCast;
  6332. prop[1 /* shouldCastTrue */] = shouldCastTrue;
  6333. if (shouldCast || hasOwn(prop, "default")) {
  6334. needCastKeys.push(normalizedKey);
  6335. }
  6336. }
  6337. }
  6338. }
  6339. const res = [normalized, needCastKeys];
  6340. if (isObject(comp)) {
  6341. cache.set(comp, res);
  6342. }
  6343. return res;
  6344. }
  6345. function validatePropName(key) {
  6346. if (key[0] !== "$" && !isReservedProp(key)) {
  6347. return true;
  6348. } else {
  6349. warn$1(`Invalid prop name: "${key}" is a reserved property.`);
  6350. }
  6351. return false;
  6352. }
  6353. function getType(ctor) {
  6354. if (ctor === null) {
  6355. return "null";
  6356. }
  6357. if (typeof ctor === "function") {
  6358. return ctor.name || "";
  6359. } else if (typeof ctor === "object") {
  6360. const name = ctor.constructor && ctor.constructor.name;
  6361. return name || "";
  6362. }
  6363. return "";
  6364. }
  6365. function validateProps(rawProps, props, instance) {
  6366. const resolvedValues = toRaw(props);
  6367. const options = instance.propsOptions[0];
  6368. const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
  6369. for (const key in options) {
  6370. let opt = options[key];
  6371. if (opt == null) continue;
  6372. validateProp(
  6373. key,
  6374. resolvedValues[key],
  6375. opt,
  6376. shallowReadonly(resolvedValues) ,
  6377. !camelizePropsKey.includes(key)
  6378. );
  6379. }
  6380. }
  6381. function validateProp(name, value, prop, props, isAbsent) {
  6382. const { type, required, validator, skipCheck } = prop;
  6383. if (required && isAbsent) {
  6384. warn$1('Missing required prop: "' + name + '"');
  6385. return;
  6386. }
  6387. if (value == null && !required) {
  6388. return;
  6389. }
  6390. if (type != null && type !== true && !skipCheck) {
  6391. let isValid = false;
  6392. const types = isArray(type) ? type : [type];
  6393. const expectedTypes = [];
  6394. for (let i = 0; i < types.length && !isValid; i++) {
  6395. const { valid, expectedType } = assertType(value, types[i]);
  6396. expectedTypes.push(expectedType || "");
  6397. isValid = valid;
  6398. }
  6399. if (!isValid) {
  6400. warn$1(getInvalidTypeMessage(name, value, expectedTypes));
  6401. return;
  6402. }
  6403. }
  6404. if (validator && !validator(value, props)) {
  6405. warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
  6406. }
  6407. }
  6408. const isSimpleType = /* @__PURE__ */ makeMap(
  6409. "String,Number,Boolean,Function,Symbol,BigInt"
  6410. );
  6411. function assertType(value, type) {
  6412. let valid;
  6413. const expectedType = getType(type);
  6414. if (expectedType === "null") {
  6415. valid = value === null;
  6416. } else if (isSimpleType(expectedType)) {
  6417. const t = typeof value;
  6418. valid = t === expectedType.toLowerCase();
  6419. if (!valid && t === "object") {
  6420. valid = value instanceof type;
  6421. }
  6422. } else if (expectedType === "Object") {
  6423. valid = isObject(value);
  6424. } else if (expectedType === "Array") {
  6425. valid = isArray(value);
  6426. } else {
  6427. valid = value instanceof type;
  6428. }
  6429. return {
  6430. valid,
  6431. expectedType
  6432. };
  6433. }
  6434. function getInvalidTypeMessage(name, value, expectedTypes) {
  6435. if (expectedTypes.length === 0) {
  6436. return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
  6437. }
  6438. let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
  6439. const expectedType = expectedTypes[0];
  6440. const receivedType = toRawType(value);
  6441. const expectedValue = styleValue(value, expectedType);
  6442. const receivedValue = styleValue(value, receivedType);
  6443. if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
  6444. message += ` with value ${expectedValue}`;
  6445. }
  6446. message += `, got ${receivedType} `;
  6447. if (isExplicable(receivedType)) {
  6448. message += `with value ${receivedValue}.`;
  6449. }
  6450. return message;
  6451. }
  6452. function styleValue(value, type) {
  6453. if (type === "String") {
  6454. return `"${value}"`;
  6455. } else if (type === "Number") {
  6456. return `${Number(value)}`;
  6457. } else {
  6458. return `${value}`;
  6459. }
  6460. }
  6461. function isExplicable(type) {
  6462. const explicitTypes = ["string", "number", "boolean"];
  6463. return explicitTypes.some((elem) => type.toLowerCase() === elem);
  6464. }
  6465. function isBoolean(...args) {
  6466. return args.some((elem) => elem.toLowerCase() === "boolean");
  6467. }
  6468. const isInternalKey = (key) => key[0] === "_" || key === "$stable";
  6469. const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
  6470. const normalizeSlot = (key, rawSlot, ctx) => {
  6471. if (rawSlot._n) {
  6472. return rawSlot;
  6473. }
  6474. const normalized = withCtx((...args) => {
  6475. if (currentInstance && (!ctx || ctx.root === currentInstance.root)) {
  6476. warn$1(
  6477. `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.`
  6478. );
  6479. }
  6480. return normalizeSlotValue(rawSlot(...args));
  6481. }, ctx);
  6482. normalized._c = false;
  6483. return normalized;
  6484. };
  6485. const normalizeObjectSlots = (rawSlots, slots, instance) => {
  6486. const ctx = rawSlots._ctx;
  6487. for (const key in rawSlots) {
  6488. if (isInternalKey(key)) continue;
  6489. const value = rawSlots[key];
  6490. if (isFunction(value)) {
  6491. slots[key] = normalizeSlot(key, value, ctx);
  6492. } else if (value != null) {
  6493. {
  6494. warn$1(
  6495. `Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
  6496. );
  6497. }
  6498. const normalized = normalizeSlotValue(value);
  6499. slots[key] = () => normalized;
  6500. }
  6501. }
  6502. };
  6503. const normalizeVNodeSlots = (instance, children) => {
  6504. if (!isKeepAlive(instance.vnode) && true) {
  6505. warn$1(
  6506. `Non-function value encountered for default slot. Prefer function slots for better performance.`
  6507. );
  6508. }
  6509. const normalized = normalizeSlotValue(children);
  6510. instance.slots.default = () => normalized;
  6511. };
  6512. const assignSlots = (slots, children, optimized) => {
  6513. for (const key in children) {
  6514. if (optimized || key !== "_") {
  6515. slots[key] = children[key];
  6516. }
  6517. }
  6518. };
  6519. const initSlots = (instance, children, optimized) => {
  6520. const slots = instance.slots = createInternalObject();
  6521. if (instance.vnode.shapeFlag & 32) {
  6522. const type = children._;
  6523. if (type) {
  6524. assignSlots(slots, children, optimized);
  6525. if (optimized) {
  6526. def(slots, "_", type, true);
  6527. }
  6528. } else {
  6529. normalizeObjectSlots(children, slots);
  6530. }
  6531. } else if (children) {
  6532. normalizeVNodeSlots(instance, children);
  6533. }
  6534. };
  6535. const updateSlots = (instance, children, optimized) => {
  6536. const { vnode, slots } = instance;
  6537. let needDeletionCheck = true;
  6538. let deletionComparisonTarget = EMPTY_OBJ;
  6539. if (vnode.shapeFlag & 32) {
  6540. const type = children._;
  6541. if (type) {
  6542. if (isHmrUpdating) {
  6543. assignSlots(slots, children, optimized);
  6544. trigger(instance, "set", "$slots");
  6545. } else if (optimized && type === 1) {
  6546. needDeletionCheck = false;
  6547. } else {
  6548. assignSlots(slots, children, optimized);
  6549. }
  6550. } else {
  6551. needDeletionCheck = !children.$stable;
  6552. normalizeObjectSlots(children, slots);
  6553. }
  6554. deletionComparisonTarget = children;
  6555. } else if (children) {
  6556. normalizeVNodeSlots(instance, children);
  6557. deletionComparisonTarget = { default: 1 };
  6558. }
  6559. if (needDeletionCheck) {
  6560. for (const key in slots) {
  6561. if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
  6562. delete slots[key];
  6563. }
  6564. }
  6565. }
  6566. };
  6567. let supported;
  6568. let perf;
  6569. function startMeasure(instance, type) {
  6570. if (instance.appContext.config.performance && isSupported()) {
  6571. perf.mark(`vue-${type}-${instance.uid}`);
  6572. }
  6573. {
  6574. devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
  6575. }
  6576. }
  6577. function endMeasure(instance, type) {
  6578. if (instance.appContext.config.performance && isSupported()) {
  6579. const startTag = `vue-${type}-${instance.uid}`;
  6580. const endTag = startTag + `:end`;
  6581. perf.mark(endTag);
  6582. perf.measure(
  6583. `<${formatComponentName(instance, instance.type)}> ${type}`,
  6584. startTag,
  6585. endTag
  6586. );
  6587. perf.clearMarks(startTag);
  6588. perf.clearMarks(endTag);
  6589. }
  6590. {
  6591. devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
  6592. }
  6593. }
  6594. function isSupported() {
  6595. if (supported !== void 0) {
  6596. return supported;
  6597. }
  6598. if (typeof window !== "undefined" && window.performance) {
  6599. supported = true;
  6600. perf = window.performance;
  6601. } else {
  6602. supported = false;
  6603. }
  6604. return supported;
  6605. }
  6606. const queuePostRenderEffect = queueEffectWithSuspense ;
  6607. function createRenderer(options) {
  6608. return baseCreateRenderer(options);
  6609. }
  6610. function createHydrationRenderer(options) {
  6611. return baseCreateRenderer(options, createHydrationFunctions);
  6612. }
  6613. function baseCreateRenderer(options, createHydrationFns) {
  6614. const target = getGlobalThis();
  6615. target.__VUE__ = true;
  6616. {
  6617. setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
  6618. }
  6619. const {
  6620. insert: hostInsert,
  6621. remove: hostRemove,
  6622. patchProp: hostPatchProp,
  6623. createElement: hostCreateElement,
  6624. createText: hostCreateText,
  6625. createComment: hostCreateComment,
  6626. setText: hostSetText,
  6627. setElementText: hostSetElementText,
  6628. parentNode: hostParentNode,
  6629. nextSibling: hostNextSibling,
  6630. setScopeId: hostSetScopeId = NOOP,
  6631. insertStaticContent: hostInsertStaticContent
  6632. } = options;
  6633. const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
  6634. if (n1 === n2) {
  6635. return;
  6636. }
  6637. if (n1 && !isSameVNodeType(n1, n2)) {
  6638. anchor = getNextHostNode(n1);
  6639. unmount(n1, parentComponent, parentSuspense, true);
  6640. n1 = null;
  6641. }
  6642. if (n2.patchFlag === -2) {
  6643. optimized = false;
  6644. n2.dynamicChildren = null;
  6645. }
  6646. const { type, ref, shapeFlag } = n2;
  6647. switch (type) {
  6648. case Text:
  6649. processText(n1, n2, container, anchor);
  6650. break;
  6651. case Comment:
  6652. processCommentNode(n1, n2, container, anchor);
  6653. break;
  6654. case Static:
  6655. if (n1 == null) {
  6656. mountStaticNode(n2, container, anchor, namespace);
  6657. } else {
  6658. patchStaticNode(n1, n2, container, namespace);
  6659. }
  6660. break;
  6661. case Fragment:
  6662. processFragment(
  6663. n1,
  6664. n2,
  6665. container,
  6666. anchor,
  6667. parentComponent,
  6668. parentSuspense,
  6669. namespace,
  6670. slotScopeIds,
  6671. optimized
  6672. );
  6673. break;
  6674. default:
  6675. if (shapeFlag & 1) {
  6676. processElement(
  6677. n1,
  6678. n2,
  6679. container,
  6680. anchor,
  6681. parentComponent,
  6682. parentSuspense,
  6683. namespace,
  6684. slotScopeIds,
  6685. optimized
  6686. );
  6687. } else if (shapeFlag & 6) {
  6688. processComponent(
  6689. n1,
  6690. n2,
  6691. container,
  6692. anchor,
  6693. parentComponent,
  6694. parentSuspense,
  6695. namespace,
  6696. slotScopeIds,
  6697. optimized
  6698. );
  6699. } else if (shapeFlag & 64) {
  6700. type.process(
  6701. n1,
  6702. n2,
  6703. container,
  6704. anchor,
  6705. parentComponent,
  6706. parentSuspense,
  6707. namespace,
  6708. slotScopeIds,
  6709. optimized,
  6710. internals
  6711. );
  6712. } else if (shapeFlag & 128) {
  6713. type.process(
  6714. n1,
  6715. n2,
  6716. container,
  6717. anchor,
  6718. parentComponent,
  6719. parentSuspense,
  6720. namespace,
  6721. slotScopeIds,
  6722. optimized,
  6723. internals
  6724. );
  6725. } else {
  6726. warn$1("Invalid VNode type:", type, `(${typeof type})`);
  6727. }
  6728. }
  6729. if (ref != null && parentComponent) {
  6730. setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
  6731. }
  6732. };
  6733. const processText = (n1, n2, container, anchor) => {
  6734. if (n1 == null) {
  6735. hostInsert(
  6736. n2.el = hostCreateText(n2.children),
  6737. container,
  6738. anchor
  6739. );
  6740. } else {
  6741. const el = n2.el = n1.el;
  6742. if (n2.children !== n1.children) {
  6743. hostSetText(el, n2.children);
  6744. }
  6745. }
  6746. };
  6747. const processCommentNode = (n1, n2, container, anchor) => {
  6748. if (n1 == null) {
  6749. hostInsert(
  6750. n2.el = hostCreateComment(n2.children || ""),
  6751. container,
  6752. anchor
  6753. );
  6754. } else {
  6755. n2.el = n1.el;
  6756. }
  6757. };
  6758. const mountStaticNode = (n2, container, anchor, namespace) => {
  6759. [n2.el, n2.anchor] = hostInsertStaticContent(
  6760. n2.children,
  6761. container,
  6762. anchor,
  6763. namespace,
  6764. n2.el,
  6765. n2.anchor
  6766. );
  6767. };
  6768. const patchStaticNode = (n1, n2, container, namespace) => {
  6769. if (n2.children !== n1.children) {
  6770. const anchor = hostNextSibling(n1.anchor);
  6771. removeStaticNode(n1);
  6772. [n2.el, n2.anchor] = hostInsertStaticContent(
  6773. n2.children,
  6774. container,
  6775. anchor,
  6776. namespace
  6777. );
  6778. } else {
  6779. n2.el = n1.el;
  6780. n2.anchor = n1.anchor;
  6781. }
  6782. };
  6783. const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
  6784. let next;
  6785. while (el && el !== anchor) {
  6786. next = hostNextSibling(el);
  6787. hostInsert(el, container, nextSibling);
  6788. el = next;
  6789. }
  6790. hostInsert(anchor, container, nextSibling);
  6791. };
  6792. const removeStaticNode = ({ el, anchor }) => {
  6793. let next;
  6794. while (el && el !== anchor) {
  6795. next = hostNextSibling(el);
  6796. hostRemove(el);
  6797. el = next;
  6798. }
  6799. hostRemove(anchor);
  6800. };
  6801. const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  6802. if (n2.type === "svg") {
  6803. namespace = "svg";
  6804. } else if (n2.type === "math") {
  6805. namespace = "mathml";
  6806. }
  6807. if (n1 == null) {
  6808. mountElement(
  6809. n2,
  6810. container,
  6811. anchor,
  6812. parentComponent,
  6813. parentSuspense,
  6814. namespace,
  6815. slotScopeIds,
  6816. optimized
  6817. );
  6818. } else {
  6819. patchElement(
  6820. n1,
  6821. n2,
  6822. parentComponent,
  6823. parentSuspense,
  6824. namespace,
  6825. slotScopeIds,
  6826. optimized
  6827. );
  6828. }
  6829. };
  6830. const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  6831. let el;
  6832. let vnodeHook;
  6833. const { props, shapeFlag, transition, dirs } = vnode;
  6834. el = vnode.el = hostCreateElement(
  6835. vnode.type,
  6836. namespace,
  6837. props && props.is,
  6838. props
  6839. );
  6840. if (shapeFlag & 8) {
  6841. hostSetElementText(el, vnode.children);
  6842. } else if (shapeFlag & 16) {
  6843. mountChildren(
  6844. vnode.children,
  6845. el,
  6846. null,
  6847. parentComponent,
  6848. parentSuspense,
  6849. resolveChildrenNamespace(vnode, namespace),
  6850. slotScopeIds,
  6851. optimized
  6852. );
  6853. }
  6854. if (dirs) {
  6855. invokeDirectiveHook(vnode, null, parentComponent, "created");
  6856. }
  6857. setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
  6858. if (props) {
  6859. for (const key in props) {
  6860. if (key !== "value" && !isReservedProp(key)) {
  6861. hostPatchProp(el, key, null, props[key], namespace, parentComponent);
  6862. }
  6863. }
  6864. if ("value" in props) {
  6865. hostPatchProp(el, "value", null, props.value, namespace);
  6866. }
  6867. if (vnodeHook = props.onVnodeBeforeMount) {
  6868. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  6869. }
  6870. }
  6871. {
  6872. def(el, "__vnode", vnode, true);
  6873. def(el, "__vueParentComponent", parentComponent, true);
  6874. }
  6875. if (dirs) {
  6876. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  6877. }
  6878. const needCallTransitionHooks = needTransition(parentSuspense, transition);
  6879. if (needCallTransitionHooks) {
  6880. transition.beforeEnter(el);
  6881. }
  6882. hostInsert(el, container, anchor);
  6883. if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
  6884. queuePostRenderEffect(() => {
  6885. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  6886. needCallTransitionHooks && transition.enter(el);
  6887. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  6888. }, parentSuspense);
  6889. }
  6890. };
  6891. const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
  6892. if (scopeId) {
  6893. hostSetScopeId(el, scopeId);
  6894. }
  6895. if (slotScopeIds) {
  6896. for (let i = 0; i < slotScopeIds.length; i++) {
  6897. hostSetScopeId(el, slotScopeIds[i]);
  6898. }
  6899. }
  6900. if (parentComponent) {
  6901. let subTree = parentComponent.subTree;
  6902. if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
  6903. subTree = filterSingleRoot(subTree.children) || subTree;
  6904. }
  6905. if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
  6906. const parentVNode = parentComponent.vnode;
  6907. setScopeId(
  6908. el,
  6909. parentVNode,
  6910. parentVNode.scopeId,
  6911. parentVNode.slotScopeIds,
  6912. parentComponent.parent
  6913. );
  6914. }
  6915. }
  6916. };
  6917. const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
  6918. for (let i = start; i < children.length; i++) {
  6919. const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
  6920. patch(
  6921. null,
  6922. child,
  6923. container,
  6924. anchor,
  6925. parentComponent,
  6926. parentSuspense,
  6927. namespace,
  6928. slotScopeIds,
  6929. optimized
  6930. );
  6931. }
  6932. };
  6933. const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  6934. const el = n2.el = n1.el;
  6935. {
  6936. el.__vnode = n2;
  6937. }
  6938. let { patchFlag, dynamicChildren, dirs } = n2;
  6939. patchFlag |= n1.patchFlag & 16;
  6940. const oldProps = n1.props || EMPTY_OBJ;
  6941. const newProps = n2.props || EMPTY_OBJ;
  6942. let vnodeHook;
  6943. parentComponent && toggleRecurse(parentComponent, false);
  6944. if (vnodeHook = newProps.onVnodeBeforeUpdate) {
  6945. invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  6946. }
  6947. if (dirs) {
  6948. invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
  6949. }
  6950. parentComponent && toggleRecurse(parentComponent, true);
  6951. if (isHmrUpdating) {
  6952. patchFlag = 0;
  6953. optimized = false;
  6954. dynamicChildren = null;
  6955. }
  6956. if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
  6957. hostSetElementText(el, "");
  6958. }
  6959. if (dynamicChildren) {
  6960. patchBlockChildren(
  6961. n1.dynamicChildren,
  6962. dynamicChildren,
  6963. el,
  6964. parentComponent,
  6965. parentSuspense,
  6966. resolveChildrenNamespace(n2, namespace),
  6967. slotScopeIds
  6968. );
  6969. {
  6970. traverseStaticChildren(n1, n2);
  6971. }
  6972. } else if (!optimized) {
  6973. patchChildren(
  6974. n1,
  6975. n2,
  6976. el,
  6977. null,
  6978. parentComponent,
  6979. parentSuspense,
  6980. resolveChildrenNamespace(n2, namespace),
  6981. slotScopeIds,
  6982. false
  6983. );
  6984. }
  6985. if (patchFlag > 0) {
  6986. if (patchFlag & 16) {
  6987. patchProps(el, oldProps, newProps, parentComponent, namespace);
  6988. } else {
  6989. if (patchFlag & 2) {
  6990. if (oldProps.class !== newProps.class) {
  6991. hostPatchProp(el, "class", null, newProps.class, namespace);
  6992. }
  6993. }
  6994. if (patchFlag & 4) {
  6995. hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
  6996. }
  6997. if (patchFlag & 8) {
  6998. const propsToUpdate = n2.dynamicProps;
  6999. for (let i = 0; i < propsToUpdate.length; i++) {
  7000. const key = propsToUpdate[i];
  7001. const prev = oldProps[key];
  7002. const next = newProps[key];
  7003. if (next !== prev || key === "value") {
  7004. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  7005. }
  7006. }
  7007. }
  7008. }
  7009. if (patchFlag & 1) {
  7010. if (n1.children !== n2.children) {
  7011. hostSetElementText(el, n2.children);
  7012. }
  7013. }
  7014. } else if (!optimized && dynamicChildren == null) {
  7015. patchProps(el, oldProps, newProps, parentComponent, namespace);
  7016. }
  7017. if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
  7018. queuePostRenderEffect(() => {
  7019. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  7020. dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
  7021. }, parentSuspense);
  7022. }
  7023. };
  7024. const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
  7025. for (let i = 0; i < newChildren.length; i++) {
  7026. const oldVNode = oldChildren[i];
  7027. const newVNode = newChildren[i];
  7028. const container = (
  7029. // oldVNode may be an errored async setup() component inside Suspense
  7030. // which will not have a mounted element
  7031. oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
  7032. // of the Fragment itself so it can move its children.
  7033. (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
  7034. // which also requires the correct parent container
  7035. !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
  7036. oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : (
  7037. // In other cases, the parent container is not actually used so we
  7038. // just pass the block element here to avoid a DOM parentNode call.
  7039. fallbackContainer
  7040. )
  7041. );
  7042. patch(
  7043. oldVNode,
  7044. newVNode,
  7045. container,
  7046. null,
  7047. parentComponent,
  7048. parentSuspense,
  7049. namespace,
  7050. slotScopeIds,
  7051. true
  7052. );
  7053. }
  7054. };
  7055. const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
  7056. if (oldProps !== newProps) {
  7057. if (oldProps !== EMPTY_OBJ) {
  7058. for (const key in oldProps) {
  7059. if (!isReservedProp(key) && !(key in newProps)) {
  7060. hostPatchProp(
  7061. el,
  7062. key,
  7063. oldProps[key],
  7064. null,
  7065. namespace,
  7066. parentComponent
  7067. );
  7068. }
  7069. }
  7070. }
  7071. for (const key in newProps) {
  7072. if (isReservedProp(key)) continue;
  7073. const next = newProps[key];
  7074. const prev = oldProps[key];
  7075. if (next !== prev && key !== "value") {
  7076. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  7077. }
  7078. }
  7079. if ("value" in newProps) {
  7080. hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
  7081. }
  7082. }
  7083. };
  7084. const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  7085. const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
  7086. const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
  7087. let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
  7088. if (
  7089. // #5523 dev root fragment may inherit directives
  7090. isHmrUpdating || patchFlag & 2048
  7091. ) {
  7092. patchFlag = 0;
  7093. optimized = false;
  7094. dynamicChildren = null;
  7095. }
  7096. if (fragmentSlotScopeIds) {
  7097. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  7098. }
  7099. if (n1 == null) {
  7100. hostInsert(fragmentStartAnchor, container, anchor);
  7101. hostInsert(fragmentEndAnchor, container, anchor);
  7102. mountChildren(
  7103. // #10007
  7104. // such fragment like `<></>` will be compiled into
  7105. // a fragment which doesn't have a children.
  7106. // In this case fallback to an empty array
  7107. n2.children || [],
  7108. container,
  7109. fragmentEndAnchor,
  7110. parentComponent,
  7111. parentSuspense,
  7112. namespace,
  7113. slotScopeIds,
  7114. optimized
  7115. );
  7116. } else {
  7117. if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
  7118. // of renderSlot() with no valid children
  7119. n1.dynamicChildren) {
  7120. patchBlockChildren(
  7121. n1.dynamicChildren,
  7122. dynamicChildren,
  7123. container,
  7124. parentComponent,
  7125. parentSuspense,
  7126. namespace,
  7127. slotScopeIds
  7128. );
  7129. {
  7130. traverseStaticChildren(n1, n2);
  7131. }
  7132. } else {
  7133. patchChildren(
  7134. n1,
  7135. n2,
  7136. container,
  7137. fragmentEndAnchor,
  7138. parentComponent,
  7139. parentSuspense,
  7140. namespace,
  7141. slotScopeIds,
  7142. optimized
  7143. );
  7144. }
  7145. }
  7146. };
  7147. const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  7148. n2.slotScopeIds = slotScopeIds;
  7149. if (n1 == null) {
  7150. if (n2.shapeFlag & 512) {
  7151. parentComponent.ctx.activate(
  7152. n2,
  7153. container,
  7154. anchor,
  7155. namespace,
  7156. optimized
  7157. );
  7158. } else {
  7159. mountComponent(
  7160. n2,
  7161. container,
  7162. anchor,
  7163. parentComponent,
  7164. parentSuspense,
  7165. namespace,
  7166. optimized
  7167. );
  7168. }
  7169. } else {
  7170. updateComponent(n1, n2, optimized);
  7171. }
  7172. };
  7173. const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
  7174. const instance = (initialVNode.component = createComponentInstance(
  7175. initialVNode,
  7176. parentComponent,
  7177. parentSuspense
  7178. ));
  7179. if (instance.type.__hmrId) {
  7180. registerHMR(instance);
  7181. }
  7182. {
  7183. pushWarningContext(initialVNode);
  7184. startMeasure(instance, `mount`);
  7185. }
  7186. if (isKeepAlive(initialVNode)) {
  7187. instance.ctx.renderer = internals;
  7188. }
  7189. {
  7190. {
  7191. startMeasure(instance, `init`);
  7192. }
  7193. setupComponent(instance, false, optimized);
  7194. {
  7195. endMeasure(instance, `init`);
  7196. }
  7197. }
  7198. if (instance.asyncDep) {
  7199. if (isHmrUpdating) initialVNode.el = null;
  7200. parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
  7201. if (!initialVNode.el) {
  7202. const placeholder = instance.subTree = createVNode(Comment);
  7203. processCommentNode(null, placeholder, container, anchor);
  7204. }
  7205. } else {
  7206. setupRenderEffect(
  7207. instance,
  7208. initialVNode,
  7209. container,
  7210. anchor,
  7211. parentSuspense,
  7212. namespace,
  7213. optimized
  7214. );
  7215. }
  7216. {
  7217. popWarningContext();
  7218. endMeasure(instance, `mount`);
  7219. }
  7220. };
  7221. const updateComponent = (n1, n2, optimized) => {
  7222. const instance = n2.component = n1.component;
  7223. if (shouldUpdateComponent(n1, n2, optimized)) {
  7224. if (instance.asyncDep && !instance.asyncResolved) {
  7225. {
  7226. pushWarningContext(n2);
  7227. }
  7228. updateComponentPreRender(instance, n2, optimized);
  7229. {
  7230. popWarningContext();
  7231. }
  7232. return;
  7233. } else {
  7234. instance.next = n2;
  7235. instance.update();
  7236. }
  7237. } else {
  7238. n2.el = n1.el;
  7239. instance.vnode = n2;
  7240. }
  7241. };
  7242. const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
  7243. const componentUpdateFn = () => {
  7244. if (!instance.isMounted) {
  7245. let vnodeHook;
  7246. const { el, props } = initialVNode;
  7247. const { bm, m, parent, root, type } = instance;
  7248. const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
  7249. toggleRecurse(instance, false);
  7250. if (bm) {
  7251. invokeArrayFns(bm);
  7252. }
  7253. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
  7254. invokeVNodeHook(vnodeHook, parent, initialVNode);
  7255. }
  7256. toggleRecurse(instance, true);
  7257. if (el && hydrateNode) {
  7258. const hydrateSubTree = () => {
  7259. {
  7260. startMeasure(instance, `render`);
  7261. }
  7262. instance.subTree = renderComponentRoot(instance);
  7263. {
  7264. endMeasure(instance, `render`);
  7265. }
  7266. {
  7267. startMeasure(instance, `hydrate`);
  7268. }
  7269. hydrateNode(
  7270. el,
  7271. instance.subTree,
  7272. instance,
  7273. parentSuspense,
  7274. null
  7275. );
  7276. {
  7277. endMeasure(instance, `hydrate`);
  7278. }
  7279. };
  7280. if (isAsyncWrapperVNode && type.__asyncHydrate) {
  7281. type.__asyncHydrate(
  7282. el,
  7283. instance,
  7284. hydrateSubTree
  7285. );
  7286. } else {
  7287. hydrateSubTree();
  7288. }
  7289. } else {
  7290. if (root.ce) {
  7291. root.ce._injectChildStyle(type);
  7292. }
  7293. {
  7294. startMeasure(instance, `render`);
  7295. }
  7296. const subTree = instance.subTree = renderComponentRoot(instance);
  7297. {
  7298. endMeasure(instance, `render`);
  7299. }
  7300. {
  7301. startMeasure(instance, `patch`);
  7302. }
  7303. patch(
  7304. null,
  7305. subTree,
  7306. container,
  7307. anchor,
  7308. instance,
  7309. parentSuspense,
  7310. namespace
  7311. );
  7312. {
  7313. endMeasure(instance, `patch`);
  7314. }
  7315. initialVNode.el = subTree.el;
  7316. }
  7317. if (m) {
  7318. queuePostRenderEffect(m, parentSuspense);
  7319. }
  7320. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
  7321. const scopedInitialVNode = initialVNode;
  7322. queuePostRenderEffect(
  7323. () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
  7324. parentSuspense
  7325. );
  7326. }
  7327. if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
  7328. instance.a && queuePostRenderEffect(instance.a, parentSuspense);
  7329. }
  7330. instance.isMounted = true;
  7331. {
  7332. devtoolsComponentAdded(instance);
  7333. }
  7334. initialVNode = container = anchor = null;
  7335. } else {
  7336. let { next, bu, u, parent, vnode } = instance;
  7337. {
  7338. const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
  7339. if (nonHydratedAsyncRoot) {
  7340. if (next) {
  7341. next.el = vnode.el;
  7342. updateComponentPreRender(instance, next, optimized);
  7343. }
  7344. nonHydratedAsyncRoot.asyncDep.then(() => {
  7345. if (!instance.isUnmounted) {
  7346. componentUpdateFn();
  7347. }
  7348. });
  7349. return;
  7350. }
  7351. }
  7352. let originNext = next;
  7353. let vnodeHook;
  7354. {
  7355. pushWarningContext(next || instance.vnode);
  7356. }
  7357. toggleRecurse(instance, false);
  7358. if (next) {
  7359. next.el = vnode.el;
  7360. updateComponentPreRender(instance, next, optimized);
  7361. } else {
  7362. next = vnode;
  7363. }
  7364. if (bu) {
  7365. invokeArrayFns(bu);
  7366. }
  7367. if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
  7368. invokeVNodeHook(vnodeHook, parent, next, vnode);
  7369. }
  7370. toggleRecurse(instance, true);
  7371. {
  7372. startMeasure(instance, `render`);
  7373. }
  7374. const nextTree = renderComponentRoot(instance);
  7375. {
  7376. endMeasure(instance, `render`);
  7377. }
  7378. const prevTree = instance.subTree;
  7379. instance.subTree = nextTree;
  7380. {
  7381. startMeasure(instance, `patch`);
  7382. }
  7383. patch(
  7384. prevTree,
  7385. nextTree,
  7386. // parent may have changed if it's in a teleport
  7387. hostParentNode(prevTree.el),
  7388. // anchor may have changed if it's in a fragment
  7389. getNextHostNode(prevTree),
  7390. instance,
  7391. parentSuspense,
  7392. namespace
  7393. );
  7394. {
  7395. endMeasure(instance, `patch`);
  7396. }
  7397. next.el = nextTree.el;
  7398. if (originNext === null) {
  7399. updateHOCHostEl(instance, nextTree.el);
  7400. }
  7401. if (u) {
  7402. queuePostRenderEffect(u, parentSuspense);
  7403. }
  7404. if (vnodeHook = next.props && next.props.onVnodeUpdated) {
  7405. queuePostRenderEffect(
  7406. () => invokeVNodeHook(vnodeHook, parent, next, vnode),
  7407. parentSuspense
  7408. );
  7409. }
  7410. {
  7411. devtoolsComponentUpdated(instance);
  7412. }
  7413. {
  7414. popWarningContext();
  7415. }
  7416. }
  7417. };
  7418. instance.scope.on();
  7419. const effect = instance.effect = new ReactiveEffect(componentUpdateFn);
  7420. instance.scope.off();
  7421. const update = instance.update = effect.run.bind(effect);
  7422. const job = instance.job = effect.runIfDirty.bind(effect);
  7423. job.i = instance;
  7424. job.id = instance.uid;
  7425. effect.scheduler = () => queueJob(job);
  7426. toggleRecurse(instance, true);
  7427. {
  7428. effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
  7429. effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
  7430. }
  7431. update();
  7432. };
  7433. const updateComponentPreRender = (instance, nextVNode, optimized) => {
  7434. nextVNode.component = instance;
  7435. const prevProps = instance.vnode.props;
  7436. instance.vnode = nextVNode;
  7437. instance.next = null;
  7438. updateProps(instance, nextVNode.props, prevProps, optimized);
  7439. updateSlots(instance, nextVNode.children, optimized);
  7440. pauseTracking();
  7441. flushPreFlushCbs(instance);
  7442. resetTracking();
  7443. };
  7444. const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
  7445. const c1 = n1 && n1.children;
  7446. const prevShapeFlag = n1 ? n1.shapeFlag : 0;
  7447. const c2 = n2.children;
  7448. const { patchFlag, shapeFlag } = n2;
  7449. if (patchFlag > 0) {
  7450. if (patchFlag & 128) {
  7451. patchKeyedChildren(
  7452. c1,
  7453. c2,
  7454. container,
  7455. anchor,
  7456. parentComponent,
  7457. parentSuspense,
  7458. namespace,
  7459. slotScopeIds,
  7460. optimized
  7461. );
  7462. return;
  7463. } else if (patchFlag & 256) {
  7464. patchUnkeyedChildren(
  7465. c1,
  7466. c2,
  7467. container,
  7468. anchor,
  7469. parentComponent,
  7470. parentSuspense,
  7471. namespace,
  7472. slotScopeIds,
  7473. optimized
  7474. );
  7475. return;
  7476. }
  7477. }
  7478. if (shapeFlag & 8) {
  7479. if (prevShapeFlag & 16) {
  7480. unmountChildren(c1, parentComponent, parentSuspense);
  7481. }
  7482. if (c2 !== c1) {
  7483. hostSetElementText(container, c2);
  7484. }
  7485. } else {
  7486. if (prevShapeFlag & 16) {
  7487. if (shapeFlag & 16) {
  7488. patchKeyedChildren(
  7489. c1,
  7490. c2,
  7491. container,
  7492. anchor,
  7493. parentComponent,
  7494. parentSuspense,
  7495. namespace,
  7496. slotScopeIds,
  7497. optimized
  7498. );
  7499. } else {
  7500. unmountChildren(c1, parentComponent, parentSuspense, true);
  7501. }
  7502. } else {
  7503. if (prevShapeFlag & 8) {
  7504. hostSetElementText(container, "");
  7505. }
  7506. if (shapeFlag & 16) {
  7507. mountChildren(
  7508. c2,
  7509. container,
  7510. anchor,
  7511. parentComponent,
  7512. parentSuspense,
  7513. namespace,
  7514. slotScopeIds,
  7515. optimized
  7516. );
  7517. }
  7518. }
  7519. }
  7520. };
  7521. const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  7522. c1 = c1 || EMPTY_ARR;
  7523. c2 = c2 || EMPTY_ARR;
  7524. const oldLength = c1.length;
  7525. const newLength = c2.length;
  7526. const commonLength = Math.min(oldLength, newLength);
  7527. let i;
  7528. for (i = 0; i < commonLength; i++) {
  7529. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  7530. patch(
  7531. c1[i],
  7532. nextChild,
  7533. container,
  7534. null,
  7535. parentComponent,
  7536. parentSuspense,
  7537. namespace,
  7538. slotScopeIds,
  7539. optimized
  7540. );
  7541. }
  7542. if (oldLength > newLength) {
  7543. unmountChildren(
  7544. c1,
  7545. parentComponent,
  7546. parentSuspense,
  7547. true,
  7548. false,
  7549. commonLength
  7550. );
  7551. } else {
  7552. mountChildren(
  7553. c2,
  7554. container,
  7555. anchor,
  7556. parentComponent,
  7557. parentSuspense,
  7558. namespace,
  7559. slotScopeIds,
  7560. optimized,
  7561. commonLength
  7562. );
  7563. }
  7564. };
  7565. const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  7566. let i = 0;
  7567. const l2 = c2.length;
  7568. let e1 = c1.length - 1;
  7569. let e2 = l2 - 1;
  7570. while (i <= e1 && i <= e2) {
  7571. const n1 = c1[i];
  7572. const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  7573. if (isSameVNodeType(n1, n2)) {
  7574. patch(
  7575. n1,
  7576. n2,
  7577. container,
  7578. null,
  7579. parentComponent,
  7580. parentSuspense,
  7581. namespace,
  7582. slotScopeIds,
  7583. optimized
  7584. );
  7585. } else {
  7586. break;
  7587. }
  7588. i++;
  7589. }
  7590. while (i <= e1 && i <= e2) {
  7591. const n1 = c1[e1];
  7592. const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
  7593. if (isSameVNodeType(n1, n2)) {
  7594. patch(
  7595. n1,
  7596. n2,
  7597. container,
  7598. null,
  7599. parentComponent,
  7600. parentSuspense,
  7601. namespace,
  7602. slotScopeIds,
  7603. optimized
  7604. );
  7605. } else {
  7606. break;
  7607. }
  7608. e1--;
  7609. e2--;
  7610. }
  7611. if (i > e1) {
  7612. if (i <= e2) {
  7613. const nextPos = e2 + 1;
  7614. const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
  7615. while (i <= e2) {
  7616. patch(
  7617. null,
  7618. c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
  7619. container,
  7620. anchor,
  7621. parentComponent,
  7622. parentSuspense,
  7623. namespace,
  7624. slotScopeIds,
  7625. optimized
  7626. );
  7627. i++;
  7628. }
  7629. }
  7630. } else if (i > e2) {
  7631. while (i <= e1) {
  7632. unmount(c1[i], parentComponent, parentSuspense, true);
  7633. i++;
  7634. }
  7635. } else {
  7636. const s1 = i;
  7637. const s2 = i;
  7638. const keyToNewIndexMap = /* @__PURE__ */ new Map();
  7639. for (i = s2; i <= e2; i++) {
  7640. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  7641. if (nextChild.key != null) {
  7642. if (keyToNewIndexMap.has(nextChild.key)) {
  7643. warn$1(
  7644. `Duplicate keys found during update:`,
  7645. JSON.stringify(nextChild.key),
  7646. `Make sure keys are unique.`
  7647. );
  7648. }
  7649. keyToNewIndexMap.set(nextChild.key, i);
  7650. }
  7651. }
  7652. let j;
  7653. let patched = 0;
  7654. const toBePatched = e2 - s2 + 1;
  7655. let moved = false;
  7656. let maxNewIndexSoFar = 0;
  7657. const newIndexToOldIndexMap = new Array(toBePatched);
  7658. for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0;
  7659. for (i = s1; i <= e1; i++) {
  7660. const prevChild = c1[i];
  7661. if (patched >= toBePatched) {
  7662. unmount(prevChild, parentComponent, parentSuspense, true);
  7663. continue;
  7664. }
  7665. let newIndex;
  7666. if (prevChild.key != null) {
  7667. newIndex = keyToNewIndexMap.get(prevChild.key);
  7668. } else {
  7669. for (j = s2; j <= e2; j++) {
  7670. if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
  7671. newIndex = j;
  7672. break;
  7673. }
  7674. }
  7675. }
  7676. if (newIndex === void 0) {
  7677. unmount(prevChild, parentComponent, parentSuspense, true);
  7678. } else {
  7679. newIndexToOldIndexMap[newIndex - s2] = i + 1;
  7680. if (newIndex >= maxNewIndexSoFar) {
  7681. maxNewIndexSoFar = newIndex;
  7682. } else {
  7683. moved = true;
  7684. }
  7685. patch(
  7686. prevChild,
  7687. c2[newIndex],
  7688. container,
  7689. null,
  7690. parentComponent,
  7691. parentSuspense,
  7692. namespace,
  7693. slotScopeIds,
  7694. optimized
  7695. );
  7696. patched++;
  7697. }
  7698. }
  7699. const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
  7700. j = increasingNewIndexSequence.length - 1;
  7701. for (i = toBePatched - 1; i >= 0; i--) {
  7702. const nextIndex = s2 + i;
  7703. const nextChild = c2[nextIndex];
  7704. const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
  7705. if (newIndexToOldIndexMap[i] === 0) {
  7706. patch(
  7707. null,
  7708. nextChild,
  7709. container,
  7710. anchor,
  7711. parentComponent,
  7712. parentSuspense,
  7713. namespace,
  7714. slotScopeIds,
  7715. optimized
  7716. );
  7717. } else if (moved) {
  7718. if (j < 0 || i !== increasingNewIndexSequence[j]) {
  7719. move(nextChild, container, anchor, 2);
  7720. } else {
  7721. j--;
  7722. }
  7723. }
  7724. }
  7725. }
  7726. };
  7727. const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
  7728. const { el, type, transition, children, shapeFlag } = vnode;
  7729. if (shapeFlag & 6) {
  7730. move(vnode.component.subTree, container, anchor, moveType);
  7731. return;
  7732. }
  7733. if (shapeFlag & 128) {
  7734. vnode.suspense.move(container, anchor, moveType);
  7735. return;
  7736. }
  7737. if (shapeFlag & 64) {
  7738. type.move(vnode, container, anchor, internals);
  7739. return;
  7740. }
  7741. if (type === Fragment) {
  7742. hostInsert(el, container, anchor);
  7743. for (let i = 0; i < children.length; i++) {
  7744. move(children[i], container, anchor, moveType);
  7745. }
  7746. hostInsert(vnode.anchor, container, anchor);
  7747. return;
  7748. }
  7749. if (type === Static) {
  7750. moveStaticNode(vnode, container, anchor);
  7751. return;
  7752. }
  7753. const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
  7754. if (needTransition2) {
  7755. if (moveType === 0) {
  7756. transition.beforeEnter(el);
  7757. hostInsert(el, container, anchor);
  7758. queuePostRenderEffect(() => transition.enter(el), parentSuspense);
  7759. } else {
  7760. const { leave, delayLeave, afterLeave } = transition;
  7761. const remove2 = () => hostInsert(el, container, anchor);
  7762. const performLeave = () => {
  7763. leave(el, () => {
  7764. remove2();
  7765. afterLeave && afterLeave();
  7766. });
  7767. };
  7768. if (delayLeave) {
  7769. delayLeave(el, remove2, performLeave);
  7770. } else {
  7771. performLeave();
  7772. }
  7773. }
  7774. } else {
  7775. hostInsert(el, container, anchor);
  7776. }
  7777. };
  7778. const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
  7779. const {
  7780. type,
  7781. props,
  7782. ref,
  7783. children,
  7784. dynamicChildren,
  7785. shapeFlag,
  7786. patchFlag,
  7787. dirs,
  7788. cacheIndex
  7789. } = vnode;
  7790. if (patchFlag === -2) {
  7791. optimized = false;
  7792. }
  7793. if (ref != null) {
  7794. setRef(ref, null, parentSuspense, vnode, true);
  7795. }
  7796. if (cacheIndex != null) {
  7797. parentComponent.renderCache[cacheIndex] = void 0;
  7798. }
  7799. if (shapeFlag & 256) {
  7800. parentComponent.ctx.deactivate(vnode);
  7801. return;
  7802. }
  7803. const shouldInvokeDirs = shapeFlag & 1 && dirs;
  7804. const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
  7805. let vnodeHook;
  7806. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
  7807. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  7808. }
  7809. if (shapeFlag & 6) {
  7810. unmountComponent(vnode.component, parentSuspense, doRemove);
  7811. } else {
  7812. if (shapeFlag & 128) {
  7813. vnode.suspense.unmount(parentSuspense, doRemove);
  7814. return;
  7815. }
  7816. if (shouldInvokeDirs) {
  7817. invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
  7818. }
  7819. if (shapeFlag & 64) {
  7820. vnode.type.remove(
  7821. vnode,
  7822. parentComponent,
  7823. parentSuspense,
  7824. internals,
  7825. doRemove
  7826. );
  7827. } else if (dynamicChildren && // #5154
  7828. // when v-once is used inside a block, setBlockTracking(-1) marks the
  7829. // parent block with hasOnce: true
  7830. // so that it doesn't take the fast path during unmount - otherwise
  7831. // components nested in v-once are never unmounted.
  7832. !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments
  7833. (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
  7834. unmountChildren(
  7835. dynamicChildren,
  7836. parentComponent,
  7837. parentSuspense,
  7838. false,
  7839. true
  7840. );
  7841. } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
  7842. unmountChildren(children, parentComponent, parentSuspense);
  7843. }
  7844. if (doRemove) {
  7845. remove(vnode);
  7846. }
  7847. }
  7848. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
  7849. queuePostRenderEffect(() => {
  7850. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  7851. shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
  7852. }, parentSuspense);
  7853. }
  7854. };
  7855. const remove = (vnode) => {
  7856. const { type, el, anchor, transition } = vnode;
  7857. if (type === Fragment) {
  7858. if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) {
  7859. vnode.children.forEach((child) => {
  7860. if (child.type === Comment) {
  7861. hostRemove(child.el);
  7862. } else {
  7863. remove(child);
  7864. }
  7865. });
  7866. } else {
  7867. removeFragment(el, anchor);
  7868. }
  7869. return;
  7870. }
  7871. if (type === Static) {
  7872. removeStaticNode(vnode);
  7873. return;
  7874. }
  7875. const performRemove = () => {
  7876. hostRemove(el);
  7877. if (transition && !transition.persisted && transition.afterLeave) {
  7878. transition.afterLeave();
  7879. }
  7880. };
  7881. if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
  7882. const { leave, delayLeave } = transition;
  7883. const performLeave = () => leave(el, performRemove);
  7884. if (delayLeave) {
  7885. delayLeave(vnode.el, performRemove, performLeave);
  7886. } else {
  7887. performLeave();
  7888. }
  7889. } else {
  7890. performRemove();
  7891. }
  7892. };
  7893. const removeFragment = (cur, end) => {
  7894. let next;
  7895. while (cur !== end) {
  7896. next = hostNextSibling(cur);
  7897. hostRemove(cur);
  7898. cur = next;
  7899. }
  7900. hostRemove(end);
  7901. };
  7902. const unmountComponent = (instance, parentSuspense, doRemove) => {
  7903. if (instance.type.__hmrId) {
  7904. unregisterHMR(instance);
  7905. }
  7906. const { bum, scope, job, subTree, um, m, a } = instance;
  7907. invalidateMount(m);
  7908. invalidateMount(a);
  7909. if (bum) {
  7910. invokeArrayFns(bum);
  7911. }
  7912. scope.stop();
  7913. if (job) {
  7914. job.flags |= 8;
  7915. unmount(subTree, instance, parentSuspense, doRemove);
  7916. }
  7917. if (um) {
  7918. queuePostRenderEffect(um, parentSuspense);
  7919. }
  7920. queuePostRenderEffect(() => {
  7921. instance.isUnmounted = true;
  7922. }, parentSuspense);
  7923. if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
  7924. parentSuspense.deps--;
  7925. if (parentSuspense.deps === 0) {
  7926. parentSuspense.resolve();
  7927. }
  7928. }
  7929. {
  7930. devtoolsComponentRemoved(instance);
  7931. }
  7932. };
  7933. const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
  7934. for (let i = start; i < children.length; i++) {
  7935. unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
  7936. }
  7937. };
  7938. const getNextHostNode = (vnode) => {
  7939. if (vnode.shapeFlag & 6) {
  7940. return getNextHostNode(vnode.component.subTree);
  7941. }
  7942. if (vnode.shapeFlag & 128) {
  7943. return vnode.suspense.next();
  7944. }
  7945. const el = hostNextSibling(vnode.anchor || vnode.el);
  7946. const teleportEnd = el && el[TeleportEndKey];
  7947. return teleportEnd ? hostNextSibling(teleportEnd) : el;
  7948. };
  7949. let isFlushing = false;
  7950. const render = (vnode, container, namespace) => {
  7951. if (vnode == null) {
  7952. if (container._vnode) {
  7953. unmount(container._vnode, null, null, true);
  7954. }
  7955. } else {
  7956. patch(
  7957. container._vnode || null,
  7958. vnode,
  7959. container,
  7960. null,
  7961. null,
  7962. null,
  7963. namespace
  7964. );
  7965. }
  7966. container._vnode = vnode;
  7967. if (!isFlushing) {
  7968. isFlushing = true;
  7969. flushPreFlushCbs();
  7970. flushPostFlushCbs();
  7971. isFlushing = false;
  7972. }
  7973. };
  7974. const internals = {
  7975. p: patch,
  7976. um: unmount,
  7977. m: move,
  7978. r: remove,
  7979. mt: mountComponent,
  7980. mc: mountChildren,
  7981. pc: patchChildren,
  7982. pbc: patchBlockChildren,
  7983. n: getNextHostNode,
  7984. o: options
  7985. };
  7986. let hydrate;
  7987. let hydrateNode;
  7988. if (createHydrationFns) {
  7989. [hydrate, hydrateNode] = createHydrationFns(
  7990. internals
  7991. );
  7992. }
  7993. return {
  7994. render,
  7995. hydrate,
  7996. createApp: createAppAPI(render, hydrate)
  7997. };
  7998. }
  7999. function resolveChildrenNamespace({ type, props }, currentNamespace) {
  8000. return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
  8001. }
  8002. function toggleRecurse({ effect, job }, allowed) {
  8003. if (allowed) {
  8004. effect.flags |= 32;
  8005. job.flags |= 4;
  8006. } else {
  8007. effect.flags &= ~32;
  8008. job.flags &= ~4;
  8009. }
  8010. }
  8011. function needTransition(parentSuspense, transition) {
  8012. return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
  8013. }
  8014. function traverseStaticChildren(n1, n2, shallow = false) {
  8015. const ch1 = n1.children;
  8016. const ch2 = n2.children;
  8017. if (isArray(ch1) && isArray(ch2)) {
  8018. for (let i = 0; i < ch1.length; i++) {
  8019. const c1 = ch1[i];
  8020. let c2 = ch2[i];
  8021. if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
  8022. if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
  8023. c2 = ch2[i] = cloneIfMounted(ch2[i]);
  8024. c2.el = c1.el;
  8025. }
  8026. if (!shallow && c2.patchFlag !== -2)
  8027. traverseStaticChildren(c1, c2);
  8028. }
  8029. if (c2.type === Text) {
  8030. c2.el = c1.el;
  8031. }
  8032. if (c2.type === Comment && !c2.el) {
  8033. c2.el = c1.el;
  8034. }
  8035. }
  8036. }
  8037. }
  8038. function getSequence(arr) {
  8039. const p = arr.slice();
  8040. const result = [0];
  8041. let i, j, u, v, c;
  8042. const len = arr.length;
  8043. for (i = 0; i < len; i++) {
  8044. const arrI = arr[i];
  8045. if (arrI !== 0) {
  8046. j = result[result.length - 1];
  8047. if (arr[j] < arrI) {
  8048. p[i] = j;
  8049. result.push(i);
  8050. continue;
  8051. }
  8052. u = 0;
  8053. v = result.length - 1;
  8054. while (u < v) {
  8055. c = u + v >> 1;
  8056. if (arr[result[c]] < arrI) {
  8057. u = c + 1;
  8058. } else {
  8059. v = c;
  8060. }
  8061. }
  8062. if (arrI < arr[result[u]]) {
  8063. if (u > 0) {
  8064. p[i] = result[u - 1];
  8065. }
  8066. result[u] = i;
  8067. }
  8068. }
  8069. }
  8070. u = result.length;
  8071. v = result[u - 1];
  8072. while (u-- > 0) {
  8073. result[u] = v;
  8074. v = p[v];
  8075. }
  8076. return result;
  8077. }
  8078. function locateNonHydratedAsyncRoot(instance) {
  8079. const subComponent = instance.subTree.component;
  8080. if (subComponent) {
  8081. if (subComponent.asyncDep && !subComponent.asyncResolved) {
  8082. return subComponent;
  8083. } else {
  8084. return locateNonHydratedAsyncRoot(subComponent);
  8085. }
  8086. }
  8087. }
  8088. function invalidateMount(hooks) {
  8089. if (hooks) {
  8090. for (let i = 0; i < hooks.length; i++)
  8091. hooks[i].flags |= 8;
  8092. }
  8093. }
  8094. const ssrContextKey = Symbol.for("v-scx");
  8095. const useSSRContext = () => {
  8096. {
  8097. warn$1(`useSSRContext() is not supported in the global build.`);
  8098. }
  8099. };
  8100. function watchEffect(effect, options) {
  8101. return doWatch(effect, null, options);
  8102. }
  8103. function watchPostEffect(effect, options) {
  8104. return doWatch(
  8105. effect,
  8106. null,
  8107. extend({}, options, { flush: "post" })
  8108. );
  8109. }
  8110. function watchSyncEffect(effect, options) {
  8111. return doWatch(
  8112. effect,
  8113. null,
  8114. extend({}, options, { flush: "sync" })
  8115. );
  8116. }
  8117. function watch(source, cb, options) {
  8118. if (!isFunction(cb)) {
  8119. warn$1(
  8120. `\`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.`
  8121. );
  8122. }
  8123. return doWatch(source, cb, options);
  8124. }
  8125. function doWatch(source, cb, options = EMPTY_OBJ) {
  8126. const { immediate, deep, flush, once } = options;
  8127. if (!cb) {
  8128. if (immediate !== void 0) {
  8129. warn$1(
  8130. `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
  8131. );
  8132. }
  8133. if (deep !== void 0) {
  8134. warn$1(
  8135. `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
  8136. );
  8137. }
  8138. if (once !== void 0) {
  8139. warn$1(
  8140. `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
  8141. );
  8142. }
  8143. }
  8144. const baseWatchOptions = extend({}, options);
  8145. baseWatchOptions.onWarn = warn$1;
  8146. const instance = currentInstance;
  8147. baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
  8148. let isPre = false;
  8149. if (flush === "post") {
  8150. baseWatchOptions.scheduler = (job) => {
  8151. queuePostRenderEffect(job, instance && instance.suspense);
  8152. };
  8153. } else if (flush !== "sync") {
  8154. isPre = true;
  8155. baseWatchOptions.scheduler = (job, isFirstRun) => {
  8156. if (isFirstRun) {
  8157. job();
  8158. } else {
  8159. queueJob(job);
  8160. }
  8161. };
  8162. }
  8163. baseWatchOptions.augmentJob = (job) => {
  8164. if (cb) {
  8165. job.flags |= 4;
  8166. }
  8167. if (isPre) {
  8168. job.flags |= 2;
  8169. if (instance) {
  8170. job.id = instance.uid;
  8171. job.i = instance;
  8172. }
  8173. }
  8174. };
  8175. const watchHandle = watch$1(source, cb, baseWatchOptions);
  8176. return watchHandle;
  8177. }
  8178. function instanceWatch(source, value, options) {
  8179. const publicThis = this.proxy;
  8180. const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  8181. let cb;
  8182. if (isFunction(value)) {
  8183. cb = value;
  8184. } else {
  8185. cb = value.handler;
  8186. options = value;
  8187. }
  8188. const reset = setCurrentInstance(this);
  8189. const res = doWatch(getter, cb.bind(publicThis), options);
  8190. reset();
  8191. return res;
  8192. }
  8193. function createPathGetter(ctx, path) {
  8194. const segments = path.split(".");
  8195. return () => {
  8196. let cur = ctx;
  8197. for (let i = 0; i < segments.length && cur; i++) {
  8198. cur = cur[segments[i]];
  8199. }
  8200. return cur;
  8201. };
  8202. }
  8203. function useModel(props, name, options = EMPTY_OBJ) {
  8204. const i = getCurrentInstance();
  8205. if (!i) {
  8206. warn$1(`useModel() called without active instance.`);
  8207. return ref();
  8208. }
  8209. const camelizedName = camelize(name);
  8210. if (!i.propsOptions[0][camelizedName]) {
  8211. warn$1(`useModel() called with prop "${name}" which is not declared.`);
  8212. return ref();
  8213. }
  8214. const hyphenatedName = hyphenate(name);
  8215. const modifiers = getModelModifiers(props, camelizedName);
  8216. const res = customRef((track, trigger) => {
  8217. let localValue;
  8218. let prevSetValue = EMPTY_OBJ;
  8219. let prevEmittedValue;
  8220. watchSyncEffect(() => {
  8221. const propValue = props[camelizedName];
  8222. if (hasChanged(localValue, propValue)) {
  8223. localValue = propValue;
  8224. trigger();
  8225. }
  8226. });
  8227. return {
  8228. get() {
  8229. track();
  8230. return options.get ? options.get(localValue) : localValue;
  8231. },
  8232. set(value) {
  8233. const emittedValue = options.set ? options.set(value) : value;
  8234. if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
  8235. return;
  8236. }
  8237. const rawProps = i.vnode.props;
  8238. if (!(rawProps && // check if parent has passed v-model
  8239. (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
  8240. localValue = value;
  8241. trigger();
  8242. }
  8243. i.emit(`update:${name}`, emittedValue);
  8244. if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
  8245. trigger();
  8246. }
  8247. prevSetValue = value;
  8248. prevEmittedValue = emittedValue;
  8249. }
  8250. };
  8251. });
  8252. res[Symbol.iterator] = () => {
  8253. let i2 = 0;
  8254. return {
  8255. next() {
  8256. if (i2 < 2) {
  8257. return { value: i2++ ? modifiers || EMPTY_OBJ : res, done: false };
  8258. } else {
  8259. return { done: true };
  8260. }
  8261. }
  8262. };
  8263. };
  8264. return res;
  8265. }
  8266. const getModelModifiers = (props, modelName) => {
  8267. return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];
  8268. };
  8269. function emit(instance, event, ...rawArgs) {
  8270. if (instance.isUnmounted) return;
  8271. const props = instance.vnode.props || EMPTY_OBJ;
  8272. {
  8273. const {
  8274. emitsOptions,
  8275. propsOptions: [propsOptions]
  8276. } = instance;
  8277. if (emitsOptions) {
  8278. if (!(event in emitsOptions) && true) {
  8279. if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
  8280. warn$1(
  8281. `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`
  8282. );
  8283. }
  8284. } else {
  8285. const validator = emitsOptions[event];
  8286. if (isFunction(validator)) {
  8287. const isValid = validator(...rawArgs);
  8288. if (!isValid) {
  8289. warn$1(
  8290. `Invalid event arguments: event validation failed for event "${event}".`
  8291. );
  8292. }
  8293. }
  8294. }
  8295. }
  8296. }
  8297. let args = rawArgs;
  8298. const isModelListener = event.startsWith("update:");
  8299. const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
  8300. if (modifiers) {
  8301. if (modifiers.trim) {
  8302. args = rawArgs.map((a) => isString(a) ? a.trim() : a);
  8303. }
  8304. if (modifiers.number) {
  8305. args = rawArgs.map(looseToNumber);
  8306. }
  8307. }
  8308. {
  8309. devtoolsComponentEmit(instance, event, args);
  8310. }
  8311. {
  8312. const lowerCaseEvent = event.toLowerCase();
  8313. if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
  8314. warn$1(
  8315. `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
  8316. instance,
  8317. instance.type
  8318. )} 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(
  8319. event
  8320. )}" instead of "${event}".`
  8321. );
  8322. }
  8323. }
  8324. let handlerName;
  8325. let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
  8326. props[handlerName = toHandlerKey(camelize(event))];
  8327. if (!handler && isModelListener) {
  8328. handler = props[handlerName = toHandlerKey(hyphenate(event))];
  8329. }
  8330. if (handler) {
  8331. callWithAsyncErrorHandling(
  8332. handler,
  8333. instance,
  8334. 6,
  8335. args
  8336. );
  8337. }
  8338. const onceHandler = props[handlerName + `Once`];
  8339. if (onceHandler) {
  8340. if (!instance.emitted) {
  8341. instance.emitted = {};
  8342. } else if (instance.emitted[handlerName]) {
  8343. return;
  8344. }
  8345. instance.emitted[handlerName] = true;
  8346. callWithAsyncErrorHandling(
  8347. onceHandler,
  8348. instance,
  8349. 6,
  8350. args
  8351. );
  8352. }
  8353. }
  8354. function normalizeEmitsOptions(comp, appContext, asMixin = false) {
  8355. const cache = appContext.emitsCache;
  8356. const cached = cache.get(comp);
  8357. if (cached !== void 0) {
  8358. return cached;
  8359. }
  8360. const raw = comp.emits;
  8361. let normalized = {};
  8362. let hasExtends = false;
  8363. if (!isFunction(comp)) {
  8364. const extendEmits = (raw2) => {
  8365. const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
  8366. if (normalizedFromExtend) {
  8367. hasExtends = true;
  8368. extend(normalized, normalizedFromExtend);
  8369. }
  8370. };
  8371. if (!asMixin && appContext.mixins.length) {
  8372. appContext.mixins.forEach(extendEmits);
  8373. }
  8374. if (comp.extends) {
  8375. extendEmits(comp.extends);
  8376. }
  8377. if (comp.mixins) {
  8378. comp.mixins.forEach(extendEmits);
  8379. }
  8380. }
  8381. if (!raw && !hasExtends) {
  8382. if (isObject(comp)) {
  8383. cache.set(comp, null);
  8384. }
  8385. return null;
  8386. }
  8387. if (isArray(raw)) {
  8388. raw.forEach((key) => normalized[key] = null);
  8389. } else {
  8390. extend(normalized, raw);
  8391. }
  8392. if (isObject(comp)) {
  8393. cache.set(comp, normalized);
  8394. }
  8395. return normalized;
  8396. }
  8397. function isEmitListener(options, key) {
  8398. if (!options || !isOn(key)) {
  8399. return false;
  8400. }
  8401. key = key.slice(2).replace(/Once$/, "");
  8402. return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
  8403. }
  8404. let accessedAttrs = false;
  8405. function markAttrsAccessed() {
  8406. accessedAttrs = true;
  8407. }
  8408. function renderComponentRoot(instance) {
  8409. const {
  8410. type: Component,
  8411. vnode,
  8412. proxy,
  8413. withProxy,
  8414. propsOptions: [propsOptions],
  8415. slots,
  8416. attrs,
  8417. emit,
  8418. render,
  8419. renderCache,
  8420. props,
  8421. data,
  8422. setupState,
  8423. ctx,
  8424. inheritAttrs
  8425. } = instance;
  8426. const prev = setCurrentRenderingInstance(instance);
  8427. let result;
  8428. let fallthroughAttrs;
  8429. {
  8430. accessedAttrs = false;
  8431. }
  8432. try {
  8433. if (vnode.shapeFlag & 4) {
  8434. const proxyToUse = withProxy || proxy;
  8435. const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
  8436. get(target, key, receiver) {
  8437. warn$1(
  8438. `Property '${String(
  8439. key
  8440. )}' was accessed via 'this'. Avoid using 'this' in templates.`
  8441. );
  8442. return Reflect.get(target, key, receiver);
  8443. }
  8444. }) : proxyToUse;
  8445. result = normalizeVNode(
  8446. render.call(
  8447. thisProxy,
  8448. proxyToUse,
  8449. renderCache,
  8450. true ? shallowReadonly(props) : props,
  8451. setupState,
  8452. data,
  8453. ctx
  8454. )
  8455. );
  8456. fallthroughAttrs = attrs;
  8457. } else {
  8458. const render2 = Component;
  8459. if (attrs === props) {
  8460. markAttrsAccessed();
  8461. }
  8462. result = normalizeVNode(
  8463. render2.length > 1 ? render2(
  8464. true ? shallowReadonly(props) : props,
  8465. true ? {
  8466. get attrs() {
  8467. markAttrsAccessed();
  8468. return shallowReadonly(attrs);
  8469. },
  8470. slots,
  8471. emit
  8472. } : { attrs, slots, emit }
  8473. ) : render2(
  8474. true ? shallowReadonly(props) : props,
  8475. null
  8476. )
  8477. );
  8478. fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
  8479. }
  8480. } catch (err) {
  8481. blockStack.length = 0;
  8482. handleError(err, instance, 1);
  8483. result = createVNode(Comment);
  8484. }
  8485. let root = result;
  8486. let setRoot = void 0;
  8487. if (result.patchFlag > 0 && result.patchFlag & 2048) {
  8488. [root, setRoot] = getChildRoot(result);
  8489. }
  8490. if (fallthroughAttrs && inheritAttrs !== false) {
  8491. const keys = Object.keys(fallthroughAttrs);
  8492. const { shapeFlag } = root;
  8493. if (keys.length) {
  8494. if (shapeFlag & (1 | 6)) {
  8495. if (propsOptions && keys.some(isModelListener)) {
  8496. fallthroughAttrs = filterModelListeners(
  8497. fallthroughAttrs,
  8498. propsOptions
  8499. );
  8500. }
  8501. root = cloneVNode(root, fallthroughAttrs, false, true);
  8502. } else if (!accessedAttrs && root.type !== Comment) {
  8503. const allAttrs = Object.keys(attrs);
  8504. const eventAttrs = [];
  8505. const extraAttrs = [];
  8506. for (let i = 0, l = allAttrs.length; i < l; i++) {
  8507. const key = allAttrs[i];
  8508. if (isOn(key)) {
  8509. if (!isModelListener(key)) {
  8510. eventAttrs.push(key[2].toLowerCase() + key.slice(3));
  8511. }
  8512. } else {
  8513. extraAttrs.push(key);
  8514. }
  8515. }
  8516. if (extraAttrs.length) {
  8517. warn$1(
  8518. `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
  8519. );
  8520. }
  8521. if (eventAttrs.length) {
  8522. warn$1(
  8523. `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.`
  8524. );
  8525. }
  8526. }
  8527. }
  8528. }
  8529. if (vnode.dirs) {
  8530. if (!isElementRoot(root)) {
  8531. warn$1(
  8532. `Runtime directive used on component with non-element root node. The directives will not function as intended.`
  8533. );
  8534. }
  8535. root = cloneVNode(root, null, false, true);
  8536. root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
  8537. }
  8538. if (vnode.transition) {
  8539. if (!isElementRoot(root)) {
  8540. warn$1(
  8541. `Component inside <Transition> renders non-element root node that cannot be animated.`
  8542. );
  8543. }
  8544. setTransitionHooks(root, vnode.transition);
  8545. }
  8546. if (setRoot) {
  8547. setRoot(root);
  8548. } else {
  8549. result = root;
  8550. }
  8551. setCurrentRenderingInstance(prev);
  8552. return result;
  8553. }
  8554. const getChildRoot = (vnode) => {
  8555. const rawChildren = vnode.children;
  8556. const dynamicChildren = vnode.dynamicChildren;
  8557. const childRoot = filterSingleRoot(rawChildren, false);
  8558. if (!childRoot) {
  8559. return [vnode, void 0];
  8560. } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) {
  8561. return getChildRoot(childRoot);
  8562. }
  8563. const index = rawChildren.indexOf(childRoot);
  8564. const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
  8565. const setRoot = (updatedRoot) => {
  8566. rawChildren[index] = updatedRoot;
  8567. if (dynamicChildren) {
  8568. if (dynamicIndex > -1) {
  8569. dynamicChildren[dynamicIndex] = updatedRoot;
  8570. } else if (updatedRoot.patchFlag > 0) {
  8571. vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
  8572. }
  8573. }
  8574. };
  8575. return [normalizeVNode(childRoot), setRoot];
  8576. };
  8577. function filterSingleRoot(children, recurse = true) {
  8578. let singleRoot;
  8579. for (let i = 0; i < children.length; i++) {
  8580. const child = children[i];
  8581. if (isVNode(child)) {
  8582. if (child.type !== Comment || child.children === "v-if") {
  8583. if (singleRoot) {
  8584. return;
  8585. } else {
  8586. singleRoot = child;
  8587. if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) {
  8588. return filterSingleRoot(singleRoot.children);
  8589. }
  8590. }
  8591. }
  8592. } else {
  8593. return;
  8594. }
  8595. }
  8596. return singleRoot;
  8597. }
  8598. const getFunctionalFallthrough = (attrs) => {
  8599. let res;
  8600. for (const key in attrs) {
  8601. if (key === "class" || key === "style" || isOn(key)) {
  8602. (res || (res = {}))[key] = attrs[key];
  8603. }
  8604. }
  8605. return res;
  8606. };
  8607. const filterModelListeners = (attrs, props) => {
  8608. const res = {};
  8609. for (const key in attrs) {
  8610. if (!isModelListener(key) || !(key.slice(9) in props)) {
  8611. res[key] = attrs[key];
  8612. }
  8613. }
  8614. return res;
  8615. };
  8616. const isElementRoot = (vnode) => {
  8617. return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;
  8618. };
  8619. function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
  8620. const { props: prevProps, children: prevChildren, component } = prevVNode;
  8621. const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
  8622. const emits = component.emitsOptions;
  8623. if ((prevChildren || nextChildren) && isHmrUpdating) {
  8624. return true;
  8625. }
  8626. if (nextVNode.dirs || nextVNode.transition) {
  8627. return true;
  8628. }
  8629. if (optimized && patchFlag >= 0) {
  8630. if (patchFlag & 1024) {
  8631. return true;
  8632. }
  8633. if (patchFlag & 16) {
  8634. if (!prevProps) {
  8635. return !!nextProps;
  8636. }
  8637. return hasPropsChanged(prevProps, nextProps, emits);
  8638. } else if (patchFlag & 8) {
  8639. const dynamicProps = nextVNode.dynamicProps;
  8640. for (let i = 0; i < dynamicProps.length; i++) {
  8641. const key = dynamicProps[i];
  8642. if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
  8643. return true;
  8644. }
  8645. }
  8646. }
  8647. } else {
  8648. if (prevChildren || nextChildren) {
  8649. if (!nextChildren || !nextChildren.$stable) {
  8650. return true;
  8651. }
  8652. }
  8653. if (prevProps === nextProps) {
  8654. return false;
  8655. }
  8656. if (!prevProps) {
  8657. return !!nextProps;
  8658. }
  8659. if (!nextProps) {
  8660. return true;
  8661. }
  8662. return hasPropsChanged(prevProps, nextProps, emits);
  8663. }
  8664. return false;
  8665. }
  8666. function hasPropsChanged(prevProps, nextProps, emitsOptions) {
  8667. const nextKeys = Object.keys(nextProps);
  8668. if (nextKeys.length !== Object.keys(prevProps).length) {
  8669. return true;
  8670. }
  8671. for (let i = 0; i < nextKeys.length; i++) {
  8672. const key = nextKeys[i];
  8673. if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
  8674. return true;
  8675. }
  8676. }
  8677. return false;
  8678. }
  8679. function updateHOCHostEl({ vnode, parent }, el) {
  8680. while (parent) {
  8681. const root = parent.subTree;
  8682. if (root.suspense && root.suspense.activeBranch === vnode) {
  8683. root.el = vnode.el;
  8684. }
  8685. if (root === vnode) {
  8686. (vnode = parent.vnode).el = el;
  8687. parent = parent.parent;
  8688. } else {
  8689. break;
  8690. }
  8691. }
  8692. }
  8693. const isSuspense = (type) => type.__isSuspense;
  8694. let suspenseId = 0;
  8695. const SuspenseImpl = {
  8696. name: "Suspense",
  8697. // In order to make Suspense tree-shakable, we need to avoid importing it
  8698. // directly in the renderer. The renderer checks for the __isSuspense flag
  8699. // on a vnode's type and calls the `process` method, passing in renderer
  8700. // internals.
  8701. __isSuspense: true,
  8702. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
  8703. if (n1 == null) {
  8704. mountSuspense(
  8705. n2,
  8706. container,
  8707. anchor,
  8708. parentComponent,
  8709. parentSuspense,
  8710. namespace,
  8711. slotScopeIds,
  8712. optimized,
  8713. rendererInternals
  8714. );
  8715. } else {
  8716. if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
  8717. n2.suspense = n1.suspense;
  8718. n2.suspense.vnode = n2;
  8719. n2.el = n1.el;
  8720. return;
  8721. }
  8722. patchSuspense(
  8723. n1,
  8724. n2,
  8725. container,
  8726. anchor,
  8727. parentComponent,
  8728. namespace,
  8729. slotScopeIds,
  8730. optimized,
  8731. rendererInternals
  8732. );
  8733. }
  8734. },
  8735. hydrate: hydrateSuspense,
  8736. normalize: normalizeSuspenseChildren
  8737. };
  8738. const Suspense = SuspenseImpl ;
  8739. function triggerEvent(vnode, name) {
  8740. const eventListener = vnode.props && vnode.props[name];
  8741. if (isFunction(eventListener)) {
  8742. eventListener();
  8743. }
  8744. }
  8745. function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
  8746. const {
  8747. p: patch,
  8748. o: { createElement }
  8749. } = rendererInternals;
  8750. const hiddenContainer = createElement("div");
  8751. const suspense = vnode.suspense = createSuspenseBoundary(
  8752. vnode,
  8753. parentSuspense,
  8754. parentComponent,
  8755. container,
  8756. hiddenContainer,
  8757. anchor,
  8758. namespace,
  8759. slotScopeIds,
  8760. optimized,
  8761. rendererInternals
  8762. );
  8763. patch(
  8764. null,
  8765. suspense.pendingBranch = vnode.ssContent,
  8766. hiddenContainer,
  8767. null,
  8768. parentComponent,
  8769. suspense,
  8770. namespace,
  8771. slotScopeIds
  8772. );
  8773. if (suspense.deps > 0) {
  8774. triggerEvent(vnode, "onPending");
  8775. triggerEvent(vnode, "onFallback");
  8776. patch(
  8777. null,
  8778. vnode.ssFallback,
  8779. container,
  8780. anchor,
  8781. parentComponent,
  8782. null,
  8783. // fallback tree will not have suspense context
  8784. namespace,
  8785. slotScopeIds
  8786. );
  8787. setActiveBranch(suspense, vnode.ssFallback);
  8788. } else {
  8789. suspense.resolve(false, true);
  8790. }
  8791. }
  8792. function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
  8793. const suspense = n2.suspense = n1.suspense;
  8794. suspense.vnode = n2;
  8795. n2.el = n1.el;
  8796. const newBranch = n2.ssContent;
  8797. const newFallback = n2.ssFallback;
  8798. const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
  8799. if (pendingBranch) {
  8800. suspense.pendingBranch = newBranch;
  8801. if (isSameVNodeType(newBranch, pendingBranch)) {
  8802. patch(
  8803. pendingBranch,
  8804. newBranch,
  8805. suspense.hiddenContainer,
  8806. null,
  8807. parentComponent,
  8808. suspense,
  8809. namespace,
  8810. slotScopeIds,
  8811. optimized
  8812. );
  8813. if (suspense.deps <= 0) {
  8814. suspense.resolve();
  8815. } else if (isInFallback) {
  8816. if (!isHydrating) {
  8817. patch(
  8818. activeBranch,
  8819. newFallback,
  8820. container,
  8821. anchor,
  8822. parentComponent,
  8823. null,
  8824. // fallback tree will not have suspense context
  8825. namespace,
  8826. slotScopeIds,
  8827. optimized
  8828. );
  8829. setActiveBranch(suspense, newFallback);
  8830. }
  8831. }
  8832. } else {
  8833. suspense.pendingId = suspenseId++;
  8834. if (isHydrating) {
  8835. suspense.isHydrating = false;
  8836. suspense.activeBranch = pendingBranch;
  8837. } else {
  8838. unmount(pendingBranch, parentComponent, suspense);
  8839. }
  8840. suspense.deps = 0;
  8841. suspense.effects.length = 0;
  8842. suspense.hiddenContainer = createElement("div");
  8843. if (isInFallback) {
  8844. patch(
  8845. null,
  8846. newBranch,
  8847. suspense.hiddenContainer,
  8848. null,
  8849. parentComponent,
  8850. suspense,
  8851. namespace,
  8852. slotScopeIds,
  8853. optimized
  8854. );
  8855. if (suspense.deps <= 0) {
  8856. suspense.resolve();
  8857. } else {
  8858. patch(
  8859. activeBranch,
  8860. newFallback,
  8861. container,
  8862. anchor,
  8863. parentComponent,
  8864. null,
  8865. // fallback tree will not have suspense context
  8866. namespace,
  8867. slotScopeIds,
  8868. optimized
  8869. );
  8870. setActiveBranch(suspense, newFallback);
  8871. }
  8872. } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
  8873. patch(
  8874. activeBranch,
  8875. newBranch,
  8876. container,
  8877. anchor,
  8878. parentComponent,
  8879. suspense,
  8880. namespace,
  8881. slotScopeIds,
  8882. optimized
  8883. );
  8884. suspense.resolve(true);
  8885. } else {
  8886. patch(
  8887. null,
  8888. newBranch,
  8889. suspense.hiddenContainer,
  8890. null,
  8891. parentComponent,
  8892. suspense,
  8893. namespace,
  8894. slotScopeIds,
  8895. optimized
  8896. );
  8897. if (suspense.deps <= 0) {
  8898. suspense.resolve();
  8899. }
  8900. }
  8901. }
  8902. } else {
  8903. if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
  8904. patch(
  8905. activeBranch,
  8906. newBranch,
  8907. container,
  8908. anchor,
  8909. parentComponent,
  8910. suspense,
  8911. namespace,
  8912. slotScopeIds,
  8913. optimized
  8914. );
  8915. setActiveBranch(suspense, newBranch);
  8916. } else {
  8917. triggerEvent(n2, "onPending");
  8918. suspense.pendingBranch = newBranch;
  8919. if (newBranch.shapeFlag & 512) {
  8920. suspense.pendingId = newBranch.component.suspenseId;
  8921. } else {
  8922. suspense.pendingId = suspenseId++;
  8923. }
  8924. patch(
  8925. null,
  8926. newBranch,
  8927. suspense.hiddenContainer,
  8928. null,
  8929. parentComponent,
  8930. suspense,
  8931. namespace,
  8932. slotScopeIds,
  8933. optimized
  8934. );
  8935. if (suspense.deps <= 0) {
  8936. suspense.resolve();
  8937. } else {
  8938. const { timeout, pendingId } = suspense;
  8939. if (timeout > 0) {
  8940. setTimeout(() => {
  8941. if (suspense.pendingId === pendingId) {
  8942. suspense.fallback(newFallback);
  8943. }
  8944. }, timeout);
  8945. } else if (timeout === 0) {
  8946. suspense.fallback(newFallback);
  8947. }
  8948. }
  8949. }
  8950. }
  8951. }
  8952. let hasWarned = false;
  8953. function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
  8954. if (!hasWarned) {
  8955. hasWarned = true;
  8956. console[console.info ? "info" : "log"](
  8957. `<Suspense> is an experimental feature and its API will likely change.`
  8958. );
  8959. }
  8960. const {
  8961. p: patch,
  8962. m: move,
  8963. um: unmount,
  8964. n: next,
  8965. o: { parentNode, remove }
  8966. } = rendererInternals;
  8967. let parentSuspenseId;
  8968. const isSuspensible = isVNodeSuspensible(vnode);
  8969. if (isSuspensible) {
  8970. if (parentSuspense && parentSuspense.pendingBranch) {
  8971. parentSuspenseId = parentSuspense.pendingId;
  8972. parentSuspense.deps++;
  8973. }
  8974. }
  8975. const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0;
  8976. {
  8977. assertNumber(timeout, `Suspense timeout`);
  8978. }
  8979. const initialAnchor = anchor;
  8980. const suspense = {
  8981. vnode,
  8982. parent: parentSuspense,
  8983. parentComponent,
  8984. namespace,
  8985. container,
  8986. hiddenContainer,
  8987. deps: 0,
  8988. pendingId: suspenseId++,
  8989. timeout: typeof timeout === "number" ? timeout : -1,
  8990. activeBranch: null,
  8991. pendingBranch: null,
  8992. isInFallback: !isHydrating,
  8993. isHydrating,
  8994. isUnmounted: false,
  8995. effects: [],
  8996. resolve(resume = false, sync = false) {
  8997. {
  8998. if (!resume && !suspense.pendingBranch) {
  8999. throw new Error(
  9000. `suspense.resolve() is called without a pending branch.`
  9001. );
  9002. }
  9003. if (suspense.isUnmounted) {
  9004. throw new Error(
  9005. `suspense.resolve() is called on an already unmounted suspense boundary.`
  9006. );
  9007. }
  9008. }
  9009. const {
  9010. vnode: vnode2,
  9011. activeBranch,
  9012. pendingBranch,
  9013. pendingId,
  9014. effects,
  9015. parentComponent: parentComponent2,
  9016. container: container2
  9017. } = suspense;
  9018. let delayEnter = false;
  9019. if (suspense.isHydrating) {
  9020. suspense.isHydrating = false;
  9021. } else if (!resume) {
  9022. delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
  9023. if (delayEnter) {
  9024. activeBranch.transition.afterLeave = () => {
  9025. if (pendingId === suspense.pendingId) {
  9026. move(
  9027. pendingBranch,
  9028. container2,
  9029. anchor === initialAnchor ? next(activeBranch) : anchor,
  9030. 0
  9031. );
  9032. queuePostFlushCb(effects);
  9033. }
  9034. };
  9035. }
  9036. if (activeBranch) {
  9037. if (parentNode(activeBranch.el) === container2) {
  9038. anchor = next(activeBranch);
  9039. }
  9040. unmount(activeBranch, parentComponent2, suspense, true);
  9041. }
  9042. if (!delayEnter) {
  9043. move(pendingBranch, container2, anchor, 0);
  9044. }
  9045. }
  9046. setActiveBranch(suspense, pendingBranch);
  9047. suspense.pendingBranch = null;
  9048. suspense.isInFallback = false;
  9049. let parent = suspense.parent;
  9050. let hasUnresolvedAncestor = false;
  9051. while (parent) {
  9052. if (parent.pendingBranch) {
  9053. parent.effects.push(...effects);
  9054. hasUnresolvedAncestor = true;
  9055. break;
  9056. }
  9057. parent = parent.parent;
  9058. }
  9059. if (!hasUnresolvedAncestor && !delayEnter) {
  9060. queuePostFlushCb(effects);
  9061. }
  9062. suspense.effects = [];
  9063. if (isSuspensible) {
  9064. if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
  9065. parentSuspense.deps--;
  9066. if (parentSuspense.deps === 0 && !sync) {
  9067. parentSuspense.resolve();
  9068. }
  9069. }
  9070. }
  9071. triggerEvent(vnode2, "onResolve");
  9072. },
  9073. fallback(fallbackVNode) {
  9074. if (!suspense.pendingBranch) {
  9075. return;
  9076. }
  9077. const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
  9078. triggerEvent(vnode2, "onFallback");
  9079. const anchor2 = next(activeBranch);
  9080. const mountFallback = () => {
  9081. if (!suspense.isInFallback) {
  9082. return;
  9083. }
  9084. patch(
  9085. null,
  9086. fallbackVNode,
  9087. container2,
  9088. anchor2,
  9089. parentComponent2,
  9090. null,
  9091. // fallback tree will not have suspense context
  9092. namespace2,
  9093. slotScopeIds,
  9094. optimized
  9095. );
  9096. setActiveBranch(suspense, fallbackVNode);
  9097. };
  9098. const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
  9099. if (delayEnter) {
  9100. activeBranch.transition.afterLeave = mountFallback;
  9101. }
  9102. suspense.isInFallback = true;
  9103. unmount(
  9104. activeBranch,
  9105. parentComponent2,
  9106. null,
  9107. // no suspense so unmount hooks fire now
  9108. true
  9109. // shouldRemove
  9110. );
  9111. if (!delayEnter) {
  9112. mountFallback();
  9113. }
  9114. },
  9115. move(container2, anchor2, type) {
  9116. suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
  9117. suspense.container = container2;
  9118. },
  9119. next() {
  9120. return suspense.activeBranch && next(suspense.activeBranch);
  9121. },
  9122. registerDep(instance, setupRenderEffect, optimized2) {
  9123. const isInPendingSuspense = !!suspense.pendingBranch;
  9124. if (isInPendingSuspense) {
  9125. suspense.deps++;
  9126. }
  9127. const hydratedEl = instance.vnode.el;
  9128. instance.asyncDep.catch((err) => {
  9129. handleError(err, instance, 0);
  9130. }).then((asyncSetupResult) => {
  9131. if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
  9132. return;
  9133. }
  9134. instance.asyncResolved = true;
  9135. const { vnode: vnode2 } = instance;
  9136. {
  9137. pushWarningContext(vnode2);
  9138. }
  9139. handleSetupResult(instance, asyncSetupResult, false);
  9140. if (hydratedEl) {
  9141. vnode2.el = hydratedEl;
  9142. }
  9143. const placeholder = !hydratedEl && instance.subTree.el;
  9144. setupRenderEffect(
  9145. instance,
  9146. vnode2,
  9147. // component may have been moved before resolve.
  9148. // if this is not a hydration, instance.subTree will be the comment
  9149. // placeholder.
  9150. parentNode(hydratedEl || instance.subTree.el),
  9151. // anchor will not be used if this is hydration, so only need to
  9152. // consider the comment placeholder case.
  9153. hydratedEl ? null : next(instance.subTree),
  9154. suspense,
  9155. namespace,
  9156. optimized2
  9157. );
  9158. if (placeholder) {
  9159. remove(placeholder);
  9160. }
  9161. updateHOCHostEl(instance, vnode2.el);
  9162. {
  9163. popWarningContext();
  9164. }
  9165. if (isInPendingSuspense && --suspense.deps === 0) {
  9166. suspense.resolve();
  9167. }
  9168. });
  9169. },
  9170. unmount(parentSuspense2, doRemove) {
  9171. suspense.isUnmounted = true;
  9172. if (suspense.activeBranch) {
  9173. unmount(
  9174. suspense.activeBranch,
  9175. parentComponent,
  9176. parentSuspense2,
  9177. doRemove
  9178. );
  9179. }
  9180. if (suspense.pendingBranch) {
  9181. unmount(
  9182. suspense.pendingBranch,
  9183. parentComponent,
  9184. parentSuspense2,
  9185. doRemove
  9186. );
  9187. }
  9188. }
  9189. };
  9190. return suspense;
  9191. }
  9192. function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
  9193. const suspense = vnode.suspense = createSuspenseBoundary(
  9194. vnode,
  9195. parentSuspense,
  9196. parentComponent,
  9197. node.parentNode,
  9198. // eslint-disable-next-line no-restricted-globals
  9199. document.createElement("div"),
  9200. null,
  9201. namespace,
  9202. slotScopeIds,
  9203. optimized,
  9204. rendererInternals,
  9205. true
  9206. );
  9207. const result = hydrateNode(
  9208. node,
  9209. suspense.pendingBranch = vnode.ssContent,
  9210. parentComponent,
  9211. suspense,
  9212. slotScopeIds,
  9213. optimized
  9214. );
  9215. if (suspense.deps === 0) {
  9216. suspense.resolve(false, true);
  9217. }
  9218. return result;
  9219. }
  9220. function normalizeSuspenseChildren(vnode) {
  9221. const { shapeFlag, children } = vnode;
  9222. const isSlotChildren = shapeFlag & 32;
  9223. vnode.ssContent = normalizeSuspenseSlot(
  9224. isSlotChildren ? children.default : children
  9225. );
  9226. vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment);
  9227. }
  9228. function normalizeSuspenseSlot(s) {
  9229. let block;
  9230. if (isFunction(s)) {
  9231. const trackBlock = isBlockTreeEnabled && s._c;
  9232. if (trackBlock) {
  9233. s._d = false;
  9234. openBlock();
  9235. }
  9236. s = s();
  9237. if (trackBlock) {
  9238. s._d = true;
  9239. block = currentBlock;
  9240. closeBlock();
  9241. }
  9242. }
  9243. if (isArray(s)) {
  9244. const singleChild = filterSingleRoot(s);
  9245. if (!singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) {
  9246. warn$1(`<Suspense> slots expect a single root node.`);
  9247. }
  9248. s = singleChild;
  9249. }
  9250. s = normalizeVNode(s);
  9251. if (block && !s.dynamicChildren) {
  9252. s.dynamicChildren = block.filter((c) => c !== s);
  9253. }
  9254. return s;
  9255. }
  9256. function queueEffectWithSuspense(fn, suspense) {
  9257. if (suspense && suspense.pendingBranch) {
  9258. if (isArray(fn)) {
  9259. suspense.effects.push(...fn);
  9260. } else {
  9261. suspense.effects.push(fn);
  9262. }
  9263. } else {
  9264. queuePostFlushCb(fn);
  9265. }
  9266. }
  9267. function setActiveBranch(suspense, branch) {
  9268. suspense.activeBranch = branch;
  9269. const { vnode, parentComponent } = suspense;
  9270. let el = branch.el;
  9271. while (!el && branch.component) {
  9272. branch = branch.component.subTree;
  9273. el = branch.el;
  9274. }
  9275. vnode.el = el;
  9276. if (parentComponent && parentComponent.subTree === vnode) {
  9277. parentComponent.vnode.el = el;
  9278. updateHOCHostEl(parentComponent, el);
  9279. }
  9280. }
  9281. function isVNodeSuspensible(vnode) {
  9282. const suspensible = vnode.props && vnode.props.suspensible;
  9283. return suspensible != null && suspensible !== false;
  9284. }
  9285. const Fragment = Symbol.for("v-fgt");
  9286. const Text = Symbol.for("v-txt");
  9287. const Comment = Symbol.for("v-cmt");
  9288. const Static = Symbol.for("v-stc");
  9289. const blockStack = [];
  9290. let currentBlock = null;
  9291. function openBlock(disableTracking = false) {
  9292. blockStack.push(currentBlock = disableTracking ? null : []);
  9293. }
  9294. function closeBlock() {
  9295. blockStack.pop();
  9296. currentBlock = blockStack[blockStack.length - 1] || null;
  9297. }
  9298. let isBlockTreeEnabled = 1;
  9299. function setBlockTracking(value) {
  9300. isBlockTreeEnabled += value;
  9301. if (value < 0 && currentBlock) {
  9302. currentBlock.hasOnce = true;
  9303. }
  9304. }
  9305. function setupBlock(vnode) {
  9306. vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
  9307. closeBlock();
  9308. if (isBlockTreeEnabled > 0 && currentBlock) {
  9309. currentBlock.push(vnode);
  9310. }
  9311. return vnode;
  9312. }
  9313. function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
  9314. return setupBlock(
  9315. createBaseVNode(
  9316. type,
  9317. props,
  9318. children,
  9319. patchFlag,
  9320. dynamicProps,
  9321. shapeFlag,
  9322. true
  9323. )
  9324. );
  9325. }
  9326. function createBlock(type, props, children, patchFlag, dynamicProps) {
  9327. return setupBlock(
  9328. createVNode(
  9329. type,
  9330. props,
  9331. children,
  9332. patchFlag,
  9333. dynamicProps,
  9334. true
  9335. )
  9336. );
  9337. }
  9338. function isVNode(value) {
  9339. return value ? value.__v_isVNode === true : false;
  9340. }
  9341. function isSameVNodeType(n1, n2) {
  9342. if (n2.shapeFlag & 6 && n1.component) {
  9343. const dirtyInstances = hmrDirtyComponents.get(n2.type);
  9344. if (dirtyInstances && dirtyInstances.has(n1.component)) {
  9345. n1.shapeFlag &= ~256;
  9346. n2.shapeFlag &= ~512;
  9347. return false;
  9348. }
  9349. }
  9350. return n1.type === n2.type && n1.key === n2.key;
  9351. }
  9352. let vnodeArgsTransformer;
  9353. function transformVNodeArgs(transformer) {
  9354. vnodeArgsTransformer = transformer;
  9355. }
  9356. const createVNodeWithArgsTransform = (...args) => {
  9357. return _createVNode(
  9358. ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args
  9359. );
  9360. };
  9361. const normalizeKey = ({ key }) => key != null ? key : null;
  9362. const normalizeRef = ({
  9363. ref,
  9364. ref_key,
  9365. ref_for
  9366. }) => {
  9367. if (typeof ref === "number") {
  9368. ref = "" + ref;
  9369. }
  9370. return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
  9371. };
  9372. function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
  9373. const vnode = {
  9374. __v_isVNode: true,
  9375. __v_skip: true,
  9376. type,
  9377. props,
  9378. key: props && normalizeKey(props),
  9379. ref: props && normalizeRef(props),
  9380. scopeId: currentScopeId,
  9381. slotScopeIds: null,
  9382. children,
  9383. component: null,
  9384. suspense: null,
  9385. ssContent: null,
  9386. ssFallback: null,
  9387. dirs: null,
  9388. transition: null,
  9389. el: null,
  9390. anchor: null,
  9391. target: null,
  9392. targetStart: null,
  9393. targetAnchor: null,
  9394. staticCount: 0,
  9395. shapeFlag,
  9396. patchFlag,
  9397. dynamicProps,
  9398. dynamicChildren: null,
  9399. appContext: null,
  9400. ctx: currentRenderingInstance
  9401. };
  9402. if (needFullChildrenNormalization) {
  9403. normalizeChildren(vnode, children);
  9404. if (shapeFlag & 128) {
  9405. type.normalize(vnode);
  9406. }
  9407. } else if (children) {
  9408. vnode.shapeFlag |= isString(children) ? 8 : 16;
  9409. }
  9410. if (vnode.key !== vnode.key) {
  9411. warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
  9412. }
  9413. if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
  9414. !isBlockNode && // has current parent block
  9415. currentBlock && // presence of a patch flag indicates this node needs patching on updates.
  9416. // component nodes also should always be patched, because even if the
  9417. // component doesn't need to update, it needs to persist the instance on to
  9418. // the next vnode so that it can be properly unmounted later.
  9419. (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
  9420. // vnode should not be considered dynamic due to handler caching.
  9421. vnode.patchFlag !== 32) {
  9422. currentBlock.push(vnode);
  9423. }
  9424. return vnode;
  9425. }
  9426. const createVNode = createVNodeWithArgsTransform ;
  9427. function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
  9428. if (!type || type === NULL_DYNAMIC_COMPONENT) {
  9429. if (!type) {
  9430. warn$1(`Invalid vnode type when creating vnode: ${type}.`);
  9431. }
  9432. type = Comment;
  9433. }
  9434. if (isVNode(type)) {
  9435. const cloned = cloneVNode(
  9436. type,
  9437. props,
  9438. true
  9439. /* mergeRef: true */
  9440. );
  9441. if (children) {
  9442. normalizeChildren(cloned, children);
  9443. }
  9444. if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
  9445. if (cloned.shapeFlag & 6) {
  9446. currentBlock[currentBlock.indexOf(type)] = cloned;
  9447. } else {
  9448. currentBlock.push(cloned);
  9449. }
  9450. }
  9451. cloned.patchFlag = -2;
  9452. return cloned;
  9453. }
  9454. if (isClassComponent(type)) {
  9455. type = type.__vccOpts;
  9456. }
  9457. if (props) {
  9458. props = guardReactiveProps(props);
  9459. let { class: klass, style } = props;
  9460. if (klass && !isString(klass)) {
  9461. props.class = normalizeClass(klass);
  9462. }
  9463. if (isObject(style)) {
  9464. if (isProxy(style) && !isArray(style)) {
  9465. style = extend({}, style);
  9466. }
  9467. props.style = normalizeStyle(style);
  9468. }
  9469. }
  9470. const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
  9471. if (shapeFlag & 4 && isProxy(type)) {
  9472. type = toRaw(type);
  9473. warn$1(
  9474. `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\`.`,
  9475. `
  9476. Component that was made reactive: `,
  9477. type
  9478. );
  9479. }
  9480. return createBaseVNode(
  9481. type,
  9482. props,
  9483. children,
  9484. patchFlag,
  9485. dynamicProps,
  9486. shapeFlag,
  9487. isBlockNode,
  9488. true
  9489. );
  9490. }
  9491. function guardReactiveProps(props) {
  9492. if (!props) return null;
  9493. return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
  9494. }
  9495. function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
  9496. const { props, ref, patchFlag, children, transition } = vnode;
  9497. const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
  9498. const cloned = {
  9499. __v_isVNode: true,
  9500. __v_skip: true,
  9501. type: vnode.type,
  9502. props: mergedProps,
  9503. key: mergedProps && normalizeKey(mergedProps),
  9504. ref: extraProps && extraProps.ref ? (
  9505. // #2078 in the case of <component :is="vnode" ref="extra"/>
  9506. // if the vnode itself already has a ref, cloneVNode will need to merge
  9507. // the refs so the single vnode can be set on multiple refs
  9508. mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps)
  9509. ) : ref,
  9510. scopeId: vnode.scopeId,
  9511. slotScopeIds: vnode.slotScopeIds,
  9512. children: patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children,
  9513. target: vnode.target,
  9514. targetStart: vnode.targetStart,
  9515. targetAnchor: vnode.targetAnchor,
  9516. staticCount: vnode.staticCount,
  9517. shapeFlag: vnode.shapeFlag,
  9518. // if the vnode is cloned with extra props, we can no longer assume its
  9519. // existing patch flag to be reliable and need to add the FULL_PROPS flag.
  9520. // note: preserve flag for fragments since they use the flag for children
  9521. // fast paths only.
  9522. patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
  9523. dynamicProps: vnode.dynamicProps,
  9524. dynamicChildren: vnode.dynamicChildren,
  9525. appContext: vnode.appContext,
  9526. dirs: vnode.dirs,
  9527. transition,
  9528. // These should technically only be non-null on mounted VNodes. However,
  9529. // they *should* be copied for kept-alive vnodes. So we just always copy
  9530. // them since them being non-null during a mount doesn't affect the logic as
  9531. // they will simply be overwritten.
  9532. component: vnode.component,
  9533. suspense: vnode.suspense,
  9534. ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
  9535. ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
  9536. el: vnode.el,
  9537. anchor: vnode.anchor,
  9538. ctx: vnode.ctx,
  9539. ce: vnode.ce
  9540. };
  9541. if (transition && cloneTransition) {
  9542. setTransitionHooks(
  9543. cloned,
  9544. transition.clone(cloned)
  9545. );
  9546. }
  9547. return cloned;
  9548. }
  9549. function deepCloneVNode(vnode) {
  9550. const cloned = cloneVNode(vnode);
  9551. if (isArray(vnode.children)) {
  9552. cloned.children = vnode.children.map(deepCloneVNode);
  9553. }
  9554. return cloned;
  9555. }
  9556. function createTextVNode(text = " ", flag = 0) {
  9557. return createVNode(Text, null, text, flag);
  9558. }
  9559. function createStaticVNode(content, numberOfNodes) {
  9560. const vnode = createVNode(Static, null, content);
  9561. vnode.staticCount = numberOfNodes;
  9562. return vnode;
  9563. }
  9564. function createCommentVNode(text = "", asBlock = false) {
  9565. return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
  9566. }
  9567. function normalizeVNode(child) {
  9568. if (child == null || typeof child === "boolean") {
  9569. return createVNode(Comment);
  9570. } else if (isArray(child)) {
  9571. return createVNode(
  9572. Fragment,
  9573. null,
  9574. // #3666, avoid reference pollution when reusing vnode
  9575. child.slice()
  9576. );
  9577. } else if (isVNode(child)) {
  9578. return cloneIfMounted(child);
  9579. } else {
  9580. return createVNode(Text, null, String(child));
  9581. }
  9582. }
  9583. function cloneIfMounted(child) {
  9584. return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
  9585. }
  9586. function normalizeChildren(vnode, children) {
  9587. let type = 0;
  9588. const { shapeFlag } = vnode;
  9589. if (children == null) {
  9590. children = null;
  9591. } else if (isArray(children)) {
  9592. type = 16;
  9593. } else if (typeof children === "object") {
  9594. if (shapeFlag & (1 | 64)) {
  9595. const slot = children.default;
  9596. if (slot) {
  9597. slot._c && (slot._d = false);
  9598. normalizeChildren(vnode, slot());
  9599. slot._c && (slot._d = true);
  9600. }
  9601. return;
  9602. } else {
  9603. type = 32;
  9604. const slotFlag = children._;
  9605. if (!slotFlag && !isInternalObject(children)) {
  9606. children._ctx = currentRenderingInstance;
  9607. } else if (slotFlag === 3 && currentRenderingInstance) {
  9608. if (currentRenderingInstance.slots._ === 1) {
  9609. children._ = 1;
  9610. } else {
  9611. children._ = 2;
  9612. vnode.patchFlag |= 1024;
  9613. }
  9614. }
  9615. }
  9616. } else if (isFunction(children)) {
  9617. children = { default: children, _ctx: currentRenderingInstance };
  9618. type = 32;
  9619. } else {
  9620. children = String(children);
  9621. if (shapeFlag & 64) {
  9622. type = 16;
  9623. children = [createTextVNode(children)];
  9624. } else {
  9625. type = 8;
  9626. }
  9627. }
  9628. vnode.children = children;
  9629. vnode.shapeFlag |= type;
  9630. }
  9631. function mergeProps(...args) {
  9632. const ret = {};
  9633. for (let i = 0; i < args.length; i++) {
  9634. const toMerge = args[i];
  9635. for (const key in toMerge) {
  9636. if (key === "class") {
  9637. if (ret.class !== toMerge.class) {
  9638. ret.class = normalizeClass([ret.class, toMerge.class]);
  9639. }
  9640. } else if (key === "style") {
  9641. ret.style = normalizeStyle([ret.style, toMerge.style]);
  9642. } else if (isOn(key)) {
  9643. const existing = ret[key];
  9644. const incoming = toMerge[key];
  9645. if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
  9646. ret[key] = existing ? [].concat(existing, incoming) : incoming;
  9647. }
  9648. } else if (key !== "") {
  9649. ret[key] = toMerge[key];
  9650. }
  9651. }
  9652. }
  9653. return ret;
  9654. }
  9655. function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
  9656. callWithAsyncErrorHandling(hook, instance, 7, [
  9657. vnode,
  9658. prevVNode
  9659. ]);
  9660. }
  9661. const emptyAppContext = createAppContext();
  9662. let uid = 0;
  9663. function createComponentInstance(vnode, parent, suspense) {
  9664. const type = vnode.type;
  9665. const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  9666. const instance = {
  9667. uid: uid++,
  9668. vnode,
  9669. type,
  9670. parent,
  9671. appContext,
  9672. root: null,
  9673. // to be immediately set
  9674. next: null,
  9675. subTree: null,
  9676. // will be set synchronously right after creation
  9677. effect: null,
  9678. update: null,
  9679. // will be set synchronously right after creation
  9680. job: null,
  9681. scope: new EffectScope(
  9682. true
  9683. /* detached */
  9684. ),
  9685. render: null,
  9686. proxy: null,
  9687. exposed: null,
  9688. exposeProxy: null,
  9689. withProxy: null,
  9690. provides: parent ? parent.provides : Object.create(appContext.provides),
  9691. ids: parent ? parent.ids : ["", 0, 0],
  9692. accessCache: null,
  9693. renderCache: [],
  9694. // local resolved assets
  9695. components: null,
  9696. directives: null,
  9697. // resolved props and emits options
  9698. propsOptions: normalizePropsOptions(type, appContext),
  9699. emitsOptions: normalizeEmitsOptions(type, appContext),
  9700. // emit
  9701. emit: null,
  9702. // to be set immediately
  9703. emitted: null,
  9704. // props default value
  9705. propsDefaults: EMPTY_OBJ,
  9706. // inheritAttrs
  9707. inheritAttrs: type.inheritAttrs,
  9708. // state
  9709. ctx: EMPTY_OBJ,
  9710. data: EMPTY_OBJ,
  9711. props: EMPTY_OBJ,
  9712. attrs: EMPTY_OBJ,
  9713. slots: EMPTY_OBJ,
  9714. refs: EMPTY_OBJ,
  9715. setupState: EMPTY_OBJ,
  9716. setupContext: null,
  9717. // suspense related
  9718. suspense,
  9719. suspenseId: suspense ? suspense.pendingId : 0,
  9720. asyncDep: null,
  9721. asyncResolved: false,
  9722. // lifecycle hooks
  9723. // not using enums here because it results in computed properties
  9724. isMounted: false,
  9725. isUnmounted: false,
  9726. isDeactivated: false,
  9727. bc: null,
  9728. c: null,
  9729. bm: null,
  9730. m: null,
  9731. bu: null,
  9732. u: null,
  9733. um: null,
  9734. bum: null,
  9735. da: null,
  9736. a: null,
  9737. rtg: null,
  9738. rtc: null,
  9739. ec: null,
  9740. sp: null
  9741. };
  9742. {
  9743. instance.ctx = createDevRenderContext(instance);
  9744. }
  9745. instance.root = parent ? parent.root : instance;
  9746. instance.emit = emit.bind(null, instance);
  9747. if (vnode.ce) {
  9748. vnode.ce(instance);
  9749. }
  9750. return instance;
  9751. }
  9752. let currentInstance = null;
  9753. const getCurrentInstance = () => currentInstance || currentRenderingInstance;
  9754. let internalSetCurrentInstance;
  9755. let setInSSRSetupState;
  9756. {
  9757. internalSetCurrentInstance = (i) => {
  9758. currentInstance = i;
  9759. };
  9760. setInSSRSetupState = (v) => {
  9761. isInSSRComponentSetup = v;
  9762. };
  9763. }
  9764. const setCurrentInstance = (instance) => {
  9765. const prev = currentInstance;
  9766. internalSetCurrentInstance(instance);
  9767. instance.scope.on();
  9768. return () => {
  9769. instance.scope.off();
  9770. internalSetCurrentInstance(prev);
  9771. };
  9772. };
  9773. const unsetCurrentInstance = () => {
  9774. currentInstance && currentInstance.scope.off();
  9775. internalSetCurrentInstance(null);
  9776. };
  9777. const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
  9778. function validateComponentName(name, { isNativeTag }) {
  9779. if (isBuiltInTag(name) || isNativeTag(name)) {
  9780. warn$1(
  9781. "Do not use built-in or reserved HTML elements as component id: " + name
  9782. );
  9783. }
  9784. }
  9785. function isStatefulComponent(instance) {
  9786. return instance.vnode.shapeFlag & 4;
  9787. }
  9788. let isInSSRComponentSetup = false;
  9789. function setupComponent(instance, isSSR = false, optimized = false) {
  9790. isSSR && setInSSRSetupState(isSSR);
  9791. const { props, children } = instance.vnode;
  9792. const isStateful = isStatefulComponent(instance);
  9793. initProps(instance, props, isStateful, isSSR);
  9794. initSlots(instance, children, optimized);
  9795. const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  9796. isSSR && setInSSRSetupState(false);
  9797. return setupResult;
  9798. }
  9799. function setupStatefulComponent(instance, isSSR) {
  9800. var _a;
  9801. const Component = instance.type;
  9802. {
  9803. if (Component.name) {
  9804. validateComponentName(Component.name, instance.appContext.config);
  9805. }
  9806. if (Component.components) {
  9807. const names = Object.keys(Component.components);
  9808. for (let i = 0; i < names.length; i++) {
  9809. validateComponentName(names[i], instance.appContext.config);
  9810. }
  9811. }
  9812. if (Component.directives) {
  9813. const names = Object.keys(Component.directives);
  9814. for (let i = 0; i < names.length; i++) {
  9815. validateDirectiveName(names[i]);
  9816. }
  9817. }
  9818. if (Component.compilerOptions && isRuntimeOnly()) {
  9819. warn$1(
  9820. `"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.`
  9821. );
  9822. }
  9823. }
  9824. instance.accessCache = /* @__PURE__ */ Object.create(null);
  9825. instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
  9826. {
  9827. exposePropsOnRenderContext(instance);
  9828. }
  9829. const { setup } = Component;
  9830. if (setup) {
  9831. pauseTracking();
  9832. const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
  9833. const reset = setCurrentInstance(instance);
  9834. const setupResult = callWithErrorHandling(
  9835. setup,
  9836. instance,
  9837. 0,
  9838. [
  9839. shallowReadonly(instance.props) ,
  9840. setupContext
  9841. ]
  9842. );
  9843. const isAsyncSetup = isPromise(setupResult);
  9844. resetTracking();
  9845. reset();
  9846. if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
  9847. markAsyncBoundary(instance);
  9848. }
  9849. if (isAsyncSetup) {
  9850. setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
  9851. if (isSSR) {
  9852. return setupResult.then((resolvedResult) => {
  9853. handleSetupResult(instance, resolvedResult, isSSR);
  9854. }).catch((e) => {
  9855. handleError(e, instance, 0);
  9856. });
  9857. } else {
  9858. instance.asyncDep = setupResult;
  9859. if (!instance.suspense) {
  9860. const name = (_a = Component.name) != null ? _a : "Anonymous";
  9861. warn$1(
  9862. `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.`
  9863. );
  9864. }
  9865. }
  9866. } else {
  9867. handleSetupResult(instance, setupResult, isSSR);
  9868. }
  9869. } else {
  9870. finishComponentSetup(instance, isSSR);
  9871. }
  9872. }
  9873. function handleSetupResult(instance, setupResult, isSSR) {
  9874. if (isFunction(setupResult)) {
  9875. {
  9876. instance.render = setupResult;
  9877. }
  9878. } else if (isObject(setupResult)) {
  9879. if (isVNode(setupResult)) {
  9880. warn$1(
  9881. `setup() should not return VNodes directly - return a render function instead.`
  9882. );
  9883. }
  9884. {
  9885. instance.devtoolsRawSetupState = setupResult;
  9886. }
  9887. instance.setupState = proxyRefs(setupResult);
  9888. {
  9889. exposeSetupStateOnRenderContext(instance);
  9890. }
  9891. } else if (setupResult !== void 0) {
  9892. warn$1(
  9893. `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`
  9894. );
  9895. }
  9896. finishComponentSetup(instance, isSSR);
  9897. }
  9898. let compile$1;
  9899. let installWithProxy;
  9900. function registerRuntimeCompiler(_compile) {
  9901. compile$1 = _compile;
  9902. installWithProxy = (i) => {
  9903. if (i.render._rc) {
  9904. i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
  9905. }
  9906. };
  9907. }
  9908. const isRuntimeOnly = () => !compile$1;
  9909. function finishComponentSetup(instance, isSSR, skipOptions) {
  9910. const Component = instance.type;
  9911. if (!instance.render) {
  9912. if (!isSSR && compile$1 && !Component.render) {
  9913. const template = Component.template || resolveMergedOptions(instance).template;
  9914. if (template) {
  9915. {
  9916. startMeasure(instance, `compile`);
  9917. }
  9918. const { isCustomElement, compilerOptions } = instance.appContext.config;
  9919. const { delimiters, compilerOptions: componentCompilerOptions } = Component;
  9920. const finalCompilerOptions = extend(
  9921. extend(
  9922. {
  9923. isCustomElement,
  9924. delimiters
  9925. },
  9926. compilerOptions
  9927. ),
  9928. componentCompilerOptions
  9929. );
  9930. Component.render = compile$1(template, finalCompilerOptions);
  9931. {
  9932. endMeasure(instance, `compile`);
  9933. }
  9934. }
  9935. }
  9936. instance.render = Component.render || NOOP;
  9937. if (installWithProxy) {
  9938. installWithProxy(instance);
  9939. }
  9940. }
  9941. {
  9942. const reset = setCurrentInstance(instance);
  9943. pauseTracking();
  9944. try {
  9945. applyOptions(instance);
  9946. } finally {
  9947. resetTracking();
  9948. reset();
  9949. }
  9950. }
  9951. if (!Component.render && instance.render === NOOP && !isSSR) {
  9952. if (!compile$1 && Component.template) {
  9953. warn$1(
  9954. `Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Use "vue.global.js" instead.` )
  9955. );
  9956. } else {
  9957. warn$1(`Component is missing template or render function: `, Component);
  9958. }
  9959. }
  9960. }
  9961. const attrsProxyHandlers = {
  9962. get(target, key) {
  9963. markAttrsAccessed();
  9964. track(target, "get", "");
  9965. return target[key];
  9966. },
  9967. set() {
  9968. warn$1(`setupContext.attrs is readonly.`);
  9969. return false;
  9970. },
  9971. deleteProperty() {
  9972. warn$1(`setupContext.attrs is readonly.`);
  9973. return false;
  9974. }
  9975. } ;
  9976. function getSlotsProxy(instance) {
  9977. return new Proxy(instance.slots, {
  9978. get(target, key) {
  9979. track(instance, "get", "$slots");
  9980. return target[key];
  9981. }
  9982. });
  9983. }
  9984. function createSetupContext(instance) {
  9985. const expose = (exposed) => {
  9986. {
  9987. if (instance.exposed) {
  9988. warn$1(`expose() should be called only once per setup().`);
  9989. }
  9990. if (exposed != null) {
  9991. let exposedType = typeof exposed;
  9992. if (exposedType === "object") {
  9993. if (isArray(exposed)) {
  9994. exposedType = "array";
  9995. } else if (isRef(exposed)) {
  9996. exposedType = "ref";
  9997. }
  9998. }
  9999. if (exposedType !== "object") {
  10000. warn$1(
  10001. `expose() should be passed a plain object, received ${exposedType}.`
  10002. );
  10003. }
  10004. }
  10005. }
  10006. instance.exposed = exposed || {};
  10007. };
  10008. {
  10009. let attrsProxy;
  10010. let slotsProxy;
  10011. return Object.freeze({
  10012. get attrs() {
  10013. return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));
  10014. },
  10015. get slots() {
  10016. return slotsProxy || (slotsProxy = getSlotsProxy(instance));
  10017. },
  10018. get emit() {
  10019. return (event, ...args) => instance.emit(event, ...args);
  10020. },
  10021. expose
  10022. });
  10023. }
  10024. }
  10025. function getComponentPublicInstance(instance) {
  10026. if (instance.exposed) {
  10027. return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
  10028. get(target, key) {
  10029. if (key in target) {
  10030. return target[key];
  10031. } else if (key in publicPropertiesMap) {
  10032. return publicPropertiesMap[key](instance);
  10033. }
  10034. },
  10035. has(target, key) {
  10036. return key in target || key in publicPropertiesMap;
  10037. }
  10038. }));
  10039. } else {
  10040. return instance.proxy;
  10041. }
  10042. }
  10043. const classifyRE = /(?:^|[-_])(\w)/g;
  10044. const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
  10045. function getComponentName(Component, includeInferred = true) {
  10046. return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
  10047. }
  10048. function formatComponentName(instance, Component, isRoot = false) {
  10049. let name = getComponentName(Component);
  10050. if (!name && Component.__file) {
  10051. const match = Component.__file.match(/([^/\\]+)\.\w+$/);
  10052. if (match) {
  10053. name = match[1];
  10054. }
  10055. }
  10056. if (!name && instance && instance.parent) {
  10057. const inferFromRegistry = (registry) => {
  10058. for (const key in registry) {
  10059. if (registry[key] === Component) {
  10060. return key;
  10061. }
  10062. }
  10063. };
  10064. name = inferFromRegistry(
  10065. instance.components || instance.parent.type.components
  10066. ) || inferFromRegistry(instance.appContext.components);
  10067. }
  10068. return name ? classify(name) : isRoot ? `App` : `Anonymous`;
  10069. }
  10070. function isClassComponent(value) {
  10071. return isFunction(value) && "__vccOpts" in value;
  10072. }
  10073. const computed = (getterOrOptions, debugOptions) => {
  10074. const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
  10075. {
  10076. const i = getCurrentInstance();
  10077. if (i && i.appContext.config.warnRecursiveComputed) {
  10078. c._warnRecursive = true;
  10079. }
  10080. }
  10081. return c;
  10082. };
  10083. function h(type, propsOrChildren, children) {
  10084. const l = arguments.length;
  10085. if (l === 2) {
  10086. if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
  10087. if (isVNode(propsOrChildren)) {
  10088. return createVNode(type, null, [propsOrChildren]);
  10089. }
  10090. return createVNode(type, propsOrChildren);
  10091. } else {
  10092. return createVNode(type, null, propsOrChildren);
  10093. }
  10094. } else {
  10095. if (l > 3) {
  10096. children = Array.prototype.slice.call(arguments, 2);
  10097. } else if (l === 3 && isVNode(children)) {
  10098. children = [children];
  10099. }
  10100. return createVNode(type, propsOrChildren, children);
  10101. }
  10102. }
  10103. function initCustomFormatter() {
  10104. if (typeof window === "undefined") {
  10105. return;
  10106. }
  10107. const vueStyle = { style: "color:#3ba776" };
  10108. const numberStyle = { style: "color:#1677ff" };
  10109. const stringStyle = { style: "color:#f5222d" };
  10110. const keywordStyle = { style: "color:#eb2f96" };
  10111. const formatter = {
  10112. __vue_custom_formatter: true,
  10113. header(obj) {
  10114. if (!isObject(obj)) {
  10115. return null;
  10116. }
  10117. if (obj.__isVue) {
  10118. return ["div", vueStyle, `VueInstance`];
  10119. } else if (isRef(obj)) {
  10120. return [
  10121. "div",
  10122. {},
  10123. ["span", vueStyle, genRefFlag(obj)],
  10124. "<",
  10125. // avoid debugger accessing value affecting behavior
  10126. formatValue("_value" in obj ? obj._value : obj),
  10127. `>`
  10128. ];
  10129. } else if (isReactive(obj)) {
  10130. return [
  10131. "div",
  10132. {},
  10133. ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"],
  10134. "<",
  10135. formatValue(obj),
  10136. `>${isReadonly(obj) ? ` (readonly)` : ``}`
  10137. ];
  10138. } else if (isReadonly(obj)) {
  10139. return [
  10140. "div",
  10141. {},
  10142. ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"],
  10143. "<",
  10144. formatValue(obj),
  10145. ">"
  10146. ];
  10147. }
  10148. return null;
  10149. },
  10150. hasBody(obj) {
  10151. return obj && obj.__isVue;
  10152. },
  10153. body(obj) {
  10154. if (obj && obj.__isVue) {
  10155. return [
  10156. "div",
  10157. {},
  10158. ...formatInstance(obj.$)
  10159. ];
  10160. }
  10161. }
  10162. };
  10163. function formatInstance(instance) {
  10164. const blocks = [];
  10165. if (instance.type.props && instance.props) {
  10166. blocks.push(createInstanceBlock("props", toRaw(instance.props)));
  10167. }
  10168. if (instance.setupState !== EMPTY_OBJ) {
  10169. blocks.push(createInstanceBlock("setup", instance.setupState));
  10170. }
  10171. if (instance.data !== EMPTY_OBJ) {
  10172. blocks.push(createInstanceBlock("data", toRaw(instance.data)));
  10173. }
  10174. const computed = extractKeys(instance, "computed");
  10175. if (computed) {
  10176. blocks.push(createInstanceBlock("computed", computed));
  10177. }
  10178. const injected = extractKeys(instance, "inject");
  10179. if (injected) {
  10180. blocks.push(createInstanceBlock("injected", injected));
  10181. }
  10182. blocks.push([
  10183. "div",
  10184. {},
  10185. [
  10186. "span",
  10187. {
  10188. style: keywordStyle.style + ";opacity:0.66"
  10189. },
  10190. "$ (internal): "
  10191. ],
  10192. ["object", { object: instance }]
  10193. ]);
  10194. return blocks;
  10195. }
  10196. function createInstanceBlock(type, target) {
  10197. target = extend({}, target);
  10198. if (!Object.keys(target).length) {
  10199. return ["span", {}];
  10200. }
  10201. return [
  10202. "div",
  10203. { style: "line-height:1.25em;margin-bottom:0.6em" },
  10204. [
  10205. "div",
  10206. {
  10207. style: "color:#476582"
  10208. },
  10209. type
  10210. ],
  10211. [
  10212. "div",
  10213. {
  10214. style: "padding-left:1.25em"
  10215. },
  10216. ...Object.keys(target).map((key) => {
  10217. return [
  10218. "div",
  10219. {},
  10220. ["span", keywordStyle, key + ": "],
  10221. formatValue(target[key], false)
  10222. ];
  10223. })
  10224. ]
  10225. ];
  10226. }
  10227. function formatValue(v, asRaw = true) {
  10228. if (typeof v === "number") {
  10229. return ["span", numberStyle, v];
  10230. } else if (typeof v === "string") {
  10231. return ["span", stringStyle, JSON.stringify(v)];
  10232. } else if (typeof v === "boolean") {
  10233. return ["span", keywordStyle, v];
  10234. } else if (isObject(v)) {
  10235. return ["object", { object: asRaw ? toRaw(v) : v }];
  10236. } else {
  10237. return ["span", stringStyle, String(v)];
  10238. }
  10239. }
  10240. function extractKeys(instance, type) {
  10241. const Comp = instance.type;
  10242. if (isFunction(Comp)) {
  10243. return;
  10244. }
  10245. const extracted = {};
  10246. for (const key in instance.ctx) {
  10247. if (isKeyOfType(Comp, key, type)) {
  10248. extracted[key] = instance.ctx[key];
  10249. }
  10250. }
  10251. return extracted;
  10252. }
  10253. function isKeyOfType(Comp, key, type) {
  10254. const opts = Comp[type];
  10255. if (isArray(opts) && opts.includes(key) || isObject(opts) && key in opts) {
  10256. return true;
  10257. }
  10258. if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {
  10259. return true;
  10260. }
  10261. if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) {
  10262. return true;
  10263. }
  10264. }
  10265. function genRefFlag(v) {
  10266. if (isShallow(v)) {
  10267. return `ShallowRef`;
  10268. }
  10269. if (v.effect) {
  10270. return `ComputedRef`;
  10271. }
  10272. return `Ref`;
  10273. }
  10274. if (window.devtoolsFormatters) {
  10275. window.devtoolsFormatters.push(formatter);
  10276. } else {
  10277. window.devtoolsFormatters = [formatter];
  10278. }
  10279. }
  10280. function withMemo(memo, render, cache, index) {
  10281. const cached = cache[index];
  10282. if (cached && isMemoSame(cached, memo)) {
  10283. return cached;
  10284. }
  10285. const ret = render();
  10286. ret.memo = memo.slice();
  10287. ret.cacheIndex = index;
  10288. return cache[index] = ret;
  10289. }
  10290. function isMemoSame(cached, memo) {
  10291. const prev = cached.memo;
  10292. if (prev.length != memo.length) {
  10293. return false;
  10294. }
  10295. for (let i = 0; i < prev.length; i++) {
  10296. if (hasChanged(prev[i], memo[i])) {
  10297. return false;
  10298. }
  10299. }
  10300. if (isBlockTreeEnabled > 0 && currentBlock) {
  10301. currentBlock.push(cached);
  10302. }
  10303. return true;
  10304. }
  10305. const version = "3.5.12";
  10306. const warn = warn$1 ;
  10307. const ErrorTypeStrings = ErrorTypeStrings$1 ;
  10308. const devtools = devtools$1 ;
  10309. const setDevtoolsHook = setDevtoolsHook$1 ;
  10310. const ssrUtils = null;
  10311. const resolveFilter = null;
  10312. const compatUtils = null;
  10313. const DeprecationTypes = null;
  10314. let policy = void 0;
  10315. const tt = typeof window !== "undefined" && window.trustedTypes;
  10316. if (tt) {
  10317. try {
  10318. policy = /* @__PURE__ */ tt.createPolicy("vue", {
  10319. createHTML: (val) => val
  10320. });
  10321. } catch (e) {
  10322. warn(`Error creating trusted types policy: ${e}`);
  10323. }
  10324. }
  10325. const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val;
  10326. const svgNS = "http://www.w3.org/2000/svg";
  10327. const mathmlNS = "http://www.w3.org/1998/Math/MathML";
  10328. const doc = typeof document !== "undefined" ? document : null;
  10329. const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
  10330. const nodeOps = {
  10331. insert: (child, parent, anchor) => {
  10332. parent.insertBefore(child, anchor || null);
  10333. },
  10334. remove: (child) => {
  10335. const parent = child.parentNode;
  10336. if (parent) {
  10337. parent.removeChild(child);
  10338. }
  10339. },
  10340. createElement: (tag, namespace, is, props) => {
  10341. const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag);
  10342. if (tag === "select" && props && props.multiple != null) {
  10343. el.setAttribute("multiple", props.multiple);
  10344. }
  10345. return el;
  10346. },
  10347. createText: (text) => doc.createTextNode(text),
  10348. createComment: (text) => doc.createComment(text),
  10349. setText: (node, text) => {
  10350. node.nodeValue = text;
  10351. },
  10352. setElementText: (el, text) => {
  10353. el.textContent = text;
  10354. },
  10355. parentNode: (node) => node.parentNode,
  10356. nextSibling: (node) => node.nextSibling,
  10357. querySelector: (selector) => doc.querySelector(selector),
  10358. setScopeId(el, id) {
  10359. el.setAttribute(id, "");
  10360. },
  10361. // __UNSAFE__
  10362. // Reason: innerHTML.
  10363. // Static content here can only come from compiled templates.
  10364. // As long as the user only uses trusted templates, this is safe.
  10365. insertStaticContent(content, parent, anchor, namespace, start, end) {
  10366. const before = anchor ? anchor.previousSibling : parent.lastChild;
  10367. if (start && (start === end || start.nextSibling)) {
  10368. while (true) {
  10369. parent.insertBefore(start.cloneNode(true), anchor);
  10370. if (start === end || !(start = start.nextSibling)) break;
  10371. }
  10372. } else {
  10373. templateContainer.innerHTML = unsafeToTrustedHTML(
  10374. namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content
  10375. );
  10376. const template = templateContainer.content;
  10377. if (namespace === "svg" || namespace === "mathml") {
  10378. const wrapper = template.firstChild;
  10379. while (wrapper.firstChild) {
  10380. template.appendChild(wrapper.firstChild);
  10381. }
  10382. template.removeChild(wrapper);
  10383. }
  10384. parent.insertBefore(template, anchor);
  10385. }
  10386. return [
  10387. // first
  10388. before ? before.nextSibling : parent.firstChild,
  10389. // last
  10390. anchor ? anchor.previousSibling : parent.lastChild
  10391. ];
  10392. }
  10393. };
  10394. const TRANSITION = "transition";
  10395. const ANIMATION = "animation";
  10396. const vtcKey = Symbol("_vtc");
  10397. const DOMTransitionPropsValidators = {
  10398. name: String,
  10399. type: String,
  10400. css: {
  10401. type: Boolean,
  10402. default: true
  10403. },
  10404. duration: [String, Number, Object],
  10405. enterFromClass: String,
  10406. enterActiveClass: String,
  10407. enterToClass: String,
  10408. appearFromClass: String,
  10409. appearActiveClass: String,
  10410. appearToClass: String,
  10411. leaveFromClass: String,
  10412. leaveActiveClass: String,
  10413. leaveToClass: String
  10414. };
  10415. const TransitionPropsValidators = /* @__PURE__ */ extend(
  10416. {},
  10417. BaseTransitionPropsValidators,
  10418. DOMTransitionPropsValidators
  10419. );
  10420. const decorate$1 = (t) => {
  10421. t.displayName = "Transition";
  10422. t.props = TransitionPropsValidators;
  10423. return t;
  10424. };
  10425. const Transition = /* @__PURE__ */ decorate$1(
  10426. (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots)
  10427. );
  10428. const callHook = (hook, args = []) => {
  10429. if (isArray(hook)) {
  10430. hook.forEach((h2) => h2(...args));
  10431. } else if (hook) {
  10432. hook(...args);
  10433. }
  10434. };
  10435. const hasExplicitCallback = (hook) => {
  10436. return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
  10437. };
  10438. function resolveTransitionProps(rawProps) {
  10439. const baseProps = {};
  10440. for (const key in rawProps) {
  10441. if (!(key in DOMTransitionPropsValidators)) {
  10442. baseProps[key] = rawProps[key];
  10443. }
  10444. }
  10445. if (rawProps.css === false) {
  10446. return baseProps;
  10447. }
  10448. const {
  10449. name = "v",
  10450. type,
  10451. duration,
  10452. enterFromClass = `${name}-enter-from`,
  10453. enterActiveClass = `${name}-enter-active`,
  10454. enterToClass = `${name}-enter-to`,
  10455. appearFromClass = enterFromClass,
  10456. appearActiveClass = enterActiveClass,
  10457. appearToClass = enterToClass,
  10458. leaveFromClass = `${name}-leave-from`,
  10459. leaveActiveClass = `${name}-leave-active`,
  10460. leaveToClass = `${name}-leave-to`
  10461. } = rawProps;
  10462. const durations = normalizeDuration(duration);
  10463. const enterDuration = durations && durations[0];
  10464. const leaveDuration = durations && durations[1];
  10465. const {
  10466. onBeforeEnter,
  10467. onEnter,
  10468. onEnterCancelled,
  10469. onLeave,
  10470. onLeaveCancelled,
  10471. onBeforeAppear = onBeforeEnter,
  10472. onAppear = onEnter,
  10473. onAppearCancelled = onEnterCancelled
  10474. } = baseProps;
  10475. const finishEnter = (el, isAppear, done) => {
  10476. removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
  10477. removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
  10478. done && done();
  10479. };
  10480. const finishLeave = (el, done) => {
  10481. el._isLeaving = false;
  10482. removeTransitionClass(el, leaveFromClass);
  10483. removeTransitionClass(el, leaveToClass);
  10484. removeTransitionClass(el, leaveActiveClass);
  10485. done && done();
  10486. };
  10487. const makeEnterHook = (isAppear) => {
  10488. return (el, done) => {
  10489. const hook = isAppear ? onAppear : onEnter;
  10490. const resolve = () => finishEnter(el, isAppear, done);
  10491. callHook(hook, [el, resolve]);
  10492. nextFrame(() => {
  10493. removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
  10494. addTransitionClass(el, isAppear ? appearToClass : enterToClass);
  10495. if (!hasExplicitCallback(hook)) {
  10496. whenTransitionEnds(el, type, enterDuration, resolve);
  10497. }
  10498. });
  10499. };
  10500. };
  10501. return extend(baseProps, {
  10502. onBeforeEnter(el) {
  10503. callHook(onBeforeEnter, [el]);
  10504. addTransitionClass(el, enterFromClass);
  10505. addTransitionClass(el, enterActiveClass);
  10506. },
  10507. onBeforeAppear(el) {
  10508. callHook(onBeforeAppear, [el]);
  10509. addTransitionClass(el, appearFromClass);
  10510. addTransitionClass(el, appearActiveClass);
  10511. },
  10512. onEnter: makeEnterHook(false),
  10513. onAppear: makeEnterHook(true),
  10514. onLeave(el, done) {
  10515. el._isLeaving = true;
  10516. const resolve = () => finishLeave(el, done);
  10517. addTransitionClass(el, leaveFromClass);
  10518. addTransitionClass(el, leaveActiveClass);
  10519. forceReflow();
  10520. nextFrame(() => {
  10521. if (!el._isLeaving) {
  10522. return;
  10523. }
  10524. removeTransitionClass(el, leaveFromClass);
  10525. addTransitionClass(el, leaveToClass);
  10526. if (!hasExplicitCallback(onLeave)) {
  10527. whenTransitionEnds(el, type, leaveDuration, resolve);
  10528. }
  10529. });
  10530. callHook(onLeave, [el, resolve]);
  10531. },
  10532. onEnterCancelled(el) {
  10533. finishEnter(el, false);
  10534. callHook(onEnterCancelled, [el]);
  10535. },
  10536. onAppearCancelled(el) {
  10537. finishEnter(el, true);
  10538. callHook(onAppearCancelled, [el]);
  10539. },
  10540. onLeaveCancelled(el) {
  10541. finishLeave(el);
  10542. callHook(onLeaveCancelled, [el]);
  10543. }
  10544. });
  10545. }
  10546. function normalizeDuration(duration) {
  10547. if (duration == null) {
  10548. return null;
  10549. } else if (isObject(duration)) {
  10550. return [NumberOf(duration.enter), NumberOf(duration.leave)];
  10551. } else {
  10552. const n = NumberOf(duration);
  10553. return [n, n];
  10554. }
  10555. }
  10556. function NumberOf(val) {
  10557. const res = toNumber(val);
  10558. {
  10559. assertNumber(res, "<transition> explicit duration");
  10560. }
  10561. return res;
  10562. }
  10563. function addTransitionClass(el, cls) {
  10564. cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
  10565. (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
  10566. }
  10567. function removeTransitionClass(el, cls) {
  10568. cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
  10569. const _vtc = el[vtcKey];
  10570. if (_vtc) {
  10571. _vtc.delete(cls);
  10572. if (!_vtc.size) {
  10573. el[vtcKey] = void 0;
  10574. }
  10575. }
  10576. }
  10577. function nextFrame(cb) {
  10578. requestAnimationFrame(() => {
  10579. requestAnimationFrame(cb);
  10580. });
  10581. }
  10582. let endId = 0;
  10583. function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
  10584. const id = el._endId = ++endId;
  10585. const resolveIfNotStale = () => {
  10586. if (id === el._endId) {
  10587. resolve();
  10588. }
  10589. };
  10590. if (explicitTimeout != null) {
  10591. return setTimeout(resolveIfNotStale, explicitTimeout);
  10592. }
  10593. const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
  10594. if (!type) {
  10595. return resolve();
  10596. }
  10597. const endEvent = type + "end";
  10598. let ended = 0;
  10599. const end = () => {
  10600. el.removeEventListener(endEvent, onEnd);
  10601. resolveIfNotStale();
  10602. };
  10603. const onEnd = (e) => {
  10604. if (e.target === el && ++ended >= propCount) {
  10605. end();
  10606. }
  10607. };
  10608. setTimeout(() => {
  10609. if (ended < propCount) {
  10610. end();
  10611. }
  10612. }, timeout + 1);
  10613. el.addEventListener(endEvent, onEnd);
  10614. }
  10615. function getTransitionInfo(el, expectedType) {
  10616. const styles = window.getComputedStyle(el);
  10617. const getStyleProperties = (key) => (styles[key] || "").split(", ");
  10618. const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
  10619. const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
  10620. const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  10621. const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
  10622. const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
  10623. const animationTimeout = getTimeout(animationDelays, animationDurations);
  10624. let type = null;
  10625. let timeout = 0;
  10626. let propCount = 0;
  10627. if (expectedType === TRANSITION) {
  10628. if (transitionTimeout > 0) {
  10629. type = TRANSITION;
  10630. timeout = transitionTimeout;
  10631. propCount = transitionDurations.length;
  10632. }
  10633. } else if (expectedType === ANIMATION) {
  10634. if (animationTimeout > 0) {
  10635. type = ANIMATION;
  10636. timeout = animationTimeout;
  10637. propCount = animationDurations.length;
  10638. }
  10639. } else {
  10640. timeout = Math.max(transitionTimeout, animationTimeout);
  10641. type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
  10642. propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
  10643. }
  10644. const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
  10645. getStyleProperties(`${TRANSITION}Property`).toString()
  10646. );
  10647. return {
  10648. type,
  10649. timeout,
  10650. propCount,
  10651. hasTransform
  10652. };
  10653. }
  10654. function getTimeout(delays, durations) {
  10655. while (delays.length < durations.length) {
  10656. delays = delays.concat(delays);
  10657. }
  10658. return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
  10659. }
  10660. function toMs(s) {
  10661. if (s === "auto") return 0;
  10662. return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
  10663. }
  10664. function forceReflow() {
  10665. return document.body.offsetHeight;
  10666. }
  10667. function patchClass(el, value, isSVG) {
  10668. const transitionClasses = el[vtcKey];
  10669. if (transitionClasses) {
  10670. value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
  10671. }
  10672. if (value == null) {
  10673. el.removeAttribute("class");
  10674. } else if (isSVG) {
  10675. el.setAttribute("class", value);
  10676. } else {
  10677. el.className = value;
  10678. }
  10679. }
  10680. const vShowOriginalDisplay = Symbol("_vod");
  10681. const vShowHidden = Symbol("_vsh");
  10682. const vShow = {
  10683. beforeMount(el, { value }, { transition }) {
  10684. el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
  10685. if (transition && value) {
  10686. transition.beforeEnter(el);
  10687. } else {
  10688. setDisplay(el, value);
  10689. }
  10690. },
  10691. mounted(el, { value }, { transition }) {
  10692. if (transition && value) {
  10693. transition.enter(el);
  10694. }
  10695. },
  10696. updated(el, { value, oldValue }, { transition }) {
  10697. if (!value === !oldValue) return;
  10698. if (transition) {
  10699. if (value) {
  10700. transition.beforeEnter(el);
  10701. setDisplay(el, true);
  10702. transition.enter(el);
  10703. } else {
  10704. transition.leave(el, () => {
  10705. setDisplay(el, false);
  10706. });
  10707. }
  10708. } else {
  10709. setDisplay(el, value);
  10710. }
  10711. },
  10712. beforeUnmount(el, { value }) {
  10713. setDisplay(el, value);
  10714. }
  10715. };
  10716. {
  10717. vShow.name = "show";
  10718. }
  10719. function setDisplay(el, value) {
  10720. el.style.display = value ? el[vShowOriginalDisplay] : "none";
  10721. el[vShowHidden] = !value;
  10722. }
  10723. const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
  10724. function useCssVars(getter) {
  10725. const instance = getCurrentInstance();
  10726. if (!instance) {
  10727. warn(`useCssVars is called without current active component instance.`);
  10728. return;
  10729. }
  10730. const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
  10731. Array.from(
  10732. document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
  10733. ).forEach((node) => setVarsOnNode(node, vars));
  10734. };
  10735. {
  10736. instance.getCssVars = () => getter(instance.proxy);
  10737. }
  10738. const setVars = () => {
  10739. const vars = getter(instance.proxy);
  10740. if (instance.ce) {
  10741. setVarsOnNode(instance.ce, vars);
  10742. } else {
  10743. setVarsOnVNode(instance.subTree, vars);
  10744. }
  10745. updateTeleports(vars);
  10746. };
  10747. onBeforeMount(() => {
  10748. watchPostEffect(setVars);
  10749. });
  10750. onMounted(() => {
  10751. const ob = new MutationObserver(setVars);
  10752. ob.observe(instance.subTree.el.parentNode, { childList: true });
  10753. onUnmounted(() => ob.disconnect());
  10754. });
  10755. }
  10756. function setVarsOnVNode(vnode, vars) {
  10757. if (vnode.shapeFlag & 128) {
  10758. const suspense = vnode.suspense;
  10759. vnode = suspense.activeBranch;
  10760. if (suspense.pendingBranch && !suspense.isHydrating) {
  10761. suspense.effects.push(() => {
  10762. setVarsOnVNode(suspense.activeBranch, vars);
  10763. });
  10764. }
  10765. }
  10766. while (vnode.component) {
  10767. vnode = vnode.component.subTree;
  10768. }
  10769. if (vnode.shapeFlag & 1 && vnode.el) {
  10770. setVarsOnNode(vnode.el, vars);
  10771. } else if (vnode.type === Fragment) {
  10772. vnode.children.forEach((c) => setVarsOnVNode(c, vars));
  10773. } else if (vnode.type === Static) {
  10774. let { el, anchor } = vnode;
  10775. while (el) {
  10776. setVarsOnNode(el, vars);
  10777. if (el === anchor) break;
  10778. el = el.nextSibling;
  10779. }
  10780. }
  10781. }
  10782. function setVarsOnNode(el, vars) {
  10783. if (el.nodeType === 1) {
  10784. const style = el.style;
  10785. let cssText = "";
  10786. for (const key in vars) {
  10787. style.setProperty(`--${key}`, vars[key]);
  10788. cssText += `--${key}: ${vars[key]};`;
  10789. }
  10790. style[CSS_VAR_TEXT] = cssText;
  10791. }
  10792. }
  10793. const displayRE = /(^|;)\s*display\s*:/;
  10794. function patchStyle(el, prev, next) {
  10795. const style = el.style;
  10796. const isCssString = isString(next);
  10797. let hasControlledDisplay = false;
  10798. if (next && !isCssString) {
  10799. if (prev) {
  10800. if (!isString(prev)) {
  10801. for (const key in prev) {
  10802. if (next[key] == null) {
  10803. setStyle(style, key, "");
  10804. }
  10805. }
  10806. } else {
  10807. for (const prevStyle of prev.split(";")) {
  10808. const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
  10809. if (next[key] == null) {
  10810. setStyle(style, key, "");
  10811. }
  10812. }
  10813. }
  10814. }
  10815. for (const key in next) {
  10816. if (key === "display") {
  10817. hasControlledDisplay = true;
  10818. }
  10819. setStyle(style, key, next[key]);
  10820. }
  10821. } else {
  10822. if (isCssString) {
  10823. if (prev !== next) {
  10824. const cssVarText = style[CSS_VAR_TEXT];
  10825. if (cssVarText) {
  10826. next += ";" + cssVarText;
  10827. }
  10828. style.cssText = next;
  10829. hasControlledDisplay = displayRE.test(next);
  10830. }
  10831. } else if (prev) {
  10832. el.removeAttribute("style");
  10833. }
  10834. }
  10835. if (vShowOriginalDisplay in el) {
  10836. el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
  10837. if (el[vShowHidden]) {
  10838. style.display = "none";
  10839. }
  10840. }
  10841. }
  10842. const semicolonRE = /[^\\];\s*$/;
  10843. const importantRE = /\s*!important$/;
  10844. function setStyle(style, name, val) {
  10845. if (isArray(val)) {
  10846. val.forEach((v) => setStyle(style, name, v));
  10847. } else {
  10848. if (val == null) val = "";
  10849. {
  10850. if (semicolonRE.test(val)) {
  10851. warn(
  10852. `Unexpected semicolon at the end of '${name}' style value: '${val}'`
  10853. );
  10854. }
  10855. }
  10856. if (name.startsWith("--")) {
  10857. style.setProperty(name, val);
  10858. } else {
  10859. const prefixed = autoPrefix(style, name);
  10860. if (importantRE.test(val)) {
  10861. style.setProperty(
  10862. hyphenate(prefixed),
  10863. val.replace(importantRE, ""),
  10864. "important"
  10865. );
  10866. } else {
  10867. style[prefixed] = val;
  10868. }
  10869. }
  10870. }
  10871. }
  10872. const prefixes = ["Webkit", "Moz", "ms"];
  10873. const prefixCache = {};
  10874. function autoPrefix(style, rawName) {
  10875. const cached = prefixCache[rawName];
  10876. if (cached) {
  10877. return cached;
  10878. }
  10879. let name = camelize(rawName);
  10880. if (name !== "filter" && name in style) {
  10881. return prefixCache[rawName] = name;
  10882. }
  10883. name = capitalize(name);
  10884. for (let i = 0; i < prefixes.length; i++) {
  10885. const prefixed = prefixes[i] + name;
  10886. if (prefixed in style) {
  10887. return prefixCache[rawName] = prefixed;
  10888. }
  10889. }
  10890. return rawName;
  10891. }
  10892. const xlinkNS = "http://www.w3.org/1999/xlink";
  10893. function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
  10894. if (isSVG && key.startsWith("xlink:")) {
  10895. if (value == null) {
  10896. el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
  10897. } else {
  10898. el.setAttributeNS(xlinkNS, key, value);
  10899. }
  10900. } else {
  10901. if (value == null || isBoolean && !includeBooleanAttr(value)) {
  10902. el.removeAttribute(key);
  10903. } else {
  10904. el.setAttribute(
  10905. key,
  10906. isBoolean ? "" : isSymbol(value) ? String(value) : value
  10907. );
  10908. }
  10909. }
  10910. }
  10911. function patchDOMProp(el, key, value, parentComponent, attrName) {
  10912. if (key === "innerHTML" || key === "textContent") {
  10913. if (value != null) {
  10914. el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
  10915. }
  10916. return;
  10917. }
  10918. const tag = el.tagName;
  10919. if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
  10920. !tag.includes("-")) {
  10921. const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
  10922. const newValue = value == null ? (
  10923. // #11647: value should be set as empty string for null and undefined,
  10924. // but <input type="checkbox"> should be set as 'on'.
  10925. el.type === "checkbox" ? "on" : ""
  10926. ) : String(value);
  10927. if (oldValue !== newValue || !("_value" in el)) {
  10928. el.value = newValue;
  10929. }
  10930. if (value == null) {
  10931. el.removeAttribute(key);
  10932. }
  10933. el._value = value;
  10934. return;
  10935. }
  10936. let needRemove = false;
  10937. if (value === "" || value == null) {
  10938. const type = typeof el[key];
  10939. if (type === "boolean") {
  10940. value = includeBooleanAttr(value);
  10941. } else if (value == null && type === "string") {
  10942. value = "";
  10943. needRemove = true;
  10944. } else if (type === "number") {
  10945. value = 0;
  10946. needRemove = true;
  10947. }
  10948. }
  10949. try {
  10950. el[key] = value;
  10951. } catch (e) {
  10952. if (!needRemove) {
  10953. warn(
  10954. `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
  10955. e
  10956. );
  10957. }
  10958. }
  10959. needRemove && el.removeAttribute(attrName || key);
  10960. }
  10961. function addEventListener(el, event, handler, options) {
  10962. el.addEventListener(event, handler, options);
  10963. }
  10964. function removeEventListener(el, event, handler, options) {
  10965. el.removeEventListener(event, handler, options);
  10966. }
  10967. const veiKey = Symbol("_vei");
  10968. function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
  10969. const invokers = el[veiKey] || (el[veiKey] = {});
  10970. const existingInvoker = invokers[rawName];
  10971. if (nextValue && existingInvoker) {
  10972. existingInvoker.value = sanitizeEventValue(nextValue, rawName) ;
  10973. } else {
  10974. const [name, options] = parseName(rawName);
  10975. if (nextValue) {
  10976. const invoker = invokers[rawName] = createInvoker(
  10977. sanitizeEventValue(nextValue, rawName) ,
  10978. instance
  10979. );
  10980. addEventListener(el, name, invoker, options);
  10981. } else if (existingInvoker) {
  10982. removeEventListener(el, name, existingInvoker, options);
  10983. invokers[rawName] = void 0;
  10984. }
  10985. }
  10986. }
  10987. const optionsModifierRE = /(?:Once|Passive|Capture)$/;
  10988. function parseName(name) {
  10989. let options;
  10990. if (optionsModifierRE.test(name)) {
  10991. options = {};
  10992. let m;
  10993. while (m = name.match(optionsModifierRE)) {
  10994. name = name.slice(0, name.length - m[0].length);
  10995. options[m[0].toLowerCase()] = true;
  10996. }
  10997. }
  10998. const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
  10999. return [event, options];
  11000. }
  11001. let cachedNow = 0;
  11002. const p = /* @__PURE__ */ Promise.resolve();
  11003. const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
  11004. function createInvoker(initialValue, instance) {
  11005. const invoker = (e) => {
  11006. if (!e._vts) {
  11007. e._vts = Date.now();
  11008. } else if (e._vts <= invoker.attached) {
  11009. return;
  11010. }
  11011. callWithAsyncErrorHandling(
  11012. patchStopImmediatePropagation(e, invoker.value),
  11013. instance,
  11014. 5,
  11015. [e]
  11016. );
  11017. };
  11018. invoker.value = initialValue;
  11019. invoker.attached = getNow();
  11020. return invoker;
  11021. }
  11022. function sanitizeEventValue(value, propName) {
  11023. if (isFunction(value) || isArray(value)) {
  11024. return value;
  11025. }
  11026. warn(
  11027. `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?
  11028. Expected function or array of functions, received type ${typeof value}.`
  11029. );
  11030. return NOOP;
  11031. }
  11032. function patchStopImmediatePropagation(e, value) {
  11033. if (isArray(value)) {
  11034. const originalStop = e.stopImmediatePropagation;
  11035. e.stopImmediatePropagation = () => {
  11036. originalStop.call(e);
  11037. e._stopped = true;
  11038. };
  11039. return value.map(
  11040. (fn) => (e2) => !e2._stopped && fn && fn(e2)
  11041. );
  11042. } else {
  11043. return value;
  11044. }
  11045. }
  11046. const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
  11047. key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
  11048. const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
  11049. const isSVG = namespace === "svg";
  11050. if (key === "class") {
  11051. patchClass(el, nextValue, isSVG);
  11052. } else if (key === "style") {
  11053. patchStyle(el, prevValue, nextValue);
  11054. } else if (isOn(key)) {
  11055. if (!isModelListener(key)) {
  11056. patchEvent(el, key, prevValue, nextValue, parentComponent);
  11057. }
  11058. } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
  11059. patchDOMProp(el, key, nextValue);
  11060. if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
  11061. patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
  11062. }
  11063. } else if (
  11064. // #11081 force set props for possible async custom element
  11065. el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
  11066. ) {
  11067. patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
  11068. } else {
  11069. if (key === "true-value") {
  11070. el._trueValue = nextValue;
  11071. } else if (key === "false-value") {
  11072. el._falseValue = nextValue;
  11073. }
  11074. patchAttr(el, key, nextValue, isSVG);
  11075. }
  11076. };
  11077. function shouldSetAsProp(el, key, value, isSVG) {
  11078. if (isSVG) {
  11079. if (key === "innerHTML" || key === "textContent") {
  11080. return true;
  11081. }
  11082. if (key in el && isNativeOn(key) && isFunction(value)) {
  11083. return true;
  11084. }
  11085. return false;
  11086. }
  11087. if (key === "spellcheck" || key === "draggable" || key === "translate") {
  11088. return false;
  11089. }
  11090. if (key === "form") {
  11091. return false;
  11092. }
  11093. if (key === "list" && el.tagName === "INPUT") {
  11094. return false;
  11095. }
  11096. if (key === "type" && el.tagName === "TEXTAREA") {
  11097. return false;
  11098. }
  11099. if (key === "width" || key === "height") {
  11100. const tag = el.tagName;
  11101. if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
  11102. return false;
  11103. }
  11104. }
  11105. if (isNativeOn(key) && isString(value)) {
  11106. return false;
  11107. }
  11108. return key in el;
  11109. }
  11110. const REMOVAL = {};
  11111. /*! #__NO_SIDE_EFFECTS__ */
  11112. // @__NO_SIDE_EFFECTS__
  11113. function defineCustomElement(options, extraOptions, _createApp) {
  11114. const Comp = defineComponent(options, extraOptions);
  11115. if (isPlainObject(Comp)) extend(Comp, extraOptions);
  11116. class VueCustomElement extends VueElement {
  11117. constructor(initialProps) {
  11118. super(Comp, initialProps, _createApp);
  11119. }
  11120. }
  11121. VueCustomElement.def = Comp;
  11122. return VueCustomElement;
  11123. }
  11124. /*! #__NO_SIDE_EFFECTS__ */
  11125. const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
  11126. return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
  11127. };
  11128. const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
  11129. };
  11130. class VueElement extends BaseClass {
  11131. constructor(_def, _props = {}, _createApp = createApp) {
  11132. super();
  11133. this._def = _def;
  11134. this._props = _props;
  11135. this._createApp = _createApp;
  11136. this._isVueCE = true;
  11137. /**
  11138. * @internal
  11139. */
  11140. this._instance = null;
  11141. /**
  11142. * @internal
  11143. */
  11144. this._app = null;
  11145. /**
  11146. * @internal
  11147. */
  11148. this._nonce = this._def.nonce;
  11149. this._connected = false;
  11150. this._resolved = false;
  11151. this._numberProps = null;
  11152. this._styleChildren = /* @__PURE__ */ new WeakSet();
  11153. this._ob = null;
  11154. if (this.shadowRoot && _createApp !== createApp) {
  11155. this._root = this.shadowRoot;
  11156. } else {
  11157. if (this.shadowRoot) {
  11158. warn(
  11159. `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
  11160. );
  11161. }
  11162. if (_def.shadowRoot !== false) {
  11163. this.attachShadow({ mode: "open" });
  11164. this._root = this.shadowRoot;
  11165. } else {
  11166. this._root = this;
  11167. }
  11168. }
  11169. if (!this._def.__asyncLoader) {
  11170. this._resolveProps(this._def);
  11171. }
  11172. }
  11173. connectedCallback() {
  11174. if (!this.isConnected) return;
  11175. if (!this.shadowRoot) {
  11176. this._parseSlots();
  11177. }
  11178. this._connected = true;
  11179. let parent = this;
  11180. while (parent = parent && (parent.parentNode || parent.host)) {
  11181. if (parent instanceof VueElement) {
  11182. this._parent = parent;
  11183. break;
  11184. }
  11185. }
  11186. if (!this._instance) {
  11187. if (this._resolved) {
  11188. this._setParent();
  11189. this._update();
  11190. } else {
  11191. if (parent && parent._pendingResolve) {
  11192. this._pendingResolve = parent._pendingResolve.then(() => {
  11193. this._pendingResolve = void 0;
  11194. this._resolveDef();
  11195. });
  11196. } else {
  11197. this._resolveDef();
  11198. }
  11199. }
  11200. }
  11201. }
  11202. _setParent(parent = this._parent) {
  11203. if (parent) {
  11204. this._instance.parent = parent._instance;
  11205. this._instance.provides = parent._instance.provides;
  11206. }
  11207. }
  11208. disconnectedCallback() {
  11209. this._connected = false;
  11210. nextTick(() => {
  11211. if (!this._connected) {
  11212. if (this._ob) {
  11213. this._ob.disconnect();
  11214. this._ob = null;
  11215. }
  11216. this._app && this._app.unmount();
  11217. if (this._instance) this._instance.ce = void 0;
  11218. this._app = this._instance = null;
  11219. }
  11220. });
  11221. }
  11222. /**
  11223. * resolve inner component definition (handle possible async component)
  11224. */
  11225. _resolveDef() {
  11226. if (this._pendingResolve) {
  11227. return;
  11228. }
  11229. for (let i = 0; i < this.attributes.length; i++) {
  11230. this._setAttr(this.attributes[i].name);
  11231. }
  11232. this._ob = new MutationObserver((mutations) => {
  11233. for (const m of mutations) {
  11234. this._setAttr(m.attributeName);
  11235. }
  11236. });
  11237. this._ob.observe(this, { attributes: true });
  11238. const resolve = (def, isAsync = false) => {
  11239. this._resolved = true;
  11240. this._pendingResolve = void 0;
  11241. const { props, styles } = def;
  11242. let numberProps;
  11243. if (props && !isArray(props)) {
  11244. for (const key in props) {
  11245. const opt = props[key];
  11246. if (opt === Number || opt && opt.type === Number) {
  11247. if (key in this._props) {
  11248. this._props[key] = toNumber(this._props[key]);
  11249. }
  11250. (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
  11251. }
  11252. }
  11253. }
  11254. this._numberProps = numberProps;
  11255. if (isAsync) {
  11256. this._resolveProps(def);
  11257. }
  11258. if (this.shadowRoot) {
  11259. this._applyStyles(styles);
  11260. } else if (styles) {
  11261. warn(
  11262. "Custom element style injection is not supported when using shadowRoot: false"
  11263. );
  11264. }
  11265. this._mount(def);
  11266. };
  11267. const asyncDef = this._def.__asyncLoader;
  11268. if (asyncDef) {
  11269. this._pendingResolve = asyncDef().then(
  11270. (def) => resolve(this._def = def, true)
  11271. );
  11272. } else {
  11273. resolve(this._def);
  11274. }
  11275. }
  11276. _mount(def) {
  11277. if (!def.name) {
  11278. def.name = "VueElement";
  11279. }
  11280. this._app = this._createApp(def);
  11281. if (def.configureApp) {
  11282. def.configureApp(this._app);
  11283. }
  11284. this._app._ceVNode = this._createVNode();
  11285. this._app.mount(this._root);
  11286. const exposed = this._instance && this._instance.exposed;
  11287. if (!exposed) return;
  11288. for (const key in exposed) {
  11289. if (!hasOwn(this, key)) {
  11290. Object.defineProperty(this, key, {
  11291. // unwrap ref to be consistent with public instance behavior
  11292. get: () => unref(exposed[key])
  11293. });
  11294. } else {
  11295. warn(`Exposed property "${key}" already exists on custom element.`);
  11296. }
  11297. }
  11298. }
  11299. _resolveProps(def) {
  11300. const { props } = def;
  11301. const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
  11302. for (const key of Object.keys(this)) {
  11303. if (key[0] !== "_" && declaredPropKeys.includes(key)) {
  11304. this._setProp(key, this[key]);
  11305. }
  11306. }
  11307. for (const key of declaredPropKeys.map(camelize)) {
  11308. Object.defineProperty(this, key, {
  11309. get() {
  11310. return this._getProp(key);
  11311. },
  11312. set(val) {
  11313. this._setProp(key, val, true, true);
  11314. }
  11315. });
  11316. }
  11317. }
  11318. _setAttr(key) {
  11319. if (key.startsWith("data-v-")) return;
  11320. const has = this.hasAttribute(key);
  11321. let value = has ? this.getAttribute(key) : REMOVAL;
  11322. const camelKey = camelize(key);
  11323. if (has && this._numberProps && this._numberProps[camelKey]) {
  11324. value = toNumber(value);
  11325. }
  11326. this._setProp(camelKey, value, false, true);
  11327. }
  11328. /**
  11329. * @internal
  11330. */
  11331. _getProp(key) {
  11332. return this._props[key];
  11333. }
  11334. /**
  11335. * @internal
  11336. */
  11337. _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
  11338. if (val !== this._props[key]) {
  11339. if (val === REMOVAL) {
  11340. delete this._props[key];
  11341. } else {
  11342. this._props[key] = val;
  11343. if (key === "key" && this._app) {
  11344. this._app._ceVNode.key = val;
  11345. }
  11346. }
  11347. if (shouldUpdate && this._instance) {
  11348. this._update();
  11349. }
  11350. if (shouldReflect) {
  11351. if (val === true) {
  11352. this.setAttribute(hyphenate(key), "");
  11353. } else if (typeof val === "string" || typeof val === "number") {
  11354. this.setAttribute(hyphenate(key), val + "");
  11355. } else if (!val) {
  11356. this.removeAttribute(hyphenate(key));
  11357. }
  11358. }
  11359. }
  11360. }
  11361. _update() {
  11362. render(this._createVNode(), this._root);
  11363. }
  11364. _createVNode() {
  11365. const baseProps = {};
  11366. if (!this.shadowRoot) {
  11367. baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
  11368. }
  11369. const vnode = createVNode(this._def, extend(baseProps, this._props));
  11370. if (!this._instance) {
  11371. vnode.ce = (instance) => {
  11372. this._instance = instance;
  11373. instance.ce = this;
  11374. instance.isCE = true;
  11375. {
  11376. instance.ceReload = (newStyles) => {
  11377. if (this._styles) {
  11378. this._styles.forEach((s) => this._root.removeChild(s));
  11379. this._styles.length = 0;
  11380. }
  11381. this._applyStyles(newStyles);
  11382. this._instance = null;
  11383. this._update();
  11384. };
  11385. }
  11386. const dispatch = (event, args) => {
  11387. this.dispatchEvent(
  11388. new CustomEvent(
  11389. event,
  11390. isPlainObject(args[0]) ? extend({ detail: args }, args[0]) : { detail: args }
  11391. )
  11392. );
  11393. };
  11394. instance.emit = (event, ...args) => {
  11395. dispatch(event, args);
  11396. if (hyphenate(event) !== event) {
  11397. dispatch(hyphenate(event), args);
  11398. }
  11399. };
  11400. this._setParent();
  11401. };
  11402. }
  11403. return vnode;
  11404. }
  11405. _applyStyles(styles, owner) {
  11406. if (!styles) return;
  11407. if (owner) {
  11408. if (owner === this._def || this._styleChildren.has(owner)) {
  11409. return;
  11410. }
  11411. this._styleChildren.add(owner);
  11412. }
  11413. const nonce = this._nonce;
  11414. for (let i = styles.length - 1; i >= 0; i--) {
  11415. const s = document.createElement("style");
  11416. if (nonce) s.setAttribute("nonce", nonce);
  11417. s.textContent = styles[i];
  11418. this.shadowRoot.prepend(s);
  11419. {
  11420. if (owner) {
  11421. if (owner.__hmrId) {
  11422. if (!this._childStyles) this._childStyles = /* @__PURE__ */ new Map();
  11423. let entry = this._childStyles.get(owner.__hmrId);
  11424. if (!entry) {
  11425. this._childStyles.set(owner.__hmrId, entry = []);
  11426. }
  11427. entry.push(s);
  11428. }
  11429. } else {
  11430. (this._styles || (this._styles = [])).push(s);
  11431. }
  11432. }
  11433. }
  11434. }
  11435. /**
  11436. * Only called when shadowRoot is false
  11437. */
  11438. _parseSlots() {
  11439. const slots = this._slots = {};
  11440. let n;
  11441. while (n = this.firstChild) {
  11442. const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default";
  11443. (slots[slotName] || (slots[slotName] = [])).push(n);
  11444. this.removeChild(n);
  11445. }
  11446. }
  11447. /**
  11448. * Only called when shadowRoot is false
  11449. */
  11450. _renderSlots() {
  11451. const outlets = (this._teleportTarget || this).querySelectorAll("slot");
  11452. const scopeId = this._instance.type.__scopeId;
  11453. for (let i = 0; i < outlets.length; i++) {
  11454. const o = outlets[i];
  11455. const slotName = o.getAttribute("name") || "default";
  11456. const content = this._slots[slotName];
  11457. const parent = o.parentNode;
  11458. if (content) {
  11459. for (const n of content) {
  11460. if (scopeId && n.nodeType === 1) {
  11461. const id = scopeId + "-s";
  11462. const walker = document.createTreeWalker(n, 1);
  11463. n.setAttribute(id, "");
  11464. let child;
  11465. while (child = walker.nextNode()) {
  11466. child.setAttribute(id, "");
  11467. }
  11468. }
  11469. parent.insertBefore(n, o);
  11470. }
  11471. } else {
  11472. while (o.firstChild) parent.insertBefore(o.firstChild, o);
  11473. }
  11474. parent.removeChild(o);
  11475. }
  11476. }
  11477. /**
  11478. * @internal
  11479. */
  11480. _injectChildStyle(comp) {
  11481. this._applyStyles(comp.styles, comp);
  11482. }
  11483. /**
  11484. * @internal
  11485. */
  11486. _removeChildStyle(comp) {
  11487. {
  11488. this._styleChildren.delete(comp);
  11489. if (this._childStyles && comp.__hmrId) {
  11490. const oldStyles = this._childStyles.get(comp.__hmrId);
  11491. if (oldStyles) {
  11492. oldStyles.forEach((s) => this._root.removeChild(s));
  11493. oldStyles.length = 0;
  11494. }
  11495. }
  11496. }
  11497. }
  11498. }
  11499. function useHost(caller) {
  11500. const instance = getCurrentInstance();
  11501. const el = instance && instance.ce;
  11502. if (el) {
  11503. return el;
  11504. } else {
  11505. if (!instance) {
  11506. warn(
  11507. `${caller || "useHost"} called without an active component instance.`
  11508. );
  11509. } else {
  11510. warn(
  11511. `${caller || "useHost"} can only be used in components defined via defineCustomElement.`
  11512. );
  11513. }
  11514. }
  11515. return null;
  11516. }
  11517. function useShadowRoot() {
  11518. const el = useHost("useShadowRoot") ;
  11519. return el && el.shadowRoot;
  11520. }
  11521. function useCssModule(name = "$style") {
  11522. {
  11523. {
  11524. warn(`useCssModule() is not supported in the global build.`);
  11525. }
  11526. return EMPTY_OBJ;
  11527. }
  11528. }
  11529. const positionMap = /* @__PURE__ */ new WeakMap();
  11530. const newPositionMap = /* @__PURE__ */ new WeakMap();
  11531. const moveCbKey = Symbol("_moveCb");
  11532. const enterCbKey = Symbol("_enterCb");
  11533. const decorate = (t) => {
  11534. delete t.props.mode;
  11535. return t;
  11536. };
  11537. const TransitionGroupImpl = /* @__PURE__ */ decorate({
  11538. name: "TransitionGroup",
  11539. props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
  11540. tag: String,
  11541. moveClass: String
  11542. }),
  11543. setup(props, { slots }) {
  11544. const instance = getCurrentInstance();
  11545. const state = useTransitionState();
  11546. let prevChildren;
  11547. let children;
  11548. onUpdated(() => {
  11549. if (!prevChildren.length) {
  11550. return;
  11551. }
  11552. const moveClass = props.moveClass || `${props.name || "v"}-move`;
  11553. if (!hasCSSTransform(
  11554. prevChildren[0].el,
  11555. instance.vnode.el,
  11556. moveClass
  11557. )) {
  11558. return;
  11559. }
  11560. prevChildren.forEach(callPendingCbs);
  11561. prevChildren.forEach(recordPosition);
  11562. const movedChildren = prevChildren.filter(applyTranslation);
  11563. forceReflow();
  11564. movedChildren.forEach((c) => {
  11565. const el = c.el;
  11566. const style = el.style;
  11567. addTransitionClass(el, moveClass);
  11568. style.transform = style.webkitTransform = style.transitionDuration = "";
  11569. const cb = el[moveCbKey] = (e) => {
  11570. if (e && e.target !== el) {
  11571. return;
  11572. }
  11573. if (!e || /transform$/.test(e.propertyName)) {
  11574. el.removeEventListener("transitionend", cb);
  11575. el[moveCbKey] = null;
  11576. removeTransitionClass(el, moveClass);
  11577. }
  11578. };
  11579. el.addEventListener("transitionend", cb);
  11580. });
  11581. });
  11582. return () => {
  11583. const rawProps = toRaw(props);
  11584. const cssTransitionProps = resolveTransitionProps(rawProps);
  11585. let tag = rawProps.tag || Fragment;
  11586. prevChildren = [];
  11587. if (children) {
  11588. for (let i = 0; i < children.length; i++) {
  11589. const child = children[i];
  11590. if (child.el && child.el instanceof Element) {
  11591. prevChildren.push(child);
  11592. setTransitionHooks(
  11593. child,
  11594. resolveTransitionHooks(
  11595. child,
  11596. cssTransitionProps,
  11597. state,
  11598. instance
  11599. )
  11600. );
  11601. positionMap.set(
  11602. child,
  11603. child.el.getBoundingClientRect()
  11604. );
  11605. }
  11606. }
  11607. }
  11608. children = slots.default ? getTransitionRawChildren(slots.default()) : [];
  11609. for (let i = 0; i < children.length; i++) {
  11610. const child = children[i];
  11611. if (child.key != null) {
  11612. setTransitionHooks(
  11613. child,
  11614. resolveTransitionHooks(child, cssTransitionProps, state, instance)
  11615. );
  11616. } else if (child.type !== Text) {
  11617. warn(`<TransitionGroup> children must be keyed.`);
  11618. }
  11619. }
  11620. return createVNode(tag, null, children);
  11621. };
  11622. }
  11623. });
  11624. const TransitionGroup = TransitionGroupImpl;
  11625. function callPendingCbs(c) {
  11626. const el = c.el;
  11627. if (el[moveCbKey]) {
  11628. el[moveCbKey]();
  11629. }
  11630. if (el[enterCbKey]) {
  11631. el[enterCbKey]();
  11632. }
  11633. }
  11634. function recordPosition(c) {
  11635. newPositionMap.set(c, c.el.getBoundingClientRect());
  11636. }
  11637. function applyTranslation(c) {
  11638. const oldPos = positionMap.get(c);
  11639. const newPos = newPositionMap.get(c);
  11640. const dx = oldPos.left - newPos.left;
  11641. const dy = oldPos.top - newPos.top;
  11642. if (dx || dy) {
  11643. const s = c.el.style;
  11644. s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
  11645. s.transitionDuration = "0s";
  11646. return c;
  11647. }
  11648. }
  11649. function hasCSSTransform(el, root, moveClass) {
  11650. const clone = el.cloneNode();
  11651. const _vtc = el[vtcKey];
  11652. if (_vtc) {
  11653. _vtc.forEach((cls) => {
  11654. cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
  11655. });
  11656. }
  11657. moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c));
  11658. clone.style.display = "none";
  11659. const container = root.nodeType === 1 ? root : root.parentNode;
  11660. container.appendChild(clone);
  11661. const { hasTransform } = getTransitionInfo(clone);
  11662. container.removeChild(clone);
  11663. return hasTransform;
  11664. }
  11665. const getModelAssigner = (vnode) => {
  11666. const fn = vnode.props["onUpdate:modelValue"] || false;
  11667. return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn;
  11668. };
  11669. function onCompositionStart(e) {
  11670. e.target.composing = true;
  11671. }
  11672. function onCompositionEnd(e) {
  11673. const target = e.target;
  11674. if (target.composing) {
  11675. target.composing = false;
  11676. target.dispatchEvent(new Event("input"));
  11677. }
  11678. }
  11679. const assignKey = Symbol("_assign");
  11680. const vModelText = {
  11681. created(el, { modifiers: { lazy, trim, number } }, vnode) {
  11682. el[assignKey] = getModelAssigner(vnode);
  11683. const castToNumber = number || vnode.props && vnode.props.type === "number";
  11684. addEventListener(el, lazy ? "change" : "input", (e) => {
  11685. if (e.target.composing) return;
  11686. let domValue = el.value;
  11687. if (trim) {
  11688. domValue = domValue.trim();
  11689. }
  11690. if (castToNumber) {
  11691. domValue = looseToNumber(domValue);
  11692. }
  11693. el[assignKey](domValue);
  11694. });
  11695. if (trim) {
  11696. addEventListener(el, "change", () => {
  11697. el.value = el.value.trim();
  11698. });
  11699. }
  11700. if (!lazy) {
  11701. addEventListener(el, "compositionstart", onCompositionStart);
  11702. addEventListener(el, "compositionend", onCompositionEnd);
  11703. addEventListener(el, "change", onCompositionEnd);
  11704. }
  11705. },
  11706. // set value on mounted so it's after min/max for type="range"
  11707. mounted(el, { value }) {
  11708. el.value = value == null ? "" : value;
  11709. },
  11710. beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
  11711. el[assignKey] = getModelAssigner(vnode);
  11712. if (el.composing) return;
  11713. const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
  11714. const newValue = value == null ? "" : value;
  11715. if (elValue === newValue) {
  11716. return;
  11717. }
  11718. if (document.activeElement === el && el.type !== "range") {
  11719. if (lazy && value === oldValue) {
  11720. return;
  11721. }
  11722. if (trim && el.value.trim() === newValue) {
  11723. return;
  11724. }
  11725. }
  11726. el.value = newValue;
  11727. }
  11728. };
  11729. const vModelCheckbox = {
  11730. // #4096 array checkboxes need to be deep traversed
  11731. deep: true,
  11732. created(el, _, vnode) {
  11733. el[assignKey] = getModelAssigner(vnode);
  11734. addEventListener(el, "change", () => {
  11735. const modelValue = el._modelValue;
  11736. const elementValue = getValue(el);
  11737. const checked = el.checked;
  11738. const assign = el[assignKey];
  11739. if (isArray(modelValue)) {
  11740. const index = looseIndexOf(modelValue, elementValue);
  11741. const found = index !== -1;
  11742. if (checked && !found) {
  11743. assign(modelValue.concat(elementValue));
  11744. } else if (!checked && found) {
  11745. const filtered = [...modelValue];
  11746. filtered.splice(index, 1);
  11747. assign(filtered);
  11748. }
  11749. } else if (isSet(modelValue)) {
  11750. const cloned = new Set(modelValue);
  11751. if (checked) {
  11752. cloned.add(elementValue);
  11753. } else {
  11754. cloned.delete(elementValue);
  11755. }
  11756. assign(cloned);
  11757. } else {
  11758. assign(getCheckboxValue(el, checked));
  11759. }
  11760. });
  11761. },
  11762. // set initial checked on mount to wait for true-value/false-value
  11763. mounted: setChecked,
  11764. beforeUpdate(el, binding, vnode) {
  11765. el[assignKey] = getModelAssigner(vnode);
  11766. setChecked(el, binding, vnode);
  11767. }
  11768. };
  11769. function setChecked(el, { value, oldValue }, vnode) {
  11770. el._modelValue = value;
  11771. let checked;
  11772. if (isArray(value)) {
  11773. checked = looseIndexOf(value, vnode.props.value) > -1;
  11774. } else if (isSet(value)) {
  11775. checked = value.has(vnode.props.value);
  11776. } else {
  11777. if (value === oldValue) return;
  11778. checked = looseEqual(value, getCheckboxValue(el, true));
  11779. }
  11780. if (el.checked !== checked) {
  11781. el.checked = checked;
  11782. }
  11783. }
  11784. const vModelRadio = {
  11785. created(el, { value }, vnode) {
  11786. el.checked = looseEqual(value, vnode.props.value);
  11787. el[assignKey] = getModelAssigner(vnode);
  11788. addEventListener(el, "change", () => {
  11789. el[assignKey](getValue(el));
  11790. });
  11791. },
  11792. beforeUpdate(el, { value, oldValue }, vnode) {
  11793. el[assignKey] = getModelAssigner(vnode);
  11794. if (value !== oldValue) {
  11795. el.checked = looseEqual(value, vnode.props.value);
  11796. }
  11797. }
  11798. };
  11799. const vModelSelect = {
  11800. // <select multiple> value need to be deep traversed
  11801. deep: true,
  11802. created(el, { value, modifiers: { number } }, vnode) {
  11803. const isSetModel = isSet(value);
  11804. addEventListener(el, "change", () => {
  11805. const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
  11806. (o) => number ? looseToNumber(getValue(o)) : getValue(o)
  11807. );
  11808. el[assignKey](
  11809. el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
  11810. );
  11811. el._assigning = true;
  11812. nextTick(() => {
  11813. el._assigning = false;
  11814. });
  11815. });
  11816. el[assignKey] = getModelAssigner(vnode);
  11817. },
  11818. // set value in mounted & updated because <select> relies on its children
  11819. // <option>s.
  11820. mounted(el, { value }) {
  11821. setSelected(el, value);
  11822. },
  11823. beforeUpdate(el, _binding, vnode) {
  11824. el[assignKey] = getModelAssigner(vnode);
  11825. },
  11826. updated(el, { value }) {
  11827. if (!el._assigning) {
  11828. setSelected(el, value);
  11829. }
  11830. }
  11831. };
  11832. function setSelected(el, value) {
  11833. const isMultiple = el.multiple;
  11834. const isArrayValue = isArray(value);
  11835. if (isMultiple && !isArrayValue && !isSet(value)) {
  11836. warn(
  11837. `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.`
  11838. );
  11839. return;
  11840. }
  11841. for (let i = 0, l = el.options.length; i < l; i++) {
  11842. const option = el.options[i];
  11843. const optionValue = getValue(option);
  11844. if (isMultiple) {
  11845. if (isArrayValue) {
  11846. const optionType = typeof optionValue;
  11847. if (optionType === "string" || optionType === "number") {
  11848. option.selected = value.some((v) => String(v) === String(optionValue));
  11849. } else {
  11850. option.selected = looseIndexOf(value, optionValue) > -1;
  11851. }
  11852. } else {
  11853. option.selected = value.has(optionValue);
  11854. }
  11855. } else if (looseEqual(getValue(option), value)) {
  11856. if (el.selectedIndex !== i) el.selectedIndex = i;
  11857. return;
  11858. }
  11859. }
  11860. if (!isMultiple && el.selectedIndex !== -1) {
  11861. el.selectedIndex = -1;
  11862. }
  11863. }
  11864. function getValue(el) {
  11865. return "_value" in el ? el._value : el.value;
  11866. }
  11867. function getCheckboxValue(el, checked) {
  11868. const key = checked ? "_trueValue" : "_falseValue";
  11869. return key in el ? el[key] : checked;
  11870. }
  11871. const vModelDynamic = {
  11872. created(el, binding, vnode) {
  11873. callModelHook(el, binding, vnode, null, "created");
  11874. },
  11875. mounted(el, binding, vnode) {
  11876. callModelHook(el, binding, vnode, null, "mounted");
  11877. },
  11878. beforeUpdate(el, binding, vnode, prevVNode) {
  11879. callModelHook(el, binding, vnode, prevVNode, "beforeUpdate");
  11880. },
  11881. updated(el, binding, vnode, prevVNode) {
  11882. callModelHook(el, binding, vnode, prevVNode, "updated");
  11883. }
  11884. };
  11885. function resolveDynamicModel(tagName, type) {
  11886. switch (tagName) {
  11887. case "SELECT":
  11888. return vModelSelect;
  11889. case "TEXTAREA":
  11890. return vModelText;
  11891. default:
  11892. switch (type) {
  11893. case "checkbox":
  11894. return vModelCheckbox;
  11895. case "radio":
  11896. return vModelRadio;
  11897. default:
  11898. return vModelText;
  11899. }
  11900. }
  11901. }
  11902. function callModelHook(el, binding, vnode, prevVNode, hook) {
  11903. const modelToUse = resolveDynamicModel(
  11904. el.tagName,
  11905. vnode.props && vnode.props.type
  11906. );
  11907. const fn = modelToUse[hook];
  11908. fn && fn(el, binding, vnode, prevVNode);
  11909. }
  11910. const systemModifiers = ["ctrl", "shift", "alt", "meta"];
  11911. const modifierGuards = {
  11912. stop: (e) => e.stopPropagation(),
  11913. prevent: (e) => e.preventDefault(),
  11914. self: (e) => e.target !== e.currentTarget,
  11915. ctrl: (e) => !e.ctrlKey,
  11916. shift: (e) => !e.shiftKey,
  11917. alt: (e) => !e.altKey,
  11918. meta: (e) => !e.metaKey,
  11919. left: (e) => "button" in e && e.button !== 0,
  11920. middle: (e) => "button" in e && e.button !== 1,
  11921. right: (e) => "button" in e && e.button !== 2,
  11922. exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
  11923. };
  11924. const withModifiers = (fn, modifiers) => {
  11925. const cache = fn._withMods || (fn._withMods = {});
  11926. const cacheKey = modifiers.join(".");
  11927. return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
  11928. for (let i = 0; i < modifiers.length; i++) {
  11929. const guard = modifierGuards[modifiers[i]];
  11930. if (guard && guard(event, modifiers)) return;
  11931. }
  11932. return fn(event, ...args);
  11933. });
  11934. };
  11935. const keyNames = {
  11936. esc: "escape",
  11937. space: " ",
  11938. up: "arrow-up",
  11939. left: "arrow-left",
  11940. right: "arrow-right",
  11941. down: "arrow-down",
  11942. delete: "backspace"
  11943. };
  11944. const withKeys = (fn, modifiers) => {
  11945. const cache = fn._withKeys || (fn._withKeys = {});
  11946. const cacheKey = modifiers.join(".");
  11947. return cache[cacheKey] || (cache[cacheKey] = (event) => {
  11948. if (!("key" in event)) {
  11949. return;
  11950. }
  11951. const eventKey = hyphenate(event.key);
  11952. if (modifiers.some(
  11953. (k) => k === eventKey || keyNames[k] === eventKey
  11954. )) {
  11955. return fn(event);
  11956. }
  11957. });
  11958. };
  11959. const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
  11960. let renderer;
  11961. let enabledHydration = false;
  11962. function ensureRenderer() {
  11963. return renderer || (renderer = createRenderer(rendererOptions));
  11964. }
  11965. function ensureHydrationRenderer() {
  11966. renderer = enabledHydration ? renderer : createHydrationRenderer(rendererOptions);
  11967. enabledHydration = true;
  11968. return renderer;
  11969. }
  11970. const render = (...args) => {
  11971. ensureRenderer().render(...args);
  11972. };
  11973. const hydrate = (...args) => {
  11974. ensureHydrationRenderer().hydrate(...args);
  11975. };
  11976. const createApp = (...args) => {
  11977. const app = ensureRenderer().createApp(...args);
  11978. {
  11979. injectNativeTagCheck(app);
  11980. injectCompilerOptionsCheck(app);
  11981. }
  11982. const { mount } = app;
  11983. app.mount = (containerOrSelector) => {
  11984. const container = normalizeContainer(containerOrSelector);
  11985. if (!container) return;
  11986. const component = app._component;
  11987. if (!isFunction(component) && !component.render && !component.template) {
  11988. component.template = container.innerHTML;
  11989. }
  11990. if (container.nodeType === 1) {
  11991. container.textContent = "";
  11992. }
  11993. const proxy = mount(container, false, resolveRootNamespace(container));
  11994. if (container instanceof Element) {
  11995. container.removeAttribute("v-cloak");
  11996. container.setAttribute("data-v-app", "");
  11997. }
  11998. return proxy;
  11999. };
  12000. return app;
  12001. };
  12002. const createSSRApp = (...args) => {
  12003. const app = ensureHydrationRenderer().createApp(...args);
  12004. {
  12005. injectNativeTagCheck(app);
  12006. injectCompilerOptionsCheck(app);
  12007. }
  12008. const { mount } = app;
  12009. app.mount = (containerOrSelector) => {
  12010. const container = normalizeContainer(containerOrSelector);
  12011. if (container) {
  12012. return mount(container, true, resolveRootNamespace(container));
  12013. }
  12014. };
  12015. return app;
  12016. };
  12017. function resolveRootNamespace(container) {
  12018. if (container instanceof SVGElement) {
  12019. return "svg";
  12020. }
  12021. if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
  12022. return "mathml";
  12023. }
  12024. }
  12025. function injectNativeTagCheck(app) {
  12026. Object.defineProperty(app.config, "isNativeTag", {
  12027. value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
  12028. writable: false
  12029. });
  12030. }
  12031. function injectCompilerOptionsCheck(app) {
  12032. if (isRuntimeOnly()) {
  12033. const isCustomElement = app.config.isCustomElement;
  12034. Object.defineProperty(app.config, "isCustomElement", {
  12035. get() {
  12036. return isCustomElement;
  12037. },
  12038. set() {
  12039. warn(
  12040. `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.`
  12041. );
  12042. }
  12043. });
  12044. const compilerOptions = app.config.compilerOptions;
  12045. 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.
  12046. - For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.
  12047. - For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
  12048. - 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`;
  12049. Object.defineProperty(app.config, "compilerOptions", {
  12050. get() {
  12051. warn(msg);
  12052. return compilerOptions;
  12053. },
  12054. set() {
  12055. warn(msg);
  12056. }
  12057. });
  12058. }
  12059. }
  12060. function normalizeContainer(container) {
  12061. if (isString(container)) {
  12062. const res = document.querySelector(container);
  12063. if (!res) {
  12064. warn(
  12065. `Failed to mount app: mount target selector "${container}" returned null.`
  12066. );
  12067. }
  12068. return res;
  12069. }
  12070. if (window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") {
  12071. warn(
  12072. `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`
  12073. );
  12074. }
  12075. return container;
  12076. }
  12077. const initDirectivesForSSR = NOOP;
  12078. function initDev() {
  12079. {
  12080. {
  12081. console.info(
  12082. `You are running a development build of Vue.
  12083. Make sure to use the production build (*.prod.js) when deploying for production.`
  12084. );
  12085. }
  12086. initCustomFormatter();
  12087. }
  12088. }
  12089. {
  12090. initDev();
  12091. }
  12092. const compile = () => {
  12093. {
  12094. warn(
  12095. `Runtime compilation is not supported in this build of Vue.` + (` Use "vue.global.js" instead.` )
  12096. );
  12097. }
  12098. };
  12099. exports.BaseTransition = BaseTransition;
  12100. exports.BaseTransitionPropsValidators = BaseTransitionPropsValidators;
  12101. exports.Comment = Comment;
  12102. exports.DeprecationTypes = DeprecationTypes;
  12103. exports.EffectScope = EffectScope;
  12104. exports.ErrorCodes = ErrorCodes;
  12105. exports.ErrorTypeStrings = ErrorTypeStrings;
  12106. exports.Fragment = Fragment;
  12107. exports.KeepAlive = KeepAlive;
  12108. exports.ReactiveEffect = ReactiveEffect;
  12109. exports.Static = Static;
  12110. exports.Suspense = Suspense;
  12111. exports.Teleport = Teleport;
  12112. exports.Text = Text;
  12113. exports.TrackOpTypes = TrackOpTypes;
  12114. exports.Transition = Transition;
  12115. exports.TransitionGroup = TransitionGroup;
  12116. exports.TriggerOpTypes = TriggerOpTypes;
  12117. exports.VueElement = VueElement;
  12118. exports.assertNumber = assertNumber;
  12119. exports.callWithAsyncErrorHandling = callWithAsyncErrorHandling;
  12120. exports.callWithErrorHandling = callWithErrorHandling;
  12121. exports.camelize = camelize;
  12122. exports.capitalize = capitalize;
  12123. exports.cloneVNode = cloneVNode;
  12124. exports.compatUtils = compatUtils;
  12125. exports.compile = compile;
  12126. exports.computed = computed;
  12127. exports.createApp = createApp;
  12128. exports.createBlock = createBlock;
  12129. exports.createCommentVNode = createCommentVNode;
  12130. exports.createElementBlock = createElementBlock;
  12131. exports.createElementVNode = createBaseVNode;
  12132. exports.createHydrationRenderer = createHydrationRenderer;
  12133. exports.createPropsRestProxy = createPropsRestProxy;
  12134. exports.createRenderer = createRenderer;
  12135. exports.createSSRApp = createSSRApp;
  12136. exports.createSlots = createSlots;
  12137. exports.createStaticVNode = createStaticVNode;
  12138. exports.createTextVNode = createTextVNode;
  12139. exports.createVNode = createVNode;
  12140. exports.customRef = customRef;
  12141. exports.defineAsyncComponent = defineAsyncComponent;
  12142. exports.defineComponent = defineComponent;
  12143. exports.defineCustomElement = defineCustomElement;
  12144. exports.defineEmits = defineEmits;
  12145. exports.defineExpose = defineExpose;
  12146. exports.defineModel = defineModel;
  12147. exports.defineOptions = defineOptions;
  12148. exports.defineProps = defineProps;
  12149. exports.defineSSRCustomElement = defineSSRCustomElement;
  12150. exports.defineSlots = defineSlots;
  12151. exports.devtools = devtools;
  12152. exports.effect = effect;
  12153. exports.effectScope = effectScope;
  12154. exports.getCurrentInstance = getCurrentInstance;
  12155. exports.getCurrentScope = getCurrentScope;
  12156. exports.getCurrentWatcher = getCurrentWatcher;
  12157. exports.getTransitionRawChildren = getTransitionRawChildren;
  12158. exports.guardReactiveProps = guardReactiveProps;
  12159. exports.h = h;
  12160. exports.handleError = handleError;
  12161. exports.hasInjectionContext = hasInjectionContext;
  12162. exports.hydrate = hydrate;
  12163. exports.hydrateOnIdle = hydrateOnIdle;
  12164. exports.hydrateOnInteraction = hydrateOnInteraction;
  12165. exports.hydrateOnMediaQuery = hydrateOnMediaQuery;
  12166. exports.hydrateOnVisible = hydrateOnVisible;
  12167. exports.initCustomFormatter = initCustomFormatter;
  12168. exports.initDirectivesForSSR = initDirectivesForSSR;
  12169. exports.inject = inject;
  12170. exports.isMemoSame = isMemoSame;
  12171. exports.isProxy = isProxy;
  12172. exports.isReactive = isReactive;
  12173. exports.isReadonly = isReadonly;
  12174. exports.isRef = isRef;
  12175. exports.isRuntimeOnly = isRuntimeOnly;
  12176. exports.isShallow = isShallow;
  12177. exports.isVNode = isVNode;
  12178. exports.markRaw = markRaw;
  12179. exports.mergeDefaults = mergeDefaults;
  12180. exports.mergeModels = mergeModels;
  12181. exports.mergeProps = mergeProps;
  12182. exports.nextTick = nextTick;
  12183. exports.normalizeClass = normalizeClass;
  12184. exports.normalizeProps = normalizeProps;
  12185. exports.normalizeStyle = normalizeStyle;
  12186. exports.onActivated = onActivated;
  12187. exports.onBeforeMount = onBeforeMount;
  12188. exports.onBeforeUnmount = onBeforeUnmount;
  12189. exports.onBeforeUpdate = onBeforeUpdate;
  12190. exports.onDeactivated = onDeactivated;
  12191. exports.onErrorCaptured = onErrorCaptured;
  12192. exports.onMounted = onMounted;
  12193. exports.onRenderTracked = onRenderTracked;
  12194. exports.onRenderTriggered = onRenderTriggered;
  12195. exports.onScopeDispose = onScopeDispose;
  12196. exports.onServerPrefetch = onServerPrefetch;
  12197. exports.onUnmounted = onUnmounted;
  12198. exports.onUpdated = onUpdated;
  12199. exports.onWatcherCleanup = onWatcherCleanup;
  12200. exports.openBlock = openBlock;
  12201. exports.popScopeId = popScopeId;
  12202. exports.provide = provide;
  12203. exports.proxyRefs = proxyRefs;
  12204. exports.pushScopeId = pushScopeId;
  12205. exports.queuePostFlushCb = queuePostFlushCb;
  12206. exports.reactive = reactive;
  12207. exports.readonly = readonly;
  12208. exports.ref = ref;
  12209. exports.registerRuntimeCompiler = registerRuntimeCompiler;
  12210. exports.render = render;
  12211. exports.renderList = renderList;
  12212. exports.renderSlot = renderSlot;
  12213. exports.resolveComponent = resolveComponent;
  12214. exports.resolveDirective = resolveDirective;
  12215. exports.resolveDynamicComponent = resolveDynamicComponent;
  12216. exports.resolveFilter = resolveFilter;
  12217. exports.resolveTransitionHooks = resolveTransitionHooks;
  12218. exports.setBlockTracking = setBlockTracking;
  12219. exports.setDevtoolsHook = setDevtoolsHook;
  12220. exports.setTransitionHooks = setTransitionHooks;
  12221. exports.shallowReactive = shallowReactive;
  12222. exports.shallowReadonly = shallowReadonly;
  12223. exports.shallowRef = shallowRef;
  12224. exports.ssrContextKey = ssrContextKey;
  12225. exports.ssrUtils = ssrUtils;
  12226. exports.stop = stop;
  12227. exports.toDisplayString = toDisplayString;
  12228. exports.toHandlerKey = toHandlerKey;
  12229. exports.toHandlers = toHandlers;
  12230. exports.toRaw = toRaw;
  12231. exports.toRef = toRef;
  12232. exports.toRefs = toRefs;
  12233. exports.toValue = toValue;
  12234. exports.transformVNodeArgs = transformVNodeArgs;
  12235. exports.triggerRef = triggerRef;
  12236. exports.unref = unref;
  12237. exports.useAttrs = useAttrs;
  12238. exports.useCssModule = useCssModule;
  12239. exports.useCssVars = useCssVars;
  12240. exports.useHost = useHost;
  12241. exports.useId = useId;
  12242. exports.useModel = useModel;
  12243. exports.useSSRContext = useSSRContext;
  12244. exports.useShadowRoot = useShadowRoot;
  12245. exports.useSlots = useSlots;
  12246. exports.useTemplateRef = useTemplateRef;
  12247. exports.useTransitionState = useTransitionState;
  12248. exports.vModelCheckbox = vModelCheckbox;
  12249. exports.vModelDynamic = vModelDynamic;
  12250. exports.vModelRadio = vModelRadio;
  12251. exports.vModelSelect = vModelSelect;
  12252. exports.vModelText = vModelText;
  12253. exports.vShow = vShow;
  12254. exports.version = version;
  12255. exports.warn = warn;
  12256. exports.watch = watch;
  12257. exports.watchEffect = watchEffect;
  12258. exports.watchPostEffect = watchPostEffect;
  12259. exports.watchSyncEffect = watchSyncEffect;
  12260. exports.withAsyncContext = withAsyncContext;
  12261. exports.withCtx = withCtx;
  12262. exports.withDefaults = withDefaults;
  12263. exports.withDirectives = withDirectives;
  12264. exports.withKeys = withKeys;
  12265. exports.withMemo = withMemo;
  12266. exports.withModifiers = withModifiers;
  12267. exports.withScopeId = withScopeId;
  12268. return exports;
  12269. })({});