runtime-core.cjs.prod.js 189 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571
  1. /**
  2. * @vue/runtime-core v3.5.4
  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. function pushWarningContext(vnode) {
  11. }
  12. function popWarningContext() {
  13. }
  14. function assertNumber(val, type) {
  15. return;
  16. }
  17. const ErrorCodes = {
  18. "SETUP_FUNCTION": 0,
  19. "0": "SETUP_FUNCTION",
  20. "RENDER_FUNCTION": 1,
  21. "1": "RENDER_FUNCTION",
  22. "NATIVE_EVENT_HANDLER": 5,
  23. "5": "NATIVE_EVENT_HANDLER",
  24. "COMPONENT_EVENT_HANDLER": 6,
  25. "6": "COMPONENT_EVENT_HANDLER",
  26. "VNODE_HOOK": 7,
  27. "7": "VNODE_HOOK",
  28. "DIRECTIVE_HOOK": 8,
  29. "8": "DIRECTIVE_HOOK",
  30. "TRANSITION_HOOK": 9,
  31. "9": "TRANSITION_HOOK",
  32. "APP_ERROR_HANDLER": 10,
  33. "10": "APP_ERROR_HANDLER",
  34. "APP_WARN_HANDLER": 11,
  35. "11": "APP_WARN_HANDLER",
  36. "FUNCTION_REF": 12,
  37. "12": "FUNCTION_REF",
  38. "ASYNC_COMPONENT_LOADER": 13,
  39. "13": "ASYNC_COMPONENT_LOADER",
  40. "SCHEDULER": 14,
  41. "14": "SCHEDULER",
  42. "COMPONENT_UPDATE": 15,
  43. "15": "COMPONENT_UPDATE",
  44. "APP_UNMOUNT_CLEANUP": 16,
  45. "16": "APP_UNMOUNT_CLEANUP"
  46. };
  47. const ErrorTypeStrings$1 = {
  48. ["sp"]: "serverPrefetch hook",
  49. ["bc"]: "beforeCreate hook",
  50. ["c"]: "created hook",
  51. ["bm"]: "beforeMount hook",
  52. ["m"]: "mounted hook",
  53. ["bu"]: "beforeUpdate hook",
  54. ["u"]: "updated",
  55. ["bum"]: "beforeUnmount hook",
  56. ["um"]: "unmounted hook",
  57. ["a"]: "activated hook",
  58. ["da"]: "deactivated hook",
  59. ["ec"]: "errorCaptured hook",
  60. ["rtc"]: "renderTracked hook",
  61. ["rtg"]: "renderTriggered hook",
  62. [0]: "setup function",
  63. [1]: "render function",
  64. [2]: "watcher getter",
  65. [3]: "watcher callback",
  66. [4]: "watcher cleanup function",
  67. [5]: "native event handler",
  68. [6]: "component event handler",
  69. [7]: "vnode hook",
  70. [8]: "directive hook",
  71. [9]: "transition hook",
  72. [10]: "app errorHandler",
  73. [11]: "app warnHandler",
  74. [12]: "ref function",
  75. [13]: "async component loader",
  76. [14]: "scheduler flush",
  77. [15]: "component update",
  78. [16]: "app unmount cleanup function"
  79. };
  80. function callWithErrorHandling(fn, instance, type, args) {
  81. try {
  82. return args ? fn(...args) : fn();
  83. } catch (err) {
  84. handleError(err, instance, type);
  85. }
  86. }
  87. function callWithAsyncErrorHandling(fn, instance, type, args) {
  88. if (shared.isFunction(fn)) {
  89. const res = callWithErrorHandling(fn, instance, type, args);
  90. if (res && shared.isPromise(res)) {
  91. res.catch((err) => {
  92. handleError(err, instance, type);
  93. });
  94. }
  95. return res;
  96. }
  97. if (shared.isArray(fn)) {
  98. const values = [];
  99. for (let i = 0; i < fn.length; i++) {
  100. values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
  101. }
  102. return values;
  103. }
  104. }
  105. function handleError(err, instance, type, throwInDev = true) {
  106. const contextVNode = instance ? instance.vnode : null;
  107. const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || shared.EMPTY_OBJ;
  108. if (instance) {
  109. let cur = instance.parent;
  110. const exposedInstance = instance.proxy;
  111. const errorInfo = `https://vuejs.org/error-reference/#runtime-${type}`;
  112. while (cur) {
  113. const errorCapturedHooks = cur.ec;
  114. if (errorCapturedHooks) {
  115. for (let i = 0; i < errorCapturedHooks.length; i++) {
  116. if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
  117. return;
  118. }
  119. }
  120. }
  121. cur = cur.parent;
  122. }
  123. if (errorHandler) {
  124. reactivity.pauseTracking();
  125. callWithErrorHandling(errorHandler, null, 10, [
  126. err,
  127. exposedInstance,
  128. errorInfo
  129. ]);
  130. reactivity.resetTracking();
  131. return;
  132. }
  133. }
  134. logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
  135. }
  136. function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {
  137. if (throwInProd) {
  138. throw err;
  139. } else {
  140. console.error(err);
  141. }
  142. }
  143. let isFlushing = false;
  144. let isFlushPending = false;
  145. const queue = [];
  146. let flushIndex = 0;
  147. const pendingPostFlushCbs = [];
  148. let activePostFlushCbs = null;
  149. let postFlushIndex = 0;
  150. const resolvedPromise = /* @__PURE__ */ Promise.resolve();
  151. let currentFlushPromise = null;
  152. function nextTick(fn) {
  153. const p = currentFlushPromise || resolvedPromise;
  154. return fn ? p.then(this ? fn.bind(this) : fn) : p;
  155. }
  156. function findInsertionIndex(id) {
  157. let start = isFlushing ? flushIndex + 1 : 0;
  158. let end = queue.length;
  159. while (start < end) {
  160. const middle = start + end >>> 1;
  161. const middleJob = queue[middle];
  162. const middleJobId = getId(middleJob);
  163. if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
  164. start = middle + 1;
  165. } else {
  166. end = middle;
  167. }
  168. }
  169. return start;
  170. }
  171. function queueJob(job) {
  172. if (!(job.flags & 1)) {
  173. const jobId = getId(job);
  174. const lastJob = queue[queue.length - 1];
  175. if (!lastJob || // fast path when the job id is larger than the tail
  176. !(job.flags & 2) && jobId >= getId(lastJob)) {
  177. queue.push(job);
  178. } else {
  179. queue.splice(findInsertionIndex(jobId), 0, job);
  180. }
  181. job.flags |= 1;
  182. queueFlush();
  183. }
  184. }
  185. function queueFlush() {
  186. if (!isFlushing && !isFlushPending) {
  187. isFlushPending = true;
  188. currentFlushPromise = resolvedPromise.then(flushJobs);
  189. }
  190. }
  191. function queuePostFlushCb(cb) {
  192. if (!shared.isArray(cb)) {
  193. if (activePostFlushCbs && cb.id === -1) {
  194. activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
  195. } else if (!(cb.flags & 1)) {
  196. pendingPostFlushCbs.push(cb);
  197. cb.flags |= 1;
  198. }
  199. } else {
  200. pendingPostFlushCbs.push(...cb);
  201. }
  202. queueFlush();
  203. }
  204. function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
  205. for (; i < queue.length; i++) {
  206. const cb = queue[i];
  207. if (cb && cb.flags & 2) {
  208. if (instance && cb.id !== instance.uid) {
  209. continue;
  210. }
  211. queue.splice(i, 1);
  212. i--;
  213. if (cb.flags & 4) {
  214. cb.flags &= ~1;
  215. }
  216. cb();
  217. cb.flags &= ~1;
  218. }
  219. }
  220. }
  221. function flushPostFlushCbs(seen) {
  222. if (pendingPostFlushCbs.length) {
  223. const deduped = [...new Set(pendingPostFlushCbs)].sort(
  224. (a, b) => getId(a) - getId(b)
  225. );
  226. pendingPostFlushCbs.length = 0;
  227. if (activePostFlushCbs) {
  228. activePostFlushCbs.push(...deduped);
  229. return;
  230. }
  231. activePostFlushCbs = deduped;
  232. for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
  233. const cb = activePostFlushCbs[postFlushIndex];
  234. if (cb.flags & 4) {
  235. cb.flags &= ~1;
  236. }
  237. if (!(cb.flags & 8)) cb();
  238. cb.flags &= ~1;
  239. }
  240. activePostFlushCbs = null;
  241. postFlushIndex = 0;
  242. }
  243. }
  244. const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
  245. function flushJobs(seen) {
  246. isFlushPending = false;
  247. isFlushing = true;
  248. try {
  249. for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
  250. const job = queue[flushIndex];
  251. if (job && !(job.flags & 8)) {
  252. if (false) ;
  253. if (job.flags & 4) {
  254. job.flags &= ~1;
  255. }
  256. callWithErrorHandling(
  257. job,
  258. job.i,
  259. job.i ? 15 : 14
  260. );
  261. job.flags &= ~1;
  262. }
  263. }
  264. } finally {
  265. for (; flushIndex < queue.length; flushIndex++) {
  266. const job = queue[flushIndex];
  267. if (job) {
  268. job.flags &= ~1;
  269. }
  270. }
  271. flushIndex = 0;
  272. queue.length = 0;
  273. flushPostFlushCbs();
  274. isFlushing = false;
  275. currentFlushPromise = null;
  276. if (queue.length || pendingPostFlushCbs.length) {
  277. flushJobs();
  278. }
  279. }
  280. }
  281. let currentRenderingInstance = null;
  282. let currentScopeId = null;
  283. function setCurrentRenderingInstance(instance) {
  284. const prev = currentRenderingInstance;
  285. currentRenderingInstance = instance;
  286. currentScopeId = instance && instance.type.__scopeId || null;
  287. return prev;
  288. }
  289. function pushScopeId(id) {
  290. currentScopeId = id;
  291. }
  292. function popScopeId() {
  293. currentScopeId = null;
  294. }
  295. const withScopeId = (_id) => withCtx;
  296. function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
  297. if (!ctx) return fn;
  298. if (fn._n) {
  299. return fn;
  300. }
  301. const renderFnWithContext = (...args) => {
  302. if (renderFnWithContext._d) {
  303. setBlockTracking(-1);
  304. }
  305. const prevInstance = setCurrentRenderingInstance(ctx);
  306. let res;
  307. try {
  308. res = fn(...args);
  309. } finally {
  310. setCurrentRenderingInstance(prevInstance);
  311. if (renderFnWithContext._d) {
  312. setBlockTracking(1);
  313. }
  314. }
  315. return res;
  316. };
  317. renderFnWithContext._n = true;
  318. renderFnWithContext._c = true;
  319. renderFnWithContext._d = true;
  320. return renderFnWithContext;
  321. }
  322. function withDirectives(vnode, directives) {
  323. if (currentRenderingInstance === null) {
  324. return vnode;
  325. }
  326. const instance = getComponentPublicInstance(currentRenderingInstance);
  327. const bindings = vnode.dirs || (vnode.dirs = []);
  328. for (let i = 0; i < directives.length; i++) {
  329. let [dir, value, arg, modifiers = shared.EMPTY_OBJ] = directives[i];
  330. if (dir) {
  331. if (shared.isFunction(dir)) {
  332. dir = {
  333. mounted: dir,
  334. updated: dir
  335. };
  336. }
  337. if (dir.deep) {
  338. reactivity.traverse(value);
  339. }
  340. bindings.push({
  341. dir,
  342. instance,
  343. value,
  344. oldValue: void 0,
  345. arg,
  346. modifiers
  347. });
  348. }
  349. }
  350. return vnode;
  351. }
  352. function invokeDirectiveHook(vnode, prevVNode, instance, name) {
  353. const bindings = vnode.dirs;
  354. const oldBindings = prevVNode && prevVNode.dirs;
  355. for (let i = 0; i < bindings.length; i++) {
  356. const binding = bindings[i];
  357. if (oldBindings) {
  358. binding.oldValue = oldBindings[i].value;
  359. }
  360. let hook = binding.dir[name];
  361. if (hook) {
  362. reactivity.pauseTracking();
  363. callWithAsyncErrorHandling(hook, instance, 8, [
  364. vnode.el,
  365. binding,
  366. vnode,
  367. prevVNode
  368. ]);
  369. reactivity.resetTracking();
  370. }
  371. }
  372. }
  373. const TeleportEndKey = Symbol("_vte");
  374. const isTeleport = (type) => type.__isTeleport;
  375. const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
  376. const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
  377. const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
  378. const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
  379. const resolveTarget = (props, select) => {
  380. const targetSelector = props && props.to;
  381. if (shared.isString(targetSelector)) {
  382. if (!select) {
  383. return null;
  384. } else {
  385. const target = select(targetSelector);
  386. return target;
  387. }
  388. } else {
  389. return targetSelector;
  390. }
  391. };
  392. const TeleportImpl = {
  393. name: "Teleport",
  394. __isTeleport: true,
  395. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
  396. const {
  397. mc: mountChildren,
  398. pc: patchChildren,
  399. pbc: patchBlockChildren,
  400. o: { insert, querySelector, createText, createComment }
  401. } = internals;
  402. const disabled = isTeleportDisabled(n2.props);
  403. let { shapeFlag, children, dynamicChildren } = n2;
  404. if (n1 == null) {
  405. const placeholder = n2.el = createText("");
  406. const mainAnchor = n2.anchor = createText("");
  407. insert(placeholder, container, anchor);
  408. insert(mainAnchor, container, anchor);
  409. const mount = (container2, anchor2) => {
  410. if (shapeFlag & 16) {
  411. mountChildren(
  412. children,
  413. container2,
  414. anchor2,
  415. parentComponent,
  416. parentSuspense,
  417. namespace,
  418. slotScopeIds,
  419. optimized
  420. );
  421. }
  422. };
  423. const mountToTarget = () => {
  424. const target = n2.target = resolveTarget(n2.props, querySelector);
  425. const targetAnchor = prepareAnchor(target, n2, createText, insert);
  426. if (target) {
  427. if (namespace !== "svg" && isTargetSVG(target)) {
  428. namespace = "svg";
  429. } else if (namespace !== "mathml" && isTargetMathML(target)) {
  430. namespace = "mathml";
  431. }
  432. if (!disabled) {
  433. mount(target, targetAnchor);
  434. updateCssVars(n2);
  435. }
  436. }
  437. };
  438. if (disabled) {
  439. mount(container, mainAnchor);
  440. updateCssVars(n2);
  441. }
  442. if (isTeleportDeferred(n2.props)) {
  443. queuePostRenderEffect(mountToTarget, parentSuspense);
  444. } else {
  445. mountToTarget();
  446. }
  447. } else {
  448. n2.el = n1.el;
  449. n2.targetStart = n1.targetStart;
  450. const mainAnchor = n2.anchor = n1.anchor;
  451. const target = n2.target = n1.target;
  452. const targetAnchor = n2.targetAnchor = n1.targetAnchor;
  453. const wasDisabled = isTeleportDisabled(n1.props);
  454. const currentContainer = wasDisabled ? container : target;
  455. const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
  456. if (namespace === "svg" || isTargetSVG(target)) {
  457. namespace = "svg";
  458. } else if (namespace === "mathml" || isTargetMathML(target)) {
  459. namespace = "mathml";
  460. }
  461. if (dynamicChildren) {
  462. patchBlockChildren(
  463. n1.dynamicChildren,
  464. dynamicChildren,
  465. currentContainer,
  466. parentComponent,
  467. parentSuspense,
  468. namespace,
  469. slotScopeIds
  470. );
  471. traverseStaticChildren(n1, n2, true);
  472. } else if (!optimized) {
  473. patchChildren(
  474. n1,
  475. n2,
  476. currentContainer,
  477. currentAnchor,
  478. parentComponent,
  479. parentSuspense,
  480. namespace,
  481. slotScopeIds,
  482. false
  483. );
  484. }
  485. if (disabled) {
  486. if (!wasDisabled) {
  487. moveTeleport(
  488. n2,
  489. container,
  490. mainAnchor,
  491. internals,
  492. 1
  493. );
  494. } else {
  495. if (n2.props && n1.props && n2.props.to !== n1.props.to) {
  496. n2.props.to = n1.props.to;
  497. }
  498. }
  499. } else {
  500. if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
  501. const nextTarget = n2.target = resolveTarget(
  502. n2.props,
  503. querySelector
  504. );
  505. if (nextTarget) {
  506. moveTeleport(
  507. n2,
  508. nextTarget,
  509. null,
  510. internals,
  511. 0
  512. );
  513. }
  514. } else if (wasDisabled) {
  515. moveTeleport(
  516. n2,
  517. target,
  518. targetAnchor,
  519. internals,
  520. 1
  521. );
  522. }
  523. }
  524. updateCssVars(n2);
  525. }
  526. },
  527. remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
  528. const {
  529. shapeFlag,
  530. children,
  531. anchor,
  532. targetStart,
  533. targetAnchor,
  534. target,
  535. props
  536. } = vnode;
  537. if (target) {
  538. hostRemove(targetStart);
  539. hostRemove(targetAnchor);
  540. }
  541. doRemove && hostRemove(anchor);
  542. if (shapeFlag & 16) {
  543. const shouldRemove = doRemove || !isTeleportDisabled(props);
  544. for (let i = 0; i < children.length; i++) {
  545. const child = children[i];
  546. unmount(
  547. child,
  548. parentComponent,
  549. parentSuspense,
  550. shouldRemove,
  551. !!child.dynamicChildren
  552. );
  553. }
  554. }
  555. },
  556. move: moveTeleport,
  557. hydrate: hydrateTeleport
  558. };
  559. function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
  560. if (moveType === 0) {
  561. insert(vnode.targetAnchor, container, parentAnchor);
  562. }
  563. const { el, anchor, shapeFlag, children, props } = vnode;
  564. const isReorder = moveType === 2;
  565. if (isReorder) {
  566. insert(el, container, parentAnchor);
  567. }
  568. if (!isReorder || isTeleportDisabled(props)) {
  569. if (shapeFlag & 16) {
  570. for (let i = 0; i < children.length; i++) {
  571. move(
  572. children[i],
  573. container,
  574. parentAnchor,
  575. 2
  576. );
  577. }
  578. }
  579. }
  580. if (isReorder) {
  581. insert(anchor, container, parentAnchor);
  582. }
  583. }
  584. function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
  585. o: { nextSibling, parentNode, querySelector, insert, createText }
  586. }, hydrateChildren) {
  587. const target = vnode.target = resolveTarget(
  588. vnode.props,
  589. querySelector
  590. );
  591. if (target) {
  592. const targetNode = target._lpa || target.firstChild;
  593. if (vnode.shapeFlag & 16) {
  594. if (isTeleportDisabled(vnode.props)) {
  595. vnode.anchor = hydrateChildren(
  596. nextSibling(node),
  597. vnode,
  598. parentNode(node),
  599. parentComponent,
  600. parentSuspense,
  601. slotScopeIds,
  602. optimized
  603. );
  604. vnode.targetStart = targetNode;
  605. vnode.targetAnchor = targetNode && nextSibling(targetNode);
  606. } else {
  607. vnode.anchor = nextSibling(node);
  608. let targetAnchor = targetNode;
  609. while (targetAnchor) {
  610. if (targetAnchor && targetAnchor.nodeType === 8) {
  611. if (targetAnchor.data === "teleport start anchor") {
  612. vnode.targetStart = targetAnchor;
  613. } else if (targetAnchor.data === "teleport anchor") {
  614. vnode.targetAnchor = targetAnchor;
  615. target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
  616. break;
  617. }
  618. }
  619. targetAnchor = nextSibling(targetAnchor);
  620. }
  621. if (!vnode.targetAnchor) {
  622. prepareAnchor(target, vnode, createText, insert);
  623. }
  624. hydrateChildren(
  625. targetNode && nextSibling(targetNode),
  626. vnode,
  627. target,
  628. parentComponent,
  629. parentSuspense,
  630. slotScopeIds,
  631. optimized
  632. );
  633. }
  634. }
  635. updateCssVars(vnode);
  636. }
  637. return vnode.anchor && nextSibling(vnode.anchor);
  638. }
  639. const Teleport = TeleportImpl;
  640. function updateCssVars(vnode) {
  641. const ctx = vnode.ctx;
  642. if (ctx && ctx.ut) {
  643. let node = vnode.targetStart;
  644. while (node && node !== vnode.targetAnchor) {
  645. if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
  646. node = node.nextSibling;
  647. }
  648. ctx.ut();
  649. }
  650. }
  651. function prepareAnchor(target, vnode, createText, insert) {
  652. const targetStart = vnode.targetStart = createText("");
  653. const targetAnchor = vnode.targetAnchor = createText("");
  654. targetStart[TeleportEndKey] = targetAnchor;
  655. if (target) {
  656. insert(targetStart, target);
  657. insert(targetAnchor, target);
  658. }
  659. return targetAnchor;
  660. }
  661. const leaveCbKey = Symbol("_leaveCb");
  662. const enterCbKey = Symbol("_enterCb");
  663. function useTransitionState() {
  664. const state = {
  665. isMounted: false,
  666. isLeaving: false,
  667. isUnmounting: false,
  668. leavingVNodes: /* @__PURE__ */ new Map()
  669. };
  670. onMounted(() => {
  671. state.isMounted = true;
  672. });
  673. onBeforeUnmount(() => {
  674. state.isUnmounting = true;
  675. });
  676. return state;
  677. }
  678. const TransitionHookValidator = [Function, Array];
  679. const BaseTransitionPropsValidators = {
  680. mode: String,
  681. appear: Boolean,
  682. persisted: Boolean,
  683. // enter
  684. onBeforeEnter: TransitionHookValidator,
  685. onEnter: TransitionHookValidator,
  686. onAfterEnter: TransitionHookValidator,
  687. onEnterCancelled: TransitionHookValidator,
  688. // leave
  689. onBeforeLeave: TransitionHookValidator,
  690. onLeave: TransitionHookValidator,
  691. onAfterLeave: TransitionHookValidator,
  692. onLeaveCancelled: TransitionHookValidator,
  693. // appear
  694. onBeforeAppear: TransitionHookValidator,
  695. onAppear: TransitionHookValidator,
  696. onAfterAppear: TransitionHookValidator,
  697. onAppearCancelled: TransitionHookValidator
  698. };
  699. const recursiveGetSubtree = (instance) => {
  700. const subTree = instance.subTree;
  701. return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
  702. };
  703. const BaseTransitionImpl = {
  704. name: `BaseTransition`,
  705. props: BaseTransitionPropsValidators,
  706. setup(props, { slots }) {
  707. const instance = getCurrentInstance();
  708. const state = useTransitionState();
  709. return () => {
  710. const children = slots.default && getTransitionRawChildren(slots.default(), true);
  711. if (!children || !children.length) {
  712. return;
  713. }
  714. const child = findNonCommentChild(children);
  715. const rawProps = reactivity.toRaw(props);
  716. const { mode } = rawProps;
  717. if (state.isLeaving) {
  718. return emptyPlaceholder(child);
  719. }
  720. const innerChild = getInnerChild$1(child);
  721. if (!innerChild) {
  722. return emptyPlaceholder(child);
  723. }
  724. let enterHooks = resolveTransitionHooks(
  725. innerChild,
  726. rawProps,
  727. state,
  728. instance,
  729. // #11061, ensure enterHooks is fresh after clone
  730. (hooks) => enterHooks = hooks
  731. );
  732. if (innerChild.type !== Comment) {
  733. setTransitionHooks(innerChild, enterHooks);
  734. }
  735. const oldChild = instance.subTree;
  736. const oldInnerChild = oldChild && getInnerChild$1(oldChild);
  737. if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
  738. const leavingHooks = resolveTransitionHooks(
  739. oldInnerChild,
  740. rawProps,
  741. state,
  742. instance
  743. );
  744. setTransitionHooks(oldInnerChild, leavingHooks);
  745. if (mode === "out-in" && innerChild.type !== Comment) {
  746. state.isLeaving = true;
  747. leavingHooks.afterLeave = () => {
  748. state.isLeaving = false;
  749. if (!(instance.job.flags & 8)) {
  750. instance.update();
  751. }
  752. delete leavingHooks.afterLeave;
  753. };
  754. return emptyPlaceholder(child);
  755. } else if (mode === "in-out" && innerChild.type !== Comment) {
  756. leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
  757. const leavingVNodesCache = getLeavingNodesForType(
  758. state,
  759. oldInnerChild
  760. );
  761. leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
  762. el[leaveCbKey] = () => {
  763. earlyRemove();
  764. el[leaveCbKey] = void 0;
  765. delete enterHooks.delayedLeave;
  766. };
  767. enterHooks.delayedLeave = delayedLeave;
  768. };
  769. }
  770. }
  771. return child;
  772. };
  773. }
  774. };
  775. function findNonCommentChild(children) {
  776. let child = children[0];
  777. if (children.length > 1) {
  778. for (const c of children) {
  779. if (c.type !== Comment) {
  780. child = c;
  781. break;
  782. }
  783. }
  784. }
  785. return child;
  786. }
  787. const BaseTransition = BaseTransitionImpl;
  788. function getLeavingNodesForType(state, vnode) {
  789. const { leavingVNodes } = state;
  790. let leavingVNodesCache = leavingVNodes.get(vnode.type);
  791. if (!leavingVNodesCache) {
  792. leavingVNodesCache = /* @__PURE__ */ Object.create(null);
  793. leavingVNodes.set(vnode.type, leavingVNodesCache);
  794. }
  795. return leavingVNodesCache;
  796. }
  797. function resolveTransitionHooks(vnode, props, state, instance, postClone) {
  798. const {
  799. appear,
  800. mode,
  801. persisted = false,
  802. onBeforeEnter,
  803. onEnter,
  804. onAfterEnter,
  805. onEnterCancelled,
  806. onBeforeLeave,
  807. onLeave,
  808. onAfterLeave,
  809. onLeaveCancelled,
  810. onBeforeAppear,
  811. onAppear,
  812. onAfterAppear,
  813. onAppearCancelled
  814. } = props;
  815. const key = String(vnode.key);
  816. const leavingVNodesCache = getLeavingNodesForType(state, vnode);
  817. const callHook = (hook, args) => {
  818. hook && callWithAsyncErrorHandling(
  819. hook,
  820. instance,
  821. 9,
  822. args
  823. );
  824. };
  825. const callAsyncHook = (hook, args) => {
  826. const done = args[1];
  827. callHook(hook, args);
  828. if (shared.isArray(hook)) {
  829. if (hook.every((hook2) => hook2.length <= 1)) done();
  830. } else if (hook.length <= 1) {
  831. done();
  832. }
  833. };
  834. const hooks = {
  835. mode,
  836. persisted,
  837. beforeEnter(el) {
  838. let hook = onBeforeEnter;
  839. if (!state.isMounted) {
  840. if (appear) {
  841. hook = onBeforeAppear || onBeforeEnter;
  842. } else {
  843. return;
  844. }
  845. }
  846. if (el[leaveCbKey]) {
  847. el[leaveCbKey](
  848. true
  849. /* cancelled */
  850. );
  851. }
  852. const leavingVNode = leavingVNodesCache[key];
  853. if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
  854. leavingVNode.el[leaveCbKey]();
  855. }
  856. callHook(hook, [el]);
  857. },
  858. enter(el) {
  859. let hook = onEnter;
  860. let afterHook = onAfterEnter;
  861. let cancelHook = onEnterCancelled;
  862. if (!state.isMounted) {
  863. if (appear) {
  864. hook = onAppear || onEnter;
  865. afterHook = onAfterAppear || onAfterEnter;
  866. cancelHook = onAppearCancelled || onEnterCancelled;
  867. } else {
  868. return;
  869. }
  870. }
  871. let called = false;
  872. const done = el[enterCbKey] = (cancelled) => {
  873. if (called) return;
  874. called = true;
  875. if (cancelled) {
  876. callHook(cancelHook, [el]);
  877. } else {
  878. callHook(afterHook, [el]);
  879. }
  880. if (hooks.delayedLeave) {
  881. hooks.delayedLeave();
  882. }
  883. el[enterCbKey] = void 0;
  884. };
  885. if (hook) {
  886. callAsyncHook(hook, [el, done]);
  887. } else {
  888. done();
  889. }
  890. },
  891. leave(el, remove) {
  892. const key2 = String(vnode.key);
  893. if (el[enterCbKey]) {
  894. el[enterCbKey](
  895. true
  896. /* cancelled */
  897. );
  898. }
  899. if (state.isUnmounting) {
  900. return remove();
  901. }
  902. callHook(onBeforeLeave, [el]);
  903. let called = false;
  904. const done = el[leaveCbKey] = (cancelled) => {
  905. if (called) return;
  906. called = true;
  907. remove();
  908. if (cancelled) {
  909. callHook(onLeaveCancelled, [el]);
  910. } else {
  911. callHook(onAfterLeave, [el]);
  912. }
  913. el[leaveCbKey] = void 0;
  914. if (leavingVNodesCache[key2] === vnode) {
  915. delete leavingVNodesCache[key2];
  916. }
  917. };
  918. leavingVNodesCache[key2] = vnode;
  919. if (onLeave) {
  920. callAsyncHook(onLeave, [el, done]);
  921. } else {
  922. done();
  923. }
  924. },
  925. clone(vnode2) {
  926. const hooks2 = resolveTransitionHooks(
  927. vnode2,
  928. props,
  929. state,
  930. instance,
  931. postClone
  932. );
  933. if (postClone) postClone(hooks2);
  934. return hooks2;
  935. }
  936. };
  937. return hooks;
  938. }
  939. function emptyPlaceholder(vnode) {
  940. if (isKeepAlive(vnode)) {
  941. vnode = cloneVNode(vnode);
  942. vnode.children = null;
  943. return vnode;
  944. }
  945. }
  946. function getInnerChild$1(vnode) {
  947. if (!isKeepAlive(vnode)) {
  948. if (isTeleport(vnode.type) && vnode.children) {
  949. return findNonCommentChild(vnode.children);
  950. }
  951. return vnode;
  952. }
  953. const { shapeFlag, children } = vnode;
  954. if (children) {
  955. if (shapeFlag & 16) {
  956. return children[0];
  957. }
  958. if (shapeFlag & 32 && shared.isFunction(children.default)) {
  959. return children.default();
  960. }
  961. }
  962. }
  963. function setTransitionHooks(vnode, hooks) {
  964. if (vnode.shapeFlag & 6 && vnode.component) {
  965. vnode.transition = hooks;
  966. setTransitionHooks(vnode.component.subTree, hooks);
  967. } else if (vnode.shapeFlag & 128) {
  968. vnode.ssContent.transition = hooks.clone(vnode.ssContent);
  969. vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
  970. } else {
  971. vnode.transition = hooks;
  972. }
  973. }
  974. function getTransitionRawChildren(children, keepComment = false, parentKey) {
  975. let ret = [];
  976. let keyedFragmentCount = 0;
  977. for (let i = 0; i < children.length; i++) {
  978. let child = children[i];
  979. const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);
  980. if (child.type === Fragment) {
  981. if (child.patchFlag & 128) keyedFragmentCount++;
  982. ret = ret.concat(
  983. getTransitionRawChildren(child.children, keepComment, key)
  984. );
  985. } else if (keepComment || child.type !== Comment) {
  986. ret.push(key != null ? cloneVNode(child, { key }) : child);
  987. }
  988. }
  989. if (keyedFragmentCount > 1) {
  990. for (let i = 0; i < ret.length; i++) {
  991. ret[i].patchFlag = -2;
  992. }
  993. }
  994. return ret;
  995. }
  996. /*! #__NO_SIDE_EFFECTS__ */
  997. // @__NO_SIDE_EFFECTS__
  998. function defineComponent(options, extraOptions) {
  999. return shared.isFunction(options) ? (
  1000. // #8236: extend call and options.name access are considered side-effects
  1001. // by Rollup, so we have to wrap it in a pure-annotated IIFE.
  1002. /* @__PURE__ */ (() => shared.extend({ name: options.name }, extraOptions, { setup: options }))()
  1003. ) : options;
  1004. }
  1005. function useId() {
  1006. const i = getCurrentInstance();
  1007. if (i) {
  1008. return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
  1009. }
  1010. }
  1011. function markAsyncBoundary(instance) {
  1012. instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
  1013. }
  1014. function useTemplateRef(key) {
  1015. const i = getCurrentInstance();
  1016. const r = reactivity.shallowRef(null);
  1017. if (i) {
  1018. const refs = i.refs === shared.EMPTY_OBJ ? i.refs = {} : i.refs;
  1019. {
  1020. Object.defineProperty(refs, key, {
  1021. enumerable: true,
  1022. get: () => r.value,
  1023. set: (val) => r.value = val
  1024. });
  1025. }
  1026. }
  1027. const ret = r;
  1028. return ret;
  1029. }
  1030. function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
  1031. if (shared.isArray(rawRef)) {
  1032. rawRef.forEach(
  1033. (r, i) => setRef(
  1034. r,
  1035. oldRawRef && (shared.isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
  1036. parentSuspense,
  1037. vnode,
  1038. isUnmount
  1039. )
  1040. );
  1041. return;
  1042. }
  1043. if (isAsyncWrapper(vnode) && !isUnmount) {
  1044. return;
  1045. }
  1046. const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
  1047. const value = isUnmount ? null : refValue;
  1048. const { i: owner, r: ref } = rawRef;
  1049. const oldRef = oldRawRef && oldRawRef.r;
  1050. const refs = owner.refs === shared.EMPTY_OBJ ? owner.refs = {} : owner.refs;
  1051. const setupState = owner.setupState;
  1052. const rawSetupState = reactivity.toRaw(setupState);
  1053. const canSetSetupRef = setupState === shared.EMPTY_OBJ ? () => false : (key) => {
  1054. return shared.hasOwn(rawSetupState, key);
  1055. };
  1056. if (oldRef != null && oldRef !== ref) {
  1057. if (shared.isString(oldRef)) {
  1058. refs[oldRef] = null;
  1059. if (canSetSetupRef(oldRef)) {
  1060. setupState[oldRef] = null;
  1061. }
  1062. } else if (reactivity.isRef(oldRef)) {
  1063. oldRef.value = null;
  1064. }
  1065. }
  1066. if (shared.isFunction(ref)) {
  1067. callWithErrorHandling(ref, owner, 12, [value, refs]);
  1068. } else {
  1069. const _isString = shared.isString(ref);
  1070. const _isRef = reactivity.isRef(ref);
  1071. if (_isString || _isRef) {
  1072. const doSet = () => {
  1073. if (rawRef.f) {
  1074. const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
  1075. if (isUnmount) {
  1076. shared.isArray(existing) && shared.remove(existing, refValue);
  1077. } else {
  1078. if (!shared.isArray(existing)) {
  1079. if (_isString) {
  1080. refs[ref] = [refValue];
  1081. if (canSetSetupRef(ref)) {
  1082. setupState[ref] = refs[ref];
  1083. }
  1084. } else {
  1085. ref.value = [refValue];
  1086. if (rawRef.k) refs[rawRef.k] = ref.value;
  1087. }
  1088. } else if (!existing.includes(refValue)) {
  1089. existing.push(refValue);
  1090. }
  1091. }
  1092. } else if (_isString) {
  1093. refs[ref] = value;
  1094. if (canSetSetupRef(ref)) {
  1095. setupState[ref] = value;
  1096. }
  1097. } else if (_isRef) {
  1098. ref.value = value;
  1099. if (rawRef.k) refs[rawRef.k] = value;
  1100. } else ;
  1101. };
  1102. if (value) {
  1103. doSet.id = -1;
  1104. queuePostRenderEffect(doSet, parentSuspense);
  1105. } else {
  1106. doSet();
  1107. }
  1108. }
  1109. }
  1110. }
  1111. let hasLoggedMismatchError = false;
  1112. const logMismatchError = () => {
  1113. if (hasLoggedMismatchError) {
  1114. return;
  1115. }
  1116. console.error("Hydration completed but contains mismatches.");
  1117. hasLoggedMismatchError = true;
  1118. };
  1119. const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
  1120. const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
  1121. const getContainerType = (container) => {
  1122. if (container.nodeType !== 1) return void 0;
  1123. if (isSVGContainer(container)) return "svg";
  1124. if (isMathMLContainer(container)) return "mathml";
  1125. return void 0;
  1126. };
  1127. const isComment = (node) => node.nodeType === 8;
  1128. function createHydrationFunctions(rendererInternals) {
  1129. const {
  1130. mt: mountComponent,
  1131. p: patch,
  1132. o: {
  1133. patchProp,
  1134. createText,
  1135. nextSibling,
  1136. parentNode,
  1137. remove,
  1138. insert,
  1139. createComment
  1140. }
  1141. } = rendererInternals;
  1142. const hydrate = (vnode, container) => {
  1143. if (!container.hasChildNodes()) {
  1144. patch(null, vnode, container);
  1145. flushPostFlushCbs();
  1146. container._vnode = vnode;
  1147. return;
  1148. }
  1149. hydrateNode(container.firstChild, vnode, null, null, null);
  1150. flushPostFlushCbs();
  1151. container._vnode = vnode;
  1152. };
  1153. const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
  1154. optimized = optimized || !!vnode.dynamicChildren;
  1155. const isFragmentStart = isComment(node) && node.data === "[";
  1156. const onMismatch = () => handleMismatch(
  1157. node,
  1158. vnode,
  1159. parentComponent,
  1160. parentSuspense,
  1161. slotScopeIds,
  1162. isFragmentStart
  1163. );
  1164. const { type, ref, shapeFlag, patchFlag } = vnode;
  1165. let domType = node.nodeType;
  1166. vnode.el = node;
  1167. if (patchFlag === -2) {
  1168. optimized = false;
  1169. vnode.dynamicChildren = null;
  1170. }
  1171. let nextNode = null;
  1172. switch (type) {
  1173. case Text:
  1174. if (domType !== 3) {
  1175. if (vnode.children === "") {
  1176. insert(vnode.el = createText(""), parentNode(node), node);
  1177. nextNode = node;
  1178. } else {
  1179. nextNode = onMismatch();
  1180. }
  1181. } else {
  1182. if (node.data !== vnode.children) {
  1183. logMismatchError();
  1184. node.data = vnode.children;
  1185. }
  1186. nextNode = nextSibling(node);
  1187. }
  1188. break;
  1189. case Comment:
  1190. if (isTemplateNode(node)) {
  1191. nextNode = nextSibling(node);
  1192. replaceNode(
  1193. vnode.el = node.content.firstChild,
  1194. node,
  1195. parentComponent
  1196. );
  1197. } else if (domType !== 8 || isFragmentStart) {
  1198. nextNode = onMismatch();
  1199. } else {
  1200. nextNode = nextSibling(node);
  1201. }
  1202. break;
  1203. case Static:
  1204. if (isFragmentStart) {
  1205. node = nextSibling(node);
  1206. domType = node.nodeType;
  1207. }
  1208. if (domType === 1 || domType === 3) {
  1209. nextNode = node;
  1210. const needToAdoptContent = !vnode.children.length;
  1211. for (let i = 0; i < vnode.staticCount; i++) {
  1212. if (needToAdoptContent)
  1213. vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data;
  1214. if (i === vnode.staticCount - 1) {
  1215. vnode.anchor = nextNode;
  1216. }
  1217. nextNode = nextSibling(nextNode);
  1218. }
  1219. return isFragmentStart ? nextSibling(nextNode) : nextNode;
  1220. } else {
  1221. onMismatch();
  1222. }
  1223. break;
  1224. case Fragment:
  1225. if (!isFragmentStart) {
  1226. nextNode = onMismatch();
  1227. } else {
  1228. nextNode = hydrateFragment(
  1229. node,
  1230. vnode,
  1231. parentComponent,
  1232. parentSuspense,
  1233. slotScopeIds,
  1234. optimized
  1235. );
  1236. }
  1237. break;
  1238. default:
  1239. if (shapeFlag & 1) {
  1240. if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
  1241. nextNode = onMismatch();
  1242. } else {
  1243. nextNode = hydrateElement(
  1244. node,
  1245. vnode,
  1246. parentComponent,
  1247. parentSuspense,
  1248. slotScopeIds,
  1249. optimized
  1250. );
  1251. }
  1252. } else if (shapeFlag & 6) {
  1253. vnode.slotScopeIds = slotScopeIds;
  1254. const container = parentNode(node);
  1255. if (isFragmentStart) {
  1256. nextNode = locateClosingAnchor(node);
  1257. } else if (isComment(node) && node.data === "teleport start") {
  1258. nextNode = locateClosingAnchor(node, node.data, "teleport end");
  1259. } else {
  1260. nextNode = nextSibling(node);
  1261. }
  1262. mountComponent(
  1263. vnode,
  1264. container,
  1265. null,
  1266. parentComponent,
  1267. parentSuspense,
  1268. getContainerType(container),
  1269. optimized
  1270. );
  1271. if (isAsyncWrapper(vnode)) {
  1272. let subTree;
  1273. if (isFragmentStart) {
  1274. subTree = createVNode(Fragment);
  1275. subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
  1276. } else {
  1277. subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
  1278. }
  1279. subTree.el = node;
  1280. vnode.component.subTree = subTree;
  1281. }
  1282. } else if (shapeFlag & 64) {
  1283. if (domType !== 8) {
  1284. nextNode = onMismatch();
  1285. } else {
  1286. nextNode = vnode.type.hydrate(
  1287. node,
  1288. vnode,
  1289. parentComponent,
  1290. parentSuspense,
  1291. slotScopeIds,
  1292. optimized,
  1293. rendererInternals,
  1294. hydrateChildren
  1295. );
  1296. }
  1297. } else if (shapeFlag & 128) {
  1298. nextNode = vnode.type.hydrate(
  1299. node,
  1300. vnode,
  1301. parentComponent,
  1302. parentSuspense,
  1303. getContainerType(parentNode(node)),
  1304. slotScopeIds,
  1305. optimized,
  1306. rendererInternals,
  1307. hydrateNode
  1308. );
  1309. } else ;
  1310. }
  1311. if (ref != null) {
  1312. setRef(ref, null, parentSuspense, vnode);
  1313. }
  1314. return nextNode;
  1315. };
  1316. const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  1317. optimized = optimized || !!vnode.dynamicChildren;
  1318. const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
  1319. const forcePatch = type === "input" || type === "option";
  1320. if (forcePatch || patchFlag !== -1) {
  1321. if (dirs) {
  1322. invokeDirectiveHook(vnode, null, parentComponent, "created");
  1323. }
  1324. let needCallTransitionHooks = false;
  1325. if (isTemplateNode(el)) {
  1326. needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
  1327. const content = el.content.firstChild;
  1328. if (needCallTransitionHooks) {
  1329. transition.beforeEnter(content);
  1330. }
  1331. replaceNode(content, el, parentComponent);
  1332. vnode.el = el = content;
  1333. }
  1334. if (shapeFlag & 16 && // skip if element has innerHTML / textContent
  1335. !(props && (props.innerHTML || props.textContent))) {
  1336. let next = hydrateChildren(
  1337. el.firstChild,
  1338. vnode,
  1339. el,
  1340. parentComponent,
  1341. parentSuspense,
  1342. slotScopeIds,
  1343. optimized
  1344. );
  1345. while (next) {
  1346. if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
  1347. logMismatchError();
  1348. }
  1349. const cur = next;
  1350. next = next.nextSibling;
  1351. remove(cur);
  1352. }
  1353. } else if (shapeFlag & 8) {
  1354. if (el.textContent !== vnode.children) {
  1355. if (!isMismatchAllowed(el, 0 /* TEXT */)) {
  1356. logMismatchError();
  1357. }
  1358. el.textContent = vnode.children;
  1359. }
  1360. }
  1361. if (props) {
  1362. if (forcePatch || !optimized || patchFlag & (16 | 32)) {
  1363. const isCustomElement = el.tagName.includes("-");
  1364. for (const key in props) {
  1365. if (forcePatch && (key.endsWith("value") || key === "indeterminate") || shared.isOn(key) && !shared.isReservedProp(key) || // force hydrate v-bind with .prop modifiers
  1366. key[0] === "." || isCustomElement) {
  1367. patchProp(el, key, null, props[key], void 0, parentComponent);
  1368. }
  1369. }
  1370. } else if (props.onClick) {
  1371. patchProp(
  1372. el,
  1373. "onClick",
  1374. null,
  1375. props.onClick,
  1376. void 0,
  1377. parentComponent
  1378. );
  1379. } else if (patchFlag & 4 && reactivity.isReactive(props.style)) {
  1380. for (const key in props.style) props.style[key];
  1381. }
  1382. }
  1383. let vnodeHooks;
  1384. if (vnodeHooks = props && props.onVnodeBeforeMount) {
  1385. invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  1386. }
  1387. if (dirs) {
  1388. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  1389. }
  1390. if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
  1391. queueEffectWithSuspense(() => {
  1392. vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  1393. needCallTransitionHooks && transition.enter(el);
  1394. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  1395. }, parentSuspense);
  1396. }
  1397. }
  1398. return el.nextSibling;
  1399. };
  1400. const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  1401. optimized = optimized || !!parentVNode.dynamicChildren;
  1402. const children = parentVNode.children;
  1403. const l = children.length;
  1404. for (let i = 0; i < l; i++) {
  1405. const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
  1406. const isText = vnode.type === Text;
  1407. if (node) {
  1408. if (isText && !optimized) {
  1409. if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
  1410. insert(
  1411. createText(
  1412. node.data.slice(vnode.children.length)
  1413. ),
  1414. container,
  1415. nextSibling(node)
  1416. );
  1417. node.data = vnode.children;
  1418. }
  1419. }
  1420. node = hydrateNode(
  1421. node,
  1422. vnode,
  1423. parentComponent,
  1424. parentSuspense,
  1425. slotScopeIds,
  1426. optimized
  1427. );
  1428. } else if (isText && !vnode.children) {
  1429. insert(vnode.el = createText(""), container);
  1430. } else {
  1431. if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
  1432. logMismatchError();
  1433. }
  1434. patch(
  1435. null,
  1436. vnode,
  1437. container,
  1438. null,
  1439. parentComponent,
  1440. parentSuspense,
  1441. getContainerType(container),
  1442. slotScopeIds
  1443. );
  1444. }
  1445. }
  1446. return node;
  1447. };
  1448. const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  1449. const { slotScopeIds: fragmentSlotScopeIds } = vnode;
  1450. if (fragmentSlotScopeIds) {
  1451. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  1452. }
  1453. const container = parentNode(node);
  1454. const next = hydrateChildren(
  1455. nextSibling(node),
  1456. vnode,
  1457. container,
  1458. parentComponent,
  1459. parentSuspense,
  1460. slotScopeIds,
  1461. optimized
  1462. );
  1463. if (next && isComment(next) && next.data === "]") {
  1464. return nextSibling(vnode.anchor = next);
  1465. } else {
  1466. logMismatchError();
  1467. insert(vnode.anchor = createComment(`]`), container, next);
  1468. return next;
  1469. }
  1470. };
  1471. const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
  1472. if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) {
  1473. logMismatchError();
  1474. }
  1475. vnode.el = null;
  1476. if (isFragment) {
  1477. const end = locateClosingAnchor(node);
  1478. while (true) {
  1479. const next2 = nextSibling(node);
  1480. if (next2 && next2 !== end) {
  1481. remove(next2);
  1482. } else {
  1483. break;
  1484. }
  1485. }
  1486. }
  1487. const next = nextSibling(node);
  1488. const container = parentNode(node);
  1489. remove(node);
  1490. patch(
  1491. null,
  1492. vnode,
  1493. container,
  1494. next,
  1495. parentComponent,
  1496. parentSuspense,
  1497. getContainerType(container),
  1498. slotScopeIds
  1499. );
  1500. return next;
  1501. };
  1502. const locateClosingAnchor = (node, open = "[", close = "]") => {
  1503. let match = 0;
  1504. while (node) {
  1505. node = nextSibling(node);
  1506. if (node && isComment(node)) {
  1507. if (node.data === open) match++;
  1508. if (node.data === close) {
  1509. if (match === 0) {
  1510. return nextSibling(node);
  1511. } else {
  1512. match--;
  1513. }
  1514. }
  1515. }
  1516. }
  1517. return node;
  1518. };
  1519. const replaceNode = (newNode, oldNode, parentComponent) => {
  1520. const parentNode2 = oldNode.parentNode;
  1521. if (parentNode2) {
  1522. parentNode2.replaceChild(newNode, oldNode);
  1523. }
  1524. let parent = parentComponent;
  1525. while (parent) {
  1526. if (parent.vnode.el === oldNode) {
  1527. parent.vnode.el = parent.subTree.el = newNode;
  1528. }
  1529. parent = parent.parent;
  1530. }
  1531. };
  1532. const isTemplateNode = (node) => {
  1533. return node.nodeType === 1 && node.tagName.toLowerCase() === "template";
  1534. };
  1535. return [hydrate, hydrateNode];
  1536. }
  1537. const allowMismatchAttr = "data-allow-mismatch";
  1538. const MismatchTypeString = {
  1539. [0 /* TEXT */]: "text",
  1540. [1 /* CHILDREN */]: "children",
  1541. [2 /* CLASS */]: "class",
  1542. [3 /* STYLE */]: "style",
  1543. [4 /* ATTRIBUTE */]: "attribute"
  1544. };
  1545. function isMismatchAllowed(el, allowedType) {
  1546. if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) {
  1547. while (el && !el.hasAttribute(allowMismatchAttr)) {
  1548. el = el.parentElement;
  1549. }
  1550. }
  1551. const allowedAttr = el && el.getAttribute(allowMismatchAttr);
  1552. if (allowedAttr == null) {
  1553. return false;
  1554. } else if (allowedAttr === "") {
  1555. return true;
  1556. } else {
  1557. const list = allowedAttr.split(",");
  1558. if (allowedType === 0 /* TEXT */ && list.includes("children")) {
  1559. return true;
  1560. }
  1561. return allowedAttr.split(",").includes(MismatchTypeString[allowedType]);
  1562. }
  1563. }
  1564. const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
  1565. const id = requestIdleCallback(hydrate, { timeout });
  1566. return () => cancelIdleCallback(id);
  1567. };
  1568. const hydrateOnVisible = (opts) => (hydrate, forEach) => {
  1569. const ob = new IntersectionObserver((entries) => {
  1570. for (const e of entries) {
  1571. if (!e.isIntersecting) continue;
  1572. ob.disconnect();
  1573. hydrate();
  1574. break;
  1575. }
  1576. }, opts);
  1577. forEach((el) => ob.observe(el));
  1578. return () => ob.disconnect();
  1579. };
  1580. const hydrateOnMediaQuery = (query) => (hydrate) => {
  1581. if (query) {
  1582. const mql = matchMedia(query);
  1583. if (mql.matches) {
  1584. hydrate();
  1585. } else {
  1586. mql.addEventListener("change", hydrate, { once: true });
  1587. return () => mql.removeEventListener("change", hydrate);
  1588. }
  1589. }
  1590. };
  1591. const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
  1592. if (shared.isString(interactions)) interactions = [interactions];
  1593. let hasHydrated = false;
  1594. const doHydrate = (e) => {
  1595. if (!hasHydrated) {
  1596. hasHydrated = true;
  1597. teardown();
  1598. hydrate();
  1599. e.target.dispatchEvent(new e.constructor(e.type, e));
  1600. }
  1601. };
  1602. const teardown = () => {
  1603. forEach((el) => {
  1604. for (const i of interactions) {
  1605. el.removeEventListener(i, doHydrate);
  1606. }
  1607. });
  1608. };
  1609. forEach((el) => {
  1610. for (const i of interactions) {
  1611. el.addEventListener(i, doHydrate, { once: true });
  1612. }
  1613. });
  1614. return teardown;
  1615. };
  1616. function forEachElement(node, cb) {
  1617. if (isComment(node) && node.data === "[") {
  1618. let depth = 1;
  1619. let next = node.nextSibling;
  1620. while (next) {
  1621. if (next.nodeType === 1) {
  1622. cb(next);
  1623. } else if (isComment(next)) {
  1624. if (next.data === "]") {
  1625. if (--depth === 0) break;
  1626. } else if (next.data === "[") {
  1627. depth++;
  1628. }
  1629. }
  1630. next = next.nextSibling;
  1631. }
  1632. } else {
  1633. cb(node);
  1634. }
  1635. }
  1636. const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
  1637. /*! #__NO_SIDE_EFFECTS__ */
  1638. // @__NO_SIDE_EFFECTS__
  1639. function defineAsyncComponent(source) {
  1640. if (shared.isFunction(source)) {
  1641. source = { loader: source };
  1642. }
  1643. const {
  1644. loader,
  1645. loadingComponent,
  1646. errorComponent,
  1647. delay = 200,
  1648. hydrate: hydrateStrategy,
  1649. timeout,
  1650. // undefined = never times out
  1651. suspensible = true,
  1652. onError: userOnError
  1653. } = source;
  1654. let pendingRequest = null;
  1655. let resolvedComp;
  1656. let retries = 0;
  1657. const retry = () => {
  1658. retries++;
  1659. pendingRequest = null;
  1660. return load();
  1661. };
  1662. const load = () => {
  1663. let thisRequest;
  1664. return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
  1665. err = err instanceof Error ? err : new Error(String(err));
  1666. if (userOnError) {
  1667. return new Promise((resolve, reject) => {
  1668. const userRetry = () => resolve(retry());
  1669. const userFail = () => reject(err);
  1670. userOnError(err, userRetry, userFail, retries + 1);
  1671. });
  1672. } else {
  1673. throw err;
  1674. }
  1675. }).then((comp) => {
  1676. if (thisRequest !== pendingRequest && pendingRequest) {
  1677. return pendingRequest;
  1678. }
  1679. if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
  1680. comp = comp.default;
  1681. }
  1682. resolvedComp = comp;
  1683. return comp;
  1684. }));
  1685. };
  1686. return defineComponent({
  1687. name: "AsyncComponentWrapper",
  1688. __asyncLoader: load,
  1689. __asyncHydrate(el, instance, hydrate) {
  1690. const doHydrate = hydrateStrategy ? () => {
  1691. const teardown = hydrateStrategy(
  1692. hydrate,
  1693. (cb) => forEachElement(el, cb)
  1694. );
  1695. if (teardown) {
  1696. (instance.bum || (instance.bum = [])).push(teardown);
  1697. }
  1698. } : hydrate;
  1699. if (resolvedComp) {
  1700. doHydrate();
  1701. } else {
  1702. load().then(() => !instance.isUnmounted && doHydrate());
  1703. }
  1704. },
  1705. get __asyncResolved() {
  1706. return resolvedComp;
  1707. },
  1708. setup() {
  1709. const instance = currentInstance;
  1710. markAsyncBoundary(instance);
  1711. if (resolvedComp) {
  1712. return () => createInnerComp(resolvedComp, instance);
  1713. }
  1714. const onError = (err) => {
  1715. pendingRequest = null;
  1716. handleError(
  1717. err,
  1718. instance,
  1719. 13,
  1720. !errorComponent
  1721. );
  1722. };
  1723. if (suspensible && instance.suspense || isInSSRComponentSetup) {
  1724. return load().then((comp) => {
  1725. return () => createInnerComp(comp, instance);
  1726. }).catch((err) => {
  1727. onError(err);
  1728. return () => errorComponent ? createVNode(errorComponent, {
  1729. error: err
  1730. }) : null;
  1731. });
  1732. }
  1733. const loaded = reactivity.ref(false);
  1734. const error = reactivity.ref();
  1735. const delayed = reactivity.ref(!!delay);
  1736. if (delay) {
  1737. setTimeout(() => {
  1738. delayed.value = false;
  1739. }, delay);
  1740. }
  1741. if (timeout != null) {
  1742. setTimeout(() => {
  1743. if (!loaded.value && !error.value) {
  1744. const err = new Error(
  1745. `Async component timed out after ${timeout}ms.`
  1746. );
  1747. onError(err);
  1748. error.value = err;
  1749. }
  1750. }, timeout);
  1751. }
  1752. load().then(() => {
  1753. loaded.value = true;
  1754. if (instance.parent && isKeepAlive(instance.parent.vnode)) {
  1755. queueJob(instance.parent.update);
  1756. }
  1757. }).catch((err) => {
  1758. onError(err);
  1759. error.value = err;
  1760. });
  1761. return () => {
  1762. if (loaded.value && resolvedComp) {
  1763. return createInnerComp(resolvedComp, instance);
  1764. } else if (error.value && errorComponent) {
  1765. return createVNode(errorComponent, {
  1766. error: error.value
  1767. });
  1768. } else if (loadingComponent && !delayed.value) {
  1769. return createVNode(loadingComponent);
  1770. }
  1771. };
  1772. }
  1773. });
  1774. }
  1775. function createInnerComp(comp, parent) {
  1776. const { ref: ref2, props, children, ce } = parent.vnode;
  1777. const vnode = createVNode(comp, props, children);
  1778. vnode.ref = ref2;
  1779. vnode.ce = ce;
  1780. delete parent.vnode.ce;
  1781. return vnode;
  1782. }
  1783. const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
  1784. const KeepAliveImpl = {
  1785. name: `KeepAlive`,
  1786. // Marker for special handling inside the renderer. We are not using a ===
  1787. // check directly on KeepAlive in the renderer, because importing it directly
  1788. // would prevent it from being tree-shaken.
  1789. __isKeepAlive: true,
  1790. props: {
  1791. include: [String, RegExp, Array],
  1792. exclude: [String, RegExp, Array],
  1793. max: [String, Number]
  1794. },
  1795. setup(props, { slots }) {
  1796. const instance = getCurrentInstance();
  1797. const sharedContext = instance.ctx;
  1798. if (!sharedContext.renderer) {
  1799. return () => {
  1800. const children = slots.default && slots.default();
  1801. return children && children.length === 1 ? children[0] : children;
  1802. };
  1803. }
  1804. const cache = /* @__PURE__ */ new Map();
  1805. const keys = /* @__PURE__ */ new Set();
  1806. let current = null;
  1807. const parentSuspense = instance.suspense;
  1808. const {
  1809. renderer: {
  1810. p: patch,
  1811. m: move,
  1812. um: _unmount,
  1813. o: { createElement }
  1814. }
  1815. } = sharedContext;
  1816. const storageContainer = createElement("div");
  1817. sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
  1818. const instance2 = vnode.component;
  1819. move(vnode, container, anchor, 0, parentSuspense);
  1820. patch(
  1821. instance2.vnode,
  1822. vnode,
  1823. container,
  1824. anchor,
  1825. instance2,
  1826. parentSuspense,
  1827. namespace,
  1828. vnode.slotScopeIds,
  1829. optimized
  1830. );
  1831. queuePostRenderEffect(() => {
  1832. instance2.isDeactivated = false;
  1833. if (instance2.a) {
  1834. shared.invokeArrayFns(instance2.a);
  1835. }
  1836. const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
  1837. if (vnodeHook) {
  1838. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  1839. }
  1840. }, parentSuspense);
  1841. };
  1842. sharedContext.deactivate = (vnode) => {
  1843. const instance2 = vnode.component;
  1844. invalidateMount(instance2.m);
  1845. invalidateMount(instance2.a);
  1846. move(vnode, storageContainer, null, 1, parentSuspense);
  1847. queuePostRenderEffect(() => {
  1848. if (instance2.da) {
  1849. shared.invokeArrayFns(instance2.da);
  1850. }
  1851. const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
  1852. if (vnodeHook) {
  1853. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  1854. }
  1855. instance2.isDeactivated = true;
  1856. }, parentSuspense);
  1857. };
  1858. function unmount(vnode) {
  1859. resetShapeFlag(vnode);
  1860. _unmount(vnode, instance, parentSuspense, true);
  1861. }
  1862. function pruneCache(filter) {
  1863. cache.forEach((vnode, key) => {
  1864. const name = getComponentName(vnode.type);
  1865. if (name && !filter(name)) {
  1866. pruneCacheEntry(key);
  1867. }
  1868. });
  1869. }
  1870. function pruneCacheEntry(key) {
  1871. const cached = cache.get(key);
  1872. if (cached && (!current || !isSameVNodeType(cached, current))) {
  1873. unmount(cached);
  1874. } else if (current) {
  1875. resetShapeFlag(current);
  1876. }
  1877. cache.delete(key);
  1878. keys.delete(key);
  1879. }
  1880. watch(
  1881. () => [props.include, props.exclude],
  1882. ([include, exclude]) => {
  1883. include && pruneCache((name) => matches(include, name));
  1884. exclude && pruneCache((name) => !matches(exclude, name));
  1885. },
  1886. // prune post-render after `current` has been updated
  1887. { flush: "post", deep: true }
  1888. );
  1889. let pendingCacheKey = null;
  1890. const cacheSubtree = () => {
  1891. if (pendingCacheKey != null) {
  1892. if (isSuspense(instance.subTree.type)) {
  1893. queuePostRenderEffect(() => {
  1894. cache.set(pendingCacheKey, getInnerChild(instance.subTree));
  1895. }, instance.subTree.suspense);
  1896. } else {
  1897. cache.set(pendingCacheKey, getInnerChild(instance.subTree));
  1898. }
  1899. }
  1900. };
  1901. onMounted(cacheSubtree);
  1902. onUpdated(cacheSubtree);
  1903. onBeforeUnmount(() => {
  1904. cache.forEach((cached) => {
  1905. const { subTree, suspense } = instance;
  1906. const vnode = getInnerChild(subTree);
  1907. if (cached.type === vnode.type && cached.key === vnode.key) {
  1908. resetShapeFlag(vnode);
  1909. const da = vnode.component.da;
  1910. da && queuePostRenderEffect(da, suspense);
  1911. return;
  1912. }
  1913. unmount(cached);
  1914. });
  1915. });
  1916. return () => {
  1917. pendingCacheKey = null;
  1918. if (!slots.default) {
  1919. return current = null;
  1920. }
  1921. const children = slots.default();
  1922. const rawVNode = children[0];
  1923. if (children.length > 1) {
  1924. current = null;
  1925. return children;
  1926. } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
  1927. current = null;
  1928. return rawVNode;
  1929. }
  1930. let vnode = getInnerChild(rawVNode);
  1931. if (vnode.type === Comment) {
  1932. current = null;
  1933. return vnode;
  1934. }
  1935. const comp = vnode.type;
  1936. const name = getComponentName(
  1937. isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
  1938. );
  1939. const { include, exclude, max } = props;
  1940. if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
  1941. vnode.shapeFlag &= ~256;
  1942. current = vnode;
  1943. return rawVNode;
  1944. }
  1945. const key = vnode.key == null ? comp : vnode.key;
  1946. const cachedVNode = cache.get(key);
  1947. if (vnode.el) {
  1948. vnode = cloneVNode(vnode);
  1949. if (rawVNode.shapeFlag & 128) {
  1950. rawVNode.ssContent = vnode;
  1951. }
  1952. }
  1953. pendingCacheKey = key;
  1954. if (cachedVNode) {
  1955. vnode.el = cachedVNode.el;
  1956. vnode.component = cachedVNode.component;
  1957. if (vnode.transition) {
  1958. setTransitionHooks(vnode, vnode.transition);
  1959. }
  1960. vnode.shapeFlag |= 512;
  1961. keys.delete(key);
  1962. keys.add(key);
  1963. } else {
  1964. keys.add(key);
  1965. if (max && keys.size > parseInt(max, 10)) {
  1966. pruneCacheEntry(keys.values().next().value);
  1967. }
  1968. }
  1969. vnode.shapeFlag |= 256;
  1970. current = vnode;
  1971. return isSuspense(rawVNode.type) ? rawVNode : vnode;
  1972. };
  1973. }
  1974. };
  1975. const KeepAlive = KeepAliveImpl;
  1976. function matches(pattern, name) {
  1977. if (shared.isArray(pattern)) {
  1978. return pattern.some((p) => matches(p, name));
  1979. } else if (shared.isString(pattern)) {
  1980. return pattern.split(",").includes(name);
  1981. } else if (shared.isRegExp(pattern)) {
  1982. pattern.lastIndex = 0;
  1983. return pattern.test(name);
  1984. }
  1985. return false;
  1986. }
  1987. function onActivated(hook, target) {
  1988. registerKeepAliveHook(hook, "a", target);
  1989. }
  1990. function onDeactivated(hook, target) {
  1991. registerKeepAliveHook(hook, "da", target);
  1992. }
  1993. function registerKeepAliveHook(hook, type, target = currentInstance) {
  1994. const wrappedHook = hook.__wdc || (hook.__wdc = () => {
  1995. let current = target;
  1996. while (current) {
  1997. if (current.isDeactivated) {
  1998. return;
  1999. }
  2000. current = current.parent;
  2001. }
  2002. return hook();
  2003. });
  2004. injectHook(type, wrappedHook, target);
  2005. if (target) {
  2006. let current = target.parent;
  2007. while (current && current.parent) {
  2008. if (isKeepAlive(current.parent.vnode)) {
  2009. injectToKeepAliveRoot(wrappedHook, type, target, current);
  2010. }
  2011. current = current.parent;
  2012. }
  2013. }
  2014. }
  2015. function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  2016. const injected = injectHook(
  2017. type,
  2018. hook,
  2019. keepAliveRoot,
  2020. true
  2021. /* prepend */
  2022. );
  2023. onUnmounted(() => {
  2024. shared.remove(keepAliveRoot[type], injected);
  2025. }, target);
  2026. }
  2027. function resetShapeFlag(vnode) {
  2028. vnode.shapeFlag &= ~256;
  2029. vnode.shapeFlag &= ~512;
  2030. }
  2031. function getInnerChild(vnode) {
  2032. return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
  2033. }
  2034. function injectHook(type, hook, target = currentInstance, prepend = false) {
  2035. if (target) {
  2036. const hooks = target[type] || (target[type] = []);
  2037. const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
  2038. reactivity.pauseTracking();
  2039. const reset = setCurrentInstance(target);
  2040. const res = callWithAsyncErrorHandling(hook, target, type, args);
  2041. reset();
  2042. reactivity.resetTracking();
  2043. return res;
  2044. });
  2045. if (prepend) {
  2046. hooks.unshift(wrappedHook);
  2047. } else {
  2048. hooks.push(wrappedHook);
  2049. }
  2050. return wrappedHook;
  2051. }
  2052. }
  2053. const createHook = (lifecycle) => (hook, target = currentInstance) => {
  2054. if (!isInSSRComponentSetup || lifecycle === "sp") {
  2055. injectHook(lifecycle, (...args) => hook(...args), target);
  2056. }
  2057. };
  2058. const onBeforeMount = createHook("bm");
  2059. const onMounted = createHook("m");
  2060. const onBeforeUpdate = createHook(
  2061. "bu"
  2062. );
  2063. const onUpdated = createHook("u");
  2064. const onBeforeUnmount = createHook(
  2065. "bum"
  2066. );
  2067. const onUnmounted = createHook("um");
  2068. const onServerPrefetch = createHook(
  2069. "sp"
  2070. );
  2071. const onRenderTriggered = createHook("rtg");
  2072. const onRenderTracked = createHook("rtc");
  2073. function onErrorCaptured(hook, target = currentInstance) {
  2074. injectHook("ec", hook, target);
  2075. }
  2076. const COMPONENTS = "components";
  2077. const DIRECTIVES = "directives";
  2078. function resolveComponent(name, maybeSelfReference) {
  2079. return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
  2080. }
  2081. const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
  2082. function resolveDynamicComponent(component) {
  2083. if (shared.isString(component)) {
  2084. return resolveAsset(COMPONENTS, component, false) || component;
  2085. } else {
  2086. return component || NULL_DYNAMIC_COMPONENT;
  2087. }
  2088. }
  2089. function resolveDirective(name) {
  2090. return resolveAsset(DIRECTIVES, name);
  2091. }
  2092. function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
  2093. const instance = currentRenderingInstance || currentInstance;
  2094. if (instance) {
  2095. const Component = instance.type;
  2096. if (type === COMPONENTS) {
  2097. const selfName = getComponentName(
  2098. Component,
  2099. false
  2100. );
  2101. if (selfName && (selfName === name || selfName === shared.camelize(name) || selfName === shared.capitalize(shared.camelize(name)))) {
  2102. return Component;
  2103. }
  2104. }
  2105. const res = (
  2106. // local registration
  2107. // check instance[type] first which is resolved for options API
  2108. resolve(instance[type] || Component[type], name) || // global registration
  2109. resolve(instance.appContext[type], name)
  2110. );
  2111. if (!res && maybeSelfReference) {
  2112. return Component;
  2113. }
  2114. return res;
  2115. }
  2116. }
  2117. function resolve(registry, name) {
  2118. return registry && (registry[name] || registry[shared.camelize(name)] || registry[shared.capitalize(shared.camelize(name))]);
  2119. }
  2120. function renderList(source, renderItem, cache, index) {
  2121. let ret;
  2122. const cached = cache && cache[index];
  2123. const sourceIsArray = shared.isArray(source);
  2124. if (sourceIsArray || shared.isString(source)) {
  2125. const sourceIsReactiveArray = sourceIsArray && reactivity.isReactive(source);
  2126. let needsWrap = false;
  2127. if (sourceIsReactiveArray) {
  2128. needsWrap = !reactivity.isShallow(source);
  2129. source = reactivity.shallowReadArray(source);
  2130. }
  2131. ret = new Array(source.length);
  2132. for (let i = 0, l = source.length; i < l; i++) {
  2133. ret[i] = renderItem(
  2134. needsWrap ? reactivity.toReactive(source[i]) : source[i],
  2135. i,
  2136. void 0,
  2137. cached && cached[i]
  2138. );
  2139. }
  2140. } else if (typeof source === "number") {
  2141. ret = new Array(source);
  2142. for (let i = 0; i < source; i++) {
  2143. ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
  2144. }
  2145. } else if (shared.isObject(source)) {
  2146. if (source[Symbol.iterator]) {
  2147. ret = Array.from(
  2148. source,
  2149. (item, i) => renderItem(item, i, void 0, cached && cached[i])
  2150. );
  2151. } else {
  2152. const keys = Object.keys(source);
  2153. ret = new Array(keys.length);
  2154. for (let i = 0, l = keys.length; i < l; i++) {
  2155. const key = keys[i];
  2156. ret[i] = renderItem(source[key], key, i, cached && cached[i]);
  2157. }
  2158. }
  2159. } else {
  2160. ret = [];
  2161. }
  2162. if (cache) {
  2163. cache[index] = ret;
  2164. }
  2165. return ret;
  2166. }
  2167. function createSlots(slots, dynamicSlots) {
  2168. for (let i = 0; i < dynamicSlots.length; i++) {
  2169. const slot = dynamicSlots[i];
  2170. if (shared.isArray(slot)) {
  2171. for (let j = 0; j < slot.length; j++) {
  2172. slots[slot[j].name] = slot[j].fn;
  2173. }
  2174. } else if (slot) {
  2175. slots[slot.name] = slot.key ? (...args) => {
  2176. const res = slot.fn(...args);
  2177. if (res) res.key = slot.key;
  2178. return res;
  2179. } : slot.fn;
  2180. }
  2181. }
  2182. return slots;
  2183. }
  2184. function renderSlot(slots, name, props = {}, fallback, noSlotted) {
  2185. if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
  2186. if (name !== "default") props.name = name;
  2187. return openBlock(), createBlock(
  2188. Fragment,
  2189. null,
  2190. [createVNode("slot", props, fallback && fallback())],
  2191. 64
  2192. );
  2193. }
  2194. let slot = slots[name];
  2195. if (slot && slot._c) {
  2196. slot._d = false;
  2197. }
  2198. openBlock();
  2199. const validSlotContent = slot && ensureValidVNode(slot(props));
  2200. const rendered = createBlock(
  2201. Fragment,
  2202. {
  2203. key: (props.key || // slot content array of a dynamic conditional slot may have a branch
  2204. // key attached in the `createSlots` helper, respect that
  2205. validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
  2206. (!validSlotContent && fallback ? "_fb" : "")
  2207. },
  2208. validSlotContent || (fallback ? fallback() : []),
  2209. validSlotContent && slots._ === 1 ? 64 : -2
  2210. );
  2211. if (!noSlotted && rendered.scopeId) {
  2212. rendered.slotScopeIds = [rendered.scopeId + "-s"];
  2213. }
  2214. if (slot && slot._c) {
  2215. slot._d = true;
  2216. }
  2217. return rendered;
  2218. }
  2219. function ensureValidVNode(vnodes) {
  2220. return vnodes.some((child) => {
  2221. if (!isVNode(child)) return true;
  2222. if (child.type === Comment) return false;
  2223. if (child.type === Fragment && !ensureValidVNode(child.children))
  2224. return false;
  2225. return true;
  2226. }) ? vnodes : null;
  2227. }
  2228. function toHandlers(obj, preserveCaseIfNecessary) {
  2229. const ret = {};
  2230. for (const key in obj) {
  2231. ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : shared.toHandlerKey(key)] = obj[key];
  2232. }
  2233. return ret;
  2234. }
  2235. const getPublicInstance = (i) => {
  2236. if (!i) return null;
  2237. if (isStatefulComponent(i)) return getComponentPublicInstance(i);
  2238. return getPublicInstance(i.parent);
  2239. };
  2240. const publicPropertiesMap = (
  2241. // Move PURE marker to new line to workaround compiler discarding it
  2242. // due to type annotation
  2243. /* @__PURE__ */ shared.extend(/* @__PURE__ */ Object.create(null), {
  2244. $: (i) => i,
  2245. $el: (i) => i.vnode.el,
  2246. $data: (i) => i.data,
  2247. $props: (i) => i.props,
  2248. $attrs: (i) => i.attrs,
  2249. $slots: (i) => i.slots,
  2250. $refs: (i) => i.refs,
  2251. $parent: (i) => getPublicInstance(i.parent),
  2252. $root: (i) => getPublicInstance(i.root),
  2253. $host: (i) => i.ce,
  2254. $emit: (i) => i.emit,
  2255. $options: (i) => resolveMergedOptions(i) ,
  2256. $forceUpdate: (i) => i.f || (i.f = () => {
  2257. queueJob(i.update);
  2258. }),
  2259. $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
  2260. $watch: (i) => instanceWatch.bind(i)
  2261. })
  2262. );
  2263. const hasSetupBinding = (state, key) => state !== shared.EMPTY_OBJ && !state.__isScriptSetup && shared.hasOwn(state, key);
  2264. const PublicInstanceProxyHandlers = {
  2265. get({ _: instance }, key) {
  2266. if (key === "__v_skip") {
  2267. return true;
  2268. }
  2269. const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
  2270. let normalizedProps;
  2271. if (key[0] !== "$") {
  2272. const n = accessCache[key];
  2273. if (n !== void 0) {
  2274. switch (n) {
  2275. case 1 /* SETUP */:
  2276. return setupState[key];
  2277. case 2 /* DATA */:
  2278. return data[key];
  2279. case 4 /* CONTEXT */:
  2280. return ctx[key];
  2281. case 3 /* PROPS */:
  2282. return props[key];
  2283. }
  2284. } else if (hasSetupBinding(setupState, key)) {
  2285. accessCache[key] = 1 /* SETUP */;
  2286. return setupState[key];
  2287. } else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) {
  2288. accessCache[key] = 2 /* DATA */;
  2289. return data[key];
  2290. } else if (
  2291. // only cache other properties when instance has declared (thus stable)
  2292. // props
  2293. (normalizedProps = instance.propsOptions[0]) && shared.hasOwn(normalizedProps, key)
  2294. ) {
  2295. accessCache[key] = 3 /* PROPS */;
  2296. return props[key];
  2297. } else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) {
  2298. accessCache[key] = 4 /* CONTEXT */;
  2299. return ctx[key];
  2300. } else if (shouldCacheAccess) {
  2301. accessCache[key] = 0 /* OTHER */;
  2302. }
  2303. }
  2304. const publicGetter = publicPropertiesMap[key];
  2305. let cssModule, globalProperties;
  2306. if (publicGetter) {
  2307. if (key === "$attrs") {
  2308. reactivity.track(instance.attrs, "get", "");
  2309. }
  2310. return publicGetter(instance);
  2311. } else if (
  2312. // css module (injected by vue-loader)
  2313. (cssModule = type.__cssModules) && (cssModule = cssModule[key])
  2314. ) {
  2315. return cssModule;
  2316. } else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) {
  2317. accessCache[key] = 4 /* CONTEXT */;
  2318. return ctx[key];
  2319. } else if (
  2320. // global properties
  2321. globalProperties = appContext.config.globalProperties, shared.hasOwn(globalProperties, key)
  2322. ) {
  2323. {
  2324. return globalProperties[key];
  2325. }
  2326. } else ;
  2327. },
  2328. set({ _: instance }, key, value) {
  2329. const { data, setupState, ctx } = instance;
  2330. if (hasSetupBinding(setupState, key)) {
  2331. setupState[key] = value;
  2332. return true;
  2333. } else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) {
  2334. data[key] = value;
  2335. return true;
  2336. } else if (shared.hasOwn(instance.props, key)) {
  2337. return false;
  2338. }
  2339. if (key[0] === "$" && key.slice(1) in instance) {
  2340. return false;
  2341. } else {
  2342. {
  2343. ctx[key] = value;
  2344. }
  2345. }
  2346. return true;
  2347. },
  2348. has({
  2349. _: { data, setupState, accessCache, ctx, appContext, propsOptions }
  2350. }, key) {
  2351. let normalizedProps;
  2352. return !!accessCache[key] || data !== shared.EMPTY_OBJ && shared.hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && shared.hasOwn(normalizedProps, key) || shared.hasOwn(ctx, key) || shared.hasOwn(publicPropertiesMap, key) || shared.hasOwn(appContext.config.globalProperties, key);
  2353. },
  2354. defineProperty(target, key, descriptor) {
  2355. if (descriptor.get != null) {
  2356. target._.accessCache[key] = 0;
  2357. } else if (shared.hasOwn(descriptor, "value")) {
  2358. this.set(target, key, descriptor.value, null);
  2359. }
  2360. return Reflect.defineProperty(target, key, descriptor);
  2361. }
  2362. };
  2363. const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ shared.extend({}, PublicInstanceProxyHandlers, {
  2364. get(target, key) {
  2365. if (key === Symbol.unscopables) {
  2366. return;
  2367. }
  2368. return PublicInstanceProxyHandlers.get(target, key, target);
  2369. },
  2370. has(_, key) {
  2371. const has = key[0] !== "_" && !shared.isGloballyAllowed(key);
  2372. return has;
  2373. }
  2374. });
  2375. function defineProps() {
  2376. return null;
  2377. }
  2378. function defineEmits() {
  2379. return null;
  2380. }
  2381. function defineExpose(exposed) {
  2382. }
  2383. function defineOptions(options) {
  2384. }
  2385. function defineSlots() {
  2386. return null;
  2387. }
  2388. function defineModel() {
  2389. }
  2390. function withDefaults(props, defaults) {
  2391. return null;
  2392. }
  2393. function useSlots() {
  2394. return getContext().slots;
  2395. }
  2396. function useAttrs() {
  2397. return getContext().attrs;
  2398. }
  2399. function getContext() {
  2400. const i = getCurrentInstance();
  2401. return i.setupContext || (i.setupContext = createSetupContext(i));
  2402. }
  2403. function normalizePropsOrEmits(props) {
  2404. return shared.isArray(props) ? props.reduce(
  2405. (normalized, p) => (normalized[p] = null, normalized),
  2406. {}
  2407. ) : props;
  2408. }
  2409. function mergeDefaults(raw, defaults) {
  2410. const props = normalizePropsOrEmits(raw);
  2411. for (const key in defaults) {
  2412. if (key.startsWith("__skip")) continue;
  2413. let opt = props[key];
  2414. if (opt) {
  2415. if (shared.isArray(opt) || shared.isFunction(opt)) {
  2416. opt = props[key] = { type: opt, default: defaults[key] };
  2417. } else {
  2418. opt.default = defaults[key];
  2419. }
  2420. } else if (opt === null) {
  2421. opt = props[key] = { default: defaults[key] };
  2422. } else ;
  2423. if (opt && defaults[`__skip_${key}`]) {
  2424. opt.skipFactory = true;
  2425. }
  2426. }
  2427. return props;
  2428. }
  2429. function mergeModels(a, b) {
  2430. if (!a || !b) return a || b;
  2431. if (shared.isArray(a) && shared.isArray(b)) return a.concat(b);
  2432. return shared.extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
  2433. }
  2434. function createPropsRestProxy(props, excludedKeys) {
  2435. const ret = {};
  2436. for (const key in props) {
  2437. if (!excludedKeys.includes(key)) {
  2438. Object.defineProperty(ret, key, {
  2439. enumerable: true,
  2440. get: () => props[key]
  2441. });
  2442. }
  2443. }
  2444. return ret;
  2445. }
  2446. function withAsyncContext(getAwaitable) {
  2447. const ctx = getCurrentInstance();
  2448. let awaitable = getAwaitable();
  2449. unsetCurrentInstance();
  2450. if (shared.isPromise(awaitable)) {
  2451. awaitable = awaitable.catch((e) => {
  2452. setCurrentInstance(ctx);
  2453. throw e;
  2454. });
  2455. }
  2456. return [awaitable, () => setCurrentInstance(ctx)];
  2457. }
  2458. let shouldCacheAccess = true;
  2459. function applyOptions(instance) {
  2460. const options = resolveMergedOptions(instance);
  2461. const publicThis = instance.proxy;
  2462. const ctx = instance.ctx;
  2463. shouldCacheAccess = false;
  2464. if (options.beforeCreate) {
  2465. callHook(options.beforeCreate, instance, "bc");
  2466. }
  2467. const {
  2468. // state
  2469. data: dataOptions,
  2470. computed: computedOptions,
  2471. methods,
  2472. watch: watchOptions,
  2473. provide: provideOptions,
  2474. inject: injectOptions,
  2475. // lifecycle
  2476. created,
  2477. beforeMount,
  2478. mounted,
  2479. beforeUpdate,
  2480. updated,
  2481. activated,
  2482. deactivated,
  2483. beforeDestroy,
  2484. beforeUnmount,
  2485. destroyed,
  2486. unmounted,
  2487. render,
  2488. renderTracked,
  2489. renderTriggered,
  2490. errorCaptured,
  2491. serverPrefetch,
  2492. // public API
  2493. expose,
  2494. inheritAttrs,
  2495. // assets
  2496. components,
  2497. directives,
  2498. filters
  2499. } = options;
  2500. const checkDuplicateProperties = null;
  2501. if (injectOptions) {
  2502. resolveInjections(injectOptions, ctx, checkDuplicateProperties);
  2503. }
  2504. if (methods) {
  2505. for (const key in methods) {
  2506. const methodHandler = methods[key];
  2507. if (shared.isFunction(methodHandler)) {
  2508. {
  2509. ctx[key] = methodHandler.bind(publicThis);
  2510. }
  2511. }
  2512. }
  2513. }
  2514. if (dataOptions) {
  2515. const data = dataOptions.call(publicThis, publicThis);
  2516. if (!shared.isObject(data)) ; else {
  2517. instance.data = reactivity.reactive(data);
  2518. }
  2519. }
  2520. shouldCacheAccess = true;
  2521. if (computedOptions) {
  2522. for (const key in computedOptions) {
  2523. const opt = computedOptions[key];
  2524. const get = shared.isFunction(opt) ? opt.bind(publicThis, publicThis) : shared.isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : shared.NOOP;
  2525. const set = !shared.isFunction(opt) && shared.isFunction(opt.set) ? opt.set.bind(publicThis) : shared.NOOP;
  2526. const c = computed({
  2527. get,
  2528. set
  2529. });
  2530. Object.defineProperty(ctx, key, {
  2531. enumerable: true,
  2532. configurable: true,
  2533. get: () => c.value,
  2534. set: (v) => c.value = v
  2535. });
  2536. }
  2537. }
  2538. if (watchOptions) {
  2539. for (const key in watchOptions) {
  2540. createWatcher(watchOptions[key], ctx, publicThis, key);
  2541. }
  2542. }
  2543. if (provideOptions) {
  2544. const provides = shared.isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
  2545. Reflect.ownKeys(provides).forEach((key) => {
  2546. provide(key, provides[key]);
  2547. });
  2548. }
  2549. if (created) {
  2550. callHook(created, instance, "c");
  2551. }
  2552. function registerLifecycleHook(register, hook) {
  2553. if (shared.isArray(hook)) {
  2554. hook.forEach((_hook) => register(_hook.bind(publicThis)));
  2555. } else if (hook) {
  2556. register(hook.bind(publicThis));
  2557. }
  2558. }
  2559. registerLifecycleHook(onBeforeMount, beforeMount);
  2560. registerLifecycleHook(onMounted, mounted);
  2561. registerLifecycleHook(onBeforeUpdate, beforeUpdate);
  2562. registerLifecycleHook(onUpdated, updated);
  2563. registerLifecycleHook(onActivated, activated);
  2564. registerLifecycleHook(onDeactivated, deactivated);
  2565. registerLifecycleHook(onErrorCaptured, errorCaptured);
  2566. registerLifecycleHook(onRenderTracked, renderTracked);
  2567. registerLifecycleHook(onRenderTriggered, renderTriggered);
  2568. registerLifecycleHook(onBeforeUnmount, beforeUnmount);
  2569. registerLifecycleHook(onUnmounted, unmounted);
  2570. registerLifecycleHook(onServerPrefetch, serverPrefetch);
  2571. if (shared.isArray(expose)) {
  2572. if (expose.length) {
  2573. const exposed = instance.exposed || (instance.exposed = {});
  2574. expose.forEach((key) => {
  2575. Object.defineProperty(exposed, key, {
  2576. get: () => publicThis[key],
  2577. set: (val) => publicThis[key] = val
  2578. });
  2579. });
  2580. } else if (!instance.exposed) {
  2581. instance.exposed = {};
  2582. }
  2583. }
  2584. if (render && instance.render === shared.NOOP) {
  2585. instance.render = render;
  2586. }
  2587. if (inheritAttrs != null) {
  2588. instance.inheritAttrs = inheritAttrs;
  2589. }
  2590. if (components) instance.components = components;
  2591. if (directives) instance.directives = directives;
  2592. if (serverPrefetch) {
  2593. markAsyncBoundary(instance);
  2594. }
  2595. }
  2596. function resolveInjections(injectOptions, ctx, checkDuplicateProperties = shared.NOOP) {
  2597. if (shared.isArray(injectOptions)) {
  2598. injectOptions = normalizeInject(injectOptions);
  2599. }
  2600. for (const key in injectOptions) {
  2601. const opt = injectOptions[key];
  2602. let injected;
  2603. if (shared.isObject(opt)) {
  2604. if ("default" in opt) {
  2605. injected = inject(
  2606. opt.from || key,
  2607. opt.default,
  2608. true
  2609. );
  2610. } else {
  2611. injected = inject(opt.from || key);
  2612. }
  2613. } else {
  2614. injected = inject(opt);
  2615. }
  2616. if (reactivity.isRef(injected)) {
  2617. Object.defineProperty(ctx, key, {
  2618. enumerable: true,
  2619. configurable: true,
  2620. get: () => injected.value,
  2621. set: (v) => injected.value = v
  2622. });
  2623. } else {
  2624. ctx[key] = injected;
  2625. }
  2626. }
  2627. }
  2628. function callHook(hook, instance, type) {
  2629. callWithAsyncErrorHandling(
  2630. shared.isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy),
  2631. instance,
  2632. type
  2633. );
  2634. }
  2635. function createWatcher(raw, ctx, publicThis, key) {
  2636. let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  2637. if (shared.isString(raw)) {
  2638. const handler = ctx[raw];
  2639. if (shared.isFunction(handler)) {
  2640. {
  2641. watch(getter, handler);
  2642. }
  2643. }
  2644. } else if (shared.isFunction(raw)) {
  2645. {
  2646. watch(getter, raw.bind(publicThis));
  2647. }
  2648. } else if (shared.isObject(raw)) {
  2649. if (shared.isArray(raw)) {
  2650. raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
  2651. } else {
  2652. const handler = shared.isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
  2653. if (shared.isFunction(handler)) {
  2654. watch(getter, handler, raw);
  2655. }
  2656. }
  2657. } else ;
  2658. }
  2659. function resolveMergedOptions(instance) {
  2660. const base = instance.type;
  2661. const { mixins, extends: extendsOptions } = base;
  2662. const {
  2663. mixins: globalMixins,
  2664. optionsCache: cache,
  2665. config: { optionMergeStrategies }
  2666. } = instance.appContext;
  2667. const cached = cache.get(base);
  2668. let resolved;
  2669. if (cached) {
  2670. resolved = cached;
  2671. } else if (!globalMixins.length && !mixins && !extendsOptions) {
  2672. {
  2673. resolved = base;
  2674. }
  2675. } else {
  2676. resolved = {};
  2677. if (globalMixins.length) {
  2678. globalMixins.forEach(
  2679. (m) => mergeOptions(resolved, m, optionMergeStrategies, true)
  2680. );
  2681. }
  2682. mergeOptions(resolved, base, optionMergeStrategies);
  2683. }
  2684. if (shared.isObject(base)) {
  2685. cache.set(base, resolved);
  2686. }
  2687. return resolved;
  2688. }
  2689. function mergeOptions(to, from, strats, asMixin = false) {
  2690. const { mixins, extends: extendsOptions } = from;
  2691. if (extendsOptions) {
  2692. mergeOptions(to, extendsOptions, strats, true);
  2693. }
  2694. if (mixins) {
  2695. mixins.forEach(
  2696. (m) => mergeOptions(to, m, strats, true)
  2697. );
  2698. }
  2699. for (const key in from) {
  2700. if (asMixin && key === "expose") ; else {
  2701. const strat = internalOptionMergeStrats[key] || strats && strats[key];
  2702. to[key] = strat ? strat(to[key], from[key]) : from[key];
  2703. }
  2704. }
  2705. return to;
  2706. }
  2707. const internalOptionMergeStrats = {
  2708. data: mergeDataFn,
  2709. props: mergeEmitsOrPropsOptions,
  2710. emits: mergeEmitsOrPropsOptions,
  2711. // objects
  2712. methods: mergeObjectOptions,
  2713. computed: mergeObjectOptions,
  2714. // lifecycle
  2715. beforeCreate: mergeAsArray,
  2716. created: mergeAsArray,
  2717. beforeMount: mergeAsArray,
  2718. mounted: mergeAsArray,
  2719. beforeUpdate: mergeAsArray,
  2720. updated: mergeAsArray,
  2721. beforeDestroy: mergeAsArray,
  2722. beforeUnmount: mergeAsArray,
  2723. destroyed: mergeAsArray,
  2724. unmounted: mergeAsArray,
  2725. activated: mergeAsArray,
  2726. deactivated: mergeAsArray,
  2727. errorCaptured: mergeAsArray,
  2728. serverPrefetch: mergeAsArray,
  2729. // assets
  2730. components: mergeObjectOptions,
  2731. directives: mergeObjectOptions,
  2732. // watch
  2733. watch: mergeWatchOptions,
  2734. // provide / inject
  2735. provide: mergeDataFn,
  2736. inject: mergeInject
  2737. };
  2738. function mergeDataFn(to, from) {
  2739. if (!from) {
  2740. return to;
  2741. }
  2742. if (!to) {
  2743. return from;
  2744. }
  2745. return function mergedDataFn() {
  2746. return (shared.extend)(
  2747. shared.isFunction(to) ? to.call(this, this) : to,
  2748. shared.isFunction(from) ? from.call(this, this) : from
  2749. );
  2750. };
  2751. }
  2752. function mergeInject(to, from) {
  2753. return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
  2754. }
  2755. function normalizeInject(raw) {
  2756. if (shared.isArray(raw)) {
  2757. const res = {};
  2758. for (let i = 0; i < raw.length; i++) {
  2759. res[raw[i]] = raw[i];
  2760. }
  2761. return res;
  2762. }
  2763. return raw;
  2764. }
  2765. function mergeAsArray(to, from) {
  2766. return to ? [...new Set([].concat(to, from))] : from;
  2767. }
  2768. function mergeObjectOptions(to, from) {
  2769. return to ? shared.extend(/* @__PURE__ */ Object.create(null), to, from) : from;
  2770. }
  2771. function mergeEmitsOrPropsOptions(to, from) {
  2772. if (to) {
  2773. if (shared.isArray(to) && shared.isArray(from)) {
  2774. return [.../* @__PURE__ */ new Set([...to, ...from])];
  2775. }
  2776. return shared.extend(
  2777. /* @__PURE__ */ Object.create(null),
  2778. normalizePropsOrEmits(to),
  2779. normalizePropsOrEmits(from != null ? from : {})
  2780. );
  2781. } else {
  2782. return from;
  2783. }
  2784. }
  2785. function mergeWatchOptions(to, from) {
  2786. if (!to) return from;
  2787. if (!from) return to;
  2788. const merged = shared.extend(/* @__PURE__ */ Object.create(null), to);
  2789. for (const key in from) {
  2790. merged[key] = mergeAsArray(to[key], from[key]);
  2791. }
  2792. return merged;
  2793. }
  2794. function createAppContext() {
  2795. return {
  2796. app: null,
  2797. config: {
  2798. isNativeTag: shared.NO,
  2799. performance: false,
  2800. globalProperties: {},
  2801. optionMergeStrategies: {},
  2802. errorHandler: void 0,
  2803. warnHandler: void 0,
  2804. compilerOptions: {}
  2805. },
  2806. mixins: [],
  2807. components: {},
  2808. directives: {},
  2809. provides: /* @__PURE__ */ Object.create(null),
  2810. optionsCache: /* @__PURE__ */ new WeakMap(),
  2811. propsCache: /* @__PURE__ */ new WeakMap(),
  2812. emitsCache: /* @__PURE__ */ new WeakMap()
  2813. };
  2814. }
  2815. let uid$1 = 0;
  2816. function createAppAPI(render, hydrate) {
  2817. return function createApp(rootComponent, rootProps = null) {
  2818. if (!shared.isFunction(rootComponent)) {
  2819. rootComponent = shared.extend({}, rootComponent);
  2820. }
  2821. if (rootProps != null && !shared.isObject(rootProps)) {
  2822. rootProps = null;
  2823. }
  2824. const context = createAppContext();
  2825. const installedPlugins = /* @__PURE__ */ new WeakSet();
  2826. const pluginCleanupFns = [];
  2827. let isMounted = false;
  2828. const app = context.app = {
  2829. _uid: uid$1++,
  2830. _component: rootComponent,
  2831. _props: rootProps,
  2832. _container: null,
  2833. _context: context,
  2834. _instance: null,
  2835. version,
  2836. get config() {
  2837. return context.config;
  2838. },
  2839. set config(v) {
  2840. },
  2841. use(plugin, ...options) {
  2842. if (installedPlugins.has(plugin)) ; else if (plugin && shared.isFunction(plugin.install)) {
  2843. installedPlugins.add(plugin);
  2844. plugin.install(app, ...options);
  2845. } else if (shared.isFunction(plugin)) {
  2846. installedPlugins.add(plugin);
  2847. plugin(app, ...options);
  2848. } else ;
  2849. return app;
  2850. },
  2851. mixin(mixin) {
  2852. {
  2853. if (!context.mixins.includes(mixin)) {
  2854. context.mixins.push(mixin);
  2855. }
  2856. }
  2857. return app;
  2858. },
  2859. component(name, component) {
  2860. if (!component) {
  2861. return context.components[name];
  2862. }
  2863. context.components[name] = component;
  2864. return app;
  2865. },
  2866. directive(name, directive) {
  2867. if (!directive) {
  2868. return context.directives[name];
  2869. }
  2870. context.directives[name] = directive;
  2871. return app;
  2872. },
  2873. mount(rootContainer, isHydrate, namespace) {
  2874. if (!isMounted) {
  2875. const vnode = app._ceVNode || createVNode(rootComponent, rootProps);
  2876. vnode.appContext = context;
  2877. if (namespace === true) {
  2878. namespace = "svg";
  2879. } else if (namespace === false) {
  2880. namespace = void 0;
  2881. }
  2882. if (isHydrate && hydrate) {
  2883. hydrate(vnode, rootContainer);
  2884. } else {
  2885. render(vnode, rootContainer, namespace);
  2886. }
  2887. isMounted = true;
  2888. app._container = rootContainer;
  2889. rootContainer.__vue_app__ = app;
  2890. return getComponentPublicInstance(vnode.component);
  2891. }
  2892. },
  2893. onUnmount(cleanupFn) {
  2894. pluginCleanupFns.push(cleanupFn);
  2895. },
  2896. unmount() {
  2897. if (isMounted) {
  2898. callWithAsyncErrorHandling(
  2899. pluginCleanupFns,
  2900. app._instance,
  2901. 16
  2902. );
  2903. render(null, app._container);
  2904. delete app._container.__vue_app__;
  2905. }
  2906. },
  2907. provide(key, value) {
  2908. context.provides[key] = value;
  2909. return app;
  2910. },
  2911. runWithContext(fn) {
  2912. const lastApp = currentApp;
  2913. currentApp = app;
  2914. try {
  2915. return fn();
  2916. } finally {
  2917. currentApp = lastApp;
  2918. }
  2919. }
  2920. };
  2921. return app;
  2922. };
  2923. }
  2924. let currentApp = null;
  2925. function provide(key, value) {
  2926. if (!currentInstance) ; else {
  2927. let provides = currentInstance.provides;
  2928. const parentProvides = currentInstance.parent && currentInstance.parent.provides;
  2929. if (parentProvides === provides) {
  2930. provides = currentInstance.provides = Object.create(parentProvides);
  2931. }
  2932. provides[key] = value;
  2933. }
  2934. }
  2935. function inject(key, defaultValue, treatDefaultAsFactory = false) {
  2936. const instance = currentInstance || currentRenderingInstance;
  2937. if (instance || currentApp) {
  2938. const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
  2939. if (provides && key in provides) {
  2940. return provides[key];
  2941. } else if (arguments.length > 1) {
  2942. return treatDefaultAsFactory && shared.isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
  2943. } else ;
  2944. }
  2945. }
  2946. function hasInjectionContext() {
  2947. return !!(currentInstance || currentRenderingInstance || currentApp);
  2948. }
  2949. const internalObjectProto = {};
  2950. const createInternalObject = () => Object.create(internalObjectProto);
  2951. const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
  2952. function initProps(instance, rawProps, isStateful, isSSR = false) {
  2953. const props = {};
  2954. const attrs = createInternalObject();
  2955. instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  2956. setFullProps(instance, rawProps, props, attrs);
  2957. for (const key in instance.propsOptions[0]) {
  2958. if (!(key in props)) {
  2959. props[key] = void 0;
  2960. }
  2961. }
  2962. if (isStateful) {
  2963. instance.props = isSSR ? props : reactivity.shallowReactive(props);
  2964. } else {
  2965. if (!instance.type.props) {
  2966. instance.props = attrs;
  2967. } else {
  2968. instance.props = props;
  2969. }
  2970. }
  2971. instance.attrs = attrs;
  2972. }
  2973. function updateProps(instance, rawProps, rawPrevProps, optimized) {
  2974. const {
  2975. props,
  2976. attrs,
  2977. vnode: { patchFlag }
  2978. } = instance;
  2979. const rawCurrentProps = reactivity.toRaw(props);
  2980. const [options] = instance.propsOptions;
  2981. let hasAttrsChanged = false;
  2982. if (
  2983. // always force full diff in dev
  2984. // - #1942 if hmr is enabled with sfc component
  2985. // - vite#872 non-sfc component used by sfc component
  2986. (optimized || patchFlag > 0) && !(patchFlag & 16)
  2987. ) {
  2988. if (patchFlag & 8) {
  2989. const propsToUpdate = instance.vnode.dynamicProps;
  2990. for (let i = 0; i < propsToUpdate.length; i++) {
  2991. let key = propsToUpdate[i];
  2992. if (isEmitListener(instance.emitsOptions, key)) {
  2993. continue;
  2994. }
  2995. const value = rawProps[key];
  2996. if (options) {
  2997. if (shared.hasOwn(attrs, key)) {
  2998. if (value !== attrs[key]) {
  2999. attrs[key] = value;
  3000. hasAttrsChanged = true;
  3001. }
  3002. } else {
  3003. const camelizedKey = shared.camelize(key);
  3004. props[camelizedKey] = resolvePropValue(
  3005. options,
  3006. rawCurrentProps,
  3007. camelizedKey,
  3008. value,
  3009. instance,
  3010. false
  3011. );
  3012. }
  3013. } else {
  3014. if (value !== attrs[key]) {
  3015. attrs[key] = value;
  3016. hasAttrsChanged = true;
  3017. }
  3018. }
  3019. }
  3020. }
  3021. } else {
  3022. if (setFullProps(instance, rawProps, props, attrs)) {
  3023. hasAttrsChanged = true;
  3024. }
  3025. let kebabKey;
  3026. for (const key in rawCurrentProps) {
  3027. if (!rawProps || // for camelCase
  3028. !shared.hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
  3029. // and converted to camelCase (#955)
  3030. ((kebabKey = shared.hyphenate(key)) === key || !shared.hasOwn(rawProps, kebabKey))) {
  3031. if (options) {
  3032. if (rawPrevProps && // for camelCase
  3033. (rawPrevProps[key] !== void 0 || // for kebab-case
  3034. rawPrevProps[kebabKey] !== void 0)) {
  3035. props[key] = resolvePropValue(
  3036. options,
  3037. rawCurrentProps,
  3038. key,
  3039. void 0,
  3040. instance,
  3041. true
  3042. );
  3043. }
  3044. } else {
  3045. delete props[key];
  3046. }
  3047. }
  3048. }
  3049. if (attrs !== rawCurrentProps) {
  3050. for (const key in attrs) {
  3051. if (!rawProps || !shared.hasOwn(rawProps, key) && true) {
  3052. delete attrs[key];
  3053. hasAttrsChanged = true;
  3054. }
  3055. }
  3056. }
  3057. }
  3058. if (hasAttrsChanged) {
  3059. reactivity.trigger(instance.attrs, "set", "");
  3060. }
  3061. }
  3062. function setFullProps(instance, rawProps, props, attrs) {
  3063. const [options, needCastKeys] = instance.propsOptions;
  3064. let hasAttrsChanged = false;
  3065. let rawCastValues;
  3066. if (rawProps) {
  3067. for (let key in rawProps) {
  3068. if (shared.isReservedProp(key)) {
  3069. continue;
  3070. }
  3071. const value = rawProps[key];
  3072. let camelKey;
  3073. if (options && shared.hasOwn(options, camelKey = shared.camelize(key))) {
  3074. if (!needCastKeys || !needCastKeys.includes(camelKey)) {
  3075. props[camelKey] = value;
  3076. } else {
  3077. (rawCastValues || (rawCastValues = {}))[camelKey] = value;
  3078. }
  3079. } else if (!isEmitListener(instance.emitsOptions, key)) {
  3080. if (!(key in attrs) || value !== attrs[key]) {
  3081. attrs[key] = value;
  3082. hasAttrsChanged = true;
  3083. }
  3084. }
  3085. }
  3086. }
  3087. if (needCastKeys) {
  3088. const rawCurrentProps = reactivity.toRaw(props);
  3089. const castValues = rawCastValues || shared.EMPTY_OBJ;
  3090. for (let i = 0; i < needCastKeys.length; i++) {
  3091. const key = needCastKeys[i];
  3092. props[key] = resolvePropValue(
  3093. options,
  3094. rawCurrentProps,
  3095. key,
  3096. castValues[key],
  3097. instance,
  3098. !shared.hasOwn(castValues, key)
  3099. );
  3100. }
  3101. }
  3102. return hasAttrsChanged;
  3103. }
  3104. function resolvePropValue(options, props, key, value, instance, isAbsent) {
  3105. const opt = options[key];
  3106. if (opt != null) {
  3107. const hasDefault = shared.hasOwn(opt, "default");
  3108. if (hasDefault && value === void 0) {
  3109. const defaultValue = opt.default;
  3110. if (opt.type !== Function && !opt.skipFactory && shared.isFunction(defaultValue)) {
  3111. const { propsDefaults } = instance;
  3112. if (key in propsDefaults) {
  3113. value = propsDefaults[key];
  3114. } else {
  3115. const reset = setCurrentInstance(instance);
  3116. value = propsDefaults[key] = defaultValue.call(
  3117. null,
  3118. props
  3119. );
  3120. reset();
  3121. }
  3122. } else {
  3123. value = defaultValue;
  3124. }
  3125. if (instance.ce) {
  3126. instance.ce._setProp(key, value);
  3127. }
  3128. }
  3129. if (opt[0 /* shouldCast */]) {
  3130. if (isAbsent && !hasDefault) {
  3131. value = false;
  3132. } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === shared.hyphenate(key))) {
  3133. value = true;
  3134. }
  3135. }
  3136. }
  3137. return value;
  3138. }
  3139. const mixinPropsCache = /* @__PURE__ */ new WeakMap();
  3140. function normalizePropsOptions(comp, appContext, asMixin = false) {
  3141. const cache = asMixin ? mixinPropsCache : appContext.propsCache;
  3142. const cached = cache.get(comp);
  3143. if (cached) {
  3144. return cached;
  3145. }
  3146. const raw = comp.props;
  3147. const normalized = {};
  3148. const needCastKeys = [];
  3149. let hasExtends = false;
  3150. if (!shared.isFunction(comp)) {
  3151. const extendProps = (raw2) => {
  3152. hasExtends = true;
  3153. const [props, keys] = normalizePropsOptions(raw2, appContext, true);
  3154. shared.extend(normalized, props);
  3155. if (keys) needCastKeys.push(...keys);
  3156. };
  3157. if (!asMixin && appContext.mixins.length) {
  3158. appContext.mixins.forEach(extendProps);
  3159. }
  3160. if (comp.extends) {
  3161. extendProps(comp.extends);
  3162. }
  3163. if (comp.mixins) {
  3164. comp.mixins.forEach(extendProps);
  3165. }
  3166. }
  3167. if (!raw && !hasExtends) {
  3168. if (shared.isObject(comp)) {
  3169. cache.set(comp, shared.EMPTY_ARR);
  3170. }
  3171. return shared.EMPTY_ARR;
  3172. }
  3173. if (shared.isArray(raw)) {
  3174. for (let i = 0; i < raw.length; i++) {
  3175. const normalizedKey = shared.camelize(raw[i]);
  3176. if (validatePropName(normalizedKey)) {
  3177. normalized[normalizedKey] = shared.EMPTY_OBJ;
  3178. }
  3179. }
  3180. } else if (raw) {
  3181. for (const key in raw) {
  3182. const normalizedKey = shared.camelize(key);
  3183. if (validatePropName(normalizedKey)) {
  3184. const opt = raw[key];
  3185. const prop = normalized[normalizedKey] = shared.isArray(opt) || shared.isFunction(opt) ? { type: opt } : shared.extend({}, opt);
  3186. const propType = prop.type;
  3187. let shouldCast = false;
  3188. let shouldCastTrue = true;
  3189. if (shared.isArray(propType)) {
  3190. for (let index = 0; index < propType.length; ++index) {
  3191. const type = propType[index];
  3192. const typeName = shared.isFunction(type) && type.name;
  3193. if (typeName === "Boolean") {
  3194. shouldCast = true;
  3195. break;
  3196. } else if (typeName === "String") {
  3197. shouldCastTrue = false;
  3198. }
  3199. }
  3200. } else {
  3201. shouldCast = shared.isFunction(propType) && propType.name === "Boolean";
  3202. }
  3203. prop[0 /* shouldCast */] = shouldCast;
  3204. prop[1 /* shouldCastTrue */] = shouldCastTrue;
  3205. if (shouldCast || shared.hasOwn(prop, "default")) {
  3206. needCastKeys.push(normalizedKey);
  3207. }
  3208. }
  3209. }
  3210. }
  3211. const res = [normalized, needCastKeys];
  3212. if (shared.isObject(comp)) {
  3213. cache.set(comp, res);
  3214. }
  3215. return res;
  3216. }
  3217. function validatePropName(key) {
  3218. if (key[0] !== "$" && !shared.isReservedProp(key)) {
  3219. return true;
  3220. }
  3221. return false;
  3222. }
  3223. const isInternalKey = (key) => key[0] === "_" || key === "$stable";
  3224. const normalizeSlotValue = (value) => shared.isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
  3225. const normalizeSlot = (key, rawSlot, ctx) => {
  3226. if (rawSlot._n) {
  3227. return rawSlot;
  3228. }
  3229. const normalized = withCtx((...args) => {
  3230. if (false) ;
  3231. return normalizeSlotValue(rawSlot(...args));
  3232. }, ctx);
  3233. normalized._c = false;
  3234. return normalized;
  3235. };
  3236. const normalizeObjectSlots = (rawSlots, slots, instance) => {
  3237. const ctx = rawSlots._ctx;
  3238. for (const key in rawSlots) {
  3239. if (isInternalKey(key)) continue;
  3240. const value = rawSlots[key];
  3241. if (shared.isFunction(value)) {
  3242. slots[key] = normalizeSlot(key, value, ctx);
  3243. } else if (value != null) {
  3244. const normalized = normalizeSlotValue(value);
  3245. slots[key] = () => normalized;
  3246. }
  3247. }
  3248. };
  3249. const normalizeVNodeSlots = (instance, children) => {
  3250. const normalized = normalizeSlotValue(children);
  3251. instance.slots.default = () => normalized;
  3252. };
  3253. const assignSlots = (slots, children, optimized) => {
  3254. for (const key in children) {
  3255. if (optimized || key !== "_") {
  3256. slots[key] = children[key];
  3257. }
  3258. }
  3259. };
  3260. const initSlots = (instance, children, optimized) => {
  3261. const slots = instance.slots = createInternalObject();
  3262. if (instance.vnode.shapeFlag & 32) {
  3263. const type = children._;
  3264. if (type) {
  3265. assignSlots(slots, children, optimized);
  3266. if (optimized) {
  3267. shared.def(slots, "_", type, true);
  3268. }
  3269. } else {
  3270. normalizeObjectSlots(children, slots);
  3271. }
  3272. } else if (children) {
  3273. normalizeVNodeSlots(instance, children);
  3274. }
  3275. };
  3276. const updateSlots = (instance, children, optimized) => {
  3277. const { vnode, slots } = instance;
  3278. let needDeletionCheck = true;
  3279. let deletionComparisonTarget = shared.EMPTY_OBJ;
  3280. if (vnode.shapeFlag & 32) {
  3281. const type = children._;
  3282. if (type) {
  3283. if (optimized && type === 1) {
  3284. needDeletionCheck = false;
  3285. } else {
  3286. assignSlots(slots, children, optimized);
  3287. }
  3288. } else {
  3289. needDeletionCheck = !children.$stable;
  3290. normalizeObjectSlots(children, slots);
  3291. }
  3292. deletionComparisonTarget = children;
  3293. } else if (children) {
  3294. normalizeVNodeSlots(instance, children);
  3295. deletionComparisonTarget = { default: 1 };
  3296. }
  3297. if (needDeletionCheck) {
  3298. for (const key in slots) {
  3299. if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
  3300. delete slots[key];
  3301. }
  3302. }
  3303. }
  3304. };
  3305. const queuePostRenderEffect = queueEffectWithSuspense ;
  3306. function createRenderer(options) {
  3307. return baseCreateRenderer(options);
  3308. }
  3309. function createHydrationRenderer(options) {
  3310. return baseCreateRenderer(options, createHydrationFunctions);
  3311. }
  3312. function baseCreateRenderer(options, createHydrationFns) {
  3313. const target = shared.getGlobalThis();
  3314. target.__VUE__ = true;
  3315. const {
  3316. insert: hostInsert,
  3317. remove: hostRemove,
  3318. patchProp: hostPatchProp,
  3319. createElement: hostCreateElement,
  3320. createText: hostCreateText,
  3321. createComment: hostCreateComment,
  3322. setText: hostSetText,
  3323. setElementText: hostSetElementText,
  3324. parentNode: hostParentNode,
  3325. nextSibling: hostNextSibling,
  3326. setScopeId: hostSetScopeId = shared.NOOP,
  3327. insertStaticContent: hostInsertStaticContent
  3328. } = options;
  3329. const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!n2.dynamicChildren) => {
  3330. if (n1 === n2) {
  3331. return;
  3332. }
  3333. if (n1 && !isSameVNodeType(n1, n2)) {
  3334. anchor = getNextHostNode(n1);
  3335. unmount(n1, parentComponent, parentSuspense, true);
  3336. n1 = null;
  3337. }
  3338. if (n2.patchFlag === -2) {
  3339. optimized = false;
  3340. n2.dynamicChildren = null;
  3341. }
  3342. const { type, ref, shapeFlag } = n2;
  3343. switch (type) {
  3344. case Text:
  3345. processText(n1, n2, container, anchor);
  3346. break;
  3347. case Comment:
  3348. processCommentNode(n1, n2, container, anchor);
  3349. break;
  3350. case Static:
  3351. if (n1 == null) {
  3352. mountStaticNode(n2, container, anchor, namespace);
  3353. }
  3354. break;
  3355. case Fragment:
  3356. processFragment(
  3357. n1,
  3358. n2,
  3359. container,
  3360. anchor,
  3361. parentComponent,
  3362. parentSuspense,
  3363. namespace,
  3364. slotScopeIds,
  3365. optimized
  3366. );
  3367. break;
  3368. default:
  3369. if (shapeFlag & 1) {
  3370. processElement(
  3371. n1,
  3372. n2,
  3373. container,
  3374. anchor,
  3375. parentComponent,
  3376. parentSuspense,
  3377. namespace,
  3378. slotScopeIds,
  3379. optimized
  3380. );
  3381. } else if (shapeFlag & 6) {
  3382. processComponent(
  3383. n1,
  3384. n2,
  3385. container,
  3386. anchor,
  3387. parentComponent,
  3388. parentSuspense,
  3389. namespace,
  3390. slotScopeIds,
  3391. optimized
  3392. );
  3393. } else if (shapeFlag & 64) {
  3394. type.process(
  3395. n1,
  3396. n2,
  3397. container,
  3398. anchor,
  3399. parentComponent,
  3400. parentSuspense,
  3401. namespace,
  3402. slotScopeIds,
  3403. optimized,
  3404. internals
  3405. );
  3406. } else if (shapeFlag & 128) {
  3407. type.process(
  3408. n1,
  3409. n2,
  3410. container,
  3411. anchor,
  3412. parentComponent,
  3413. parentSuspense,
  3414. namespace,
  3415. slotScopeIds,
  3416. optimized,
  3417. internals
  3418. );
  3419. } else ;
  3420. }
  3421. if (ref != null && parentComponent) {
  3422. setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
  3423. }
  3424. };
  3425. const processText = (n1, n2, container, anchor) => {
  3426. if (n1 == null) {
  3427. hostInsert(
  3428. n2.el = hostCreateText(n2.children),
  3429. container,
  3430. anchor
  3431. );
  3432. } else {
  3433. const el = n2.el = n1.el;
  3434. if (n2.children !== n1.children) {
  3435. hostSetText(el, n2.children);
  3436. }
  3437. }
  3438. };
  3439. const processCommentNode = (n1, n2, container, anchor) => {
  3440. if (n1 == null) {
  3441. hostInsert(
  3442. n2.el = hostCreateComment(n2.children || ""),
  3443. container,
  3444. anchor
  3445. );
  3446. } else {
  3447. n2.el = n1.el;
  3448. }
  3449. };
  3450. const mountStaticNode = (n2, container, anchor, namespace) => {
  3451. [n2.el, n2.anchor] = hostInsertStaticContent(
  3452. n2.children,
  3453. container,
  3454. anchor,
  3455. namespace,
  3456. n2.el,
  3457. n2.anchor
  3458. );
  3459. };
  3460. const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
  3461. let next;
  3462. while (el && el !== anchor) {
  3463. next = hostNextSibling(el);
  3464. hostInsert(el, container, nextSibling);
  3465. el = next;
  3466. }
  3467. hostInsert(anchor, container, nextSibling);
  3468. };
  3469. const removeStaticNode = ({ el, anchor }) => {
  3470. let next;
  3471. while (el && el !== anchor) {
  3472. next = hostNextSibling(el);
  3473. hostRemove(el);
  3474. el = next;
  3475. }
  3476. hostRemove(anchor);
  3477. };
  3478. const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  3479. if (n2.type === "svg") {
  3480. namespace = "svg";
  3481. } else if (n2.type === "math") {
  3482. namespace = "mathml";
  3483. }
  3484. if (n1 == null) {
  3485. mountElement(
  3486. n2,
  3487. container,
  3488. anchor,
  3489. parentComponent,
  3490. parentSuspense,
  3491. namespace,
  3492. slotScopeIds,
  3493. optimized
  3494. );
  3495. } else {
  3496. patchElement(
  3497. n1,
  3498. n2,
  3499. parentComponent,
  3500. parentSuspense,
  3501. namespace,
  3502. slotScopeIds,
  3503. optimized
  3504. );
  3505. }
  3506. };
  3507. const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  3508. let el;
  3509. let vnodeHook;
  3510. const { props, shapeFlag, transition, dirs } = vnode;
  3511. el = vnode.el = hostCreateElement(
  3512. vnode.type,
  3513. namespace,
  3514. props && props.is,
  3515. props
  3516. );
  3517. if (shapeFlag & 8) {
  3518. hostSetElementText(el, vnode.children);
  3519. } else if (shapeFlag & 16) {
  3520. mountChildren(
  3521. vnode.children,
  3522. el,
  3523. null,
  3524. parentComponent,
  3525. parentSuspense,
  3526. resolveChildrenNamespace(vnode, namespace),
  3527. slotScopeIds,
  3528. optimized
  3529. );
  3530. }
  3531. if (dirs) {
  3532. invokeDirectiveHook(vnode, null, parentComponent, "created");
  3533. }
  3534. setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
  3535. if (props) {
  3536. for (const key in props) {
  3537. if (key !== "value" && !shared.isReservedProp(key)) {
  3538. hostPatchProp(el, key, null, props[key], namespace, parentComponent);
  3539. }
  3540. }
  3541. if ("value" in props) {
  3542. hostPatchProp(el, "value", null, props.value, namespace);
  3543. }
  3544. if (vnodeHook = props.onVnodeBeforeMount) {
  3545. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  3546. }
  3547. }
  3548. if (dirs) {
  3549. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  3550. }
  3551. const needCallTransitionHooks = needTransition(parentSuspense, transition);
  3552. if (needCallTransitionHooks) {
  3553. transition.beforeEnter(el);
  3554. }
  3555. hostInsert(el, container, anchor);
  3556. if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
  3557. queuePostRenderEffect(() => {
  3558. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  3559. needCallTransitionHooks && transition.enter(el);
  3560. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  3561. }, parentSuspense);
  3562. }
  3563. };
  3564. const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
  3565. if (scopeId) {
  3566. hostSetScopeId(el, scopeId);
  3567. }
  3568. if (slotScopeIds) {
  3569. for (let i = 0; i < slotScopeIds.length; i++) {
  3570. hostSetScopeId(el, slotScopeIds[i]);
  3571. }
  3572. }
  3573. if (parentComponent) {
  3574. let subTree = parentComponent.subTree;
  3575. if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
  3576. const parentVNode = parentComponent.vnode;
  3577. setScopeId(
  3578. el,
  3579. parentVNode,
  3580. parentVNode.scopeId,
  3581. parentVNode.slotScopeIds,
  3582. parentComponent.parent
  3583. );
  3584. }
  3585. }
  3586. };
  3587. const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
  3588. for (let i = start; i < children.length; i++) {
  3589. const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
  3590. patch(
  3591. null,
  3592. child,
  3593. container,
  3594. anchor,
  3595. parentComponent,
  3596. parentSuspense,
  3597. namespace,
  3598. slotScopeIds,
  3599. optimized
  3600. );
  3601. }
  3602. };
  3603. const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  3604. const el = n2.el = n1.el;
  3605. let { patchFlag, dynamicChildren, dirs } = n2;
  3606. patchFlag |= n1.patchFlag & 16;
  3607. const oldProps = n1.props || shared.EMPTY_OBJ;
  3608. const newProps = n2.props || shared.EMPTY_OBJ;
  3609. let vnodeHook;
  3610. parentComponent && toggleRecurse(parentComponent, false);
  3611. if (vnodeHook = newProps.onVnodeBeforeUpdate) {
  3612. invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  3613. }
  3614. if (dirs) {
  3615. invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
  3616. }
  3617. parentComponent && toggleRecurse(parentComponent, true);
  3618. if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
  3619. hostSetElementText(el, "");
  3620. }
  3621. if (dynamicChildren) {
  3622. patchBlockChildren(
  3623. n1.dynamicChildren,
  3624. dynamicChildren,
  3625. el,
  3626. parentComponent,
  3627. parentSuspense,
  3628. resolveChildrenNamespace(n2, namespace),
  3629. slotScopeIds
  3630. );
  3631. } else if (!optimized) {
  3632. patchChildren(
  3633. n1,
  3634. n2,
  3635. el,
  3636. null,
  3637. parentComponent,
  3638. parentSuspense,
  3639. resolveChildrenNamespace(n2, namespace),
  3640. slotScopeIds,
  3641. false
  3642. );
  3643. }
  3644. if (patchFlag > 0) {
  3645. if (patchFlag & 16) {
  3646. patchProps(el, oldProps, newProps, parentComponent, namespace);
  3647. } else {
  3648. if (patchFlag & 2) {
  3649. if (oldProps.class !== newProps.class) {
  3650. hostPatchProp(el, "class", null, newProps.class, namespace);
  3651. }
  3652. }
  3653. if (patchFlag & 4) {
  3654. hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
  3655. }
  3656. if (patchFlag & 8) {
  3657. const propsToUpdate = n2.dynamicProps;
  3658. for (let i = 0; i < propsToUpdate.length; i++) {
  3659. const key = propsToUpdate[i];
  3660. const prev = oldProps[key];
  3661. const next = newProps[key];
  3662. if (next !== prev || key === "value") {
  3663. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  3664. }
  3665. }
  3666. }
  3667. }
  3668. if (patchFlag & 1) {
  3669. if (n1.children !== n2.children) {
  3670. hostSetElementText(el, n2.children);
  3671. }
  3672. }
  3673. } else if (!optimized && dynamicChildren == null) {
  3674. patchProps(el, oldProps, newProps, parentComponent, namespace);
  3675. }
  3676. if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
  3677. queuePostRenderEffect(() => {
  3678. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  3679. dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
  3680. }, parentSuspense);
  3681. }
  3682. };
  3683. const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
  3684. for (let i = 0; i < newChildren.length; i++) {
  3685. const oldVNode = oldChildren[i];
  3686. const newVNode = newChildren[i];
  3687. const container = (
  3688. // oldVNode may be an errored async setup() component inside Suspense
  3689. // which will not have a mounted element
  3690. oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
  3691. // of the Fragment itself so it can move its children.
  3692. (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
  3693. // which also requires the correct parent container
  3694. !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
  3695. oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : (
  3696. // In other cases, the parent container is not actually used so we
  3697. // just pass the block element here to avoid a DOM parentNode call.
  3698. fallbackContainer
  3699. )
  3700. );
  3701. patch(
  3702. oldVNode,
  3703. newVNode,
  3704. container,
  3705. null,
  3706. parentComponent,
  3707. parentSuspense,
  3708. namespace,
  3709. slotScopeIds,
  3710. true
  3711. );
  3712. }
  3713. };
  3714. const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
  3715. if (oldProps !== newProps) {
  3716. if (oldProps !== shared.EMPTY_OBJ) {
  3717. for (const key in oldProps) {
  3718. if (!shared.isReservedProp(key) && !(key in newProps)) {
  3719. hostPatchProp(
  3720. el,
  3721. key,
  3722. oldProps[key],
  3723. null,
  3724. namespace,
  3725. parentComponent
  3726. );
  3727. }
  3728. }
  3729. }
  3730. for (const key in newProps) {
  3731. if (shared.isReservedProp(key)) continue;
  3732. const next = newProps[key];
  3733. const prev = oldProps[key];
  3734. if (next !== prev && key !== "value") {
  3735. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  3736. }
  3737. }
  3738. if ("value" in newProps) {
  3739. hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
  3740. }
  3741. }
  3742. };
  3743. const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  3744. const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
  3745. const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
  3746. let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
  3747. if (fragmentSlotScopeIds) {
  3748. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  3749. }
  3750. if (n1 == null) {
  3751. hostInsert(fragmentStartAnchor, container, anchor);
  3752. hostInsert(fragmentEndAnchor, container, anchor);
  3753. mountChildren(
  3754. // #10007
  3755. // such fragment like `<></>` will be compiled into
  3756. // a fragment which doesn't have a children.
  3757. // In this case fallback to an empty array
  3758. n2.children || [],
  3759. container,
  3760. fragmentEndAnchor,
  3761. parentComponent,
  3762. parentSuspense,
  3763. namespace,
  3764. slotScopeIds,
  3765. optimized
  3766. );
  3767. } else {
  3768. if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
  3769. // of renderSlot() with no valid children
  3770. n1.dynamicChildren) {
  3771. patchBlockChildren(
  3772. n1.dynamicChildren,
  3773. dynamicChildren,
  3774. container,
  3775. parentComponent,
  3776. parentSuspense,
  3777. namespace,
  3778. slotScopeIds
  3779. );
  3780. if (
  3781. // #2080 if the stable fragment has a key, it's a <template v-for> that may
  3782. // get moved around. Make sure all root level vnodes inherit el.
  3783. // #2134 or if it's a component root, it may also get moved around
  3784. // as the component is being moved.
  3785. n2.key != null || parentComponent && n2 === parentComponent.subTree
  3786. ) {
  3787. traverseStaticChildren(
  3788. n1,
  3789. n2,
  3790. true
  3791. /* shallow */
  3792. );
  3793. }
  3794. } else {
  3795. patchChildren(
  3796. n1,
  3797. n2,
  3798. container,
  3799. fragmentEndAnchor,
  3800. parentComponent,
  3801. parentSuspense,
  3802. namespace,
  3803. slotScopeIds,
  3804. optimized
  3805. );
  3806. }
  3807. }
  3808. };
  3809. const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  3810. n2.slotScopeIds = slotScopeIds;
  3811. if (n1 == null) {
  3812. if (n2.shapeFlag & 512) {
  3813. parentComponent.ctx.activate(
  3814. n2,
  3815. container,
  3816. anchor,
  3817. namespace,
  3818. optimized
  3819. );
  3820. } else {
  3821. mountComponent(
  3822. n2,
  3823. container,
  3824. anchor,
  3825. parentComponent,
  3826. parentSuspense,
  3827. namespace,
  3828. optimized
  3829. );
  3830. }
  3831. } else {
  3832. updateComponent(n1, n2, optimized);
  3833. }
  3834. };
  3835. const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
  3836. const instance = (initialVNode.component = createComponentInstance(
  3837. initialVNode,
  3838. parentComponent,
  3839. parentSuspense
  3840. ));
  3841. if (isKeepAlive(initialVNode)) {
  3842. instance.ctx.renderer = internals;
  3843. }
  3844. {
  3845. setupComponent(instance, false, optimized);
  3846. }
  3847. if (instance.asyncDep) {
  3848. parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
  3849. if (!initialVNode.el) {
  3850. const placeholder = instance.subTree = createVNode(Comment);
  3851. processCommentNode(null, placeholder, container, anchor);
  3852. }
  3853. } else {
  3854. setupRenderEffect(
  3855. instance,
  3856. initialVNode,
  3857. container,
  3858. anchor,
  3859. parentSuspense,
  3860. namespace,
  3861. optimized
  3862. );
  3863. }
  3864. };
  3865. const updateComponent = (n1, n2, optimized) => {
  3866. const instance = n2.component = n1.component;
  3867. if (shouldUpdateComponent(n1, n2, optimized)) {
  3868. if (instance.asyncDep && !instance.asyncResolved) {
  3869. updateComponentPreRender(instance, n2, optimized);
  3870. return;
  3871. } else {
  3872. instance.next = n2;
  3873. instance.update();
  3874. }
  3875. } else {
  3876. n2.el = n1.el;
  3877. instance.vnode = n2;
  3878. }
  3879. };
  3880. const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
  3881. const componentUpdateFn = () => {
  3882. if (!instance.isMounted) {
  3883. let vnodeHook;
  3884. const { el, props } = initialVNode;
  3885. const { bm, m, parent, root, type } = instance;
  3886. const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
  3887. toggleRecurse(instance, false);
  3888. if (bm) {
  3889. shared.invokeArrayFns(bm);
  3890. }
  3891. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
  3892. invokeVNodeHook(vnodeHook, parent, initialVNode);
  3893. }
  3894. toggleRecurse(instance, true);
  3895. if (el && hydrateNode) {
  3896. const hydrateSubTree = () => {
  3897. instance.subTree = renderComponentRoot(instance);
  3898. hydrateNode(
  3899. el,
  3900. instance.subTree,
  3901. instance,
  3902. parentSuspense,
  3903. null
  3904. );
  3905. };
  3906. if (isAsyncWrapperVNode && type.__asyncHydrate) {
  3907. type.__asyncHydrate(
  3908. el,
  3909. instance,
  3910. hydrateSubTree
  3911. );
  3912. } else {
  3913. hydrateSubTree();
  3914. }
  3915. } else {
  3916. if (root.ce) {
  3917. root.ce._injectChildStyle(type);
  3918. }
  3919. const subTree = instance.subTree = renderComponentRoot(instance);
  3920. patch(
  3921. null,
  3922. subTree,
  3923. container,
  3924. anchor,
  3925. instance,
  3926. parentSuspense,
  3927. namespace
  3928. );
  3929. initialVNode.el = subTree.el;
  3930. }
  3931. if (m) {
  3932. queuePostRenderEffect(m, parentSuspense);
  3933. }
  3934. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
  3935. const scopedInitialVNode = initialVNode;
  3936. queuePostRenderEffect(
  3937. () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
  3938. parentSuspense
  3939. );
  3940. }
  3941. if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
  3942. instance.a && queuePostRenderEffect(instance.a, parentSuspense);
  3943. }
  3944. instance.isMounted = true;
  3945. initialVNode = container = anchor = null;
  3946. } else {
  3947. let { next, bu, u, parent, vnode } = instance;
  3948. {
  3949. const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
  3950. if (nonHydratedAsyncRoot) {
  3951. if (next) {
  3952. next.el = vnode.el;
  3953. updateComponentPreRender(instance, next, optimized);
  3954. }
  3955. nonHydratedAsyncRoot.asyncDep.then(() => {
  3956. if (!instance.isUnmounted) {
  3957. componentUpdateFn();
  3958. }
  3959. });
  3960. return;
  3961. }
  3962. }
  3963. let originNext = next;
  3964. let vnodeHook;
  3965. toggleRecurse(instance, false);
  3966. if (next) {
  3967. next.el = vnode.el;
  3968. updateComponentPreRender(instance, next, optimized);
  3969. } else {
  3970. next = vnode;
  3971. }
  3972. if (bu) {
  3973. shared.invokeArrayFns(bu);
  3974. }
  3975. if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
  3976. invokeVNodeHook(vnodeHook, parent, next, vnode);
  3977. }
  3978. toggleRecurse(instance, true);
  3979. const nextTree = renderComponentRoot(instance);
  3980. const prevTree = instance.subTree;
  3981. instance.subTree = nextTree;
  3982. patch(
  3983. prevTree,
  3984. nextTree,
  3985. // parent may have changed if it's in a teleport
  3986. hostParentNode(prevTree.el),
  3987. // anchor may have changed if it's in a fragment
  3988. getNextHostNode(prevTree),
  3989. instance,
  3990. parentSuspense,
  3991. namespace
  3992. );
  3993. next.el = nextTree.el;
  3994. if (originNext === null) {
  3995. updateHOCHostEl(instance, nextTree.el);
  3996. }
  3997. if (u) {
  3998. queuePostRenderEffect(u, parentSuspense);
  3999. }
  4000. if (vnodeHook = next.props && next.props.onVnodeUpdated) {
  4001. queuePostRenderEffect(
  4002. () => invokeVNodeHook(vnodeHook, parent, next, vnode),
  4003. parentSuspense
  4004. );
  4005. }
  4006. }
  4007. };
  4008. instance.scope.on();
  4009. const effect = instance.effect = new reactivity.ReactiveEffect(componentUpdateFn);
  4010. instance.scope.off();
  4011. const update = instance.update = effect.run.bind(effect);
  4012. const job = instance.job = effect.runIfDirty.bind(effect);
  4013. job.i = instance;
  4014. job.id = instance.uid;
  4015. effect.scheduler = () => queueJob(job);
  4016. toggleRecurse(instance, true);
  4017. update();
  4018. };
  4019. const updateComponentPreRender = (instance, nextVNode, optimized) => {
  4020. nextVNode.component = instance;
  4021. const prevProps = instance.vnode.props;
  4022. instance.vnode = nextVNode;
  4023. instance.next = null;
  4024. updateProps(instance, nextVNode.props, prevProps, optimized);
  4025. updateSlots(instance, nextVNode.children, optimized);
  4026. reactivity.pauseTracking();
  4027. flushPreFlushCbs(instance);
  4028. reactivity.resetTracking();
  4029. };
  4030. const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
  4031. const c1 = n1 && n1.children;
  4032. const prevShapeFlag = n1 ? n1.shapeFlag : 0;
  4033. const c2 = n2.children;
  4034. const { patchFlag, shapeFlag } = n2;
  4035. if (patchFlag > 0) {
  4036. if (patchFlag & 128) {
  4037. patchKeyedChildren(
  4038. c1,
  4039. c2,
  4040. container,
  4041. anchor,
  4042. parentComponent,
  4043. parentSuspense,
  4044. namespace,
  4045. slotScopeIds,
  4046. optimized
  4047. );
  4048. return;
  4049. } else if (patchFlag & 256) {
  4050. patchUnkeyedChildren(
  4051. c1,
  4052. c2,
  4053. container,
  4054. anchor,
  4055. parentComponent,
  4056. parentSuspense,
  4057. namespace,
  4058. slotScopeIds,
  4059. optimized
  4060. );
  4061. return;
  4062. }
  4063. }
  4064. if (shapeFlag & 8) {
  4065. if (prevShapeFlag & 16) {
  4066. unmountChildren(c1, parentComponent, parentSuspense);
  4067. }
  4068. if (c2 !== c1) {
  4069. hostSetElementText(container, c2);
  4070. }
  4071. } else {
  4072. if (prevShapeFlag & 16) {
  4073. if (shapeFlag & 16) {
  4074. patchKeyedChildren(
  4075. c1,
  4076. c2,
  4077. container,
  4078. anchor,
  4079. parentComponent,
  4080. parentSuspense,
  4081. namespace,
  4082. slotScopeIds,
  4083. optimized
  4084. );
  4085. } else {
  4086. unmountChildren(c1, parentComponent, parentSuspense, true);
  4087. }
  4088. } else {
  4089. if (prevShapeFlag & 8) {
  4090. hostSetElementText(container, "");
  4091. }
  4092. if (shapeFlag & 16) {
  4093. mountChildren(
  4094. c2,
  4095. container,
  4096. anchor,
  4097. parentComponent,
  4098. parentSuspense,
  4099. namespace,
  4100. slotScopeIds,
  4101. optimized
  4102. );
  4103. }
  4104. }
  4105. }
  4106. };
  4107. const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4108. c1 = c1 || shared.EMPTY_ARR;
  4109. c2 = c2 || shared.EMPTY_ARR;
  4110. const oldLength = c1.length;
  4111. const newLength = c2.length;
  4112. const commonLength = Math.min(oldLength, newLength);
  4113. let i;
  4114. for (i = 0; i < commonLength; i++) {
  4115. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  4116. patch(
  4117. c1[i],
  4118. nextChild,
  4119. container,
  4120. null,
  4121. parentComponent,
  4122. parentSuspense,
  4123. namespace,
  4124. slotScopeIds,
  4125. optimized
  4126. );
  4127. }
  4128. if (oldLength > newLength) {
  4129. unmountChildren(
  4130. c1,
  4131. parentComponent,
  4132. parentSuspense,
  4133. true,
  4134. false,
  4135. commonLength
  4136. );
  4137. } else {
  4138. mountChildren(
  4139. c2,
  4140. container,
  4141. anchor,
  4142. parentComponent,
  4143. parentSuspense,
  4144. namespace,
  4145. slotScopeIds,
  4146. optimized,
  4147. commonLength
  4148. );
  4149. }
  4150. };
  4151. const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4152. let i = 0;
  4153. const l2 = c2.length;
  4154. let e1 = c1.length - 1;
  4155. let e2 = l2 - 1;
  4156. while (i <= e1 && i <= e2) {
  4157. const n1 = c1[i];
  4158. const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  4159. if (isSameVNodeType(n1, n2)) {
  4160. patch(
  4161. n1,
  4162. n2,
  4163. container,
  4164. null,
  4165. parentComponent,
  4166. parentSuspense,
  4167. namespace,
  4168. slotScopeIds,
  4169. optimized
  4170. );
  4171. } else {
  4172. break;
  4173. }
  4174. i++;
  4175. }
  4176. while (i <= e1 && i <= e2) {
  4177. const n1 = c1[e1];
  4178. const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
  4179. if (isSameVNodeType(n1, n2)) {
  4180. patch(
  4181. n1,
  4182. n2,
  4183. container,
  4184. null,
  4185. parentComponent,
  4186. parentSuspense,
  4187. namespace,
  4188. slotScopeIds,
  4189. optimized
  4190. );
  4191. } else {
  4192. break;
  4193. }
  4194. e1--;
  4195. e2--;
  4196. }
  4197. if (i > e1) {
  4198. if (i <= e2) {
  4199. const nextPos = e2 + 1;
  4200. const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
  4201. while (i <= e2) {
  4202. patch(
  4203. null,
  4204. c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
  4205. container,
  4206. anchor,
  4207. parentComponent,
  4208. parentSuspense,
  4209. namespace,
  4210. slotScopeIds,
  4211. optimized
  4212. );
  4213. i++;
  4214. }
  4215. }
  4216. } else if (i > e2) {
  4217. while (i <= e1) {
  4218. unmount(c1[i], parentComponent, parentSuspense, true);
  4219. i++;
  4220. }
  4221. } else {
  4222. const s1 = i;
  4223. const s2 = i;
  4224. const keyToNewIndexMap = /* @__PURE__ */ new Map();
  4225. for (i = s2; i <= e2; i++) {
  4226. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  4227. if (nextChild.key != null) {
  4228. keyToNewIndexMap.set(nextChild.key, i);
  4229. }
  4230. }
  4231. let j;
  4232. let patched = 0;
  4233. const toBePatched = e2 - s2 + 1;
  4234. let moved = false;
  4235. let maxNewIndexSoFar = 0;
  4236. const newIndexToOldIndexMap = new Array(toBePatched);
  4237. for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0;
  4238. for (i = s1; i <= e1; i++) {
  4239. const prevChild = c1[i];
  4240. if (patched >= toBePatched) {
  4241. unmount(prevChild, parentComponent, parentSuspense, true);
  4242. continue;
  4243. }
  4244. let newIndex;
  4245. if (prevChild.key != null) {
  4246. newIndex = keyToNewIndexMap.get(prevChild.key);
  4247. } else {
  4248. for (j = s2; j <= e2; j++) {
  4249. if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
  4250. newIndex = j;
  4251. break;
  4252. }
  4253. }
  4254. }
  4255. if (newIndex === void 0) {
  4256. unmount(prevChild, parentComponent, parentSuspense, true);
  4257. } else {
  4258. newIndexToOldIndexMap[newIndex - s2] = i + 1;
  4259. if (newIndex >= maxNewIndexSoFar) {
  4260. maxNewIndexSoFar = newIndex;
  4261. } else {
  4262. moved = true;
  4263. }
  4264. patch(
  4265. prevChild,
  4266. c2[newIndex],
  4267. container,
  4268. null,
  4269. parentComponent,
  4270. parentSuspense,
  4271. namespace,
  4272. slotScopeIds,
  4273. optimized
  4274. );
  4275. patched++;
  4276. }
  4277. }
  4278. const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : shared.EMPTY_ARR;
  4279. j = increasingNewIndexSequence.length - 1;
  4280. for (i = toBePatched - 1; i >= 0; i--) {
  4281. const nextIndex = s2 + i;
  4282. const nextChild = c2[nextIndex];
  4283. const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
  4284. if (newIndexToOldIndexMap[i] === 0) {
  4285. patch(
  4286. null,
  4287. nextChild,
  4288. container,
  4289. anchor,
  4290. parentComponent,
  4291. parentSuspense,
  4292. namespace,
  4293. slotScopeIds,
  4294. optimized
  4295. );
  4296. } else if (moved) {
  4297. if (j < 0 || i !== increasingNewIndexSequence[j]) {
  4298. move(nextChild, container, anchor, 2);
  4299. } else {
  4300. j--;
  4301. }
  4302. }
  4303. }
  4304. }
  4305. };
  4306. const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
  4307. const { el, type, transition, children, shapeFlag } = vnode;
  4308. if (shapeFlag & 6) {
  4309. move(vnode.component.subTree, container, anchor, moveType);
  4310. return;
  4311. }
  4312. if (shapeFlag & 128) {
  4313. vnode.suspense.move(container, anchor, moveType);
  4314. return;
  4315. }
  4316. if (shapeFlag & 64) {
  4317. type.move(vnode, container, anchor, internals);
  4318. return;
  4319. }
  4320. if (type === Fragment) {
  4321. hostInsert(el, container, anchor);
  4322. for (let i = 0; i < children.length; i++) {
  4323. move(children[i], container, anchor, moveType);
  4324. }
  4325. hostInsert(vnode.anchor, container, anchor);
  4326. return;
  4327. }
  4328. if (type === Static) {
  4329. moveStaticNode(vnode, container, anchor);
  4330. return;
  4331. }
  4332. const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
  4333. if (needTransition2) {
  4334. if (moveType === 0) {
  4335. transition.beforeEnter(el);
  4336. hostInsert(el, container, anchor);
  4337. queuePostRenderEffect(() => transition.enter(el), parentSuspense);
  4338. } else {
  4339. const { leave, delayLeave, afterLeave } = transition;
  4340. const remove2 = () => hostInsert(el, container, anchor);
  4341. const performLeave = () => {
  4342. leave(el, () => {
  4343. remove2();
  4344. afterLeave && afterLeave();
  4345. });
  4346. };
  4347. if (delayLeave) {
  4348. delayLeave(el, remove2, performLeave);
  4349. } else {
  4350. performLeave();
  4351. }
  4352. }
  4353. } else {
  4354. hostInsert(el, container, anchor);
  4355. }
  4356. };
  4357. const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
  4358. const {
  4359. type,
  4360. props,
  4361. ref,
  4362. children,
  4363. dynamicChildren,
  4364. shapeFlag,
  4365. patchFlag,
  4366. dirs,
  4367. cacheIndex
  4368. } = vnode;
  4369. if (patchFlag === -2) {
  4370. optimized = false;
  4371. }
  4372. if (ref != null) {
  4373. setRef(ref, null, parentSuspense, vnode, true);
  4374. }
  4375. if (cacheIndex != null) {
  4376. parentComponent.renderCache[cacheIndex] = void 0;
  4377. }
  4378. if (shapeFlag & 256) {
  4379. parentComponent.ctx.deactivate(vnode);
  4380. return;
  4381. }
  4382. const shouldInvokeDirs = shapeFlag & 1 && dirs;
  4383. const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
  4384. let vnodeHook;
  4385. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
  4386. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  4387. }
  4388. if (shapeFlag & 6) {
  4389. unmountComponent(vnode.component, parentSuspense, doRemove);
  4390. } else {
  4391. if (shapeFlag & 128) {
  4392. vnode.suspense.unmount(parentSuspense, doRemove);
  4393. return;
  4394. }
  4395. if (shouldInvokeDirs) {
  4396. invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
  4397. }
  4398. if (shapeFlag & 64) {
  4399. vnode.type.remove(
  4400. vnode,
  4401. parentComponent,
  4402. parentSuspense,
  4403. internals,
  4404. doRemove
  4405. );
  4406. } else if (dynamicChildren && // #5154
  4407. // when v-once is used inside a block, setBlockTracking(-1) marks the
  4408. // parent block with hasOnce: true
  4409. // so that it doesn't take the fast path during unmount - otherwise
  4410. // components nested in v-once are never unmounted.
  4411. !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments
  4412. (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
  4413. unmountChildren(
  4414. dynamicChildren,
  4415. parentComponent,
  4416. parentSuspense,
  4417. false,
  4418. true
  4419. );
  4420. } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
  4421. unmountChildren(children, parentComponent, parentSuspense);
  4422. }
  4423. if (doRemove) {
  4424. remove(vnode);
  4425. }
  4426. }
  4427. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
  4428. queuePostRenderEffect(() => {
  4429. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  4430. shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
  4431. }, parentSuspense);
  4432. }
  4433. };
  4434. const remove = (vnode) => {
  4435. const { type, el, anchor, transition } = vnode;
  4436. if (type === Fragment) {
  4437. {
  4438. removeFragment(el, anchor);
  4439. }
  4440. return;
  4441. }
  4442. if (type === Static) {
  4443. removeStaticNode(vnode);
  4444. return;
  4445. }
  4446. const performRemove = () => {
  4447. hostRemove(el);
  4448. if (transition && !transition.persisted && transition.afterLeave) {
  4449. transition.afterLeave();
  4450. }
  4451. };
  4452. if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
  4453. const { leave, delayLeave } = transition;
  4454. const performLeave = () => leave(el, performRemove);
  4455. if (delayLeave) {
  4456. delayLeave(vnode.el, performRemove, performLeave);
  4457. } else {
  4458. performLeave();
  4459. }
  4460. } else {
  4461. performRemove();
  4462. }
  4463. };
  4464. const removeFragment = (cur, end) => {
  4465. let next;
  4466. while (cur !== end) {
  4467. next = hostNextSibling(cur);
  4468. hostRemove(cur);
  4469. cur = next;
  4470. }
  4471. hostRemove(end);
  4472. };
  4473. const unmountComponent = (instance, parentSuspense, doRemove) => {
  4474. const { bum, scope, job, subTree, um, m, a } = instance;
  4475. invalidateMount(m);
  4476. invalidateMount(a);
  4477. if (bum) {
  4478. shared.invokeArrayFns(bum);
  4479. }
  4480. scope.stop();
  4481. if (job) {
  4482. job.flags |= 8;
  4483. unmount(subTree, instance, parentSuspense, doRemove);
  4484. }
  4485. if (um) {
  4486. queuePostRenderEffect(um, parentSuspense);
  4487. }
  4488. queuePostRenderEffect(() => {
  4489. instance.isUnmounted = true;
  4490. }, parentSuspense);
  4491. if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
  4492. parentSuspense.deps--;
  4493. if (parentSuspense.deps === 0) {
  4494. parentSuspense.resolve();
  4495. }
  4496. }
  4497. };
  4498. const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
  4499. for (let i = start; i < children.length; i++) {
  4500. unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
  4501. }
  4502. };
  4503. const getNextHostNode = (vnode) => {
  4504. if (vnode.shapeFlag & 6) {
  4505. return getNextHostNode(vnode.component.subTree);
  4506. }
  4507. if (vnode.shapeFlag & 128) {
  4508. return vnode.suspense.next();
  4509. }
  4510. const el = hostNextSibling(vnode.anchor || vnode.el);
  4511. const teleportEnd = el && el[TeleportEndKey];
  4512. return teleportEnd ? hostNextSibling(teleportEnd) : el;
  4513. };
  4514. let isFlushing = false;
  4515. const render = (vnode, container, namespace) => {
  4516. if (vnode == null) {
  4517. if (container._vnode) {
  4518. unmount(container._vnode, null, null, true);
  4519. }
  4520. } else {
  4521. patch(
  4522. container._vnode || null,
  4523. vnode,
  4524. container,
  4525. null,
  4526. null,
  4527. null,
  4528. namespace
  4529. );
  4530. }
  4531. container._vnode = vnode;
  4532. if (!isFlushing) {
  4533. isFlushing = true;
  4534. flushPreFlushCbs();
  4535. flushPostFlushCbs();
  4536. isFlushing = false;
  4537. }
  4538. };
  4539. const internals = {
  4540. p: patch,
  4541. um: unmount,
  4542. m: move,
  4543. r: remove,
  4544. mt: mountComponent,
  4545. mc: mountChildren,
  4546. pc: patchChildren,
  4547. pbc: patchBlockChildren,
  4548. n: getNextHostNode,
  4549. o: options
  4550. };
  4551. let hydrate;
  4552. let hydrateNode;
  4553. if (createHydrationFns) {
  4554. [hydrate, hydrateNode] = createHydrationFns(
  4555. internals
  4556. );
  4557. }
  4558. return {
  4559. render,
  4560. hydrate,
  4561. createApp: createAppAPI(render, hydrate)
  4562. };
  4563. }
  4564. function resolveChildrenNamespace({ type, props }, currentNamespace) {
  4565. return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
  4566. }
  4567. function toggleRecurse({ effect, job }, allowed) {
  4568. if (allowed) {
  4569. effect.flags |= 32;
  4570. job.flags |= 4;
  4571. } else {
  4572. effect.flags &= ~32;
  4573. job.flags &= ~4;
  4574. }
  4575. }
  4576. function needTransition(parentSuspense, transition) {
  4577. return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
  4578. }
  4579. function traverseStaticChildren(n1, n2, shallow = false) {
  4580. const ch1 = n1.children;
  4581. const ch2 = n2.children;
  4582. if (shared.isArray(ch1) && shared.isArray(ch2)) {
  4583. for (let i = 0; i < ch1.length; i++) {
  4584. const c1 = ch1[i];
  4585. let c2 = ch2[i];
  4586. if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
  4587. if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
  4588. c2 = ch2[i] = cloneIfMounted(ch2[i]);
  4589. c2.el = c1.el;
  4590. }
  4591. if (!shallow && c2.patchFlag !== -2)
  4592. traverseStaticChildren(c1, c2);
  4593. }
  4594. if (c2.type === Text) {
  4595. c2.el = c1.el;
  4596. }
  4597. }
  4598. }
  4599. }
  4600. function getSequence(arr) {
  4601. const p = arr.slice();
  4602. const result = [0];
  4603. let i, j, u, v, c;
  4604. const len = arr.length;
  4605. for (i = 0; i < len; i++) {
  4606. const arrI = arr[i];
  4607. if (arrI !== 0) {
  4608. j = result[result.length - 1];
  4609. if (arr[j] < arrI) {
  4610. p[i] = j;
  4611. result.push(i);
  4612. continue;
  4613. }
  4614. u = 0;
  4615. v = result.length - 1;
  4616. while (u < v) {
  4617. c = u + v >> 1;
  4618. if (arr[result[c]] < arrI) {
  4619. u = c + 1;
  4620. } else {
  4621. v = c;
  4622. }
  4623. }
  4624. if (arrI < arr[result[u]]) {
  4625. if (u > 0) {
  4626. p[i] = result[u - 1];
  4627. }
  4628. result[u] = i;
  4629. }
  4630. }
  4631. }
  4632. u = result.length;
  4633. v = result[u - 1];
  4634. while (u-- > 0) {
  4635. result[u] = v;
  4636. v = p[v];
  4637. }
  4638. return result;
  4639. }
  4640. function locateNonHydratedAsyncRoot(instance) {
  4641. const subComponent = instance.subTree.component;
  4642. if (subComponent) {
  4643. if (subComponent.asyncDep && !subComponent.asyncResolved) {
  4644. return subComponent;
  4645. } else {
  4646. return locateNonHydratedAsyncRoot(subComponent);
  4647. }
  4648. }
  4649. }
  4650. function invalidateMount(hooks) {
  4651. if (hooks) {
  4652. for (let i = 0; i < hooks.length; i++)
  4653. hooks[i].flags |= 8;
  4654. }
  4655. }
  4656. const ssrContextKey = Symbol.for("v-scx");
  4657. const useSSRContext = () => {
  4658. {
  4659. const ctx = inject(ssrContextKey);
  4660. return ctx;
  4661. }
  4662. };
  4663. function watchEffect(effect, options) {
  4664. return doWatch(effect, null, options);
  4665. }
  4666. function watchPostEffect(effect, options) {
  4667. return doWatch(
  4668. effect,
  4669. null,
  4670. { flush: "post" }
  4671. );
  4672. }
  4673. function watchSyncEffect(effect, options) {
  4674. return doWatch(
  4675. effect,
  4676. null,
  4677. { flush: "sync" }
  4678. );
  4679. }
  4680. function watch(source, cb, options) {
  4681. return doWatch(source, cb, options);
  4682. }
  4683. function doWatch(source, cb, options = shared.EMPTY_OBJ) {
  4684. const { immediate, deep, flush, once } = options;
  4685. const baseWatchOptions = shared.extend({}, options);
  4686. let ssrCleanup;
  4687. if (isInSSRComponentSetup) {
  4688. if (flush === "sync") {
  4689. const ctx = useSSRContext();
  4690. ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
  4691. } else if (!cb || immediate) {
  4692. baseWatchOptions.once = true;
  4693. } else {
  4694. return {
  4695. stop: shared.NOOP,
  4696. resume: shared.NOOP,
  4697. pause: shared.NOOP
  4698. };
  4699. }
  4700. }
  4701. const instance = currentInstance;
  4702. baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
  4703. let isPre = false;
  4704. if (flush === "post") {
  4705. baseWatchOptions.scheduler = (job) => {
  4706. queuePostRenderEffect(job, instance && instance.suspense);
  4707. };
  4708. } else if (flush !== "sync") {
  4709. isPre = true;
  4710. baseWatchOptions.scheduler = (job, isFirstRun) => {
  4711. if (isFirstRun) {
  4712. job();
  4713. } else {
  4714. queueJob(job);
  4715. }
  4716. };
  4717. }
  4718. baseWatchOptions.augmentJob = (job) => {
  4719. if (cb) {
  4720. job.flags |= 4;
  4721. }
  4722. if (isPre) {
  4723. job.flags |= 2;
  4724. if (instance) {
  4725. job.id = instance.uid;
  4726. job.i = instance;
  4727. }
  4728. }
  4729. };
  4730. const watchHandle = reactivity.watch(source, cb, baseWatchOptions);
  4731. if (ssrCleanup) ssrCleanup.push(watchHandle);
  4732. return watchHandle;
  4733. }
  4734. function instanceWatch(source, value, options) {
  4735. const publicThis = this.proxy;
  4736. const getter = shared.isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  4737. let cb;
  4738. if (shared.isFunction(value)) {
  4739. cb = value;
  4740. } else {
  4741. cb = value.handler;
  4742. options = value;
  4743. }
  4744. const reset = setCurrentInstance(this);
  4745. const res = doWatch(getter, cb.bind(publicThis), options);
  4746. reset();
  4747. return res;
  4748. }
  4749. function createPathGetter(ctx, path) {
  4750. const segments = path.split(".");
  4751. return () => {
  4752. let cur = ctx;
  4753. for (let i = 0; i < segments.length && cur; i++) {
  4754. cur = cur[segments[i]];
  4755. }
  4756. return cur;
  4757. };
  4758. }
  4759. function useModel(props, name, options = shared.EMPTY_OBJ) {
  4760. const i = getCurrentInstance();
  4761. const camelizedName = shared.camelize(name);
  4762. const hyphenatedName = shared.hyphenate(name);
  4763. const modifiers = getModelModifiers(props, name);
  4764. const res = reactivity.customRef((track, trigger) => {
  4765. let localValue;
  4766. let prevSetValue = shared.EMPTY_OBJ;
  4767. let prevEmittedValue;
  4768. watchSyncEffect(() => {
  4769. const propValue = props[name];
  4770. if (shared.hasChanged(localValue, propValue)) {
  4771. localValue = propValue;
  4772. trigger();
  4773. }
  4774. });
  4775. return {
  4776. get() {
  4777. track();
  4778. return options.get ? options.get(localValue) : localValue;
  4779. },
  4780. set(value) {
  4781. const emittedValue = options.set ? options.set(value) : value;
  4782. if (!shared.hasChanged(emittedValue, localValue) && !(prevSetValue !== shared.EMPTY_OBJ && shared.hasChanged(value, prevSetValue))) {
  4783. return;
  4784. }
  4785. const rawProps = i.vnode.props;
  4786. if (!(rawProps && // check if parent has passed v-model
  4787. (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
  4788. localValue = value;
  4789. trigger();
  4790. }
  4791. i.emit(`update:${name}`, emittedValue);
  4792. if (shared.hasChanged(value, emittedValue) && shared.hasChanged(value, prevSetValue) && !shared.hasChanged(emittedValue, prevEmittedValue)) {
  4793. trigger();
  4794. }
  4795. prevSetValue = value;
  4796. prevEmittedValue = emittedValue;
  4797. }
  4798. };
  4799. });
  4800. res[Symbol.iterator] = () => {
  4801. let i2 = 0;
  4802. return {
  4803. next() {
  4804. if (i2 < 2) {
  4805. return { value: i2++ ? modifiers || shared.EMPTY_OBJ : res, done: false };
  4806. } else {
  4807. return { done: true };
  4808. }
  4809. }
  4810. };
  4811. };
  4812. return res;
  4813. }
  4814. const getModelModifiers = (props, modelName) => {
  4815. return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${shared.camelize(modelName)}Modifiers`] || props[`${shared.hyphenate(modelName)}Modifiers`];
  4816. };
  4817. function emit(instance, event, ...rawArgs) {
  4818. if (instance.isUnmounted) return;
  4819. const props = instance.vnode.props || shared.EMPTY_OBJ;
  4820. let args = rawArgs;
  4821. const isModelListener = event.startsWith("update:");
  4822. const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
  4823. if (modifiers) {
  4824. if (modifiers.trim) {
  4825. args = rawArgs.map((a) => shared.isString(a) ? a.trim() : a);
  4826. }
  4827. if (modifiers.number) {
  4828. args = rawArgs.map(shared.looseToNumber);
  4829. }
  4830. }
  4831. let handlerName;
  4832. let handler = props[handlerName = shared.toHandlerKey(event)] || // also try camelCase event handler (#2249)
  4833. props[handlerName = shared.toHandlerKey(shared.camelize(event))];
  4834. if (!handler && isModelListener) {
  4835. handler = props[handlerName = shared.toHandlerKey(shared.hyphenate(event))];
  4836. }
  4837. if (handler) {
  4838. callWithAsyncErrorHandling(
  4839. handler,
  4840. instance,
  4841. 6,
  4842. args
  4843. );
  4844. }
  4845. const onceHandler = props[handlerName + `Once`];
  4846. if (onceHandler) {
  4847. if (!instance.emitted) {
  4848. instance.emitted = {};
  4849. } else if (instance.emitted[handlerName]) {
  4850. return;
  4851. }
  4852. instance.emitted[handlerName] = true;
  4853. callWithAsyncErrorHandling(
  4854. onceHandler,
  4855. instance,
  4856. 6,
  4857. args
  4858. );
  4859. }
  4860. }
  4861. function normalizeEmitsOptions(comp, appContext, asMixin = false) {
  4862. const cache = appContext.emitsCache;
  4863. const cached = cache.get(comp);
  4864. if (cached !== void 0) {
  4865. return cached;
  4866. }
  4867. const raw = comp.emits;
  4868. let normalized = {};
  4869. let hasExtends = false;
  4870. if (!shared.isFunction(comp)) {
  4871. const extendEmits = (raw2) => {
  4872. const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
  4873. if (normalizedFromExtend) {
  4874. hasExtends = true;
  4875. shared.extend(normalized, normalizedFromExtend);
  4876. }
  4877. };
  4878. if (!asMixin && appContext.mixins.length) {
  4879. appContext.mixins.forEach(extendEmits);
  4880. }
  4881. if (comp.extends) {
  4882. extendEmits(comp.extends);
  4883. }
  4884. if (comp.mixins) {
  4885. comp.mixins.forEach(extendEmits);
  4886. }
  4887. }
  4888. if (!raw && !hasExtends) {
  4889. if (shared.isObject(comp)) {
  4890. cache.set(comp, null);
  4891. }
  4892. return null;
  4893. }
  4894. if (shared.isArray(raw)) {
  4895. raw.forEach((key) => normalized[key] = null);
  4896. } else {
  4897. shared.extend(normalized, raw);
  4898. }
  4899. if (shared.isObject(comp)) {
  4900. cache.set(comp, normalized);
  4901. }
  4902. return normalized;
  4903. }
  4904. function isEmitListener(options, key) {
  4905. if (!options || !shared.isOn(key)) {
  4906. return false;
  4907. }
  4908. key = key.slice(2).replace(/Once$/, "");
  4909. return shared.hasOwn(options, key[0].toLowerCase() + key.slice(1)) || shared.hasOwn(options, shared.hyphenate(key)) || shared.hasOwn(options, key);
  4910. }
  4911. function markAttrsAccessed() {
  4912. }
  4913. function renderComponentRoot(instance) {
  4914. const {
  4915. type: Component,
  4916. vnode,
  4917. proxy,
  4918. withProxy,
  4919. propsOptions: [propsOptions],
  4920. slots,
  4921. attrs,
  4922. emit,
  4923. render,
  4924. renderCache,
  4925. props,
  4926. data,
  4927. setupState,
  4928. ctx,
  4929. inheritAttrs
  4930. } = instance;
  4931. const prev = setCurrentRenderingInstance(instance);
  4932. let result;
  4933. let fallthroughAttrs;
  4934. try {
  4935. if (vnode.shapeFlag & 4) {
  4936. const proxyToUse = withProxy || proxy;
  4937. const thisProxy = false ? new Proxy(proxyToUse, {
  4938. get(target, key, receiver) {
  4939. warn(
  4940. `Property '${String(
  4941. key
  4942. )}' was accessed via 'this'. Avoid using 'this' in templates.`
  4943. );
  4944. return Reflect.get(target, key, receiver);
  4945. }
  4946. }) : proxyToUse;
  4947. result = normalizeVNode(
  4948. render.call(
  4949. thisProxy,
  4950. proxyToUse,
  4951. renderCache,
  4952. false ? shallowReadonly(props) : props,
  4953. setupState,
  4954. data,
  4955. ctx
  4956. )
  4957. );
  4958. fallthroughAttrs = attrs;
  4959. } else {
  4960. const render2 = Component;
  4961. if (false) ;
  4962. result = normalizeVNode(
  4963. render2.length > 1 ? render2(
  4964. false ? shallowReadonly(props) : props,
  4965. false ? {
  4966. get attrs() {
  4967. markAttrsAccessed();
  4968. return shallowReadonly(attrs);
  4969. },
  4970. slots,
  4971. emit
  4972. } : { attrs, slots, emit }
  4973. ) : render2(
  4974. false ? shallowReadonly(props) : props,
  4975. null
  4976. )
  4977. );
  4978. fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
  4979. }
  4980. } catch (err) {
  4981. blockStack.length = 0;
  4982. handleError(err, instance, 1);
  4983. result = createVNode(Comment);
  4984. }
  4985. let root = result;
  4986. if (fallthroughAttrs && inheritAttrs !== false) {
  4987. const keys = Object.keys(fallthroughAttrs);
  4988. const { shapeFlag } = root;
  4989. if (keys.length) {
  4990. if (shapeFlag & (1 | 6)) {
  4991. if (propsOptions && keys.some(shared.isModelListener)) {
  4992. fallthroughAttrs = filterModelListeners(
  4993. fallthroughAttrs,
  4994. propsOptions
  4995. );
  4996. }
  4997. root = cloneVNode(root, fallthroughAttrs, false, true);
  4998. }
  4999. }
  5000. }
  5001. if (vnode.dirs) {
  5002. root = cloneVNode(root, null, false, true);
  5003. root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
  5004. }
  5005. if (vnode.transition) {
  5006. setTransitionHooks(root, vnode.transition);
  5007. }
  5008. {
  5009. result = root;
  5010. }
  5011. setCurrentRenderingInstance(prev);
  5012. return result;
  5013. }
  5014. function filterSingleRoot(children, recurse = true) {
  5015. let singleRoot;
  5016. for (let i = 0; i < children.length; i++) {
  5017. const child = children[i];
  5018. if (isVNode(child)) {
  5019. if (child.type !== Comment || child.children === "v-if") {
  5020. if (singleRoot) {
  5021. return;
  5022. } else {
  5023. singleRoot = child;
  5024. }
  5025. }
  5026. } else {
  5027. return;
  5028. }
  5029. }
  5030. return singleRoot;
  5031. }
  5032. const getFunctionalFallthrough = (attrs) => {
  5033. let res;
  5034. for (const key in attrs) {
  5035. if (key === "class" || key === "style" || shared.isOn(key)) {
  5036. (res || (res = {}))[key] = attrs[key];
  5037. }
  5038. }
  5039. return res;
  5040. };
  5041. const filterModelListeners = (attrs, props) => {
  5042. const res = {};
  5043. for (const key in attrs) {
  5044. if (!shared.isModelListener(key) || !(key.slice(9) in props)) {
  5045. res[key] = attrs[key];
  5046. }
  5047. }
  5048. return res;
  5049. };
  5050. function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
  5051. const { props: prevProps, children: prevChildren, component } = prevVNode;
  5052. const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
  5053. const emits = component.emitsOptions;
  5054. if (nextVNode.dirs || nextVNode.transition) {
  5055. return true;
  5056. }
  5057. if (optimized && patchFlag >= 0) {
  5058. if (patchFlag & 1024) {
  5059. return true;
  5060. }
  5061. if (patchFlag & 16) {
  5062. if (!prevProps) {
  5063. return !!nextProps;
  5064. }
  5065. return hasPropsChanged(prevProps, nextProps, emits);
  5066. } else if (patchFlag & 8) {
  5067. const dynamicProps = nextVNode.dynamicProps;
  5068. for (let i = 0; i < dynamicProps.length; i++) {
  5069. const key = dynamicProps[i];
  5070. if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
  5071. return true;
  5072. }
  5073. }
  5074. }
  5075. } else {
  5076. if (prevChildren || nextChildren) {
  5077. if (!nextChildren || !nextChildren.$stable) {
  5078. return true;
  5079. }
  5080. }
  5081. if (prevProps === nextProps) {
  5082. return false;
  5083. }
  5084. if (!prevProps) {
  5085. return !!nextProps;
  5086. }
  5087. if (!nextProps) {
  5088. return true;
  5089. }
  5090. return hasPropsChanged(prevProps, nextProps, emits);
  5091. }
  5092. return false;
  5093. }
  5094. function hasPropsChanged(prevProps, nextProps, emitsOptions) {
  5095. const nextKeys = Object.keys(nextProps);
  5096. if (nextKeys.length !== Object.keys(prevProps).length) {
  5097. return true;
  5098. }
  5099. for (let i = 0; i < nextKeys.length; i++) {
  5100. const key = nextKeys[i];
  5101. if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
  5102. return true;
  5103. }
  5104. }
  5105. return false;
  5106. }
  5107. function updateHOCHostEl({ vnode, parent }, el) {
  5108. while (parent) {
  5109. const root = parent.subTree;
  5110. if (root.suspense && root.suspense.activeBranch === vnode) {
  5111. root.el = vnode.el;
  5112. }
  5113. if (root === vnode) {
  5114. (vnode = parent.vnode).el = el;
  5115. parent = parent.parent;
  5116. } else {
  5117. break;
  5118. }
  5119. }
  5120. }
  5121. const isSuspense = (type) => type.__isSuspense;
  5122. let suspenseId = 0;
  5123. const SuspenseImpl = {
  5124. name: "Suspense",
  5125. // In order to make Suspense tree-shakable, we need to avoid importing it
  5126. // directly in the renderer. The renderer checks for the __isSuspense flag
  5127. // on a vnode's type and calls the `process` method, passing in renderer
  5128. // internals.
  5129. __isSuspense: true,
  5130. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
  5131. if (n1 == null) {
  5132. mountSuspense(
  5133. n2,
  5134. container,
  5135. anchor,
  5136. parentComponent,
  5137. parentSuspense,
  5138. namespace,
  5139. slotScopeIds,
  5140. optimized,
  5141. rendererInternals
  5142. );
  5143. } else {
  5144. if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
  5145. n2.suspense = n1.suspense;
  5146. n2.suspense.vnode = n2;
  5147. n2.el = n1.el;
  5148. return;
  5149. }
  5150. patchSuspense(
  5151. n1,
  5152. n2,
  5153. container,
  5154. anchor,
  5155. parentComponent,
  5156. namespace,
  5157. slotScopeIds,
  5158. optimized,
  5159. rendererInternals
  5160. );
  5161. }
  5162. },
  5163. hydrate: hydrateSuspense,
  5164. normalize: normalizeSuspenseChildren
  5165. };
  5166. const Suspense = SuspenseImpl ;
  5167. function triggerEvent(vnode, name) {
  5168. const eventListener = vnode.props && vnode.props[name];
  5169. if (shared.isFunction(eventListener)) {
  5170. eventListener();
  5171. }
  5172. }
  5173. function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
  5174. const {
  5175. p: patch,
  5176. o: { createElement }
  5177. } = rendererInternals;
  5178. const hiddenContainer = createElement("div");
  5179. const suspense = vnode.suspense = createSuspenseBoundary(
  5180. vnode,
  5181. parentSuspense,
  5182. parentComponent,
  5183. container,
  5184. hiddenContainer,
  5185. anchor,
  5186. namespace,
  5187. slotScopeIds,
  5188. optimized,
  5189. rendererInternals
  5190. );
  5191. patch(
  5192. null,
  5193. suspense.pendingBranch = vnode.ssContent,
  5194. hiddenContainer,
  5195. null,
  5196. parentComponent,
  5197. suspense,
  5198. namespace,
  5199. slotScopeIds
  5200. );
  5201. if (suspense.deps > 0) {
  5202. triggerEvent(vnode, "onPending");
  5203. triggerEvent(vnode, "onFallback");
  5204. patch(
  5205. null,
  5206. vnode.ssFallback,
  5207. container,
  5208. anchor,
  5209. parentComponent,
  5210. null,
  5211. // fallback tree will not have suspense context
  5212. namespace,
  5213. slotScopeIds
  5214. );
  5215. setActiveBranch(suspense, vnode.ssFallback);
  5216. } else {
  5217. suspense.resolve(false, true);
  5218. }
  5219. }
  5220. function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
  5221. const suspense = n2.suspense = n1.suspense;
  5222. suspense.vnode = n2;
  5223. n2.el = n1.el;
  5224. const newBranch = n2.ssContent;
  5225. const newFallback = n2.ssFallback;
  5226. const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
  5227. if (pendingBranch) {
  5228. suspense.pendingBranch = newBranch;
  5229. if (isSameVNodeType(newBranch, pendingBranch)) {
  5230. patch(
  5231. pendingBranch,
  5232. newBranch,
  5233. suspense.hiddenContainer,
  5234. null,
  5235. parentComponent,
  5236. suspense,
  5237. namespace,
  5238. slotScopeIds,
  5239. optimized
  5240. );
  5241. if (suspense.deps <= 0) {
  5242. suspense.resolve();
  5243. } else if (isInFallback) {
  5244. if (!isHydrating) {
  5245. patch(
  5246. activeBranch,
  5247. newFallback,
  5248. container,
  5249. anchor,
  5250. parentComponent,
  5251. null,
  5252. // fallback tree will not have suspense context
  5253. namespace,
  5254. slotScopeIds,
  5255. optimized
  5256. );
  5257. setActiveBranch(suspense, newFallback);
  5258. }
  5259. }
  5260. } else {
  5261. suspense.pendingId = suspenseId++;
  5262. if (isHydrating) {
  5263. suspense.isHydrating = false;
  5264. suspense.activeBranch = pendingBranch;
  5265. } else {
  5266. unmount(pendingBranch, parentComponent, suspense);
  5267. }
  5268. suspense.deps = 0;
  5269. suspense.effects.length = 0;
  5270. suspense.hiddenContainer = createElement("div");
  5271. if (isInFallback) {
  5272. patch(
  5273. null,
  5274. newBranch,
  5275. suspense.hiddenContainer,
  5276. null,
  5277. parentComponent,
  5278. suspense,
  5279. namespace,
  5280. slotScopeIds,
  5281. optimized
  5282. );
  5283. if (suspense.deps <= 0) {
  5284. suspense.resolve();
  5285. } else {
  5286. patch(
  5287. activeBranch,
  5288. newFallback,
  5289. container,
  5290. anchor,
  5291. parentComponent,
  5292. null,
  5293. // fallback tree will not have suspense context
  5294. namespace,
  5295. slotScopeIds,
  5296. optimized
  5297. );
  5298. setActiveBranch(suspense, newFallback);
  5299. }
  5300. } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
  5301. patch(
  5302. activeBranch,
  5303. newBranch,
  5304. container,
  5305. anchor,
  5306. parentComponent,
  5307. suspense,
  5308. namespace,
  5309. slotScopeIds,
  5310. optimized
  5311. );
  5312. suspense.resolve(true);
  5313. } else {
  5314. patch(
  5315. null,
  5316. newBranch,
  5317. suspense.hiddenContainer,
  5318. null,
  5319. parentComponent,
  5320. suspense,
  5321. namespace,
  5322. slotScopeIds,
  5323. optimized
  5324. );
  5325. if (suspense.deps <= 0) {
  5326. suspense.resolve();
  5327. }
  5328. }
  5329. }
  5330. } else {
  5331. if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
  5332. patch(
  5333. activeBranch,
  5334. newBranch,
  5335. container,
  5336. anchor,
  5337. parentComponent,
  5338. suspense,
  5339. namespace,
  5340. slotScopeIds,
  5341. optimized
  5342. );
  5343. setActiveBranch(suspense, newBranch);
  5344. } else {
  5345. triggerEvent(n2, "onPending");
  5346. suspense.pendingBranch = newBranch;
  5347. if (newBranch.shapeFlag & 512) {
  5348. suspense.pendingId = newBranch.component.suspenseId;
  5349. } else {
  5350. suspense.pendingId = suspenseId++;
  5351. }
  5352. patch(
  5353. null,
  5354. newBranch,
  5355. suspense.hiddenContainer,
  5356. null,
  5357. parentComponent,
  5358. suspense,
  5359. namespace,
  5360. slotScopeIds,
  5361. optimized
  5362. );
  5363. if (suspense.deps <= 0) {
  5364. suspense.resolve();
  5365. } else {
  5366. const { timeout, pendingId } = suspense;
  5367. if (timeout > 0) {
  5368. setTimeout(() => {
  5369. if (suspense.pendingId === pendingId) {
  5370. suspense.fallback(newFallback);
  5371. }
  5372. }, timeout);
  5373. } else if (timeout === 0) {
  5374. suspense.fallback(newFallback);
  5375. }
  5376. }
  5377. }
  5378. }
  5379. }
  5380. function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
  5381. const {
  5382. p: patch,
  5383. m: move,
  5384. um: unmount,
  5385. n: next,
  5386. o: { parentNode, remove }
  5387. } = rendererInternals;
  5388. let parentSuspenseId;
  5389. const isSuspensible = isVNodeSuspensible(vnode);
  5390. if (isSuspensible) {
  5391. if (parentSuspense && parentSuspense.pendingBranch) {
  5392. parentSuspenseId = parentSuspense.pendingId;
  5393. parentSuspense.deps++;
  5394. }
  5395. }
  5396. const timeout = vnode.props ? shared.toNumber(vnode.props.timeout) : void 0;
  5397. const initialAnchor = anchor;
  5398. const suspense = {
  5399. vnode,
  5400. parent: parentSuspense,
  5401. parentComponent,
  5402. namespace,
  5403. container,
  5404. hiddenContainer,
  5405. deps: 0,
  5406. pendingId: suspenseId++,
  5407. timeout: typeof timeout === "number" ? timeout : -1,
  5408. activeBranch: null,
  5409. pendingBranch: null,
  5410. isInFallback: !isHydrating,
  5411. isHydrating,
  5412. isUnmounted: false,
  5413. effects: [],
  5414. resolve(resume = false, sync = false) {
  5415. const {
  5416. vnode: vnode2,
  5417. activeBranch,
  5418. pendingBranch,
  5419. pendingId,
  5420. effects,
  5421. parentComponent: parentComponent2,
  5422. container: container2
  5423. } = suspense;
  5424. let delayEnter = false;
  5425. if (suspense.isHydrating) {
  5426. suspense.isHydrating = false;
  5427. } else if (!resume) {
  5428. delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
  5429. if (delayEnter) {
  5430. activeBranch.transition.afterLeave = () => {
  5431. if (pendingId === suspense.pendingId) {
  5432. move(
  5433. pendingBranch,
  5434. container2,
  5435. anchor === initialAnchor ? next(activeBranch) : anchor,
  5436. 0
  5437. );
  5438. queuePostFlushCb(effects);
  5439. }
  5440. };
  5441. }
  5442. if (activeBranch) {
  5443. if (parentNode(activeBranch.el) === container2) {
  5444. anchor = next(activeBranch);
  5445. }
  5446. unmount(activeBranch, parentComponent2, suspense, true);
  5447. }
  5448. if (!delayEnter) {
  5449. move(pendingBranch, container2, anchor, 0);
  5450. }
  5451. }
  5452. setActiveBranch(suspense, pendingBranch);
  5453. suspense.pendingBranch = null;
  5454. suspense.isInFallback = false;
  5455. let parent = suspense.parent;
  5456. let hasUnresolvedAncestor = false;
  5457. while (parent) {
  5458. if (parent.pendingBranch) {
  5459. parent.effects.push(...effects);
  5460. hasUnresolvedAncestor = true;
  5461. break;
  5462. }
  5463. parent = parent.parent;
  5464. }
  5465. if (!hasUnresolvedAncestor && !delayEnter) {
  5466. queuePostFlushCb(effects);
  5467. }
  5468. suspense.effects = [];
  5469. if (isSuspensible) {
  5470. if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
  5471. parentSuspense.deps--;
  5472. if (parentSuspense.deps === 0 && !sync) {
  5473. parentSuspense.resolve();
  5474. }
  5475. }
  5476. }
  5477. triggerEvent(vnode2, "onResolve");
  5478. },
  5479. fallback(fallbackVNode) {
  5480. if (!suspense.pendingBranch) {
  5481. return;
  5482. }
  5483. const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
  5484. triggerEvent(vnode2, "onFallback");
  5485. const anchor2 = next(activeBranch);
  5486. const mountFallback = () => {
  5487. if (!suspense.isInFallback) {
  5488. return;
  5489. }
  5490. patch(
  5491. null,
  5492. fallbackVNode,
  5493. container2,
  5494. anchor2,
  5495. parentComponent2,
  5496. null,
  5497. // fallback tree will not have suspense context
  5498. namespace2,
  5499. slotScopeIds,
  5500. optimized
  5501. );
  5502. setActiveBranch(suspense, fallbackVNode);
  5503. };
  5504. const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
  5505. if (delayEnter) {
  5506. activeBranch.transition.afterLeave = mountFallback;
  5507. }
  5508. suspense.isInFallback = true;
  5509. unmount(
  5510. activeBranch,
  5511. parentComponent2,
  5512. null,
  5513. // no suspense so unmount hooks fire now
  5514. true
  5515. // shouldRemove
  5516. );
  5517. if (!delayEnter) {
  5518. mountFallback();
  5519. }
  5520. },
  5521. move(container2, anchor2, type) {
  5522. suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
  5523. suspense.container = container2;
  5524. },
  5525. next() {
  5526. return suspense.activeBranch && next(suspense.activeBranch);
  5527. },
  5528. registerDep(instance, setupRenderEffect, optimized2) {
  5529. const isInPendingSuspense = !!suspense.pendingBranch;
  5530. if (isInPendingSuspense) {
  5531. suspense.deps++;
  5532. }
  5533. const hydratedEl = instance.vnode.el;
  5534. instance.asyncDep.catch((err) => {
  5535. handleError(err, instance, 0);
  5536. }).then((asyncSetupResult) => {
  5537. if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
  5538. return;
  5539. }
  5540. instance.asyncResolved = true;
  5541. const { vnode: vnode2 } = instance;
  5542. handleSetupResult(instance, asyncSetupResult, false);
  5543. if (hydratedEl) {
  5544. vnode2.el = hydratedEl;
  5545. }
  5546. const placeholder = !hydratedEl && instance.subTree.el;
  5547. setupRenderEffect(
  5548. instance,
  5549. vnode2,
  5550. // component may have been moved before resolve.
  5551. // if this is not a hydration, instance.subTree will be the comment
  5552. // placeholder.
  5553. parentNode(hydratedEl || instance.subTree.el),
  5554. // anchor will not be used if this is hydration, so only need to
  5555. // consider the comment placeholder case.
  5556. hydratedEl ? null : next(instance.subTree),
  5557. suspense,
  5558. namespace,
  5559. optimized2
  5560. );
  5561. if (placeholder) {
  5562. remove(placeholder);
  5563. }
  5564. updateHOCHostEl(instance, vnode2.el);
  5565. if (isInPendingSuspense && --suspense.deps === 0) {
  5566. suspense.resolve();
  5567. }
  5568. });
  5569. },
  5570. unmount(parentSuspense2, doRemove) {
  5571. suspense.isUnmounted = true;
  5572. if (suspense.activeBranch) {
  5573. unmount(
  5574. suspense.activeBranch,
  5575. parentComponent,
  5576. parentSuspense2,
  5577. doRemove
  5578. );
  5579. }
  5580. if (suspense.pendingBranch) {
  5581. unmount(
  5582. suspense.pendingBranch,
  5583. parentComponent,
  5584. parentSuspense2,
  5585. doRemove
  5586. );
  5587. }
  5588. }
  5589. };
  5590. return suspense;
  5591. }
  5592. function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
  5593. const suspense = vnode.suspense = createSuspenseBoundary(
  5594. vnode,
  5595. parentSuspense,
  5596. parentComponent,
  5597. node.parentNode,
  5598. // eslint-disable-next-line no-restricted-globals
  5599. document.createElement("div"),
  5600. null,
  5601. namespace,
  5602. slotScopeIds,
  5603. optimized,
  5604. rendererInternals,
  5605. true
  5606. );
  5607. const result = hydrateNode(
  5608. node,
  5609. suspense.pendingBranch = vnode.ssContent,
  5610. parentComponent,
  5611. suspense,
  5612. slotScopeIds,
  5613. optimized
  5614. );
  5615. if (suspense.deps === 0) {
  5616. suspense.resolve(false, true);
  5617. }
  5618. return result;
  5619. }
  5620. function normalizeSuspenseChildren(vnode) {
  5621. const { shapeFlag, children } = vnode;
  5622. const isSlotChildren = shapeFlag & 32;
  5623. vnode.ssContent = normalizeSuspenseSlot(
  5624. isSlotChildren ? children.default : children
  5625. );
  5626. vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment);
  5627. }
  5628. function normalizeSuspenseSlot(s) {
  5629. let block;
  5630. if (shared.isFunction(s)) {
  5631. const trackBlock = isBlockTreeEnabled && s._c;
  5632. if (trackBlock) {
  5633. s._d = false;
  5634. openBlock();
  5635. }
  5636. s = s();
  5637. if (trackBlock) {
  5638. s._d = true;
  5639. block = currentBlock;
  5640. closeBlock();
  5641. }
  5642. }
  5643. if (shared.isArray(s)) {
  5644. const singleChild = filterSingleRoot(s);
  5645. s = singleChild;
  5646. }
  5647. s = normalizeVNode(s);
  5648. if (block && !s.dynamicChildren) {
  5649. s.dynamicChildren = block.filter((c) => c !== s);
  5650. }
  5651. return s;
  5652. }
  5653. function queueEffectWithSuspense(fn, suspense) {
  5654. if (suspense && suspense.pendingBranch) {
  5655. if (shared.isArray(fn)) {
  5656. suspense.effects.push(...fn);
  5657. } else {
  5658. suspense.effects.push(fn);
  5659. }
  5660. } else {
  5661. queuePostFlushCb(fn);
  5662. }
  5663. }
  5664. function setActiveBranch(suspense, branch) {
  5665. suspense.activeBranch = branch;
  5666. const { vnode, parentComponent } = suspense;
  5667. let el = branch.el;
  5668. while (!el && branch.component) {
  5669. branch = branch.component.subTree;
  5670. el = branch.el;
  5671. }
  5672. vnode.el = el;
  5673. if (parentComponent && parentComponent.subTree === vnode) {
  5674. parentComponent.vnode.el = el;
  5675. updateHOCHostEl(parentComponent, el);
  5676. }
  5677. }
  5678. function isVNodeSuspensible(vnode) {
  5679. const suspensible = vnode.props && vnode.props.suspensible;
  5680. return suspensible != null && suspensible !== false;
  5681. }
  5682. const Fragment = Symbol.for("v-fgt");
  5683. const Text = Symbol.for("v-txt");
  5684. const Comment = Symbol.for("v-cmt");
  5685. const Static = Symbol.for("v-stc");
  5686. const blockStack = [];
  5687. let currentBlock = null;
  5688. function openBlock(disableTracking = false) {
  5689. blockStack.push(currentBlock = disableTracking ? null : []);
  5690. }
  5691. function closeBlock() {
  5692. blockStack.pop();
  5693. currentBlock = blockStack[blockStack.length - 1] || null;
  5694. }
  5695. let isBlockTreeEnabled = 1;
  5696. function setBlockTracking(value) {
  5697. isBlockTreeEnabled += value;
  5698. if (value < 0 && currentBlock) {
  5699. currentBlock.hasOnce = true;
  5700. }
  5701. }
  5702. function setupBlock(vnode) {
  5703. vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || shared.EMPTY_ARR : null;
  5704. closeBlock();
  5705. if (isBlockTreeEnabled > 0 && currentBlock) {
  5706. currentBlock.push(vnode);
  5707. }
  5708. return vnode;
  5709. }
  5710. function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
  5711. return setupBlock(
  5712. createBaseVNode(
  5713. type,
  5714. props,
  5715. children,
  5716. patchFlag,
  5717. dynamicProps,
  5718. shapeFlag,
  5719. true
  5720. )
  5721. );
  5722. }
  5723. function createBlock(type, props, children, patchFlag, dynamicProps) {
  5724. return setupBlock(
  5725. createVNode(
  5726. type,
  5727. props,
  5728. children,
  5729. patchFlag,
  5730. dynamicProps,
  5731. true
  5732. )
  5733. );
  5734. }
  5735. function isVNode(value) {
  5736. return value ? value.__v_isVNode === true : false;
  5737. }
  5738. function isSameVNodeType(n1, n2) {
  5739. return n1.type === n2.type && n1.key === n2.key;
  5740. }
  5741. function transformVNodeArgs(transformer) {
  5742. }
  5743. const normalizeKey = ({ key }) => key != null ? key : null;
  5744. const normalizeRef = ({
  5745. ref,
  5746. ref_key,
  5747. ref_for
  5748. }) => {
  5749. if (typeof ref === "number") {
  5750. ref = "" + ref;
  5751. }
  5752. return ref != null ? shared.isString(ref) || reactivity.isRef(ref) || shared.isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
  5753. };
  5754. function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
  5755. const vnode = {
  5756. __v_isVNode: true,
  5757. __v_skip: true,
  5758. type,
  5759. props,
  5760. key: props && normalizeKey(props),
  5761. ref: props && normalizeRef(props),
  5762. scopeId: currentScopeId,
  5763. slotScopeIds: null,
  5764. children,
  5765. component: null,
  5766. suspense: null,
  5767. ssContent: null,
  5768. ssFallback: null,
  5769. dirs: null,
  5770. transition: null,
  5771. el: null,
  5772. anchor: null,
  5773. target: null,
  5774. targetStart: null,
  5775. targetAnchor: null,
  5776. staticCount: 0,
  5777. shapeFlag,
  5778. patchFlag,
  5779. dynamicProps,
  5780. dynamicChildren: null,
  5781. appContext: null,
  5782. ctx: currentRenderingInstance
  5783. };
  5784. if (needFullChildrenNormalization) {
  5785. normalizeChildren(vnode, children);
  5786. if (shapeFlag & 128) {
  5787. type.normalize(vnode);
  5788. }
  5789. } else if (children) {
  5790. vnode.shapeFlag |= shared.isString(children) ? 8 : 16;
  5791. }
  5792. if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
  5793. !isBlockNode && // has current parent block
  5794. currentBlock && // presence of a patch flag indicates this node needs patching on updates.
  5795. // component nodes also should always be patched, because even if the
  5796. // component doesn't need to update, it needs to persist the instance on to
  5797. // the next vnode so that it can be properly unmounted later.
  5798. (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
  5799. // vnode should not be considered dynamic due to handler caching.
  5800. vnode.patchFlag !== 32) {
  5801. currentBlock.push(vnode);
  5802. }
  5803. return vnode;
  5804. }
  5805. const createVNode = _createVNode;
  5806. function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
  5807. if (!type || type === NULL_DYNAMIC_COMPONENT) {
  5808. type = Comment;
  5809. }
  5810. if (isVNode(type)) {
  5811. const cloned = cloneVNode(
  5812. type,
  5813. props,
  5814. true
  5815. /* mergeRef: true */
  5816. );
  5817. if (children) {
  5818. normalizeChildren(cloned, children);
  5819. }
  5820. if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
  5821. if (cloned.shapeFlag & 6) {
  5822. currentBlock[currentBlock.indexOf(type)] = cloned;
  5823. } else {
  5824. currentBlock.push(cloned);
  5825. }
  5826. }
  5827. cloned.patchFlag = -2;
  5828. return cloned;
  5829. }
  5830. if (isClassComponent(type)) {
  5831. type = type.__vccOpts;
  5832. }
  5833. if (props) {
  5834. props = guardReactiveProps(props);
  5835. let { class: klass, style } = props;
  5836. if (klass && !shared.isString(klass)) {
  5837. props.class = shared.normalizeClass(klass);
  5838. }
  5839. if (shared.isObject(style)) {
  5840. if (reactivity.isProxy(style) && !shared.isArray(style)) {
  5841. style = shared.extend({}, style);
  5842. }
  5843. props.style = shared.normalizeStyle(style);
  5844. }
  5845. }
  5846. const shapeFlag = shared.isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : shared.isObject(type) ? 4 : shared.isFunction(type) ? 2 : 0;
  5847. return createBaseVNode(
  5848. type,
  5849. props,
  5850. children,
  5851. patchFlag,
  5852. dynamicProps,
  5853. shapeFlag,
  5854. isBlockNode,
  5855. true
  5856. );
  5857. }
  5858. function guardReactiveProps(props) {
  5859. if (!props) return null;
  5860. return reactivity.isProxy(props) || isInternalObject(props) ? shared.extend({}, props) : props;
  5861. }
  5862. function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
  5863. const { props, ref, patchFlag, children, transition } = vnode;
  5864. const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
  5865. const cloned = {
  5866. __v_isVNode: true,
  5867. __v_skip: true,
  5868. type: vnode.type,
  5869. props: mergedProps,
  5870. key: mergedProps && normalizeKey(mergedProps),
  5871. ref: extraProps && extraProps.ref ? (
  5872. // #2078 in the case of <component :is="vnode" ref="extra"/>
  5873. // if the vnode itself already has a ref, cloneVNode will need to merge
  5874. // the refs so the single vnode can be set on multiple refs
  5875. mergeRef && ref ? shared.isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps)
  5876. ) : ref,
  5877. scopeId: vnode.scopeId,
  5878. slotScopeIds: vnode.slotScopeIds,
  5879. children: children,
  5880. target: vnode.target,
  5881. targetStart: vnode.targetStart,
  5882. targetAnchor: vnode.targetAnchor,
  5883. staticCount: vnode.staticCount,
  5884. shapeFlag: vnode.shapeFlag,
  5885. // if the vnode is cloned with extra props, we can no longer assume its
  5886. // existing patch flag to be reliable and need to add the FULL_PROPS flag.
  5887. // note: preserve flag for fragments since they use the flag for children
  5888. // fast paths only.
  5889. patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
  5890. dynamicProps: vnode.dynamicProps,
  5891. dynamicChildren: vnode.dynamicChildren,
  5892. appContext: vnode.appContext,
  5893. dirs: vnode.dirs,
  5894. transition,
  5895. // These should technically only be non-null on mounted VNodes. However,
  5896. // they *should* be copied for kept-alive vnodes. So we just always copy
  5897. // them since them being non-null during a mount doesn't affect the logic as
  5898. // they will simply be overwritten.
  5899. component: vnode.component,
  5900. suspense: vnode.suspense,
  5901. ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
  5902. ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
  5903. el: vnode.el,
  5904. anchor: vnode.anchor,
  5905. ctx: vnode.ctx,
  5906. ce: vnode.ce
  5907. };
  5908. if (transition && cloneTransition) {
  5909. setTransitionHooks(
  5910. cloned,
  5911. transition.clone(cloned)
  5912. );
  5913. }
  5914. return cloned;
  5915. }
  5916. function createTextVNode(text = " ", flag = 0) {
  5917. return createVNode(Text, null, text, flag);
  5918. }
  5919. function createStaticVNode(content, numberOfNodes) {
  5920. const vnode = createVNode(Static, null, content);
  5921. vnode.staticCount = numberOfNodes;
  5922. return vnode;
  5923. }
  5924. function createCommentVNode(text = "", asBlock = false) {
  5925. return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
  5926. }
  5927. function normalizeVNode(child) {
  5928. if (child == null || typeof child === "boolean") {
  5929. return createVNode(Comment);
  5930. } else if (shared.isArray(child)) {
  5931. return createVNode(
  5932. Fragment,
  5933. null,
  5934. // #3666, avoid reference pollution when reusing vnode
  5935. child.slice()
  5936. );
  5937. } else if (typeof child === "object") {
  5938. return cloneIfMounted(child);
  5939. } else {
  5940. return createVNode(Text, null, String(child));
  5941. }
  5942. }
  5943. function cloneIfMounted(child) {
  5944. return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
  5945. }
  5946. function normalizeChildren(vnode, children) {
  5947. let type = 0;
  5948. const { shapeFlag } = vnode;
  5949. if (children == null) {
  5950. children = null;
  5951. } else if (shared.isArray(children)) {
  5952. type = 16;
  5953. } else if (typeof children === "object") {
  5954. if (shapeFlag & (1 | 64)) {
  5955. const slot = children.default;
  5956. if (slot) {
  5957. slot._c && (slot._d = false);
  5958. normalizeChildren(vnode, slot());
  5959. slot._c && (slot._d = true);
  5960. }
  5961. return;
  5962. } else {
  5963. type = 32;
  5964. const slotFlag = children._;
  5965. if (!slotFlag && !isInternalObject(children)) {
  5966. children._ctx = currentRenderingInstance;
  5967. } else if (slotFlag === 3 && currentRenderingInstance) {
  5968. if (currentRenderingInstance.slots._ === 1) {
  5969. children._ = 1;
  5970. } else {
  5971. children._ = 2;
  5972. vnode.patchFlag |= 1024;
  5973. }
  5974. }
  5975. }
  5976. } else if (shared.isFunction(children)) {
  5977. children = { default: children, _ctx: currentRenderingInstance };
  5978. type = 32;
  5979. } else {
  5980. children = String(children);
  5981. if (shapeFlag & 64) {
  5982. type = 16;
  5983. children = [createTextVNode(children)];
  5984. } else {
  5985. type = 8;
  5986. }
  5987. }
  5988. vnode.children = children;
  5989. vnode.shapeFlag |= type;
  5990. }
  5991. function mergeProps(...args) {
  5992. const ret = {};
  5993. for (let i = 0; i < args.length; i++) {
  5994. const toMerge = args[i];
  5995. for (const key in toMerge) {
  5996. if (key === "class") {
  5997. if (ret.class !== toMerge.class) {
  5998. ret.class = shared.normalizeClass([ret.class, toMerge.class]);
  5999. }
  6000. } else if (key === "style") {
  6001. ret.style = shared.normalizeStyle([ret.style, toMerge.style]);
  6002. } else if (shared.isOn(key)) {
  6003. const existing = ret[key];
  6004. const incoming = toMerge[key];
  6005. if (incoming && existing !== incoming && !(shared.isArray(existing) && existing.includes(incoming))) {
  6006. ret[key] = existing ? [].concat(existing, incoming) : incoming;
  6007. }
  6008. } else if (key !== "") {
  6009. ret[key] = toMerge[key];
  6010. }
  6011. }
  6012. }
  6013. return ret;
  6014. }
  6015. function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
  6016. callWithAsyncErrorHandling(hook, instance, 7, [
  6017. vnode,
  6018. prevVNode
  6019. ]);
  6020. }
  6021. const emptyAppContext = createAppContext();
  6022. let uid = 0;
  6023. function createComponentInstance(vnode, parent, suspense) {
  6024. const type = vnode.type;
  6025. const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  6026. const instance = {
  6027. uid: uid++,
  6028. vnode,
  6029. type,
  6030. parent,
  6031. appContext,
  6032. root: null,
  6033. // to be immediately set
  6034. next: null,
  6035. subTree: null,
  6036. // will be set synchronously right after creation
  6037. effect: null,
  6038. update: null,
  6039. // will be set synchronously right after creation
  6040. job: null,
  6041. scope: new reactivity.EffectScope(
  6042. true
  6043. /* detached */
  6044. ),
  6045. render: null,
  6046. proxy: null,
  6047. exposed: null,
  6048. exposeProxy: null,
  6049. withProxy: null,
  6050. provides: parent ? parent.provides : Object.create(appContext.provides),
  6051. ids: parent ? parent.ids : ["", 0, 0],
  6052. accessCache: null,
  6053. renderCache: [],
  6054. // local resolved assets
  6055. components: null,
  6056. directives: null,
  6057. // resolved props and emits options
  6058. propsOptions: normalizePropsOptions(type, appContext),
  6059. emitsOptions: normalizeEmitsOptions(type, appContext),
  6060. // emit
  6061. emit: null,
  6062. // to be set immediately
  6063. emitted: null,
  6064. // props default value
  6065. propsDefaults: shared.EMPTY_OBJ,
  6066. // inheritAttrs
  6067. inheritAttrs: type.inheritAttrs,
  6068. // state
  6069. ctx: shared.EMPTY_OBJ,
  6070. data: shared.EMPTY_OBJ,
  6071. props: shared.EMPTY_OBJ,
  6072. attrs: shared.EMPTY_OBJ,
  6073. slots: shared.EMPTY_OBJ,
  6074. refs: shared.EMPTY_OBJ,
  6075. setupState: shared.EMPTY_OBJ,
  6076. setupContext: null,
  6077. // suspense related
  6078. suspense,
  6079. suspenseId: suspense ? suspense.pendingId : 0,
  6080. asyncDep: null,
  6081. asyncResolved: false,
  6082. // lifecycle hooks
  6083. // not using enums here because it results in computed properties
  6084. isMounted: false,
  6085. isUnmounted: false,
  6086. isDeactivated: false,
  6087. bc: null,
  6088. c: null,
  6089. bm: null,
  6090. m: null,
  6091. bu: null,
  6092. u: null,
  6093. um: null,
  6094. bum: null,
  6095. da: null,
  6096. a: null,
  6097. rtg: null,
  6098. rtc: null,
  6099. ec: null,
  6100. sp: null
  6101. };
  6102. {
  6103. instance.ctx = { _: instance };
  6104. }
  6105. instance.root = parent ? parent.root : instance;
  6106. instance.emit = emit.bind(null, instance);
  6107. if (vnode.ce) {
  6108. vnode.ce(instance);
  6109. }
  6110. return instance;
  6111. }
  6112. let currentInstance = null;
  6113. const getCurrentInstance = () => currentInstance || currentRenderingInstance;
  6114. let internalSetCurrentInstance;
  6115. let setInSSRSetupState;
  6116. {
  6117. const g = shared.getGlobalThis();
  6118. const registerGlobalSetter = (key, setter) => {
  6119. let setters;
  6120. if (!(setters = g[key])) setters = g[key] = [];
  6121. setters.push(setter);
  6122. return (v) => {
  6123. if (setters.length > 1) setters.forEach((set) => set(v));
  6124. else setters[0](v);
  6125. };
  6126. };
  6127. internalSetCurrentInstance = registerGlobalSetter(
  6128. `__VUE_INSTANCE_SETTERS__`,
  6129. (v) => currentInstance = v
  6130. );
  6131. setInSSRSetupState = registerGlobalSetter(
  6132. `__VUE_SSR_SETTERS__`,
  6133. (v) => isInSSRComponentSetup = v
  6134. );
  6135. }
  6136. const setCurrentInstance = (instance) => {
  6137. const prev = currentInstance;
  6138. internalSetCurrentInstance(instance);
  6139. instance.scope.on();
  6140. return () => {
  6141. instance.scope.off();
  6142. internalSetCurrentInstance(prev);
  6143. };
  6144. };
  6145. const unsetCurrentInstance = () => {
  6146. currentInstance && currentInstance.scope.off();
  6147. internalSetCurrentInstance(null);
  6148. };
  6149. function isStatefulComponent(instance) {
  6150. return instance.vnode.shapeFlag & 4;
  6151. }
  6152. let isInSSRComponentSetup = false;
  6153. function setupComponent(instance, isSSR = false, optimized = false) {
  6154. isSSR && setInSSRSetupState(isSSR);
  6155. const { props, children } = instance.vnode;
  6156. const isStateful = isStatefulComponent(instance);
  6157. initProps(instance, props, isStateful, isSSR);
  6158. initSlots(instance, children, optimized);
  6159. const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  6160. isSSR && setInSSRSetupState(false);
  6161. return setupResult;
  6162. }
  6163. function setupStatefulComponent(instance, isSSR) {
  6164. const Component = instance.type;
  6165. instance.accessCache = /* @__PURE__ */ Object.create(null);
  6166. instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
  6167. const { setup } = Component;
  6168. if (setup) {
  6169. const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
  6170. const reset = setCurrentInstance(instance);
  6171. reactivity.pauseTracking();
  6172. const setupResult = callWithErrorHandling(
  6173. setup,
  6174. instance,
  6175. 0,
  6176. [
  6177. instance.props,
  6178. setupContext
  6179. ]
  6180. );
  6181. reactivity.resetTracking();
  6182. reset();
  6183. if (shared.isPromise(setupResult)) {
  6184. if (!isAsyncWrapper(instance)) markAsyncBoundary(instance);
  6185. setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
  6186. if (isSSR) {
  6187. return setupResult.then((resolvedResult) => {
  6188. handleSetupResult(instance, resolvedResult, isSSR);
  6189. }).catch((e) => {
  6190. handleError(e, instance, 0);
  6191. });
  6192. } else {
  6193. instance.asyncDep = setupResult;
  6194. }
  6195. } else {
  6196. handleSetupResult(instance, setupResult, isSSR);
  6197. }
  6198. } else {
  6199. finishComponentSetup(instance, isSSR);
  6200. }
  6201. }
  6202. function handleSetupResult(instance, setupResult, isSSR) {
  6203. if (shared.isFunction(setupResult)) {
  6204. if (instance.type.__ssrInlineRender) {
  6205. instance.ssrRender = setupResult;
  6206. } else {
  6207. instance.render = setupResult;
  6208. }
  6209. } else if (shared.isObject(setupResult)) {
  6210. instance.setupState = reactivity.proxyRefs(setupResult);
  6211. } else ;
  6212. finishComponentSetup(instance, isSSR);
  6213. }
  6214. let compile;
  6215. let installWithProxy;
  6216. function registerRuntimeCompiler(_compile) {
  6217. compile = _compile;
  6218. installWithProxy = (i) => {
  6219. if (i.render._rc) {
  6220. i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
  6221. }
  6222. };
  6223. }
  6224. const isRuntimeOnly = () => !compile;
  6225. function finishComponentSetup(instance, isSSR, skipOptions) {
  6226. const Component = instance.type;
  6227. if (!instance.render) {
  6228. if (!isSSR && compile && !Component.render) {
  6229. const template = Component.template || resolveMergedOptions(instance).template;
  6230. if (template) {
  6231. const { isCustomElement, compilerOptions } = instance.appContext.config;
  6232. const { delimiters, compilerOptions: componentCompilerOptions } = Component;
  6233. const finalCompilerOptions = shared.extend(
  6234. shared.extend(
  6235. {
  6236. isCustomElement,
  6237. delimiters
  6238. },
  6239. compilerOptions
  6240. ),
  6241. componentCompilerOptions
  6242. );
  6243. Component.render = compile(template, finalCompilerOptions);
  6244. }
  6245. }
  6246. instance.render = Component.render || shared.NOOP;
  6247. if (installWithProxy) {
  6248. installWithProxy(instance);
  6249. }
  6250. }
  6251. {
  6252. const reset = setCurrentInstance(instance);
  6253. reactivity.pauseTracking();
  6254. try {
  6255. applyOptions(instance);
  6256. } finally {
  6257. reactivity.resetTracking();
  6258. reset();
  6259. }
  6260. }
  6261. }
  6262. const attrsProxyHandlers = {
  6263. get(target, key) {
  6264. reactivity.track(target, "get", "");
  6265. return target[key];
  6266. }
  6267. };
  6268. function createSetupContext(instance) {
  6269. const expose = (exposed) => {
  6270. instance.exposed = exposed || {};
  6271. };
  6272. {
  6273. return {
  6274. attrs: new Proxy(instance.attrs, attrsProxyHandlers),
  6275. slots: instance.slots,
  6276. emit: instance.emit,
  6277. expose
  6278. };
  6279. }
  6280. }
  6281. function getComponentPublicInstance(instance) {
  6282. if (instance.exposed) {
  6283. return instance.exposeProxy || (instance.exposeProxy = new Proxy(reactivity.proxyRefs(reactivity.markRaw(instance.exposed)), {
  6284. get(target, key) {
  6285. if (key in target) {
  6286. return target[key];
  6287. } else if (key in publicPropertiesMap) {
  6288. return publicPropertiesMap[key](instance);
  6289. }
  6290. },
  6291. has(target, key) {
  6292. return key in target || key in publicPropertiesMap;
  6293. }
  6294. }));
  6295. } else {
  6296. return instance.proxy;
  6297. }
  6298. }
  6299. function getComponentName(Component, includeInferred = true) {
  6300. return shared.isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
  6301. }
  6302. function isClassComponent(value) {
  6303. return shared.isFunction(value) && "__vccOpts" in value;
  6304. }
  6305. const computed = (getterOrOptions, debugOptions) => {
  6306. const c = reactivity.computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
  6307. return c;
  6308. };
  6309. function h(type, propsOrChildren, children) {
  6310. const l = arguments.length;
  6311. if (l === 2) {
  6312. if (shared.isObject(propsOrChildren) && !shared.isArray(propsOrChildren)) {
  6313. if (isVNode(propsOrChildren)) {
  6314. return createVNode(type, null, [propsOrChildren]);
  6315. }
  6316. return createVNode(type, propsOrChildren);
  6317. } else {
  6318. return createVNode(type, null, propsOrChildren);
  6319. }
  6320. } else {
  6321. if (l > 3) {
  6322. children = Array.prototype.slice.call(arguments, 2);
  6323. } else if (l === 3 && isVNode(children)) {
  6324. children = [children];
  6325. }
  6326. return createVNode(type, propsOrChildren, children);
  6327. }
  6328. }
  6329. function initCustomFormatter() {
  6330. {
  6331. return;
  6332. }
  6333. }
  6334. function withMemo(memo, render, cache, index) {
  6335. const cached = cache[index];
  6336. if (cached && isMemoSame(cached, memo)) {
  6337. return cached;
  6338. }
  6339. const ret = render();
  6340. ret.memo = memo.slice();
  6341. ret.cacheIndex = index;
  6342. return cache[index] = ret;
  6343. }
  6344. function isMemoSame(cached, memo) {
  6345. const prev = cached.memo;
  6346. if (prev.length != memo.length) {
  6347. return false;
  6348. }
  6349. for (let i = 0; i < prev.length; i++) {
  6350. if (shared.hasChanged(prev[i], memo[i])) {
  6351. return false;
  6352. }
  6353. }
  6354. if (isBlockTreeEnabled > 0 && currentBlock) {
  6355. currentBlock.push(cached);
  6356. }
  6357. return true;
  6358. }
  6359. const version = "3.5.4";
  6360. const warn$1 = shared.NOOP;
  6361. const ErrorTypeStrings = ErrorTypeStrings$1 ;
  6362. const devtools = void 0;
  6363. const setDevtoolsHook = shared.NOOP;
  6364. const _ssrUtils = {
  6365. createComponentInstance,
  6366. setupComponent,
  6367. renderComponentRoot,
  6368. setCurrentRenderingInstance,
  6369. isVNode: isVNode,
  6370. normalizeVNode,
  6371. getComponentPublicInstance,
  6372. ensureValidVNode,
  6373. pushWarningContext,
  6374. popWarningContext
  6375. };
  6376. const ssrUtils = _ssrUtils ;
  6377. const resolveFilter = null;
  6378. const compatUtils = null;
  6379. const DeprecationTypes = null;
  6380. exports.EffectScope = reactivity.EffectScope;
  6381. exports.ReactiveEffect = reactivity.ReactiveEffect;
  6382. exports.TrackOpTypes = reactivity.TrackOpTypes;
  6383. exports.TriggerOpTypes = reactivity.TriggerOpTypes;
  6384. exports.customRef = reactivity.customRef;
  6385. exports.effect = reactivity.effect;
  6386. exports.effectScope = reactivity.effectScope;
  6387. exports.getCurrentScope = reactivity.getCurrentScope;
  6388. exports.getCurrentWatcher = reactivity.getCurrentWatcher;
  6389. exports.isProxy = reactivity.isProxy;
  6390. exports.isReactive = reactivity.isReactive;
  6391. exports.isReadonly = reactivity.isReadonly;
  6392. exports.isRef = reactivity.isRef;
  6393. exports.isShallow = reactivity.isShallow;
  6394. exports.markRaw = reactivity.markRaw;
  6395. exports.onScopeDispose = reactivity.onScopeDispose;
  6396. exports.onWatcherCleanup = reactivity.onWatcherCleanup;
  6397. exports.proxyRefs = reactivity.proxyRefs;
  6398. exports.reactive = reactivity.reactive;
  6399. exports.readonly = reactivity.readonly;
  6400. exports.ref = reactivity.ref;
  6401. exports.shallowReactive = reactivity.shallowReactive;
  6402. exports.shallowReadonly = reactivity.shallowReadonly;
  6403. exports.shallowRef = reactivity.shallowRef;
  6404. exports.stop = reactivity.stop;
  6405. exports.toRaw = reactivity.toRaw;
  6406. exports.toRef = reactivity.toRef;
  6407. exports.toRefs = reactivity.toRefs;
  6408. exports.toValue = reactivity.toValue;
  6409. exports.triggerRef = reactivity.triggerRef;
  6410. exports.unref = reactivity.unref;
  6411. exports.camelize = shared.camelize;
  6412. exports.capitalize = shared.capitalize;
  6413. exports.normalizeClass = shared.normalizeClass;
  6414. exports.normalizeProps = shared.normalizeProps;
  6415. exports.normalizeStyle = shared.normalizeStyle;
  6416. exports.toDisplayString = shared.toDisplayString;
  6417. exports.toHandlerKey = shared.toHandlerKey;
  6418. exports.BaseTransition = BaseTransition;
  6419. exports.BaseTransitionPropsValidators = BaseTransitionPropsValidators;
  6420. exports.Comment = Comment;
  6421. exports.DeprecationTypes = DeprecationTypes;
  6422. exports.ErrorCodes = ErrorCodes;
  6423. exports.ErrorTypeStrings = ErrorTypeStrings;
  6424. exports.Fragment = Fragment;
  6425. exports.KeepAlive = KeepAlive;
  6426. exports.Static = Static;
  6427. exports.Suspense = Suspense;
  6428. exports.Teleport = Teleport;
  6429. exports.Text = Text;
  6430. exports.assertNumber = assertNumber;
  6431. exports.callWithAsyncErrorHandling = callWithAsyncErrorHandling;
  6432. exports.callWithErrorHandling = callWithErrorHandling;
  6433. exports.cloneVNode = cloneVNode;
  6434. exports.compatUtils = compatUtils;
  6435. exports.computed = computed;
  6436. exports.createBlock = createBlock;
  6437. exports.createCommentVNode = createCommentVNode;
  6438. exports.createElementBlock = createElementBlock;
  6439. exports.createElementVNode = createBaseVNode;
  6440. exports.createHydrationRenderer = createHydrationRenderer;
  6441. exports.createPropsRestProxy = createPropsRestProxy;
  6442. exports.createRenderer = createRenderer;
  6443. exports.createSlots = createSlots;
  6444. exports.createStaticVNode = createStaticVNode;
  6445. exports.createTextVNode = createTextVNode;
  6446. exports.createVNode = createVNode;
  6447. exports.defineAsyncComponent = defineAsyncComponent;
  6448. exports.defineComponent = defineComponent;
  6449. exports.defineEmits = defineEmits;
  6450. exports.defineExpose = defineExpose;
  6451. exports.defineModel = defineModel;
  6452. exports.defineOptions = defineOptions;
  6453. exports.defineProps = defineProps;
  6454. exports.defineSlots = defineSlots;
  6455. exports.devtools = devtools;
  6456. exports.getCurrentInstance = getCurrentInstance;
  6457. exports.getTransitionRawChildren = getTransitionRawChildren;
  6458. exports.guardReactiveProps = guardReactiveProps;
  6459. exports.h = h;
  6460. exports.handleError = handleError;
  6461. exports.hasInjectionContext = hasInjectionContext;
  6462. exports.hydrateOnIdle = hydrateOnIdle;
  6463. exports.hydrateOnInteraction = hydrateOnInteraction;
  6464. exports.hydrateOnMediaQuery = hydrateOnMediaQuery;
  6465. exports.hydrateOnVisible = hydrateOnVisible;
  6466. exports.initCustomFormatter = initCustomFormatter;
  6467. exports.inject = inject;
  6468. exports.isMemoSame = isMemoSame;
  6469. exports.isRuntimeOnly = isRuntimeOnly;
  6470. exports.isVNode = isVNode;
  6471. exports.mergeDefaults = mergeDefaults;
  6472. exports.mergeModels = mergeModels;
  6473. exports.mergeProps = mergeProps;
  6474. exports.nextTick = nextTick;
  6475. exports.onActivated = onActivated;
  6476. exports.onBeforeMount = onBeforeMount;
  6477. exports.onBeforeUnmount = onBeforeUnmount;
  6478. exports.onBeforeUpdate = onBeforeUpdate;
  6479. exports.onDeactivated = onDeactivated;
  6480. exports.onErrorCaptured = onErrorCaptured;
  6481. exports.onMounted = onMounted;
  6482. exports.onRenderTracked = onRenderTracked;
  6483. exports.onRenderTriggered = onRenderTriggered;
  6484. exports.onServerPrefetch = onServerPrefetch;
  6485. exports.onUnmounted = onUnmounted;
  6486. exports.onUpdated = onUpdated;
  6487. exports.openBlock = openBlock;
  6488. exports.popScopeId = popScopeId;
  6489. exports.provide = provide;
  6490. exports.pushScopeId = pushScopeId;
  6491. exports.queuePostFlushCb = queuePostFlushCb;
  6492. exports.registerRuntimeCompiler = registerRuntimeCompiler;
  6493. exports.renderList = renderList;
  6494. exports.renderSlot = renderSlot;
  6495. exports.resolveComponent = resolveComponent;
  6496. exports.resolveDirective = resolveDirective;
  6497. exports.resolveDynamicComponent = resolveDynamicComponent;
  6498. exports.resolveFilter = resolveFilter;
  6499. exports.resolveTransitionHooks = resolveTransitionHooks;
  6500. exports.setBlockTracking = setBlockTracking;
  6501. exports.setDevtoolsHook = setDevtoolsHook;
  6502. exports.setTransitionHooks = setTransitionHooks;
  6503. exports.ssrContextKey = ssrContextKey;
  6504. exports.ssrUtils = ssrUtils;
  6505. exports.toHandlers = toHandlers;
  6506. exports.transformVNodeArgs = transformVNodeArgs;
  6507. exports.useAttrs = useAttrs;
  6508. exports.useId = useId;
  6509. exports.useModel = useModel;
  6510. exports.useSSRContext = useSSRContext;
  6511. exports.useSlots = useSlots;
  6512. exports.useTemplateRef = useTemplateRef;
  6513. exports.useTransitionState = useTransitionState;
  6514. exports.version = version;
  6515. exports.warn = warn$1;
  6516. exports.watch = watch;
  6517. exports.watchEffect = watchEffect;
  6518. exports.watchPostEffect = watchPostEffect;
  6519. exports.watchSyncEffect = watchSyncEffect;
  6520. exports.withAsyncContext = withAsyncContext;
  6521. exports.withCtx = withCtx;
  6522. exports.withDefaults = withDefaults;
  6523. exports.withDirectives = withDirectives;
  6524. exports.withMemo = withMemo;
  6525. exports.withScopeId = withScopeId;