runtime-core.cjs.js 256 KB

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