vue.runtime.global.js 326 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787
  1. var Vue = (function (exports) {
  2. 'use strict';
  3. function makeMap(str, expectsLowerCase) {
  4. const map = /* @__PURE__ */ Object.create(null);
  5. const list = str.split(",");
  6. for (let i = 0; i < list.length; i++) {
  7. map[list[i]] = true;
  8. }
  9. return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
  10. }
  11. const EMPTY_OBJ = Object.freeze({}) ;
  12. const EMPTY_ARR = Object.freeze([]) ;
  13. const NOOP = () => {
  14. };
  15. const NO = () => false;
  16. const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
  17. (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
  18. const isModelListener = (key) => key.startsWith("onUpdate:");
  19. const extend = Object.assign;
  20. const remove = (arr, el) => {
  21. const i = arr.indexOf(el);
  22. if (i > -1) {
  23. arr.splice(i, 1);
  24. }
  25. };
  26. const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
  27. const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
  28. const isArray = Array.isArray;
  29. const isMap = (val) => toTypeString(val) === "[object Map]";
  30. const isSet = (val) => toTypeString(val) === "[object Set]";
  31. const isDate = (val) => toTypeString(val) === "[object Date]";
  32. const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
  33. const isFunction = (val) => typeof val === "function";
  34. const isString = (val) => typeof val === "string";
  35. const isSymbol = (val) => typeof val === "symbol";
  36. const isObject = (val) => val !== null && typeof val === "object";
  37. const isPromise = (val) => {
  38. return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
  39. };
  40. const objectToString = Object.prototype.toString;
  41. const toTypeString = (value) => objectToString.call(value);
  42. const toRawType = (value) => {
  43. return toTypeString(value).slice(8, -1);
  44. };
  45. const isPlainObject = (val) => toTypeString(val) === "[object Object]";
  46. const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
  47. const isReservedProp = /* @__PURE__ */ makeMap(
  48. // the leading comma is intentional so empty string "" is also included
  49. ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
  50. );
  51. const isBuiltInDirective = /* @__PURE__ */ makeMap(
  52. "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
  53. );
  54. const cacheStringFunction = (fn) => {
  55. const cache = /* @__PURE__ */ Object.create(null);
  56. return (str) => {
  57. const hit = cache[str];
  58. return hit || (cache[str] = fn(str));
  59. };
  60. };
  61. const camelizeRE = /-(\w)/g;
  62. const camelize = cacheStringFunction((str) => {
  63. return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
  64. });
  65. const hyphenateRE = /\B([A-Z])/g;
  66. const hyphenate = cacheStringFunction(
  67. (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
  68. );
  69. const capitalize = cacheStringFunction((str) => {
  70. return str.charAt(0).toUpperCase() + str.slice(1);
  71. });
  72. const toHandlerKey = cacheStringFunction((str) => {
  73. const s = str ? `on${capitalize(str)}` : ``;
  74. return s;
  75. });
  76. const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
  77. const invokeArrayFns = (fns, arg) => {
  78. for (let i = 0; i < fns.length; i++) {
  79. fns[i](arg);
  80. }
  81. };
  82. const def = (obj, key, value) => {
  83. Object.defineProperty(obj, key, {
  84. configurable: true,
  85. enumerable: false,
  86. value
  87. });
  88. };
  89. const looseToNumber = (val) => {
  90. const n = parseFloat(val);
  91. return isNaN(n) ? val : n;
  92. };
  93. const toNumber = (val) => {
  94. const n = isString(val) ? Number(val) : NaN;
  95. return isNaN(n) ? val : n;
  96. };
  97. let _globalThis;
  98. const getGlobalThis = () => {
  99. return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
  100. };
  101. const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console";
  102. const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
  103. function normalizeStyle(value) {
  104. if (isArray(value)) {
  105. const res = {};
  106. for (let i = 0; i < value.length; i++) {
  107. const item = value[i];
  108. const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
  109. if (normalized) {
  110. for (const key in normalized) {
  111. res[key] = normalized[key];
  112. }
  113. }
  114. }
  115. return res;
  116. } else if (isString(value) || isObject(value)) {
  117. return value;
  118. }
  119. }
  120. const listDelimiterRE = /;(?![^(]*\))/g;
  121. const propertyDelimiterRE = /:([^]+)/;
  122. const styleCommentRE = /\/\*[^]*?\*\//g;
  123. function parseStringStyle(cssText) {
  124. const ret = {};
  125. cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
  126. if (item) {
  127. const tmp = item.split(propertyDelimiterRE);
  128. tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
  129. }
  130. });
  131. return ret;
  132. }
  133. function normalizeClass(value) {
  134. let res = "";
  135. if (isString(value)) {
  136. res = value;
  137. } else if (isArray(value)) {
  138. for (let i = 0; i < value.length; i++) {
  139. const normalized = normalizeClass(value[i]);
  140. if (normalized) {
  141. res += normalized + " ";
  142. }
  143. }
  144. } else if (isObject(value)) {
  145. for (const name in value) {
  146. if (value[name]) {
  147. res += name + " ";
  148. }
  149. }
  150. }
  151. return res.trim();
  152. }
  153. function normalizeProps(props) {
  154. if (!props)
  155. return null;
  156. let { class: klass, style } = props;
  157. if (klass && !isString(klass)) {
  158. props.class = normalizeClass(klass);
  159. }
  160. if (style) {
  161. props.style = normalizeStyle(style);
  162. }
  163. return props;
  164. }
  165. const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
  166. const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
  167. const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
  168. const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
  169. const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
  170. const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
  171. function includeBooleanAttr(value) {
  172. return !!value || value === "";
  173. }
  174. function looseCompareArrays(a, b) {
  175. if (a.length !== b.length)
  176. return false;
  177. let equal = true;
  178. for (let i = 0; equal && i < a.length; i++) {
  179. equal = looseEqual(a[i], b[i]);
  180. }
  181. return equal;
  182. }
  183. function looseEqual(a, b) {
  184. if (a === b)
  185. return true;
  186. let aValidType = isDate(a);
  187. let bValidType = isDate(b);
  188. if (aValidType || bValidType) {
  189. return aValidType && bValidType ? a.getTime() === b.getTime() : false;
  190. }
  191. aValidType = isSymbol(a);
  192. bValidType = isSymbol(b);
  193. if (aValidType || bValidType) {
  194. return a === b;
  195. }
  196. aValidType = isArray(a);
  197. bValidType = isArray(b);
  198. if (aValidType || bValidType) {
  199. return aValidType && bValidType ? looseCompareArrays(a, b) : false;
  200. }
  201. aValidType = isObject(a);
  202. bValidType = isObject(b);
  203. if (aValidType || bValidType) {
  204. if (!aValidType || !bValidType) {
  205. return false;
  206. }
  207. const aKeysCount = Object.keys(a).length;
  208. const bKeysCount = Object.keys(b).length;
  209. if (aKeysCount !== bKeysCount) {
  210. return false;
  211. }
  212. for (const key in a) {
  213. const aHasKey = a.hasOwnProperty(key);
  214. const bHasKey = b.hasOwnProperty(key);
  215. if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
  216. return false;
  217. }
  218. }
  219. }
  220. return String(a) === String(b);
  221. }
  222. function looseIndexOf(arr, val) {
  223. return arr.findIndex((item) => looseEqual(item, val));
  224. }
  225. const toDisplayString = (val) => {
  226. return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
  227. };
  228. const replacer = (_key, val) => {
  229. if (val && val.__v_isRef) {
  230. return replacer(_key, val.value);
  231. } else if (isMap(val)) {
  232. return {
  233. [`Map(${val.size})`]: [...val.entries()].reduce(
  234. (entries, [key, val2], i) => {
  235. entries[stringifySymbol(key, i) + " =>"] = val2;
  236. return entries;
  237. },
  238. {}
  239. )
  240. };
  241. } else if (isSet(val)) {
  242. return {
  243. [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
  244. };
  245. } else if (isSymbol(val)) {
  246. return stringifySymbol(val);
  247. } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
  248. return String(val);
  249. }
  250. return val;
  251. };
  252. const stringifySymbol = (v, i = "") => {
  253. var _a;
  254. return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
  255. };
  256. function warn$1(msg, ...args) {
  257. console.warn(`[Vue warn] ${msg}`, ...args);
  258. }
  259. let activeEffectScope;
  260. class EffectScope {
  261. constructor(detached = false) {
  262. this.detached = detached;
  263. /**
  264. * @internal
  265. */
  266. this._active = true;
  267. /**
  268. * @internal
  269. */
  270. this.effects = [];
  271. /**
  272. * @internal
  273. */
  274. this.cleanups = [];
  275. this.parent = activeEffectScope;
  276. if (!detached && activeEffectScope) {
  277. this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
  278. this
  279. ) - 1;
  280. }
  281. }
  282. get active() {
  283. return this._active;
  284. }
  285. run(fn) {
  286. if (this._active) {
  287. const currentEffectScope = activeEffectScope;
  288. try {
  289. activeEffectScope = this;
  290. return fn();
  291. } finally {
  292. activeEffectScope = currentEffectScope;
  293. }
  294. } else {
  295. warn$1(`cannot run an inactive effect scope.`);
  296. }
  297. }
  298. /**
  299. * This should only be called on non-detached scopes
  300. * @internal
  301. */
  302. on() {
  303. activeEffectScope = this;
  304. }
  305. /**
  306. * This should only be called on non-detached scopes
  307. * @internal
  308. */
  309. off() {
  310. activeEffectScope = this.parent;
  311. }
  312. stop(fromParent) {
  313. if (this._active) {
  314. let i, l;
  315. for (i = 0, l = this.effects.length; i < l; i++) {
  316. this.effects[i].stop();
  317. }
  318. for (i = 0, l = this.cleanups.length; i < l; i++) {
  319. this.cleanups[i]();
  320. }
  321. if (this.scopes) {
  322. for (i = 0, l = this.scopes.length; i < l; i++) {
  323. this.scopes[i].stop(true);
  324. }
  325. }
  326. if (!this.detached && this.parent && !fromParent) {
  327. const last = this.parent.scopes.pop();
  328. if (last && last !== this) {
  329. this.parent.scopes[this.index] = last;
  330. last.index = this.index;
  331. }
  332. }
  333. this.parent = void 0;
  334. this._active = false;
  335. }
  336. }
  337. }
  338. function effectScope(detached) {
  339. return new EffectScope(detached);
  340. }
  341. function recordEffectScope(effect, scope = activeEffectScope) {
  342. if (scope && scope.active) {
  343. scope.effects.push(effect);
  344. }
  345. }
  346. function getCurrentScope() {
  347. return activeEffectScope;
  348. }
  349. function onScopeDispose(fn) {
  350. if (activeEffectScope) {
  351. activeEffectScope.cleanups.push(fn);
  352. } else {
  353. warn$1(
  354. `onScopeDispose() is called when there is no active effect scope to be associated with.`
  355. );
  356. }
  357. }
  358. const createDep = (effects) => {
  359. const dep = new Set(effects);
  360. dep.w = 0;
  361. dep.n = 0;
  362. return dep;
  363. };
  364. const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
  365. const newTracked = (dep) => (dep.n & trackOpBit) > 0;
  366. const initDepMarkers = ({ deps }) => {
  367. if (deps.length) {
  368. for (let i = 0; i < deps.length; i++) {
  369. deps[i].w |= trackOpBit;
  370. }
  371. }
  372. };
  373. const finalizeDepMarkers = (effect) => {
  374. const { deps } = effect;
  375. if (deps.length) {
  376. let ptr = 0;
  377. for (let i = 0; i < deps.length; i++) {
  378. const dep = deps[i];
  379. if (wasTracked(dep) && !newTracked(dep)) {
  380. dep.delete(effect);
  381. } else {
  382. deps[ptr++] = dep;
  383. }
  384. dep.w &= ~trackOpBit;
  385. dep.n &= ~trackOpBit;
  386. }
  387. deps.length = ptr;
  388. }
  389. };
  390. const targetMap = /* @__PURE__ */ new WeakMap();
  391. let effectTrackDepth = 0;
  392. let trackOpBit = 1;
  393. const maxMarkerBits = 30;
  394. let activeEffect;
  395. const ITERATE_KEY = Symbol("iterate" );
  396. const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate" );
  397. class ReactiveEffect {
  398. constructor(fn, scheduler = null, scope) {
  399. this.fn = fn;
  400. this.scheduler = scheduler;
  401. this.active = true;
  402. this.deps = [];
  403. this.parent = void 0;
  404. recordEffectScope(this, scope);
  405. }
  406. run() {
  407. if (!this.active) {
  408. return this.fn();
  409. }
  410. let parent = activeEffect;
  411. let lastShouldTrack = shouldTrack;
  412. while (parent) {
  413. if (parent === this) {
  414. return;
  415. }
  416. parent = parent.parent;
  417. }
  418. try {
  419. this.parent = activeEffect;
  420. activeEffect = this;
  421. shouldTrack = true;
  422. trackOpBit = 1 << ++effectTrackDepth;
  423. if (effectTrackDepth <= maxMarkerBits) {
  424. initDepMarkers(this);
  425. } else {
  426. cleanupEffect(this);
  427. }
  428. return this.fn();
  429. } finally {
  430. if (effectTrackDepth <= maxMarkerBits) {
  431. finalizeDepMarkers(this);
  432. }
  433. trackOpBit = 1 << --effectTrackDepth;
  434. activeEffect = this.parent;
  435. shouldTrack = lastShouldTrack;
  436. this.parent = void 0;
  437. if (this.deferStop) {
  438. this.stop();
  439. }
  440. }
  441. }
  442. stop() {
  443. if (activeEffect === this) {
  444. this.deferStop = true;
  445. } else if (this.active) {
  446. cleanupEffect(this);
  447. if (this.onStop) {
  448. this.onStop();
  449. }
  450. this.active = false;
  451. }
  452. }
  453. }
  454. function cleanupEffect(effect2) {
  455. const { deps } = effect2;
  456. if (deps.length) {
  457. for (let i = 0; i < deps.length; i++) {
  458. deps[i].delete(effect2);
  459. }
  460. deps.length = 0;
  461. }
  462. }
  463. function effect(fn, options) {
  464. if (fn.effect instanceof ReactiveEffect) {
  465. fn = fn.effect.fn;
  466. }
  467. const _effect = new ReactiveEffect(fn);
  468. if (options) {
  469. extend(_effect, options);
  470. if (options.scope)
  471. recordEffectScope(_effect, options.scope);
  472. }
  473. if (!options || !options.lazy) {
  474. _effect.run();
  475. }
  476. const runner = _effect.run.bind(_effect);
  477. runner.effect = _effect;
  478. return runner;
  479. }
  480. function stop(runner) {
  481. runner.effect.stop();
  482. }
  483. let shouldTrack = true;
  484. const trackStack = [];
  485. function pauseTracking() {
  486. trackStack.push(shouldTrack);
  487. shouldTrack = false;
  488. }
  489. function resetTracking() {
  490. const last = trackStack.pop();
  491. shouldTrack = last === void 0 ? true : last;
  492. }
  493. function track(target, type, key) {
  494. if (shouldTrack && activeEffect) {
  495. let depsMap = targetMap.get(target);
  496. if (!depsMap) {
  497. targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
  498. }
  499. let dep = depsMap.get(key);
  500. if (!dep) {
  501. depsMap.set(key, dep = createDep());
  502. }
  503. const eventInfo = { effect: activeEffect, target, type, key } ;
  504. trackEffects(dep, eventInfo);
  505. }
  506. }
  507. function trackEffects(dep, debuggerEventExtraInfo) {
  508. let shouldTrack2 = false;
  509. if (effectTrackDepth <= maxMarkerBits) {
  510. if (!newTracked(dep)) {
  511. dep.n |= trackOpBit;
  512. shouldTrack2 = !wasTracked(dep);
  513. }
  514. } else {
  515. shouldTrack2 = !dep.has(activeEffect);
  516. }
  517. if (shouldTrack2) {
  518. dep.add(activeEffect);
  519. activeEffect.deps.push(dep);
  520. if (activeEffect.onTrack) {
  521. activeEffect.onTrack(
  522. extend(
  523. {
  524. effect: activeEffect
  525. },
  526. debuggerEventExtraInfo
  527. )
  528. );
  529. }
  530. }
  531. }
  532. function trigger(target, type, key, newValue, oldValue, oldTarget) {
  533. const depsMap = targetMap.get(target);
  534. if (!depsMap) {
  535. return;
  536. }
  537. let deps = [];
  538. if (type === "clear") {
  539. deps = [...depsMap.values()];
  540. } else if (key === "length" && isArray(target)) {
  541. const newLength = Number(newValue);
  542. depsMap.forEach((dep, key2) => {
  543. if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) {
  544. deps.push(dep);
  545. }
  546. });
  547. } else {
  548. if (key !== void 0) {
  549. deps.push(depsMap.get(key));
  550. }
  551. switch (type) {
  552. case "add":
  553. if (!isArray(target)) {
  554. deps.push(depsMap.get(ITERATE_KEY));
  555. if (isMap(target)) {
  556. deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
  557. }
  558. } else if (isIntegerKey(key)) {
  559. deps.push(depsMap.get("length"));
  560. }
  561. break;
  562. case "delete":
  563. if (!isArray(target)) {
  564. deps.push(depsMap.get(ITERATE_KEY));
  565. if (isMap(target)) {
  566. deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
  567. }
  568. }
  569. break;
  570. case "set":
  571. if (isMap(target)) {
  572. deps.push(depsMap.get(ITERATE_KEY));
  573. }
  574. break;
  575. }
  576. }
  577. const eventInfo = { target, type, key, newValue, oldValue, oldTarget } ;
  578. if (deps.length === 1) {
  579. if (deps[0]) {
  580. {
  581. triggerEffects(deps[0], eventInfo);
  582. }
  583. }
  584. } else {
  585. const effects = [];
  586. for (const dep of deps) {
  587. if (dep) {
  588. effects.push(...dep);
  589. }
  590. }
  591. {
  592. triggerEffects(createDep(effects), eventInfo);
  593. }
  594. }
  595. }
  596. function triggerEffects(dep, debuggerEventExtraInfo) {
  597. const effects = isArray(dep) ? dep : [...dep];
  598. for (const effect2 of effects) {
  599. if (effect2.computed) {
  600. triggerEffect(effect2, debuggerEventExtraInfo);
  601. }
  602. }
  603. for (const effect2 of effects) {
  604. if (!effect2.computed) {
  605. triggerEffect(effect2, debuggerEventExtraInfo);
  606. }
  607. }
  608. }
  609. function triggerEffect(effect2, debuggerEventExtraInfo) {
  610. if (effect2 !== activeEffect || effect2.allowRecurse) {
  611. if (effect2.onTrigger) {
  612. effect2.onTrigger(extend({ effect: effect2 }, debuggerEventExtraInfo));
  613. }
  614. if (effect2.scheduler) {
  615. effect2.scheduler();
  616. } else {
  617. effect2.run();
  618. }
  619. }
  620. }
  621. function getDepFromReactive(object, key) {
  622. var _a;
  623. return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
  624. }
  625. const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
  626. const builtInSymbols = new Set(
  627. /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
  628. );
  629. const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
  630. function createArrayInstrumentations() {
  631. const instrumentations = {};
  632. ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
  633. instrumentations[key] = function(...args) {
  634. const arr = toRaw(this);
  635. for (let i = 0, l = this.length; i < l; i++) {
  636. track(arr, "get", i + "");
  637. }
  638. const res = arr[key](...args);
  639. if (res === -1 || res === false) {
  640. return arr[key](...args.map(toRaw));
  641. } else {
  642. return res;
  643. }
  644. };
  645. });
  646. ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
  647. instrumentations[key] = function(...args) {
  648. pauseTracking();
  649. const res = toRaw(this)[key].apply(this, args);
  650. resetTracking();
  651. return res;
  652. };
  653. });
  654. return instrumentations;
  655. }
  656. function hasOwnProperty(key) {
  657. const obj = toRaw(this);
  658. track(obj, "has", key);
  659. return obj.hasOwnProperty(key);
  660. }
  661. class BaseReactiveHandler {
  662. constructor(_isReadonly = false, _shallow = false) {
  663. this._isReadonly = _isReadonly;
  664. this._shallow = _shallow;
  665. }
  666. get(target, key, receiver) {
  667. const isReadonly2 = this._isReadonly, shallow = this._shallow;
  668. if (key === "__v_isReactive") {
  669. return !isReadonly2;
  670. } else if (key === "__v_isReadonly") {
  671. return isReadonly2;
  672. } else if (key === "__v_isShallow") {
  673. return shallow;
  674. } else if (key === "__v_raw") {
  675. if (receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
  676. // this means the reciever is a user proxy of the reactive proxy
  677. Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
  678. return target;
  679. }
  680. return;
  681. }
  682. const targetIsArray = isArray(target);
  683. if (!isReadonly2) {
  684. if (targetIsArray && hasOwn(arrayInstrumentations, key)) {
  685. return Reflect.get(arrayInstrumentations, key, receiver);
  686. }
  687. if (key === "hasOwnProperty") {
  688. return hasOwnProperty;
  689. }
  690. }
  691. const res = Reflect.get(target, key, receiver);
  692. if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
  693. return res;
  694. }
  695. if (!isReadonly2) {
  696. track(target, "get", key);
  697. }
  698. if (shallow) {
  699. return res;
  700. }
  701. if (isRef(res)) {
  702. return targetIsArray && isIntegerKey(key) ? res : res.value;
  703. }
  704. if (isObject(res)) {
  705. return isReadonly2 ? readonly(res) : reactive(res);
  706. }
  707. return res;
  708. }
  709. }
  710. class MutableReactiveHandler extends BaseReactiveHandler {
  711. constructor(shallow = false) {
  712. super(false, shallow);
  713. }
  714. set(target, key, value, receiver) {
  715. let oldValue = target[key];
  716. if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
  717. return false;
  718. }
  719. if (!this._shallow) {
  720. if (!isShallow(value) && !isReadonly(value)) {
  721. oldValue = toRaw(oldValue);
  722. value = toRaw(value);
  723. }
  724. if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
  725. oldValue.value = value;
  726. return true;
  727. }
  728. }
  729. const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
  730. const result = Reflect.set(target, key, value, receiver);
  731. if (target === toRaw(receiver)) {
  732. if (!hadKey) {
  733. trigger(target, "add", key, value);
  734. } else if (hasChanged(value, oldValue)) {
  735. trigger(target, "set", key, value, oldValue);
  736. }
  737. }
  738. return result;
  739. }
  740. deleteProperty(target, key) {
  741. const hadKey = hasOwn(target, key);
  742. const oldValue = target[key];
  743. const result = Reflect.deleteProperty(target, key);
  744. if (result && hadKey) {
  745. trigger(target, "delete", key, void 0, oldValue);
  746. }
  747. return result;
  748. }
  749. has(target, key) {
  750. const result = Reflect.has(target, key);
  751. if (!isSymbol(key) || !builtInSymbols.has(key)) {
  752. track(target, "has", key);
  753. }
  754. return result;
  755. }
  756. ownKeys(target) {
  757. track(
  758. target,
  759. "iterate",
  760. isArray(target) ? "length" : ITERATE_KEY
  761. );
  762. return Reflect.ownKeys(target);
  763. }
  764. }
  765. class ReadonlyReactiveHandler extends BaseReactiveHandler {
  766. constructor(shallow = false) {
  767. super(true, shallow);
  768. }
  769. set(target, key) {
  770. {
  771. warn$1(
  772. `Set operation on key "${String(key)}" failed: target is readonly.`,
  773. target
  774. );
  775. }
  776. return true;
  777. }
  778. deleteProperty(target, key) {
  779. {
  780. warn$1(
  781. `Delete operation on key "${String(key)}" failed: target is readonly.`,
  782. target
  783. );
  784. }
  785. return true;
  786. }
  787. }
  788. const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
  789. const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
  790. const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(
  791. true
  792. );
  793. const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
  794. const toShallow = (value) => value;
  795. const getProto = (v) => Reflect.getPrototypeOf(v);
  796. function get(target, key, isReadonly = false, isShallow = false) {
  797. target = target["__v_raw"];
  798. const rawTarget = toRaw(target);
  799. const rawKey = toRaw(key);
  800. if (!isReadonly) {
  801. if (hasChanged(key, rawKey)) {
  802. track(rawTarget, "get", key);
  803. }
  804. track(rawTarget, "get", rawKey);
  805. }
  806. const { has: has2 } = getProto(rawTarget);
  807. const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
  808. if (has2.call(rawTarget, key)) {
  809. return wrap(target.get(key));
  810. } else if (has2.call(rawTarget, rawKey)) {
  811. return wrap(target.get(rawKey));
  812. } else if (target !== rawTarget) {
  813. target.get(key);
  814. }
  815. }
  816. function has(key, isReadonly = false) {
  817. const target = this["__v_raw"];
  818. const rawTarget = toRaw(target);
  819. const rawKey = toRaw(key);
  820. if (!isReadonly) {
  821. if (hasChanged(key, rawKey)) {
  822. track(rawTarget, "has", key);
  823. }
  824. track(rawTarget, "has", rawKey);
  825. }
  826. return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
  827. }
  828. function size(target, isReadonly = false) {
  829. target = target["__v_raw"];
  830. !isReadonly && track(toRaw(target), "iterate", ITERATE_KEY);
  831. return Reflect.get(target, "size", target);
  832. }
  833. function add(value) {
  834. value = toRaw(value);
  835. const target = toRaw(this);
  836. const proto = getProto(target);
  837. const hadKey = proto.has.call(target, value);
  838. if (!hadKey) {
  839. target.add(value);
  840. trigger(target, "add", value, value);
  841. }
  842. return this;
  843. }
  844. function set(key, value) {
  845. value = toRaw(value);
  846. const target = toRaw(this);
  847. const { has: has2, get: get2 } = getProto(target);
  848. let hadKey = has2.call(target, key);
  849. if (!hadKey) {
  850. key = toRaw(key);
  851. hadKey = has2.call(target, key);
  852. } else {
  853. checkIdentityKeys(target, has2, key);
  854. }
  855. const oldValue = get2.call(target, key);
  856. target.set(key, value);
  857. if (!hadKey) {
  858. trigger(target, "add", key, value);
  859. } else if (hasChanged(value, oldValue)) {
  860. trigger(target, "set", key, value, oldValue);
  861. }
  862. return this;
  863. }
  864. function deleteEntry(key) {
  865. const target = toRaw(this);
  866. const { has: has2, get: get2 } = getProto(target);
  867. let hadKey = has2.call(target, key);
  868. if (!hadKey) {
  869. key = toRaw(key);
  870. hadKey = has2.call(target, key);
  871. } else {
  872. checkIdentityKeys(target, has2, key);
  873. }
  874. const oldValue = get2 ? get2.call(target, key) : void 0;
  875. const result = target.delete(key);
  876. if (hadKey) {
  877. trigger(target, "delete", key, void 0, oldValue);
  878. }
  879. return result;
  880. }
  881. function clear() {
  882. const target = toRaw(this);
  883. const hadItems = target.size !== 0;
  884. const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
  885. const result = target.clear();
  886. if (hadItems) {
  887. trigger(target, "clear", void 0, void 0, oldTarget);
  888. }
  889. return result;
  890. }
  891. function createForEach(isReadonly, isShallow) {
  892. return function forEach(callback, thisArg) {
  893. const observed = this;
  894. const target = observed["__v_raw"];
  895. const rawTarget = toRaw(target);
  896. const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
  897. !isReadonly && track(rawTarget, "iterate", ITERATE_KEY);
  898. return target.forEach((value, key) => {
  899. return callback.call(thisArg, wrap(value), wrap(key), observed);
  900. });
  901. };
  902. }
  903. function createIterableMethod(method, isReadonly, isShallow) {
  904. return function(...args) {
  905. const target = this["__v_raw"];
  906. const rawTarget = toRaw(target);
  907. const targetIsMap = isMap(rawTarget);
  908. const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
  909. const isKeyOnly = method === "keys" && targetIsMap;
  910. const innerIterator = target[method](...args);
  911. const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
  912. !isReadonly && track(
  913. rawTarget,
  914. "iterate",
  915. isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
  916. );
  917. return {
  918. // iterator protocol
  919. next() {
  920. const { value, done } = innerIterator.next();
  921. return done ? { value, done } : {
  922. value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
  923. done
  924. };
  925. },
  926. // iterable protocol
  927. [Symbol.iterator]() {
  928. return this;
  929. }
  930. };
  931. };
  932. }
  933. function createReadonlyMethod(type) {
  934. return function(...args) {
  935. {
  936. const key = args[0] ? `on key "${args[0]}" ` : ``;
  937. console.warn(
  938. `${capitalize(type)} operation ${key}failed: target is readonly.`,
  939. toRaw(this)
  940. );
  941. }
  942. return type === "delete" ? false : type === "clear" ? void 0 : this;
  943. };
  944. }
  945. function createInstrumentations() {
  946. const mutableInstrumentations2 = {
  947. get(key) {
  948. return get(this, key);
  949. },
  950. get size() {
  951. return size(this);
  952. },
  953. has,
  954. add,
  955. set,
  956. delete: deleteEntry,
  957. clear,
  958. forEach: createForEach(false, false)
  959. };
  960. const shallowInstrumentations2 = {
  961. get(key) {
  962. return get(this, key, false, true);
  963. },
  964. get size() {
  965. return size(this);
  966. },
  967. has,
  968. add,
  969. set,
  970. delete: deleteEntry,
  971. clear,
  972. forEach: createForEach(false, true)
  973. };
  974. const readonlyInstrumentations2 = {
  975. get(key) {
  976. return get(this, key, true);
  977. },
  978. get size() {
  979. return size(this, true);
  980. },
  981. has(key) {
  982. return has.call(this, key, true);
  983. },
  984. add: createReadonlyMethod("add"),
  985. set: createReadonlyMethod("set"),
  986. delete: createReadonlyMethod("delete"),
  987. clear: createReadonlyMethod("clear"),
  988. forEach: createForEach(true, false)
  989. };
  990. const shallowReadonlyInstrumentations2 = {
  991. get(key) {
  992. return get(this, key, true, true);
  993. },
  994. get size() {
  995. return size(this, true);
  996. },
  997. has(key) {
  998. return has.call(this, key, true);
  999. },
  1000. add: createReadonlyMethod("add"),
  1001. set: createReadonlyMethod("set"),
  1002. delete: createReadonlyMethod("delete"),
  1003. clear: createReadonlyMethod("clear"),
  1004. forEach: createForEach(true, true)
  1005. };
  1006. const iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
  1007. iteratorMethods.forEach((method) => {
  1008. mutableInstrumentations2[method] = createIterableMethod(
  1009. method,
  1010. false,
  1011. false
  1012. );
  1013. readonlyInstrumentations2[method] = createIterableMethod(
  1014. method,
  1015. true,
  1016. false
  1017. );
  1018. shallowInstrumentations2[method] = createIterableMethod(
  1019. method,
  1020. false,
  1021. true
  1022. );
  1023. shallowReadonlyInstrumentations2[method] = createIterableMethod(
  1024. method,
  1025. true,
  1026. true
  1027. );
  1028. });
  1029. return [
  1030. mutableInstrumentations2,
  1031. readonlyInstrumentations2,
  1032. shallowInstrumentations2,
  1033. shallowReadonlyInstrumentations2
  1034. ];
  1035. }
  1036. const [
  1037. mutableInstrumentations,
  1038. readonlyInstrumentations,
  1039. shallowInstrumentations,
  1040. shallowReadonlyInstrumentations
  1041. ] = /* @__PURE__ */ createInstrumentations();
  1042. function createInstrumentationGetter(isReadonly, shallow) {
  1043. const instrumentations = shallow ? isReadonly ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly ? readonlyInstrumentations : mutableInstrumentations;
  1044. return (target, key, receiver) => {
  1045. if (key === "__v_isReactive") {
  1046. return !isReadonly;
  1047. } else if (key === "__v_isReadonly") {
  1048. return isReadonly;
  1049. } else if (key === "__v_raw") {
  1050. return target;
  1051. }
  1052. return Reflect.get(
  1053. hasOwn(instrumentations, key) && key in target ? instrumentations : target,
  1054. key,
  1055. receiver
  1056. );
  1057. };
  1058. }
  1059. const mutableCollectionHandlers = {
  1060. get: /* @__PURE__ */ createInstrumentationGetter(false, false)
  1061. };
  1062. const shallowCollectionHandlers = {
  1063. get: /* @__PURE__ */ createInstrumentationGetter(false, true)
  1064. };
  1065. const readonlyCollectionHandlers = {
  1066. get: /* @__PURE__ */ createInstrumentationGetter(true, false)
  1067. };
  1068. const shallowReadonlyCollectionHandlers = {
  1069. get: /* @__PURE__ */ createInstrumentationGetter(true, true)
  1070. };
  1071. function checkIdentityKeys(target, has2, key) {
  1072. const rawKey = toRaw(key);
  1073. if (rawKey !== key && has2.call(target, rawKey)) {
  1074. const type = toRawType(target);
  1075. console.warn(
  1076. `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
  1077. );
  1078. }
  1079. }
  1080. const reactiveMap = /* @__PURE__ */ new WeakMap();
  1081. const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
  1082. const readonlyMap = /* @__PURE__ */ new WeakMap();
  1083. const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
  1084. function targetTypeMap(rawType) {
  1085. switch (rawType) {
  1086. case "Object":
  1087. case "Array":
  1088. return 1 /* COMMON */;
  1089. case "Map":
  1090. case "Set":
  1091. case "WeakMap":
  1092. case "WeakSet":
  1093. return 2 /* COLLECTION */;
  1094. default:
  1095. return 0 /* INVALID */;
  1096. }
  1097. }
  1098. function getTargetType(value) {
  1099. return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
  1100. }
  1101. function reactive(target) {
  1102. if (isReadonly(target)) {
  1103. return target;
  1104. }
  1105. return createReactiveObject(
  1106. target,
  1107. false,
  1108. mutableHandlers,
  1109. mutableCollectionHandlers,
  1110. reactiveMap
  1111. );
  1112. }
  1113. function shallowReactive(target) {
  1114. return createReactiveObject(
  1115. target,
  1116. false,
  1117. shallowReactiveHandlers,
  1118. shallowCollectionHandlers,
  1119. shallowReactiveMap
  1120. );
  1121. }
  1122. function readonly(target) {
  1123. return createReactiveObject(
  1124. target,
  1125. true,
  1126. readonlyHandlers,
  1127. readonlyCollectionHandlers,
  1128. readonlyMap
  1129. );
  1130. }
  1131. function shallowReadonly(target) {
  1132. return createReactiveObject(
  1133. target,
  1134. true,
  1135. shallowReadonlyHandlers,
  1136. shallowReadonlyCollectionHandlers,
  1137. shallowReadonlyMap
  1138. );
  1139. }
  1140. function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
  1141. if (!isObject(target)) {
  1142. {
  1143. console.warn(`value cannot be made reactive: ${String(target)}`);
  1144. }
  1145. return target;
  1146. }
  1147. if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
  1148. return target;
  1149. }
  1150. const existingProxy = proxyMap.get(target);
  1151. if (existingProxy) {
  1152. return existingProxy;
  1153. }
  1154. const targetType = getTargetType(target);
  1155. if (targetType === 0 /* INVALID */) {
  1156. return target;
  1157. }
  1158. const proxy = new Proxy(
  1159. target,
  1160. targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
  1161. );
  1162. proxyMap.set(target, proxy);
  1163. return proxy;
  1164. }
  1165. function isReactive(value) {
  1166. if (isReadonly(value)) {
  1167. return isReactive(value["__v_raw"]);
  1168. }
  1169. return !!(value && value["__v_isReactive"]);
  1170. }
  1171. function isReadonly(value) {
  1172. return !!(value && value["__v_isReadonly"]);
  1173. }
  1174. function isShallow(value) {
  1175. return !!(value && value["__v_isShallow"]);
  1176. }
  1177. function isProxy(value) {
  1178. return isReactive(value) || isReadonly(value);
  1179. }
  1180. function toRaw(observed) {
  1181. const raw = observed && observed["__v_raw"];
  1182. return raw ? toRaw(raw) : observed;
  1183. }
  1184. function markRaw(value) {
  1185. def(value, "__v_skip", true);
  1186. return value;
  1187. }
  1188. const toReactive = (value) => isObject(value) ? reactive(value) : value;
  1189. const toReadonly = (value) => isObject(value) ? readonly(value) : value;
  1190. function trackRefValue(ref2) {
  1191. if (shouldTrack && activeEffect) {
  1192. ref2 = toRaw(ref2);
  1193. {
  1194. trackEffects(ref2.dep || (ref2.dep = createDep()), {
  1195. target: ref2,
  1196. type: "get",
  1197. key: "value"
  1198. });
  1199. }
  1200. }
  1201. }
  1202. function triggerRefValue(ref2, newVal) {
  1203. ref2 = toRaw(ref2);
  1204. const dep = ref2.dep;
  1205. if (dep) {
  1206. {
  1207. triggerEffects(dep, {
  1208. target: ref2,
  1209. type: "set",
  1210. key: "value",
  1211. newValue: newVal
  1212. });
  1213. }
  1214. }
  1215. }
  1216. function isRef(r) {
  1217. return !!(r && r.__v_isRef === true);
  1218. }
  1219. function ref(value) {
  1220. return createRef(value, false);
  1221. }
  1222. function shallowRef(value) {
  1223. return createRef(value, true);
  1224. }
  1225. function createRef(rawValue, shallow) {
  1226. if (isRef(rawValue)) {
  1227. return rawValue;
  1228. }
  1229. return new RefImpl(rawValue, shallow);
  1230. }
  1231. class RefImpl {
  1232. constructor(value, __v_isShallow) {
  1233. this.__v_isShallow = __v_isShallow;
  1234. this.dep = void 0;
  1235. this.__v_isRef = true;
  1236. this._rawValue = __v_isShallow ? value : toRaw(value);
  1237. this._value = __v_isShallow ? value : toReactive(value);
  1238. }
  1239. get value() {
  1240. trackRefValue(this);
  1241. return this._value;
  1242. }
  1243. set value(newVal) {
  1244. const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
  1245. newVal = useDirectValue ? newVal : toRaw(newVal);
  1246. if (hasChanged(newVal, this._rawValue)) {
  1247. this._rawValue = newVal;
  1248. this._value = useDirectValue ? newVal : toReactive(newVal);
  1249. triggerRefValue(this, newVal);
  1250. }
  1251. }
  1252. }
  1253. function triggerRef(ref2) {
  1254. triggerRefValue(ref2, ref2.value );
  1255. }
  1256. function unref(ref2) {
  1257. return isRef(ref2) ? ref2.value : ref2;
  1258. }
  1259. function toValue(source) {
  1260. return isFunction(source) ? source() : unref(source);
  1261. }
  1262. const shallowUnwrapHandlers = {
  1263. get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
  1264. set: (target, key, value, receiver) => {
  1265. const oldValue = target[key];
  1266. if (isRef(oldValue) && !isRef(value)) {
  1267. oldValue.value = value;
  1268. return true;
  1269. } else {
  1270. return Reflect.set(target, key, value, receiver);
  1271. }
  1272. }
  1273. };
  1274. function proxyRefs(objectWithRefs) {
  1275. return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
  1276. }
  1277. class CustomRefImpl {
  1278. constructor(factory) {
  1279. this.dep = void 0;
  1280. this.__v_isRef = true;
  1281. const { get, set } = factory(
  1282. () => trackRefValue(this),
  1283. () => triggerRefValue(this)
  1284. );
  1285. this._get = get;
  1286. this._set = set;
  1287. }
  1288. get value() {
  1289. return this._get();
  1290. }
  1291. set value(newVal) {
  1292. this._set(newVal);
  1293. }
  1294. }
  1295. function customRef(factory) {
  1296. return new CustomRefImpl(factory);
  1297. }
  1298. function toRefs(object) {
  1299. if (!isProxy(object)) {
  1300. console.warn(`toRefs() expects a reactive object but received a plain one.`);
  1301. }
  1302. const ret = isArray(object) ? new Array(object.length) : {};
  1303. for (const key in object) {
  1304. ret[key] = propertyToRef(object, key);
  1305. }
  1306. return ret;
  1307. }
  1308. class ObjectRefImpl {
  1309. constructor(_object, _key, _defaultValue) {
  1310. this._object = _object;
  1311. this._key = _key;
  1312. this._defaultValue = _defaultValue;
  1313. this.__v_isRef = true;
  1314. }
  1315. get value() {
  1316. const val = this._object[this._key];
  1317. return val === void 0 ? this._defaultValue : val;
  1318. }
  1319. set value(newVal) {
  1320. this._object[this._key] = newVal;
  1321. }
  1322. get dep() {
  1323. return getDepFromReactive(toRaw(this._object), this._key);
  1324. }
  1325. }
  1326. class GetterRefImpl {
  1327. constructor(_getter) {
  1328. this._getter = _getter;
  1329. this.__v_isRef = true;
  1330. this.__v_isReadonly = true;
  1331. }
  1332. get value() {
  1333. return this._getter();
  1334. }
  1335. }
  1336. function toRef(source, key, defaultValue) {
  1337. if (isRef(source)) {
  1338. return source;
  1339. } else if (isFunction(source)) {
  1340. return new GetterRefImpl(source);
  1341. } else if (isObject(source) && arguments.length > 1) {
  1342. return propertyToRef(source, key, defaultValue);
  1343. } else {
  1344. return ref(source);
  1345. }
  1346. }
  1347. function propertyToRef(source, key, defaultValue) {
  1348. const val = source[key];
  1349. return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
  1350. }
  1351. class ComputedRefImpl {
  1352. constructor(getter, _setter, isReadonly, isSSR) {
  1353. this._setter = _setter;
  1354. this.dep = void 0;
  1355. this.__v_isRef = true;
  1356. this["__v_isReadonly"] = false;
  1357. this._dirty = true;
  1358. this.effect = new ReactiveEffect(getter, () => {
  1359. if (!this._dirty) {
  1360. this._dirty = true;
  1361. triggerRefValue(this);
  1362. }
  1363. });
  1364. this.effect.computed = this;
  1365. this.effect.active = this._cacheable = !isSSR;
  1366. this["__v_isReadonly"] = isReadonly;
  1367. }
  1368. get value() {
  1369. const self = toRaw(this);
  1370. trackRefValue(self);
  1371. if (self._dirty || !self._cacheable) {
  1372. self._dirty = false;
  1373. self._value = self.effect.run();
  1374. }
  1375. return self._value;
  1376. }
  1377. set value(newValue) {
  1378. this._setter(newValue);
  1379. }
  1380. }
  1381. function computed$1(getterOrOptions, debugOptions, isSSR = false) {
  1382. let getter;
  1383. let setter;
  1384. const onlyGetter = isFunction(getterOrOptions);
  1385. if (onlyGetter) {
  1386. getter = getterOrOptions;
  1387. setter = () => {
  1388. console.warn("Write operation failed: computed value is readonly");
  1389. } ;
  1390. } else {
  1391. getter = getterOrOptions.get;
  1392. setter = getterOrOptions.set;
  1393. }
  1394. const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
  1395. if (debugOptions && !isSSR) {
  1396. cRef.effect.onTrack = debugOptions.onTrack;
  1397. cRef.effect.onTrigger = debugOptions.onTrigger;
  1398. }
  1399. return cRef;
  1400. }
  1401. const stack = [];
  1402. function pushWarningContext(vnode) {
  1403. stack.push(vnode);
  1404. }
  1405. function popWarningContext() {
  1406. stack.pop();
  1407. }
  1408. function warn(msg, ...args) {
  1409. pauseTracking();
  1410. const instance = stack.length ? stack[stack.length - 1].component : null;
  1411. const appWarnHandler = instance && instance.appContext.config.warnHandler;
  1412. const trace = getComponentTrace();
  1413. if (appWarnHandler) {
  1414. callWithErrorHandling(
  1415. appWarnHandler,
  1416. instance,
  1417. 11,
  1418. [
  1419. msg + args.join(""),
  1420. instance && instance.proxy,
  1421. trace.map(
  1422. ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
  1423. ).join("\n"),
  1424. trace
  1425. ]
  1426. );
  1427. } else {
  1428. const warnArgs = [`[Vue warn]: ${msg}`, ...args];
  1429. if (trace.length && // avoid spamming console during tests
  1430. true) {
  1431. warnArgs.push(`
  1432. `, ...formatTrace(trace));
  1433. }
  1434. console.warn(...warnArgs);
  1435. }
  1436. resetTracking();
  1437. }
  1438. function getComponentTrace() {
  1439. let currentVNode = stack[stack.length - 1];
  1440. if (!currentVNode) {
  1441. return [];
  1442. }
  1443. const normalizedStack = [];
  1444. while (currentVNode) {
  1445. const last = normalizedStack[0];
  1446. if (last && last.vnode === currentVNode) {
  1447. last.recurseCount++;
  1448. } else {
  1449. normalizedStack.push({
  1450. vnode: currentVNode,
  1451. recurseCount: 0
  1452. });
  1453. }
  1454. const parentInstance = currentVNode.component && currentVNode.component.parent;
  1455. currentVNode = parentInstance && parentInstance.vnode;
  1456. }
  1457. return normalizedStack;
  1458. }
  1459. function formatTrace(trace) {
  1460. const logs = [];
  1461. trace.forEach((entry, i) => {
  1462. logs.push(...i === 0 ? [] : [`
  1463. `], ...formatTraceEntry(entry));
  1464. });
  1465. return logs;
  1466. }
  1467. function formatTraceEntry({ vnode, recurseCount }) {
  1468. const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
  1469. const isRoot = vnode.component ? vnode.component.parent == null : false;
  1470. const open = ` at <${formatComponentName(
  1471. vnode.component,
  1472. vnode.type,
  1473. isRoot
  1474. )}`;
  1475. const close = `>` + postfix;
  1476. return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
  1477. }
  1478. function formatProps(props) {
  1479. const res = [];
  1480. const keys = Object.keys(props);
  1481. keys.slice(0, 3).forEach((key) => {
  1482. res.push(...formatProp(key, props[key]));
  1483. });
  1484. if (keys.length > 3) {
  1485. res.push(` ...`);
  1486. }
  1487. return res;
  1488. }
  1489. function formatProp(key, value, raw) {
  1490. if (isString(value)) {
  1491. value = JSON.stringify(value);
  1492. return raw ? value : [`${key}=${value}`];
  1493. } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
  1494. return raw ? value : [`${key}=${value}`];
  1495. } else if (isRef(value)) {
  1496. value = formatProp(key, toRaw(value.value), true);
  1497. return raw ? value : [`${key}=Ref<`, value, `>`];
  1498. } else if (isFunction(value)) {
  1499. return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
  1500. } else {
  1501. value = toRaw(value);
  1502. return raw ? value : [`${key}=`, value];
  1503. }
  1504. }
  1505. function assertNumber(val, type) {
  1506. if (val === void 0) {
  1507. return;
  1508. } else if (typeof val !== "number") {
  1509. warn(`${type} is not a valid number - got ${JSON.stringify(val)}.`);
  1510. } else if (isNaN(val)) {
  1511. warn(`${type} is NaN - the duration expression might be incorrect.`);
  1512. }
  1513. }
  1514. const ErrorTypeStrings = {
  1515. ["sp"]: "serverPrefetch hook",
  1516. ["bc"]: "beforeCreate hook",
  1517. ["c"]: "created hook",
  1518. ["bm"]: "beforeMount hook",
  1519. ["m"]: "mounted hook",
  1520. ["bu"]: "beforeUpdate hook",
  1521. ["u"]: "updated",
  1522. ["bum"]: "beforeUnmount hook",
  1523. ["um"]: "unmounted hook",
  1524. ["a"]: "activated hook",
  1525. ["da"]: "deactivated hook",
  1526. ["ec"]: "errorCaptured hook",
  1527. ["rtc"]: "renderTracked hook",
  1528. ["rtg"]: "renderTriggered hook",
  1529. [0]: "setup function",
  1530. [1]: "render function",
  1531. [2]: "watcher getter",
  1532. [3]: "watcher callback",
  1533. [4]: "watcher cleanup function",
  1534. [5]: "native event handler",
  1535. [6]: "component event handler",
  1536. [7]: "vnode hook",
  1537. [8]: "directive hook",
  1538. [9]: "transition hook",
  1539. [10]: "app errorHandler",
  1540. [11]: "app warnHandler",
  1541. [12]: "ref function",
  1542. [13]: "async component loader",
  1543. [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"
  1544. };
  1545. function callWithErrorHandling(fn, instance, type, args) {
  1546. let res;
  1547. try {
  1548. res = args ? fn(...args) : fn();
  1549. } catch (err) {
  1550. handleError(err, instance, type);
  1551. }
  1552. return res;
  1553. }
  1554. function callWithAsyncErrorHandling(fn, instance, type, args) {
  1555. if (isFunction(fn)) {
  1556. const res = callWithErrorHandling(fn, instance, type, args);
  1557. if (res && isPromise(res)) {
  1558. res.catch((err) => {
  1559. handleError(err, instance, type);
  1560. });
  1561. }
  1562. return res;
  1563. }
  1564. const values = [];
  1565. for (let i = 0; i < fn.length; i++) {
  1566. values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
  1567. }
  1568. return values;
  1569. }
  1570. function handleError(err, instance, type, throwInDev = true) {
  1571. const contextVNode = instance ? instance.vnode : null;
  1572. if (instance) {
  1573. let cur = instance.parent;
  1574. const exposedInstance = instance.proxy;
  1575. const errorInfo = ErrorTypeStrings[type] ;
  1576. while (cur) {
  1577. const errorCapturedHooks = cur.ec;
  1578. if (errorCapturedHooks) {
  1579. for (let i = 0; i < errorCapturedHooks.length; i++) {
  1580. if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
  1581. return;
  1582. }
  1583. }
  1584. }
  1585. cur = cur.parent;
  1586. }
  1587. const appErrorHandler = instance.appContext.config.errorHandler;
  1588. if (appErrorHandler) {
  1589. callWithErrorHandling(
  1590. appErrorHandler,
  1591. null,
  1592. 10,
  1593. [err, exposedInstance, errorInfo]
  1594. );
  1595. return;
  1596. }
  1597. }
  1598. logError(err, type, contextVNode, throwInDev);
  1599. }
  1600. function logError(err, type, contextVNode, throwInDev = true) {
  1601. {
  1602. const info = ErrorTypeStrings[type];
  1603. if (contextVNode) {
  1604. pushWarningContext(contextVNode);
  1605. }
  1606. warn(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
  1607. if (contextVNode) {
  1608. popWarningContext();
  1609. }
  1610. if (throwInDev) {
  1611. throw err;
  1612. } else {
  1613. console.error(err);
  1614. }
  1615. }
  1616. }
  1617. let isFlushing = false;
  1618. let isFlushPending = false;
  1619. const queue = [];
  1620. let flushIndex = 0;
  1621. const pendingPostFlushCbs = [];
  1622. let activePostFlushCbs = null;
  1623. let postFlushIndex = 0;
  1624. const resolvedPromise = /* @__PURE__ */ Promise.resolve();
  1625. let currentFlushPromise = null;
  1626. const RECURSION_LIMIT = 100;
  1627. function nextTick(fn) {
  1628. const p = currentFlushPromise || resolvedPromise;
  1629. return fn ? p.then(this ? fn.bind(this) : fn) : p;
  1630. }
  1631. function findInsertionIndex(id) {
  1632. let start = flushIndex + 1;
  1633. let end = queue.length;
  1634. while (start < end) {
  1635. const middle = start + end >>> 1;
  1636. const middleJob = queue[middle];
  1637. const middleJobId = getId(middleJob);
  1638. if (middleJobId < id || middleJobId === id && middleJob.pre) {
  1639. start = middle + 1;
  1640. } else {
  1641. end = middle;
  1642. }
  1643. }
  1644. return start;
  1645. }
  1646. function queueJob(job) {
  1647. if (!queue.length || !queue.includes(
  1648. job,
  1649. isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex
  1650. )) {
  1651. if (job.id == null) {
  1652. queue.push(job);
  1653. } else {
  1654. queue.splice(findInsertionIndex(job.id), 0, job);
  1655. }
  1656. queueFlush();
  1657. }
  1658. }
  1659. function queueFlush() {
  1660. if (!isFlushing && !isFlushPending) {
  1661. isFlushPending = true;
  1662. currentFlushPromise = resolvedPromise.then(flushJobs);
  1663. }
  1664. }
  1665. function invalidateJob(job) {
  1666. const i = queue.indexOf(job);
  1667. if (i > flushIndex) {
  1668. queue.splice(i, 1);
  1669. }
  1670. }
  1671. function queuePostFlushCb(cb) {
  1672. if (!isArray(cb)) {
  1673. if (!activePostFlushCbs || !activePostFlushCbs.includes(
  1674. cb,
  1675. cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex
  1676. )) {
  1677. pendingPostFlushCbs.push(cb);
  1678. }
  1679. } else {
  1680. pendingPostFlushCbs.push(...cb);
  1681. }
  1682. queueFlush();
  1683. }
  1684. function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
  1685. {
  1686. seen = seen || /* @__PURE__ */ new Map();
  1687. }
  1688. for (; i < queue.length; i++) {
  1689. const cb = queue[i];
  1690. if (cb && cb.pre) {
  1691. if (instance && cb.id !== instance.uid) {
  1692. continue;
  1693. }
  1694. if (checkRecursiveUpdates(seen, cb)) {
  1695. continue;
  1696. }
  1697. queue.splice(i, 1);
  1698. i--;
  1699. cb();
  1700. }
  1701. }
  1702. }
  1703. function flushPostFlushCbs(seen) {
  1704. if (pendingPostFlushCbs.length) {
  1705. const deduped = [...new Set(pendingPostFlushCbs)];
  1706. pendingPostFlushCbs.length = 0;
  1707. if (activePostFlushCbs) {
  1708. activePostFlushCbs.push(...deduped);
  1709. return;
  1710. }
  1711. activePostFlushCbs = deduped;
  1712. {
  1713. seen = seen || /* @__PURE__ */ new Map();
  1714. }
  1715. activePostFlushCbs.sort((a, b) => getId(a) - getId(b));
  1716. for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
  1717. if (checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) {
  1718. continue;
  1719. }
  1720. activePostFlushCbs[postFlushIndex]();
  1721. }
  1722. activePostFlushCbs = null;
  1723. postFlushIndex = 0;
  1724. }
  1725. }
  1726. const getId = (job) => job.id == null ? Infinity : job.id;
  1727. const comparator = (a, b) => {
  1728. const diff = getId(a) - getId(b);
  1729. if (diff === 0) {
  1730. if (a.pre && !b.pre)
  1731. return -1;
  1732. if (b.pre && !a.pre)
  1733. return 1;
  1734. }
  1735. return diff;
  1736. };
  1737. function flushJobs(seen) {
  1738. isFlushPending = false;
  1739. isFlushing = true;
  1740. {
  1741. seen = seen || /* @__PURE__ */ new Map();
  1742. }
  1743. queue.sort(comparator);
  1744. const check = (job) => checkRecursiveUpdates(seen, job) ;
  1745. try {
  1746. for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
  1747. const job = queue[flushIndex];
  1748. if (job && job.active !== false) {
  1749. if (check(job)) {
  1750. continue;
  1751. }
  1752. callWithErrorHandling(job, null, 14);
  1753. }
  1754. }
  1755. } finally {
  1756. flushIndex = 0;
  1757. queue.length = 0;
  1758. flushPostFlushCbs(seen);
  1759. isFlushing = false;
  1760. currentFlushPromise = null;
  1761. if (queue.length || pendingPostFlushCbs.length) {
  1762. flushJobs(seen);
  1763. }
  1764. }
  1765. }
  1766. function checkRecursiveUpdates(seen, fn) {
  1767. if (!seen.has(fn)) {
  1768. seen.set(fn, 1);
  1769. } else {
  1770. const count = seen.get(fn);
  1771. if (count > RECURSION_LIMIT) {
  1772. const instance = fn.ownerInstance;
  1773. const componentName = instance && getComponentName(instance.type);
  1774. warn(
  1775. `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`
  1776. );
  1777. return true;
  1778. } else {
  1779. seen.set(fn, count + 1);
  1780. }
  1781. }
  1782. }
  1783. let isHmrUpdating = false;
  1784. const hmrDirtyComponents = /* @__PURE__ */ new Set();
  1785. {
  1786. getGlobalThis().__VUE_HMR_RUNTIME__ = {
  1787. createRecord: tryWrap(createRecord),
  1788. rerender: tryWrap(rerender),
  1789. reload: tryWrap(reload)
  1790. };
  1791. }
  1792. const map = /* @__PURE__ */ new Map();
  1793. function registerHMR(instance) {
  1794. const id = instance.type.__hmrId;
  1795. let record = map.get(id);
  1796. if (!record) {
  1797. createRecord(id, instance.type);
  1798. record = map.get(id);
  1799. }
  1800. record.instances.add(instance);
  1801. }
  1802. function unregisterHMR(instance) {
  1803. map.get(instance.type.__hmrId).instances.delete(instance);
  1804. }
  1805. function createRecord(id, initialDef) {
  1806. if (map.has(id)) {
  1807. return false;
  1808. }
  1809. map.set(id, {
  1810. initialDef: normalizeClassComponent(initialDef),
  1811. instances: /* @__PURE__ */ new Set()
  1812. });
  1813. return true;
  1814. }
  1815. function normalizeClassComponent(component) {
  1816. return isClassComponent(component) ? component.__vccOpts : component;
  1817. }
  1818. function rerender(id, newRender) {
  1819. const record = map.get(id);
  1820. if (!record) {
  1821. return;
  1822. }
  1823. record.initialDef.render = newRender;
  1824. [...record.instances].forEach((instance) => {
  1825. if (newRender) {
  1826. instance.render = newRender;
  1827. normalizeClassComponent(instance.type).render = newRender;
  1828. }
  1829. instance.renderCache = [];
  1830. isHmrUpdating = true;
  1831. instance.update();
  1832. isHmrUpdating = false;
  1833. });
  1834. }
  1835. function reload(id, newComp) {
  1836. const record = map.get(id);
  1837. if (!record)
  1838. return;
  1839. newComp = normalizeClassComponent(newComp);
  1840. updateComponentDef(record.initialDef, newComp);
  1841. const instances = [...record.instances];
  1842. for (const instance of instances) {
  1843. const oldComp = normalizeClassComponent(instance.type);
  1844. if (!hmrDirtyComponents.has(oldComp)) {
  1845. if (oldComp !== record.initialDef) {
  1846. updateComponentDef(oldComp, newComp);
  1847. }
  1848. hmrDirtyComponents.add(oldComp);
  1849. }
  1850. instance.appContext.propsCache.delete(instance.type);
  1851. instance.appContext.emitsCache.delete(instance.type);
  1852. instance.appContext.optionsCache.delete(instance.type);
  1853. if (instance.ceReload) {
  1854. hmrDirtyComponents.add(oldComp);
  1855. instance.ceReload(newComp.styles);
  1856. hmrDirtyComponents.delete(oldComp);
  1857. } else if (instance.parent) {
  1858. queueJob(instance.parent.update);
  1859. } else if (instance.appContext.reload) {
  1860. instance.appContext.reload();
  1861. } else if (typeof window !== "undefined") {
  1862. window.location.reload();
  1863. } else {
  1864. console.warn(
  1865. "[HMR] Root or manually mounted instance modified. Full reload required."
  1866. );
  1867. }
  1868. }
  1869. queuePostFlushCb(() => {
  1870. for (const instance of instances) {
  1871. hmrDirtyComponents.delete(
  1872. normalizeClassComponent(instance.type)
  1873. );
  1874. }
  1875. });
  1876. }
  1877. function updateComponentDef(oldComp, newComp) {
  1878. extend(oldComp, newComp);
  1879. for (const key in oldComp) {
  1880. if (key !== "__file" && !(key in newComp)) {
  1881. delete oldComp[key];
  1882. }
  1883. }
  1884. }
  1885. function tryWrap(fn) {
  1886. return (id, arg) => {
  1887. try {
  1888. return fn(id, arg);
  1889. } catch (e) {
  1890. console.error(e);
  1891. console.warn(
  1892. `[HMR] Something went wrong during Vue component hot-reload. Full reload required.`
  1893. );
  1894. }
  1895. };
  1896. }
  1897. exports.devtools = void 0;
  1898. let buffer = [];
  1899. let devtoolsNotInstalled = false;
  1900. function emit$1(event, ...args) {
  1901. if (exports.devtools) {
  1902. exports.devtools.emit(event, ...args);
  1903. } else if (!devtoolsNotInstalled) {
  1904. buffer.push({ event, args });
  1905. }
  1906. }
  1907. function setDevtoolsHook(hook, target) {
  1908. var _a, _b;
  1909. exports.devtools = hook;
  1910. if (exports.devtools) {
  1911. exports.devtools.enabled = true;
  1912. buffer.forEach(({ event, args }) => exports.devtools.emit(event, ...args));
  1913. buffer = [];
  1914. } else if (
  1915. // handle late devtools injection - only do this if we are in an actual
  1916. // browser environment to avoid the timer handle stalling test runner exit
  1917. // (#4815)
  1918. typeof window !== "undefined" && // some envs mock window but not fully
  1919. window.HTMLElement && // also exclude jsdom
  1920. !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))
  1921. ) {
  1922. const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
  1923. replay.push((newHook) => {
  1924. setDevtoolsHook(newHook, target);
  1925. });
  1926. setTimeout(() => {
  1927. if (!exports.devtools) {
  1928. target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
  1929. devtoolsNotInstalled = true;
  1930. buffer = [];
  1931. }
  1932. }, 3e3);
  1933. } else {
  1934. devtoolsNotInstalled = true;
  1935. buffer = [];
  1936. }
  1937. }
  1938. function devtoolsInitApp(app, version) {
  1939. emit$1("app:init" /* APP_INIT */, app, version, {
  1940. Fragment,
  1941. Text,
  1942. Comment,
  1943. Static
  1944. });
  1945. }
  1946. function devtoolsUnmountApp(app) {
  1947. emit$1("app:unmount" /* APP_UNMOUNT */, app);
  1948. }
  1949. const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook(
  1950. "component:added" /* COMPONENT_ADDED */
  1951. );
  1952. const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */);
  1953. const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
  1954. "component:removed" /* COMPONENT_REMOVED */
  1955. );
  1956. const devtoolsComponentRemoved = (component) => {
  1957. if (exports.devtools && typeof exports.devtools.cleanupBuffer === "function" && // remove the component if it wasn't buffered
  1958. !exports.devtools.cleanupBuffer(component)) {
  1959. _devtoolsComponentRemoved(component);
  1960. }
  1961. };
  1962. function createDevtoolsComponentHook(hook) {
  1963. return (component) => {
  1964. emit$1(
  1965. hook,
  1966. component.appContext.app,
  1967. component.uid,
  1968. component.parent ? component.parent.uid : void 0,
  1969. component
  1970. );
  1971. };
  1972. }
  1973. const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook(
  1974. "perf:start" /* PERFORMANCE_START */
  1975. );
  1976. const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook(
  1977. "perf:end" /* PERFORMANCE_END */
  1978. );
  1979. function createDevtoolsPerformanceHook(hook) {
  1980. return (component, type, time) => {
  1981. emit$1(hook, component.appContext.app, component.uid, component, type, time);
  1982. };
  1983. }
  1984. function devtoolsComponentEmit(component, event, params) {
  1985. emit$1(
  1986. "component:emit" /* COMPONENT_EMIT */,
  1987. component.appContext.app,
  1988. component,
  1989. event,
  1990. params
  1991. );
  1992. }
  1993. function emit(instance, event, ...rawArgs) {
  1994. if (instance.isUnmounted)
  1995. return;
  1996. const props = instance.vnode.props || EMPTY_OBJ;
  1997. {
  1998. const {
  1999. emitsOptions,
  2000. propsOptions: [propsOptions]
  2001. } = instance;
  2002. if (emitsOptions) {
  2003. if (!(event in emitsOptions) && true) {
  2004. if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
  2005. warn(
  2006. `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`
  2007. );
  2008. }
  2009. } else {
  2010. const validator = emitsOptions[event];
  2011. if (isFunction(validator)) {
  2012. const isValid = validator(...rawArgs);
  2013. if (!isValid) {
  2014. warn(
  2015. `Invalid event arguments: event validation failed for event "${event}".`
  2016. );
  2017. }
  2018. }
  2019. }
  2020. }
  2021. }
  2022. let args = rawArgs;
  2023. const isModelListener = event.startsWith("update:");
  2024. const modelArg = isModelListener && event.slice(7);
  2025. if (modelArg && modelArg in props) {
  2026. const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`;
  2027. const { number, trim } = props[modifiersKey] || EMPTY_OBJ;
  2028. if (trim) {
  2029. args = rawArgs.map((a) => isString(a) ? a.trim() : a);
  2030. }
  2031. if (number) {
  2032. args = rawArgs.map(looseToNumber);
  2033. }
  2034. }
  2035. {
  2036. devtoolsComponentEmit(instance, event, args);
  2037. }
  2038. {
  2039. const lowerCaseEvent = event.toLowerCase();
  2040. if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
  2041. warn(
  2042. `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
  2043. instance,
  2044. instance.type
  2045. )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(event)}" instead of "${event}".`
  2046. );
  2047. }
  2048. }
  2049. let handlerName;
  2050. let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
  2051. props[handlerName = toHandlerKey(camelize(event))];
  2052. if (!handler && isModelListener) {
  2053. handler = props[handlerName = toHandlerKey(hyphenate(event))];
  2054. }
  2055. if (handler) {
  2056. callWithAsyncErrorHandling(
  2057. handler,
  2058. instance,
  2059. 6,
  2060. args
  2061. );
  2062. }
  2063. const onceHandler = props[handlerName + `Once`];
  2064. if (onceHandler) {
  2065. if (!instance.emitted) {
  2066. instance.emitted = {};
  2067. } else if (instance.emitted[handlerName]) {
  2068. return;
  2069. }
  2070. instance.emitted[handlerName] = true;
  2071. callWithAsyncErrorHandling(
  2072. onceHandler,
  2073. instance,
  2074. 6,
  2075. args
  2076. );
  2077. }
  2078. }
  2079. function normalizeEmitsOptions(comp, appContext, asMixin = false) {
  2080. const cache = appContext.emitsCache;
  2081. const cached = cache.get(comp);
  2082. if (cached !== void 0) {
  2083. return cached;
  2084. }
  2085. const raw = comp.emits;
  2086. let normalized = {};
  2087. let hasExtends = false;
  2088. if (!isFunction(comp)) {
  2089. const extendEmits = (raw2) => {
  2090. const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
  2091. if (normalizedFromExtend) {
  2092. hasExtends = true;
  2093. extend(normalized, normalizedFromExtend);
  2094. }
  2095. };
  2096. if (!asMixin && appContext.mixins.length) {
  2097. appContext.mixins.forEach(extendEmits);
  2098. }
  2099. if (comp.extends) {
  2100. extendEmits(comp.extends);
  2101. }
  2102. if (comp.mixins) {
  2103. comp.mixins.forEach(extendEmits);
  2104. }
  2105. }
  2106. if (!raw && !hasExtends) {
  2107. if (isObject(comp)) {
  2108. cache.set(comp, null);
  2109. }
  2110. return null;
  2111. }
  2112. if (isArray(raw)) {
  2113. raw.forEach((key) => normalized[key] = null);
  2114. } else {
  2115. extend(normalized, raw);
  2116. }
  2117. if (isObject(comp)) {
  2118. cache.set(comp, normalized);
  2119. }
  2120. return normalized;
  2121. }
  2122. function isEmitListener(options, key) {
  2123. if (!options || !isOn(key)) {
  2124. return false;
  2125. }
  2126. key = key.slice(2).replace(/Once$/, "");
  2127. return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
  2128. }
  2129. let currentRenderingInstance = null;
  2130. let currentScopeId = null;
  2131. function setCurrentRenderingInstance(instance) {
  2132. const prev = currentRenderingInstance;
  2133. currentRenderingInstance = instance;
  2134. currentScopeId = instance && instance.type.__scopeId || null;
  2135. return prev;
  2136. }
  2137. function pushScopeId(id) {
  2138. currentScopeId = id;
  2139. }
  2140. function popScopeId() {
  2141. currentScopeId = null;
  2142. }
  2143. const withScopeId = (_id) => withCtx;
  2144. function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
  2145. if (!ctx)
  2146. return fn;
  2147. if (fn._n) {
  2148. return fn;
  2149. }
  2150. const renderFnWithContext = (...args) => {
  2151. if (renderFnWithContext._d) {
  2152. setBlockTracking(-1);
  2153. }
  2154. const prevInstance = setCurrentRenderingInstance(ctx);
  2155. let res;
  2156. try {
  2157. res = fn(...args);
  2158. } finally {
  2159. setCurrentRenderingInstance(prevInstance);
  2160. if (renderFnWithContext._d) {
  2161. setBlockTracking(1);
  2162. }
  2163. }
  2164. {
  2165. devtoolsComponentUpdated(ctx);
  2166. }
  2167. return res;
  2168. };
  2169. renderFnWithContext._n = true;
  2170. renderFnWithContext._c = true;
  2171. renderFnWithContext._d = true;
  2172. return renderFnWithContext;
  2173. }
  2174. let accessedAttrs = false;
  2175. function markAttrsAccessed() {
  2176. accessedAttrs = true;
  2177. }
  2178. function renderComponentRoot(instance) {
  2179. const {
  2180. type: Component,
  2181. vnode,
  2182. proxy,
  2183. withProxy,
  2184. props,
  2185. propsOptions: [propsOptions],
  2186. slots,
  2187. attrs,
  2188. emit,
  2189. render,
  2190. renderCache,
  2191. data,
  2192. setupState,
  2193. ctx,
  2194. inheritAttrs
  2195. } = instance;
  2196. let result;
  2197. let fallthroughAttrs;
  2198. const prev = setCurrentRenderingInstance(instance);
  2199. {
  2200. accessedAttrs = false;
  2201. }
  2202. try {
  2203. if (vnode.shapeFlag & 4) {
  2204. const proxyToUse = withProxy || proxy;
  2205. const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
  2206. get(target, key, receiver) {
  2207. warn(
  2208. `Property '${String(
  2209. key
  2210. )}' was accessed via 'this'. Avoid using 'this' in templates.`
  2211. );
  2212. return Reflect.get(target, key, receiver);
  2213. }
  2214. }) : proxyToUse;
  2215. result = normalizeVNode(
  2216. render.call(
  2217. thisProxy,
  2218. proxyToUse,
  2219. renderCache,
  2220. props,
  2221. setupState,
  2222. data,
  2223. ctx
  2224. )
  2225. );
  2226. fallthroughAttrs = attrs;
  2227. } else {
  2228. const render2 = Component;
  2229. if (attrs === props) {
  2230. markAttrsAccessed();
  2231. }
  2232. result = normalizeVNode(
  2233. render2.length > 1 ? render2(
  2234. props,
  2235. true ? {
  2236. get attrs() {
  2237. markAttrsAccessed();
  2238. return attrs;
  2239. },
  2240. slots,
  2241. emit
  2242. } : { attrs, slots, emit }
  2243. ) : render2(
  2244. props,
  2245. null
  2246. /* we know it doesn't need it */
  2247. )
  2248. );
  2249. fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
  2250. }
  2251. } catch (err) {
  2252. blockStack.length = 0;
  2253. handleError(err, instance, 1);
  2254. result = createVNode(Comment);
  2255. }
  2256. let root = result;
  2257. let setRoot = void 0;
  2258. if (result.patchFlag > 0 && result.patchFlag & 2048) {
  2259. [root, setRoot] = getChildRoot(result);
  2260. }
  2261. if (fallthroughAttrs && inheritAttrs !== false) {
  2262. const keys = Object.keys(fallthroughAttrs);
  2263. const { shapeFlag } = root;
  2264. if (keys.length) {
  2265. if (shapeFlag & (1 | 6)) {
  2266. if (propsOptions && keys.some(isModelListener)) {
  2267. fallthroughAttrs = filterModelListeners(
  2268. fallthroughAttrs,
  2269. propsOptions
  2270. );
  2271. }
  2272. root = cloneVNode(root, fallthroughAttrs);
  2273. } else if (!accessedAttrs && root.type !== Comment) {
  2274. const allAttrs = Object.keys(attrs);
  2275. const eventAttrs = [];
  2276. const extraAttrs = [];
  2277. for (let i = 0, l = allAttrs.length; i < l; i++) {
  2278. const key = allAttrs[i];
  2279. if (isOn(key)) {
  2280. if (!isModelListener(key)) {
  2281. eventAttrs.push(key[2].toLowerCase() + key.slice(3));
  2282. }
  2283. } else {
  2284. extraAttrs.push(key);
  2285. }
  2286. }
  2287. if (extraAttrs.length) {
  2288. warn(
  2289. `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
  2290. );
  2291. }
  2292. if (eventAttrs.length) {
  2293. warn(
  2294. `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`
  2295. );
  2296. }
  2297. }
  2298. }
  2299. }
  2300. if (vnode.dirs) {
  2301. if (!isElementRoot(root)) {
  2302. warn(
  2303. `Runtime directive used on component with non-element root node. The directives will not function as intended.`
  2304. );
  2305. }
  2306. root = cloneVNode(root);
  2307. root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
  2308. }
  2309. if (vnode.transition) {
  2310. if (!isElementRoot(root)) {
  2311. warn(
  2312. `Component inside <Transition> renders non-element root node that cannot be animated.`
  2313. );
  2314. }
  2315. root.transition = vnode.transition;
  2316. }
  2317. if (setRoot) {
  2318. setRoot(root);
  2319. } else {
  2320. result = root;
  2321. }
  2322. setCurrentRenderingInstance(prev);
  2323. return result;
  2324. }
  2325. const getChildRoot = (vnode) => {
  2326. const rawChildren = vnode.children;
  2327. const dynamicChildren = vnode.dynamicChildren;
  2328. const childRoot = filterSingleRoot(rawChildren);
  2329. if (!childRoot) {
  2330. return [vnode, void 0];
  2331. }
  2332. const index = rawChildren.indexOf(childRoot);
  2333. const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
  2334. const setRoot = (updatedRoot) => {
  2335. rawChildren[index] = updatedRoot;
  2336. if (dynamicChildren) {
  2337. if (dynamicIndex > -1) {
  2338. dynamicChildren[dynamicIndex] = updatedRoot;
  2339. } else if (updatedRoot.patchFlag > 0) {
  2340. vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
  2341. }
  2342. }
  2343. };
  2344. return [normalizeVNode(childRoot), setRoot];
  2345. };
  2346. function filterSingleRoot(children) {
  2347. let singleRoot;
  2348. for (let i = 0; i < children.length; i++) {
  2349. const child = children[i];
  2350. if (isVNode(child)) {
  2351. if (child.type !== Comment || child.children === "v-if") {
  2352. if (singleRoot) {
  2353. return;
  2354. } else {
  2355. singleRoot = child;
  2356. }
  2357. }
  2358. } else {
  2359. return;
  2360. }
  2361. }
  2362. return singleRoot;
  2363. }
  2364. const getFunctionalFallthrough = (attrs) => {
  2365. let res;
  2366. for (const key in attrs) {
  2367. if (key === "class" || key === "style" || isOn(key)) {
  2368. (res || (res = {}))[key] = attrs[key];
  2369. }
  2370. }
  2371. return res;
  2372. };
  2373. const filterModelListeners = (attrs, props) => {
  2374. const res = {};
  2375. for (const key in attrs) {
  2376. if (!isModelListener(key) || !(key.slice(9) in props)) {
  2377. res[key] = attrs[key];
  2378. }
  2379. }
  2380. return res;
  2381. };
  2382. const isElementRoot = (vnode) => {
  2383. return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;
  2384. };
  2385. function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
  2386. const { props: prevProps, children: prevChildren, component } = prevVNode;
  2387. const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
  2388. const emits = component.emitsOptions;
  2389. if ((prevChildren || nextChildren) && isHmrUpdating) {
  2390. return true;
  2391. }
  2392. if (nextVNode.dirs || nextVNode.transition) {
  2393. return true;
  2394. }
  2395. if (optimized && patchFlag >= 0) {
  2396. if (patchFlag & 1024) {
  2397. return true;
  2398. }
  2399. if (patchFlag & 16) {
  2400. if (!prevProps) {
  2401. return !!nextProps;
  2402. }
  2403. return hasPropsChanged(prevProps, nextProps, emits);
  2404. } else if (patchFlag & 8) {
  2405. const dynamicProps = nextVNode.dynamicProps;
  2406. for (let i = 0; i < dynamicProps.length; i++) {
  2407. const key = dynamicProps[i];
  2408. if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
  2409. return true;
  2410. }
  2411. }
  2412. }
  2413. } else {
  2414. if (prevChildren || nextChildren) {
  2415. if (!nextChildren || !nextChildren.$stable) {
  2416. return true;
  2417. }
  2418. }
  2419. if (prevProps === nextProps) {
  2420. return false;
  2421. }
  2422. if (!prevProps) {
  2423. return !!nextProps;
  2424. }
  2425. if (!nextProps) {
  2426. return true;
  2427. }
  2428. return hasPropsChanged(prevProps, nextProps, emits);
  2429. }
  2430. return false;
  2431. }
  2432. function hasPropsChanged(prevProps, nextProps, emitsOptions) {
  2433. const nextKeys = Object.keys(nextProps);
  2434. if (nextKeys.length !== Object.keys(prevProps).length) {
  2435. return true;
  2436. }
  2437. for (let i = 0; i < nextKeys.length; i++) {
  2438. const key = nextKeys[i];
  2439. if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
  2440. return true;
  2441. }
  2442. }
  2443. return false;
  2444. }
  2445. function updateHOCHostEl({ vnode, parent }, el) {
  2446. while (parent && parent.subTree === vnode) {
  2447. (vnode = parent.vnode).el = el;
  2448. parent = parent.parent;
  2449. }
  2450. }
  2451. const COMPONENTS = "components";
  2452. const DIRECTIVES = "directives";
  2453. function resolveComponent(name, maybeSelfReference) {
  2454. return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
  2455. }
  2456. const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
  2457. function resolveDynamicComponent(component) {
  2458. if (isString(component)) {
  2459. return resolveAsset(COMPONENTS, component, false) || component;
  2460. } else {
  2461. return component || NULL_DYNAMIC_COMPONENT;
  2462. }
  2463. }
  2464. function resolveDirective(name) {
  2465. return resolveAsset(DIRECTIVES, name);
  2466. }
  2467. function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
  2468. const instance = currentRenderingInstance || currentInstance;
  2469. if (instance) {
  2470. const Component = instance.type;
  2471. if (type === COMPONENTS) {
  2472. const selfName = getComponentName(
  2473. Component,
  2474. false
  2475. /* do not include inferred name to avoid breaking existing code */
  2476. );
  2477. if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
  2478. return Component;
  2479. }
  2480. }
  2481. const res = (
  2482. // local registration
  2483. // check instance[type] first which is resolved for options API
  2484. resolve(instance[type] || Component[type], name) || // global registration
  2485. resolve(instance.appContext[type], name)
  2486. );
  2487. if (!res && maybeSelfReference) {
  2488. return Component;
  2489. }
  2490. if (warnMissing && !res) {
  2491. const extra = type === COMPONENTS ? `
  2492. If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
  2493. warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
  2494. }
  2495. return res;
  2496. } else {
  2497. warn(
  2498. `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
  2499. );
  2500. }
  2501. }
  2502. function resolve(registry, name) {
  2503. return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
  2504. }
  2505. const isSuspense = (type) => type.__isSuspense;
  2506. const SuspenseImpl = {
  2507. name: "Suspense",
  2508. // In order to make Suspense tree-shakable, we need to avoid importing it
  2509. // directly in the renderer. The renderer checks for the __isSuspense flag
  2510. // on a vnode's type and calls the `process` method, passing in renderer
  2511. // internals.
  2512. __isSuspense: true,
  2513. process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {
  2514. if (n1 == null) {
  2515. mountSuspense(
  2516. n2,
  2517. container,
  2518. anchor,
  2519. parentComponent,
  2520. parentSuspense,
  2521. isSVG,
  2522. slotScopeIds,
  2523. optimized,
  2524. rendererInternals
  2525. );
  2526. } else {
  2527. patchSuspense(
  2528. n1,
  2529. n2,
  2530. container,
  2531. anchor,
  2532. parentComponent,
  2533. isSVG,
  2534. slotScopeIds,
  2535. optimized,
  2536. rendererInternals
  2537. );
  2538. }
  2539. },
  2540. hydrate: hydrateSuspense,
  2541. create: createSuspenseBoundary,
  2542. normalize: normalizeSuspenseChildren
  2543. };
  2544. const Suspense = SuspenseImpl ;
  2545. function triggerEvent(vnode, name) {
  2546. const eventListener = vnode.props && vnode.props[name];
  2547. if (isFunction(eventListener)) {
  2548. eventListener();
  2549. }
  2550. }
  2551. function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {
  2552. const {
  2553. p: patch,
  2554. o: { createElement }
  2555. } = rendererInternals;
  2556. const hiddenContainer = createElement("div");
  2557. const suspense = vnode.suspense = createSuspenseBoundary(
  2558. vnode,
  2559. parentSuspense,
  2560. parentComponent,
  2561. container,
  2562. hiddenContainer,
  2563. anchor,
  2564. isSVG,
  2565. slotScopeIds,
  2566. optimized,
  2567. rendererInternals
  2568. );
  2569. patch(
  2570. null,
  2571. suspense.pendingBranch = vnode.ssContent,
  2572. hiddenContainer,
  2573. null,
  2574. parentComponent,
  2575. suspense,
  2576. isSVG,
  2577. slotScopeIds
  2578. );
  2579. if (suspense.deps > 0) {
  2580. triggerEvent(vnode, "onPending");
  2581. triggerEvent(vnode, "onFallback");
  2582. patch(
  2583. null,
  2584. vnode.ssFallback,
  2585. container,
  2586. anchor,
  2587. parentComponent,
  2588. null,
  2589. // fallback tree will not have suspense context
  2590. isSVG,
  2591. slotScopeIds
  2592. );
  2593. setActiveBranch(suspense, vnode.ssFallback);
  2594. } else {
  2595. suspense.resolve(false, true);
  2596. }
  2597. }
  2598. function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
  2599. const suspense = n2.suspense = n1.suspense;
  2600. suspense.vnode = n2;
  2601. n2.el = n1.el;
  2602. const newBranch = n2.ssContent;
  2603. const newFallback = n2.ssFallback;
  2604. const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
  2605. if (pendingBranch) {
  2606. suspense.pendingBranch = newBranch;
  2607. if (isSameVNodeType(newBranch, pendingBranch)) {
  2608. patch(
  2609. pendingBranch,
  2610. newBranch,
  2611. suspense.hiddenContainer,
  2612. null,
  2613. parentComponent,
  2614. suspense,
  2615. isSVG,
  2616. slotScopeIds,
  2617. optimized
  2618. );
  2619. if (suspense.deps <= 0) {
  2620. suspense.resolve();
  2621. } else if (isInFallback) {
  2622. patch(
  2623. activeBranch,
  2624. newFallback,
  2625. container,
  2626. anchor,
  2627. parentComponent,
  2628. null,
  2629. // fallback tree will not have suspense context
  2630. isSVG,
  2631. slotScopeIds,
  2632. optimized
  2633. );
  2634. setActiveBranch(suspense, newFallback);
  2635. }
  2636. } else {
  2637. suspense.pendingId++;
  2638. if (isHydrating) {
  2639. suspense.isHydrating = false;
  2640. suspense.activeBranch = pendingBranch;
  2641. } else {
  2642. unmount(pendingBranch, parentComponent, suspense);
  2643. }
  2644. suspense.deps = 0;
  2645. suspense.effects.length = 0;
  2646. suspense.hiddenContainer = createElement("div");
  2647. if (isInFallback) {
  2648. patch(
  2649. null,
  2650. newBranch,
  2651. suspense.hiddenContainer,
  2652. null,
  2653. parentComponent,
  2654. suspense,
  2655. isSVG,
  2656. slotScopeIds,
  2657. optimized
  2658. );
  2659. if (suspense.deps <= 0) {
  2660. suspense.resolve();
  2661. } else {
  2662. patch(
  2663. activeBranch,
  2664. newFallback,
  2665. container,
  2666. anchor,
  2667. parentComponent,
  2668. null,
  2669. // fallback tree will not have suspense context
  2670. isSVG,
  2671. slotScopeIds,
  2672. optimized
  2673. );
  2674. setActiveBranch(suspense, newFallback);
  2675. }
  2676. } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
  2677. patch(
  2678. activeBranch,
  2679. newBranch,
  2680. container,
  2681. anchor,
  2682. parentComponent,
  2683. suspense,
  2684. isSVG,
  2685. slotScopeIds,
  2686. optimized
  2687. );
  2688. suspense.resolve(true);
  2689. } else {
  2690. patch(
  2691. null,
  2692. newBranch,
  2693. suspense.hiddenContainer,
  2694. null,
  2695. parentComponent,
  2696. suspense,
  2697. isSVG,
  2698. slotScopeIds,
  2699. optimized
  2700. );
  2701. if (suspense.deps <= 0) {
  2702. suspense.resolve();
  2703. }
  2704. }
  2705. }
  2706. } else {
  2707. if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
  2708. patch(
  2709. activeBranch,
  2710. newBranch,
  2711. container,
  2712. anchor,
  2713. parentComponent,
  2714. suspense,
  2715. isSVG,
  2716. slotScopeIds,
  2717. optimized
  2718. );
  2719. setActiveBranch(suspense, newBranch);
  2720. } else {
  2721. triggerEvent(n2, "onPending");
  2722. suspense.pendingBranch = newBranch;
  2723. suspense.pendingId++;
  2724. patch(
  2725. null,
  2726. newBranch,
  2727. suspense.hiddenContainer,
  2728. null,
  2729. parentComponent,
  2730. suspense,
  2731. isSVG,
  2732. slotScopeIds,
  2733. optimized
  2734. );
  2735. if (suspense.deps <= 0) {
  2736. suspense.resolve();
  2737. } else {
  2738. const { timeout, pendingId } = suspense;
  2739. if (timeout > 0) {
  2740. setTimeout(() => {
  2741. if (suspense.pendingId === pendingId) {
  2742. suspense.fallback(newFallback);
  2743. }
  2744. }, timeout);
  2745. } else if (timeout === 0) {
  2746. suspense.fallback(newFallback);
  2747. }
  2748. }
  2749. }
  2750. }
  2751. }
  2752. let hasWarned = false;
  2753. function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
  2754. if (!hasWarned) {
  2755. hasWarned = true;
  2756. console[console.info ? "info" : "log"](
  2757. `<Suspense> is an experimental feature and its API will likely change.`
  2758. );
  2759. }
  2760. const {
  2761. p: patch,
  2762. m: move,
  2763. um: unmount,
  2764. n: next,
  2765. o: { parentNode, remove }
  2766. } = rendererInternals;
  2767. let parentSuspenseId;
  2768. const isSuspensible = isVNodeSuspensible(vnode);
  2769. if (isSuspensible) {
  2770. if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) {
  2771. parentSuspenseId = parentSuspense.pendingId;
  2772. parentSuspense.deps++;
  2773. }
  2774. }
  2775. const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0;
  2776. {
  2777. assertNumber(timeout, `Suspense timeout`);
  2778. }
  2779. const suspense = {
  2780. vnode,
  2781. parent: parentSuspense,
  2782. parentComponent,
  2783. isSVG,
  2784. container,
  2785. hiddenContainer,
  2786. anchor,
  2787. deps: 0,
  2788. pendingId: 0,
  2789. timeout: typeof timeout === "number" ? timeout : -1,
  2790. activeBranch: null,
  2791. pendingBranch: null,
  2792. isInFallback: true,
  2793. isHydrating,
  2794. isUnmounted: false,
  2795. effects: [],
  2796. resolve(resume = false, sync = false) {
  2797. {
  2798. if (!resume && !suspense.pendingBranch) {
  2799. throw new Error(
  2800. `suspense.resolve() is called without a pending branch.`
  2801. );
  2802. }
  2803. if (suspense.isUnmounted) {
  2804. throw new Error(
  2805. `suspense.resolve() is called on an already unmounted suspense boundary.`
  2806. );
  2807. }
  2808. }
  2809. const {
  2810. vnode: vnode2,
  2811. activeBranch,
  2812. pendingBranch,
  2813. pendingId,
  2814. effects,
  2815. parentComponent: parentComponent2,
  2816. container: container2
  2817. } = suspense;
  2818. let delayEnter = false;
  2819. if (suspense.isHydrating) {
  2820. suspense.isHydrating = false;
  2821. } else if (!resume) {
  2822. delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
  2823. if (delayEnter) {
  2824. activeBranch.transition.afterLeave = () => {
  2825. if (pendingId === suspense.pendingId) {
  2826. move(
  2827. pendingBranch,
  2828. container2,
  2829. next(activeBranch),
  2830. 0
  2831. );
  2832. queuePostFlushCb(effects);
  2833. }
  2834. };
  2835. }
  2836. let { anchor: anchor2 } = suspense;
  2837. if (activeBranch) {
  2838. anchor2 = next(activeBranch);
  2839. unmount(activeBranch, parentComponent2, suspense, true);
  2840. }
  2841. if (!delayEnter) {
  2842. move(pendingBranch, container2, anchor2, 0);
  2843. }
  2844. }
  2845. setActiveBranch(suspense, pendingBranch);
  2846. suspense.pendingBranch = null;
  2847. suspense.isInFallback = false;
  2848. let parent = suspense.parent;
  2849. let hasUnresolvedAncestor = false;
  2850. while (parent) {
  2851. if (parent.pendingBranch) {
  2852. parent.effects.push(...effects);
  2853. hasUnresolvedAncestor = true;
  2854. break;
  2855. }
  2856. parent = parent.parent;
  2857. }
  2858. if (!hasUnresolvedAncestor && !delayEnter) {
  2859. queuePostFlushCb(effects);
  2860. }
  2861. suspense.effects = [];
  2862. if (isSuspensible) {
  2863. if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
  2864. parentSuspense.deps--;
  2865. if (parentSuspense.deps === 0 && !sync) {
  2866. parentSuspense.resolve();
  2867. }
  2868. }
  2869. }
  2870. triggerEvent(vnode2, "onResolve");
  2871. },
  2872. fallback(fallbackVNode) {
  2873. if (!suspense.pendingBranch) {
  2874. return;
  2875. }
  2876. const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense;
  2877. triggerEvent(vnode2, "onFallback");
  2878. const anchor2 = next(activeBranch);
  2879. const mountFallback = () => {
  2880. if (!suspense.isInFallback) {
  2881. return;
  2882. }
  2883. patch(
  2884. null,
  2885. fallbackVNode,
  2886. container2,
  2887. anchor2,
  2888. parentComponent2,
  2889. null,
  2890. // fallback tree will not have suspense context
  2891. isSVG2,
  2892. slotScopeIds,
  2893. optimized
  2894. );
  2895. setActiveBranch(suspense, fallbackVNode);
  2896. };
  2897. const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
  2898. if (delayEnter) {
  2899. activeBranch.transition.afterLeave = mountFallback;
  2900. }
  2901. suspense.isInFallback = true;
  2902. unmount(
  2903. activeBranch,
  2904. parentComponent2,
  2905. null,
  2906. // no suspense so unmount hooks fire now
  2907. true
  2908. // shouldRemove
  2909. );
  2910. if (!delayEnter) {
  2911. mountFallback();
  2912. }
  2913. },
  2914. move(container2, anchor2, type) {
  2915. suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
  2916. suspense.container = container2;
  2917. },
  2918. next() {
  2919. return suspense.activeBranch && next(suspense.activeBranch);
  2920. },
  2921. registerDep(instance, setupRenderEffect) {
  2922. const isInPendingSuspense = !!suspense.pendingBranch;
  2923. if (isInPendingSuspense) {
  2924. suspense.deps++;
  2925. }
  2926. const hydratedEl = instance.vnode.el;
  2927. instance.asyncDep.catch((err) => {
  2928. handleError(err, instance, 0);
  2929. }).then((asyncSetupResult) => {
  2930. if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
  2931. return;
  2932. }
  2933. instance.asyncResolved = true;
  2934. const { vnode: vnode2 } = instance;
  2935. {
  2936. pushWarningContext(vnode2);
  2937. }
  2938. handleSetupResult(instance, asyncSetupResult, false);
  2939. if (hydratedEl) {
  2940. vnode2.el = hydratedEl;
  2941. }
  2942. const placeholder = !hydratedEl && instance.subTree.el;
  2943. setupRenderEffect(
  2944. instance,
  2945. vnode2,
  2946. // component may have been moved before resolve.
  2947. // if this is not a hydration, instance.subTree will be the comment
  2948. // placeholder.
  2949. parentNode(hydratedEl || instance.subTree.el),
  2950. // anchor will not be used if this is hydration, so only need to
  2951. // consider the comment placeholder case.
  2952. hydratedEl ? null : next(instance.subTree),
  2953. suspense,
  2954. isSVG,
  2955. optimized
  2956. );
  2957. if (placeholder) {
  2958. remove(placeholder);
  2959. }
  2960. updateHOCHostEl(instance, vnode2.el);
  2961. {
  2962. popWarningContext();
  2963. }
  2964. if (isInPendingSuspense && --suspense.deps === 0) {
  2965. suspense.resolve();
  2966. }
  2967. });
  2968. },
  2969. unmount(parentSuspense2, doRemove) {
  2970. suspense.isUnmounted = true;
  2971. if (suspense.activeBranch) {
  2972. unmount(
  2973. suspense.activeBranch,
  2974. parentComponent,
  2975. parentSuspense2,
  2976. doRemove
  2977. );
  2978. }
  2979. if (suspense.pendingBranch) {
  2980. unmount(
  2981. suspense.pendingBranch,
  2982. parentComponent,
  2983. parentSuspense2,
  2984. doRemove
  2985. );
  2986. }
  2987. }
  2988. };
  2989. return suspense;
  2990. }
  2991. function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals, hydrateNode) {
  2992. const suspense = vnode.suspense = createSuspenseBoundary(
  2993. vnode,
  2994. parentSuspense,
  2995. parentComponent,
  2996. node.parentNode,
  2997. document.createElement("div"),
  2998. null,
  2999. isSVG,
  3000. slotScopeIds,
  3001. optimized,
  3002. rendererInternals,
  3003. true
  3004. /* hydrating */
  3005. );
  3006. const result = hydrateNode(
  3007. node,
  3008. suspense.pendingBranch = vnode.ssContent,
  3009. parentComponent,
  3010. suspense,
  3011. slotScopeIds,
  3012. optimized
  3013. );
  3014. if (suspense.deps === 0) {
  3015. suspense.resolve(false, true);
  3016. }
  3017. return result;
  3018. }
  3019. function normalizeSuspenseChildren(vnode) {
  3020. const { shapeFlag, children } = vnode;
  3021. const isSlotChildren = shapeFlag & 32;
  3022. vnode.ssContent = normalizeSuspenseSlot(
  3023. isSlotChildren ? children.default : children
  3024. );
  3025. vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment);
  3026. }
  3027. function normalizeSuspenseSlot(s) {
  3028. let block;
  3029. if (isFunction(s)) {
  3030. const trackBlock = isBlockTreeEnabled && s._c;
  3031. if (trackBlock) {
  3032. s._d = false;
  3033. openBlock();
  3034. }
  3035. s = s();
  3036. if (trackBlock) {
  3037. s._d = true;
  3038. block = currentBlock;
  3039. closeBlock();
  3040. }
  3041. }
  3042. if (isArray(s)) {
  3043. const singleChild = filterSingleRoot(s);
  3044. if (!singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) {
  3045. warn(`<Suspense> slots expect a single root node.`);
  3046. }
  3047. s = singleChild;
  3048. }
  3049. s = normalizeVNode(s);
  3050. if (block && !s.dynamicChildren) {
  3051. s.dynamicChildren = block.filter((c) => c !== s);
  3052. }
  3053. return s;
  3054. }
  3055. function queueEffectWithSuspense(fn, suspense) {
  3056. if (suspense && suspense.pendingBranch) {
  3057. if (isArray(fn)) {
  3058. suspense.effects.push(...fn);
  3059. } else {
  3060. suspense.effects.push(fn);
  3061. }
  3062. } else {
  3063. queuePostFlushCb(fn);
  3064. }
  3065. }
  3066. function setActiveBranch(suspense, branch) {
  3067. suspense.activeBranch = branch;
  3068. const { vnode, parentComponent } = suspense;
  3069. const el = vnode.el = branch.el;
  3070. if (parentComponent && parentComponent.subTree === vnode) {
  3071. parentComponent.vnode.el = el;
  3072. updateHOCHostEl(parentComponent, el);
  3073. }
  3074. }
  3075. function isVNodeSuspensible(vnode) {
  3076. var _a;
  3077. return ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
  3078. }
  3079. function watchEffect(effect, options) {
  3080. return doWatch(effect, null, options);
  3081. }
  3082. function watchPostEffect(effect, options) {
  3083. return doWatch(
  3084. effect,
  3085. null,
  3086. extend({}, options, { flush: "post" })
  3087. );
  3088. }
  3089. function watchSyncEffect(effect, options) {
  3090. return doWatch(
  3091. effect,
  3092. null,
  3093. extend({}, options, { flush: "sync" })
  3094. );
  3095. }
  3096. const INITIAL_WATCHER_VALUE = {};
  3097. function watch(source, cb, options) {
  3098. if (!isFunction(cb)) {
  3099. warn(
  3100. `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
  3101. );
  3102. }
  3103. return doWatch(source, cb, options);
  3104. }
  3105. function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
  3106. var _a;
  3107. if (!cb) {
  3108. if (immediate !== void 0) {
  3109. warn(
  3110. `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
  3111. );
  3112. }
  3113. if (deep !== void 0) {
  3114. warn(
  3115. `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
  3116. );
  3117. }
  3118. }
  3119. const warnInvalidSource = (s) => {
  3120. warn(
  3121. `Invalid watch source: `,
  3122. s,
  3123. `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
  3124. );
  3125. };
  3126. const instance = getCurrentScope() === ((_a = currentInstance) == null ? void 0 : _a.scope) ? currentInstance : null;
  3127. let getter;
  3128. let forceTrigger = false;
  3129. let isMultiSource = false;
  3130. if (isRef(source)) {
  3131. getter = () => source.value;
  3132. forceTrigger = isShallow(source);
  3133. } else if (isReactive(source)) {
  3134. getter = () => source;
  3135. deep = true;
  3136. } else if (isArray(source)) {
  3137. isMultiSource = true;
  3138. forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
  3139. getter = () => source.map((s) => {
  3140. if (isRef(s)) {
  3141. return s.value;
  3142. } else if (isReactive(s)) {
  3143. return traverse(s);
  3144. } else if (isFunction(s)) {
  3145. return callWithErrorHandling(s, instance, 2);
  3146. } else {
  3147. warnInvalidSource(s);
  3148. }
  3149. });
  3150. } else if (isFunction(source)) {
  3151. if (cb) {
  3152. getter = () => callWithErrorHandling(source, instance, 2);
  3153. } else {
  3154. getter = () => {
  3155. if (instance && instance.isUnmounted) {
  3156. return;
  3157. }
  3158. if (cleanup) {
  3159. cleanup();
  3160. }
  3161. return callWithAsyncErrorHandling(
  3162. source,
  3163. instance,
  3164. 3,
  3165. [onCleanup]
  3166. );
  3167. };
  3168. }
  3169. } else {
  3170. getter = NOOP;
  3171. warnInvalidSource(source);
  3172. }
  3173. if (cb && deep) {
  3174. const baseGetter = getter;
  3175. getter = () => traverse(baseGetter());
  3176. }
  3177. let cleanup;
  3178. let onCleanup = (fn) => {
  3179. cleanup = effect.onStop = () => {
  3180. callWithErrorHandling(fn, instance, 4);
  3181. cleanup = effect.onStop = void 0;
  3182. };
  3183. };
  3184. let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
  3185. const job = () => {
  3186. if (!effect.active) {
  3187. return;
  3188. }
  3189. if (cb) {
  3190. const newValue = effect.run();
  3191. if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {
  3192. if (cleanup) {
  3193. cleanup();
  3194. }
  3195. callWithAsyncErrorHandling(cb, instance, 3, [
  3196. newValue,
  3197. // pass undefined as the old value when it's changed for the first time
  3198. oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
  3199. onCleanup
  3200. ]);
  3201. oldValue = newValue;
  3202. }
  3203. } else {
  3204. effect.run();
  3205. }
  3206. };
  3207. job.allowRecurse = !!cb;
  3208. let scheduler;
  3209. if (flush === "sync") {
  3210. scheduler = job;
  3211. } else if (flush === "post") {
  3212. scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
  3213. } else {
  3214. job.pre = true;
  3215. if (instance)
  3216. job.id = instance.uid;
  3217. scheduler = () => queueJob(job);
  3218. }
  3219. const effect = new ReactiveEffect(getter, scheduler);
  3220. {
  3221. effect.onTrack = onTrack;
  3222. effect.onTrigger = onTrigger;
  3223. }
  3224. if (cb) {
  3225. if (immediate) {
  3226. job();
  3227. } else {
  3228. oldValue = effect.run();
  3229. }
  3230. } else if (flush === "post") {
  3231. queuePostRenderEffect(
  3232. effect.run.bind(effect),
  3233. instance && instance.suspense
  3234. );
  3235. } else {
  3236. effect.run();
  3237. }
  3238. const unwatch = () => {
  3239. effect.stop();
  3240. if (instance && instance.scope) {
  3241. remove(instance.scope.effects, effect);
  3242. }
  3243. };
  3244. return unwatch;
  3245. }
  3246. function instanceWatch(source, value, options) {
  3247. const publicThis = this.proxy;
  3248. const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  3249. let cb;
  3250. if (isFunction(value)) {
  3251. cb = value;
  3252. } else {
  3253. cb = value.handler;
  3254. options = value;
  3255. }
  3256. const cur = currentInstance;
  3257. setCurrentInstance(this);
  3258. const res = doWatch(getter, cb.bind(publicThis), options);
  3259. if (cur) {
  3260. setCurrentInstance(cur);
  3261. } else {
  3262. unsetCurrentInstance();
  3263. }
  3264. return res;
  3265. }
  3266. function createPathGetter(ctx, path) {
  3267. const segments = path.split(".");
  3268. return () => {
  3269. let cur = ctx;
  3270. for (let i = 0; i < segments.length && cur; i++) {
  3271. cur = cur[segments[i]];
  3272. }
  3273. return cur;
  3274. };
  3275. }
  3276. function traverse(value, seen) {
  3277. if (!isObject(value) || value["__v_skip"]) {
  3278. return value;
  3279. }
  3280. seen = seen || /* @__PURE__ */ new Set();
  3281. if (seen.has(value)) {
  3282. return value;
  3283. }
  3284. seen.add(value);
  3285. if (isRef(value)) {
  3286. traverse(value.value, seen);
  3287. } else if (isArray(value)) {
  3288. for (let i = 0; i < value.length; i++) {
  3289. traverse(value[i], seen);
  3290. }
  3291. } else if (isSet(value) || isMap(value)) {
  3292. value.forEach((v) => {
  3293. traverse(v, seen);
  3294. });
  3295. } else if (isPlainObject(value)) {
  3296. for (const key in value) {
  3297. traverse(value[key], seen);
  3298. }
  3299. }
  3300. return value;
  3301. }
  3302. function validateDirectiveName(name) {
  3303. if (isBuiltInDirective(name)) {
  3304. warn("Do not use built-in directive ids as custom directive id: " + name);
  3305. }
  3306. }
  3307. function withDirectives(vnode, directives) {
  3308. const internalInstance = currentRenderingInstance;
  3309. if (internalInstance === null) {
  3310. warn(`withDirectives can only be used inside render functions.`);
  3311. return vnode;
  3312. }
  3313. const instance = getExposeProxy(internalInstance) || internalInstance.proxy;
  3314. const bindings = vnode.dirs || (vnode.dirs = []);
  3315. for (let i = 0; i < directives.length; i++) {
  3316. let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
  3317. if (dir) {
  3318. if (isFunction(dir)) {
  3319. dir = {
  3320. mounted: dir,
  3321. updated: dir
  3322. };
  3323. }
  3324. if (dir.deep) {
  3325. traverse(value);
  3326. }
  3327. bindings.push({
  3328. dir,
  3329. instance,
  3330. value,
  3331. oldValue: void 0,
  3332. arg,
  3333. modifiers
  3334. });
  3335. }
  3336. }
  3337. return vnode;
  3338. }
  3339. function invokeDirectiveHook(vnode, prevVNode, instance, name) {
  3340. const bindings = vnode.dirs;
  3341. const oldBindings = prevVNode && prevVNode.dirs;
  3342. for (let i = 0; i < bindings.length; i++) {
  3343. const binding = bindings[i];
  3344. if (oldBindings) {
  3345. binding.oldValue = oldBindings[i].value;
  3346. }
  3347. let hook = binding.dir[name];
  3348. if (hook) {
  3349. pauseTracking();
  3350. callWithAsyncErrorHandling(hook, instance, 8, [
  3351. vnode.el,
  3352. binding,
  3353. vnode,
  3354. prevVNode
  3355. ]);
  3356. resetTracking();
  3357. }
  3358. }
  3359. }
  3360. const leaveCbKey = Symbol("_leaveCb");
  3361. const enterCbKey$1 = Symbol("_enterCb");
  3362. function useTransitionState() {
  3363. const state = {
  3364. isMounted: false,
  3365. isLeaving: false,
  3366. isUnmounting: false,
  3367. leavingVNodes: /* @__PURE__ */ new Map()
  3368. };
  3369. onMounted(() => {
  3370. state.isMounted = true;
  3371. });
  3372. onBeforeUnmount(() => {
  3373. state.isUnmounting = true;
  3374. });
  3375. return state;
  3376. }
  3377. const TransitionHookValidator = [Function, Array];
  3378. const BaseTransitionPropsValidators = {
  3379. mode: String,
  3380. appear: Boolean,
  3381. persisted: Boolean,
  3382. // enter
  3383. onBeforeEnter: TransitionHookValidator,
  3384. onEnter: TransitionHookValidator,
  3385. onAfterEnter: TransitionHookValidator,
  3386. onEnterCancelled: TransitionHookValidator,
  3387. // leave
  3388. onBeforeLeave: TransitionHookValidator,
  3389. onLeave: TransitionHookValidator,
  3390. onAfterLeave: TransitionHookValidator,
  3391. onLeaveCancelled: TransitionHookValidator,
  3392. // appear
  3393. onBeforeAppear: TransitionHookValidator,
  3394. onAppear: TransitionHookValidator,
  3395. onAfterAppear: TransitionHookValidator,
  3396. onAppearCancelled: TransitionHookValidator
  3397. };
  3398. const BaseTransitionImpl = {
  3399. name: `BaseTransition`,
  3400. props: BaseTransitionPropsValidators,
  3401. setup(props, { slots }) {
  3402. const instance = getCurrentInstance();
  3403. const state = useTransitionState();
  3404. let prevTransitionKey;
  3405. return () => {
  3406. const children = slots.default && getTransitionRawChildren(slots.default(), true);
  3407. if (!children || !children.length) {
  3408. return;
  3409. }
  3410. let child = children[0];
  3411. if (children.length > 1) {
  3412. let hasFound = false;
  3413. for (const c of children) {
  3414. if (c.type !== Comment) {
  3415. if (hasFound) {
  3416. warn(
  3417. "<transition> can only be used on a single element or component. Use <transition-group> for lists."
  3418. );
  3419. break;
  3420. }
  3421. child = c;
  3422. hasFound = true;
  3423. }
  3424. }
  3425. }
  3426. const rawProps = toRaw(props);
  3427. const { mode } = rawProps;
  3428. if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
  3429. warn(`invalid <transition> mode: ${mode}`);
  3430. }
  3431. if (state.isLeaving) {
  3432. return emptyPlaceholder(child);
  3433. }
  3434. const innerChild = getKeepAliveChild(child);
  3435. if (!innerChild) {
  3436. return emptyPlaceholder(child);
  3437. }
  3438. const enterHooks = resolveTransitionHooks(
  3439. innerChild,
  3440. rawProps,
  3441. state,
  3442. instance
  3443. );
  3444. setTransitionHooks(innerChild, enterHooks);
  3445. const oldChild = instance.subTree;
  3446. const oldInnerChild = oldChild && getKeepAliveChild(oldChild);
  3447. let transitionKeyChanged = false;
  3448. const { getTransitionKey } = innerChild.type;
  3449. if (getTransitionKey) {
  3450. const key = getTransitionKey();
  3451. if (prevTransitionKey === void 0) {
  3452. prevTransitionKey = key;
  3453. } else if (key !== prevTransitionKey) {
  3454. prevTransitionKey = key;
  3455. transitionKeyChanged = true;
  3456. }
  3457. }
  3458. if (oldInnerChild && oldInnerChild.type !== Comment && (!isSameVNodeType(innerChild, oldInnerChild) || transitionKeyChanged)) {
  3459. const leavingHooks = resolveTransitionHooks(
  3460. oldInnerChild,
  3461. rawProps,
  3462. state,
  3463. instance
  3464. );
  3465. setTransitionHooks(oldInnerChild, leavingHooks);
  3466. if (mode === "out-in") {
  3467. state.isLeaving = true;
  3468. leavingHooks.afterLeave = () => {
  3469. state.isLeaving = false;
  3470. if (instance.update.active !== false) {
  3471. instance.update();
  3472. }
  3473. };
  3474. return emptyPlaceholder(child);
  3475. } else if (mode === "in-out" && innerChild.type !== Comment) {
  3476. leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
  3477. const leavingVNodesCache = getLeavingNodesForType(
  3478. state,
  3479. oldInnerChild
  3480. );
  3481. leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
  3482. el[leaveCbKey] = () => {
  3483. earlyRemove();
  3484. el[leaveCbKey] = void 0;
  3485. delete enterHooks.delayedLeave;
  3486. };
  3487. enterHooks.delayedLeave = delayedLeave;
  3488. };
  3489. }
  3490. }
  3491. return child;
  3492. };
  3493. }
  3494. };
  3495. const BaseTransition = BaseTransitionImpl;
  3496. function getLeavingNodesForType(state, vnode) {
  3497. const { leavingVNodes } = state;
  3498. let leavingVNodesCache = leavingVNodes.get(vnode.type);
  3499. if (!leavingVNodesCache) {
  3500. leavingVNodesCache = /* @__PURE__ */ Object.create(null);
  3501. leavingVNodes.set(vnode.type, leavingVNodesCache);
  3502. }
  3503. return leavingVNodesCache;
  3504. }
  3505. function resolveTransitionHooks(vnode, props, state, instance) {
  3506. const {
  3507. appear,
  3508. mode,
  3509. persisted = false,
  3510. onBeforeEnter,
  3511. onEnter,
  3512. onAfterEnter,
  3513. onEnterCancelled,
  3514. onBeforeLeave,
  3515. onLeave,
  3516. onAfterLeave,
  3517. onLeaveCancelled,
  3518. onBeforeAppear,
  3519. onAppear,
  3520. onAfterAppear,
  3521. onAppearCancelled
  3522. } = props;
  3523. const key = String(vnode.key);
  3524. const leavingVNodesCache = getLeavingNodesForType(state, vnode);
  3525. const callHook = (hook, args) => {
  3526. hook && callWithAsyncErrorHandling(
  3527. hook,
  3528. instance,
  3529. 9,
  3530. args
  3531. );
  3532. };
  3533. const callAsyncHook = (hook, args) => {
  3534. const done = args[1];
  3535. callHook(hook, args);
  3536. if (isArray(hook)) {
  3537. if (hook.every((hook2) => hook2.length <= 1))
  3538. done();
  3539. } else if (hook.length <= 1) {
  3540. done();
  3541. }
  3542. };
  3543. const hooks = {
  3544. mode,
  3545. persisted,
  3546. beforeEnter(el) {
  3547. let hook = onBeforeEnter;
  3548. if (!state.isMounted) {
  3549. if (appear) {
  3550. hook = onBeforeAppear || onBeforeEnter;
  3551. } else {
  3552. return;
  3553. }
  3554. }
  3555. if (el[leaveCbKey]) {
  3556. el[leaveCbKey](
  3557. true
  3558. /* cancelled */
  3559. );
  3560. }
  3561. const leavingVNode = leavingVNodesCache[key];
  3562. if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
  3563. leavingVNode.el[leaveCbKey]();
  3564. }
  3565. callHook(hook, [el]);
  3566. },
  3567. enter(el) {
  3568. let hook = onEnter;
  3569. let afterHook = onAfterEnter;
  3570. let cancelHook = onEnterCancelled;
  3571. if (!state.isMounted) {
  3572. if (appear) {
  3573. hook = onAppear || onEnter;
  3574. afterHook = onAfterAppear || onAfterEnter;
  3575. cancelHook = onAppearCancelled || onEnterCancelled;
  3576. } else {
  3577. return;
  3578. }
  3579. }
  3580. let called = false;
  3581. const done = el[enterCbKey$1] = (cancelled) => {
  3582. if (called)
  3583. return;
  3584. called = true;
  3585. if (cancelled) {
  3586. callHook(cancelHook, [el]);
  3587. } else {
  3588. callHook(afterHook, [el]);
  3589. }
  3590. if (hooks.delayedLeave) {
  3591. hooks.delayedLeave();
  3592. }
  3593. el[enterCbKey$1] = void 0;
  3594. };
  3595. if (hook) {
  3596. callAsyncHook(hook, [el, done]);
  3597. } else {
  3598. done();
  3599. }
  3600. },
  3601. leave(el, remove) {
  3602. const key2 = String(vnode.key);
  3603. if (el[enterCbKey$1]) {
  3604. el[enterCbKey$1](
  3605. true
  3606. /* cancelled */
  3607. );
  3608. }
  3609. if (state.isUnmounting) {
  3610. return remove();
  3611. }
  3612. callHook(onBeforeLeave, [el]);
  3613. let called = false;
  3614. const done = el[leaveCbKey] = (cancelled) => {
  3615. if (called)
  3616. return;
  3617. called = true;
  3618. remove();
  3619. if (cancelled) {
  3620. callHook(onLeaveCancelled, [el]);
  3621. } else {
  3622. callHook(onAfterLeave, [el]);
  3623. }
  3624. el[leaveCbKey] = void 0;
  3625. if (leavingVNodesCache[key2] === vnode) {
  3626. delete leavingVNodesCache[key2];
  3627. }
  3628. };
  3629. leavingVNodesCache[key2] = vnode;
  3630. if (onLeave) {
  3631. callAsyncHook(onLeave, [el, done]);
  3632. } else {
  3633. done();
  3634. }
  3635. },
  3636. clone(vnode2) {
  3637. return resolveTransitionHooks(vnode2, props, state, instance);
  3638. }
  3639. };
  3640. return hooks;
  3641. }
  3642. function emptyPlaceholder(vnode) {
  3643. if (isKeepAlive(vnode)) {
  3644. vnode = cloneVNode(vnode);
  3645. vnode.children = null;
  3646. return vnode;
  3647. }
  3648. }
  3649. function getKeepAliveChild(vnode) {
  3650. return isKeepAlive(vnode) ? (
  3651. // #7121 ensure get the child component subtree in case
  3652. // it's been replaced during HMR
  3653. vnode.component ? vnode.component.subTree : vnode.children ? vnode.children[0] : void 0
  3654. ) : vnode;
  3655. }
  3656. function setTransitionHooks(vnode, hooks) {
  3657. if (vnode.shapeFlag & 6 && vnode.component) {
  3658. setTransitionHooks(vnode.component.subTree, hooks);
  3659. } else if (vnode.shapeFlag & 128) {
  3660. vnode.ssContent.transition = hooks.clone(vnode.ssContent);
  3661. vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
  3662. } else {
  3663. vnode.transition = hooks;
  3664. }
  3665. }
  3666. function getTransitionRawChildren(children, keepComment = false, parentKey) {
  3667. let ret = [];
  3668. let keyedFragmentCount = 0;
  3669. for (let i = 0; i < children.length; i++) {
  3670. let child = children[i];
  3671. const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);
  3672. if (child.type === Fragment) {
  3673. if (child.patchFlag & 128)
  3674. keyedFragmentCount++;
  3675. ret = ret.concat(
  3676. getTransitionRawChildren(child.children, keepComment, key)
  3677. );
  3678. } else if (keepComment || child.type !== Comment) {
  3679. ret.push(key != null ? cloneVNode(child, { key }) : child);
  3680. }
  3681. }
  3682. if (keyedFragmentCount > 1) {
  3683. for (let i = 0; i < ret.length; i++) {
  3684. ret[i].patchFlag = -2;
  3685. }
  3686. }
  3687. return ret;
  3688. }
  3689. /*! #__NO_SIDE_EFFECTS__ */
  3690. // @__NO_SIDE_EFFECTS__
  3691. function defineComponent(options, extraOptions) {
  3692. return isFunction(options) ? (
  3693. // #8326: extend call and options.name access are considered side-effects
  3694. // by Rollup, so we have to wrap it in a pure-annotated IIFE.
  3695. /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
  3696. ) : options;
  3697. }
  3698. const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
  3699. /*! #__NO_SIDE_EFFECTS__ */
  3700. // @__NO_SIDE_EFFECTS__
  3701. function defineAsyncComponent(source) {
  3702. if (isFunction(source)) {
  3703. source = { loader: source };
  3704. }
  3705. const {
  3706. loader,
  3707. loadingComponent,
  3708. errorComponent,
  3709. delay = 200,
  3710. timeout,
  3711. // undefined = never times out
  3712. suspensible = true,
  3713. onError: userOnError
  3714. } = source;
  3715. let pendingRequest = null;
  3716. let resolvedComp;
  3717. let retries = 0;
  3718. const retry = () => {
  3719. retries++;
  3720. pendingRequest = null;
  3721. return load();
  3722. };
  3723. const load = () => {
  3724. let thisRequest;
  3725. return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
  3726. err = err instanceof Error ? err : new Error(String(err));
  3727. if (userOnError) {
  3728. return new Promise((resolve, reject) => {
  3729. const userRetry = () => resolve(retry());
  3730. const userFail = () => reject(err);
  3731. userOnError(err, userRetry, userFail, retries + 1);
  3732. });
  3733. } else {
  3734. throw err;
  3735. }
  3736. }).then((comp) => {
  3737. if (thisRequest !== pendingRequest && pendingRequest) {
  3738. return pendingRequest;
  3739. }
  3740. if (!comp) {
  3741. warn(
  3742. `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
  3743. );
  3744. }
  3745. if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
  3746. comp = comp.default;
  3747. }
  3748. if (comp && !isObject(comp) && !isFunction(comp)) {
  3749. throw new Error(`Invalid async component load result: ${comp}`);
  3750. }
  3751. resolvedComp = comp;
  3752. return comp;
  3753. }));
  3754. };
  3755. return defineComponent({
  3756. name: "AsyncComponentWrapper",
  3757. __asyncLoader: load,
  3758. get __asyncResolved() {
  3759. return resolvedComp;
  3760. },
  3761. setup() {
  3762. const instance = currentInstance;
  3763. if (resolvedComp) {
  3764. return () => createInnerComp(resolvedComp, instance);
  3765. }
  3766. const onError = (err) => {
  3767. pendingRequest = null;
  3768. handleError(
  3769. err,
  3770. instance,
  3771. 13,
  3772. !errorComponent
  3773. /* do not throw in dev if user provided error component */
  3774. );
  3775. };
  3776. if (suspensible && instance.suspense || false) {
  3777. return load().then((comp) => {
  3778. return () => createInnerComp(comp, instance);
  3779. }).catch((err) => {
  3780. onError(err);
  3781. return () => errorComponent ? createVNode(errorComponent, {
  3782. error: err
  3783. }) : null;
  3784. });
  3785. }
  3786. const loaded = ref(false);
  3787. const error = ref();
  3788. const delayed = ref(!!delay);
  3789. if (delay) {
  3790. setTimeout(() => {
  3791. delayed.value = false;
  3792. }, delay);
  3793. }
  3794. if (timeout != null) {
  3795. setTimeout(() => {
  3796. if (!loaded.value && !error.value) {
  3797. const err = new Error(
  3798. `Async component timed out after ${timeout}ms.`
  3799. );
  3800. onError(err);
  3801. error.value = err;
  3802. }
  3803. }, timeout);
  3804. }
  3805. load().then(() => {
  3806. loaded.value = true;
  3807. if (instance.parent && isKeepAlive(instance.parent.vnode)) {
  3808. queueJob(instance.parent.update);
  3809. }
  3810. }).catch((err) => {
  3811. onError(err);
  3812. error.value = err;
  3813. });
  3814. return () => {
  3815. if (loaded.value && resolvedComp) {
  3816. return createInnerComp(resolvedComp, instance);
  3817. } else if (error.value && errorComponent) {
  3818. return createVNode(errorComponent, {
  3819. error: error.value
  3820. });
  3821. } else if (loadingComponent && !delayed.value) {
  3822. return createVNode(loadingComponent);
  3823. }
  3824. };
  3825. }
  3826. });
  3827. }
  3828. function createInnerComp(comp, parent) {
  3829. const { ref: ref2, props, children, ce } = parent.vnode;
  3830. const vnode = createVNode(comp, props, children);
  3831. vnode.ref = ref2;
  3832. vnode.ce = ce;
  3833. delete parent.vnode.ce;
  3834. return vnode;
  3835. }
  3836. const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
  3837. const KeepAliveImpl = {
  3838. name: `KeepAlive`,
  3839. // Marker for special handling inside the renderer. We are not using a ===
  3840. // check directly on KeepAlive in the renderer, because importing it directly
  3841. // would prevent it from being tree-shaken.
  3842. __isKeepAlive: true,
  3843. props: {
  3844. include: [String, RegExp, Array],
  3845. exclude: [String, RegExp, Array],
  3846. max: [String, Number]
  3847. },
  3848. setup(props, { slots }) {
  3849. const instance = getCurrentInstance();
  3850. const sharedContext = instance.ctx;
  3851. const cache = /* @__PURE__ */ new Map();
  3852. const keys = /* @__PURE__ */ new Set();
  3853. let current = null;
  3854. {
  3855. instance.__v_cache = cache;
  3856. }
  3857. const parentSuspense = instance.suspense;
  3858. const {
  3859. renderer: {
  3860. p: patch,
  3861. m: move,
  3862. um: _unmount,
  3863. o: { createElement }
  3864. }
  3865. } = sharedContext;
  3866. const storageContainer = createElement("div");
  3867. sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
  3868. const instance2 = vnode.component;
  3869. move(vnode, container, anchor, 0, parentSuspense);
  3870. patch(
  3871. instance2.vnode,
  3872. vnode,
  3873. container,
  3874. anchor,
  3875. instance2,
  3876. parentSuspense,
  3877. isSVG,
  3878. vnode.slotScopeIds,
  3879. optimized
  3880. );
  3881. queuePostRenderEffect(() => {
  3882. instance2.isDeactivated = false;
  3883. if (instance2.a) {
  3884. invokeArrayFns(instance2.a);
  3885. }
  3886. const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
  3887. if (vnodeHook) {
  3888. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  3889. }
  3890. }, parentSuspense);
  3891. {
  3892. devtoolsComponentAdded(instance2);
  3893. }
  3894. };
  3895. sharedContext.deactivate = (vnode) => {
  3896. const instance2 = vnode.component;
  3897. move(vnode, storageContainer, null, 1, parentSuspense);
  3898. queuePostRenderEffect(() => {
  3899. if (instance2.da) {
  3900. invokeArrayFns(instance2.da);
  3901. }
  3902. const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
  3903. if (vnodeHook) {
  3904. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  3905. }
  3906. instance2.isDeactivated = true;
  3907. }, parentSuspense);
  3908. {
  3909. devtoolsComponentAdded(instance2);
  3910. }
  3911. };
  3912. function unmount(vnode) {
  3913. resetShapeFlag(vnode);
  3914. _unmount(vnode, instance, parentSuspense, true);
  3915. }
  3916. function pruneCache(filter) {
  3917. cache.forEach((vnode, key) => {
  3918. const name = getComponentName(vnode.type);
  3919. if (name && (!filter || !filter(name))) {
  3920. pruneCacheEntry(key);
  3921. }
  3922. });
  3923. }
  3924. function pruneCacheEntry(key) {
  3925. const cached = cache.get(key);
  3926. if (!current || !isSameVNodeType(cached, current)) {
  3927. unmount(cached);
  3928. } else if (current) {
  3929. resetShapeFlag(current);
  3930. }
  3931. cache.delete(key);
  3932. keys.delete(key);
  3933. }
  3934. watch(
  3935. () => [props.include, props.exclude],
  3936. ([include, exclude]) => {
  3937. include && pruneCache((name) => matches(include, name));
  3938. exclude && pruneCache((name) => !matches(exclude, name));
  3939. },
  3940. // prune post-render after `current` has been updated
  3941. { flush: "post", deep: true }
  3942. );
  3943. let pendingCacheKey = null;
  3944. const cacheSubtree = () => {
  3945. if (pendingCacheKey != null) {
  3946. cache.set(pendingCacheKey, getInnerChild(instance.subTree));
  3947. }
  3948. };
  3949. onMounted(cacheSubtree);
  3950. onUpdated(cacheSubtree);
  3951. onBeforeUnmount(() => {
  3952. cache.forEach((cached) => {
  3953. const { subTree, suspense } = instance;
  3954. const vnode = getInnerChild(subTree);
  3955. if (cached.type === vnode.type && cached.key === vnode.key) {
  3956. resetShapeFlag(vnode);
  3957. const da = vnode.component.da;
  3958. da && queuePostRenderEffect(da, suspense);
  3959. return;
  3960. }
  3961. unmount(cached);
  3962. });
  3963. });
  3964. return () => {
  3965. pendingCacheKey = null;
  3966. if (!slots.default) {
  3967. return null;
  3968. }
  3969. const children = slots.default();
  3970. const rawVNode = children[0];
  3971. if (children.length > 1) {
  3972. {
  3973. warn(`KeepAlive should contain exactly one component child.`);
  3974. }
  3975. current = null;
  3976. return children;
  3977. } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
  3978. current = null;
  3979. return rawVNode;
  3980. }
  3981. let vnode = getInnerChild(rawVNode);
  3982. const comp = vnode.type;
  3983. const name = getComponentName(
  3984. isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
  3985. );
  3986. const { include, exclude, max } = props;
  3987. if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
  3988. current = vnode;
  3989. return rawVNode;
  3990. }
  3991. const key = vnode.key == null ? comp : vnode.key;
  3992. const cachedVNode = cache.get(key);
  3993. if (vnode.el) {
  3994. vnode = cloneVNode(vnode);
  3995. if (rawVNode.shapeFlag & 128) {
  3996. rawVNode.ssContent = vnode;
  3997. }
  3998. }
  3999. pendingCacheKey = key;
  4000. if (cachedVNode) {
  4001. vnode.el = cachedVNode.el;
  4002. vnode.component = cachedVNode.component;
  4003. if (vnode.transition) {
  4004. setTransitionHooks(vnode, vnode.transition);
  4005. }
  4006. vnode.shapeFlag |= 512;
  4007. keys.delete(key);
  4008. keys.add(key);
  4009. } else {
  4010. keys.add(key);
  4011. if (max && keys.size > parseInt(max, 10)) {
  4012. pruneCacheEntry(keys.values().next().value);
  4013. }
  4014. }
  4015. vnode.shapeFlag |= 256;
  4016. current = vnode;
  4017. return isSuspense(rawVNode.type) ? rawVNode : vnode;
  4018. };
  4019. }
  4020. };
  4021. const KeepAlive = KeepAliveImpl;
  4022. function matches(pattern, name) {
  4023. if (isArray(pattern)) {
  4024. return pattern.some((p) => matches(p, name));
  4025. } else if (isString(pattern)) {
  4026. return pattern.split(",").includes(name);
  4027. } else if (isRegExp(pattern)) {
  4028. return pattern.test(name);
  4029. }
  4030. return false;
  4031. }
  4032. function onActivated(hook, target) {
  4033. registerKeepAliveHook(hook, "a", target);
  4034. }
  4035. function onDeactivated(hook, target) {
  4036. registerKeepAliveHook(hook, "da", target);
  4037. }
  4038. function registerKeepAliveHook(hook, type, target = currentInstance) {
  4039. const wrappedHook = hook.__wdc || (hook.__wdc = () => {
  4040. let current = target;
  4041. while (current) {
  4042. if (current.isDeactivated) {
  4043. return;
  4044. }
  4045. current = current.parent;
  4046. }
  4047. return hook();
  4048. });
  4049. injectHook(type, wrappedHook, target);
  4050. if (target) {
  4051. let current = target.parent;
  4052. while (current && current.parent) {
  4053. if (isKeepAlive(current.parent.vnode)) {
  4054. injectToKeepAliveRoot(wrappedHook, type, target, current);
  4055. }
  4056. current = current.parent;
  4057. }
  4058. }
  4059. }
  4060. function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  4061. const injected = injectHook(
  4062. type,
  4063. hook,
  4064. keepAliveRoot,
  4065. true
  4066. /* prepend */
  4067. );
  4068. onUnmounted(() => {
  4069. remove(keepAliveRoot[type], injected);
  4070. }, target);
  4071. }
  4072. function resetShapeFlag(vnode) {
  4073. vnode.shapeFlag &= ~256;
  4074. vnode.shapeFlag &= ~512;
  4075. }
  4076. function getInnerChild(vnode) {
  4077. return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
  4078. }
  4079. function injectHook(type, hook, target = currentInstance, prepend = false) {
  4080. if (target) {
  4081. const hooks = target[type] || (target[type] = []);
  4082. const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
  4083. if (target.isUnmounted) {
  4084. return;
  4085. }
  4086. pauseTracking();
  4087. setCurrentInstance(target);
  4088. const res = callWithAsyncErrorHandling(hook, target, type, args);
  4089. unsetCurrentInstance();
  4090. resetTracking();
  4091. return res;
  4092. });
  4093. if (prepend) {
  4094. hooks.unshift(wrappedHook);
  4095. } else {
  4096. hooks.push(wrappedHook);
  4097. }
  4098. return wrappedHook;
  4099. } else {
  4100. const apiName = toHandlerKey(ErrorTypeStrings[type].replace(/ hook$/, ""));
  4101. warn(
  4102. `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` )
  4103. );
  4104. }
  4105. }
  4106. const createHook = (lifecycle) => (hook, target = currentInstance) => (
  4107. // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
  4108. (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target)
  4109. );
  4110. const onBeforeMount = createHook("bm");
  4111. const onMounted = createHook("m");
  4112. const onBeforeUpdate = createHook("bu");
  4113. const onUpdated = createHook("u");
  4114. const onBeforeUnmount = createHook("bum");
  4115. const onUnmounted = createHook("um");
  4116. const onServerPrefetch = createHook("sp");
  4117. const onRenderTriggered = createHook(
  4118. "rtg"
  4119. );
  4120. const onRenderTracked = createHook(
  4121. "rtc"
  4122. );
  4123. function onErrorCaptured(hook, target = currentInstance) {
  4124. injectHook("ec", hook, target);
  4125. }
  4126. function renderList(source, renderItem, cache, index) {
  4127. let ret;
  4128. const cached = cache && cache[index];
  4129. if (isArray(source) || isString(source)) {
  4130. ret = new Array(source.length);
  4131. for (let i = 0, l = source.length; i < l; i++) {
  4132. ret[i] = renderItem(source[i], i, void 0, cached && cached[i]);
  4133. }
  4134. } else if (typeof source === "number") {
  4135. if (!Number.isInteger(source)) {
  4136. warn(`The v-for range expect an integer value but got ${source}.`);
  4137. }
  4138. ret = new Array(source);
  4139. for (let i = 0; i < source; i++) {
  4140. ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
  4141. }
  4142. } else if (isObject(source)) {
  4143. if (source[Symbol.iterator]) {
  4144. ret = Array.from(
  4145. source,
  4146. (item, i) => renderItem(item, i, void 0, cached && cached[i])
  4147. );
  4148. } else {
  4149. const keys = Object.keys(source);
  4150. ret = new Array(keys.length);
  4151. for (let i = 0, l = keys.length; i < l; i++) {
  4152. const key = keys[i];
  4153. ret[i] = renderItem(source[key], key, i, cached && cached[i]);
  4154. }
  4155. }
  4156. } else {
  4157. ret = [];
  4158. }
  4159. if (cache) {
  4160. cache[index] = ret;
  4161. }
  4162. return ret;
  4163. }
  4164. function createSlots(slots, dynamicSlots) {
  4165. for (let i = 0; i < dynamicSlots.length; i++) {
  4166. const slot = dynamicSlots[i];
  4167. if (isArray(slot)) {
  4168. for (let j = 0; j < slot.length; j++) {
  4169. slots[slot[j].name] = slot[j].fn;
  4170. }
  4171. } else if (slot) {
  4172. slots[slot.name] = slot.key ? (...args) => {
  4173. const res = slot.fn(...args);
  4174. if (res)
  4175. res.key = slot.key;
  4176. return res;
  4177. } : slot.fn;
  4178. }
  4179. }
  4180. return slots;
  4181. }
  4182. function renderSlot(slots, name, props = {}, fallback, noSlotted) {
  4183. if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) {
  4184. if (name !== "default")
  4185. props.name = name;
  4186. return createVNode("slot", props, fallback && fallback());
  4187. }
  4188. let slot = slots[name];
  4189. if (slot && slot.length > 1) {
  4190. warn(
  4191. `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.`
  4192. );
  4193. slot = () => [];
  4194. }
  4195. if (slot && slot._c) {
  4196. slot._d = false;
  4197. }
  4198. openBlock();
  4199. const validSlotContent = slot && ensureValidVNode(slot(props));
  4200. const rendered = createBlock(
  4201. Fragment,
  4202. {
  4203. key: props.key || // slot content array of a dynamic conditional slot may have a branch
  4204. // key attached in the `createSlots` helper, respect that
  4205. validSlotContent && validSlotContent.key || `_${name}`
  4206. },
  4207. validSlotContent || (fallback ? fallback() : []),
  4208. validSlotContent && slots._ === 1 ? 64 : -2
  4209. );
  4210. if (!noSlotted && rendered.scopeId) {
  4211. rendered.slotScopeIds = [rendered.scopeId + "-s"];
  4212. }
  4213. if (slot && slot._c) {
  4214. slot._d = true;
  4215. }
  4216. return rendered;
  4217. }
  4218. function ensureValidVNode(vnodes) {
  4219. return vnodes.some((child) => {
  4220. if (!isVNode(child))
  4221. return true;
  4222. if (child.type === Comment)
  4223. return false;
  4224. if (child.type === Fragment && !ensureValidVNode(child.children))
  4225. return false;
  4226. return true;
  4227. }) ? vnodes : null;
  4228. }
  4229. function toHandlers(obj, preserveCaseIfNecessary) {
  4230. const ret = {};
  4231. if (!isObject(obj)) {
  4232. warn(`v-on with no argument expects an object value.`);
  4233. return ret;
  4234. }
  4235. for (const key in obj) {
  4236. ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];
  4237. }
  4238. return ret;
  4239. }
  4240. const getPublicInstance = (i) => {
  4241. if (!i)
  4242. return null;
  4243. if (isStatefulComponent(i))
  4244. return getExposeProxy(i) || i.proxy;
  4245. return getPublicInstance(i.parent);
  4246. };
  4247. const publicPropertiesMap = (
  4248. // Move PURE marker to new line to workaround compiler discarding it
  4249. // due to type annotation
  4250. /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
  4251. $: (i) => i,
  4252. $el: (i) => i.vnode.el,
  4253. $data: (i) => i.data,
  4254. $props: (i) => shallowReadonly(i.props) ,
  4255. $attrs: (i) => shallowReadonly(i.attrs) ,
  4256. $slots: (i) => shallowReadonly(i.slots) ,
  4257. $refs: (i) => shallowReadonly(i.refs) ,
  4258. $parent: (i) => getPublicInstance(i.parent),
  4259. $root: (i) => getPublicInstance(i.root),
  4260. $emit: (i) => i.emit,
  4261. $options: (i) => resolveMergedOptions(i) ,
  4262. $forceUpdate: (i) => i.f || (i.f = () => queueJob(i.update)),
  4263. $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
  4264. $watch: (i) => instanceWatch.bind(i)
  4265. })
  4266. );
  4267. const isReservedPrefix = (key) => key === "_" || key === "$";
  4268. const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
  4269. const PublicInstanceProxyHandlers = {
  4270. get({ _: instance }, key) {
  4271. const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
  4272. if (key === "__isVue") {
  4273. return true;
  4274. }
  4275. let normalizedProps;
  4276. if (key[0] !== "$") {
  4277. const n = accessCache[key];
  4278. if (n !== void 0) {
  4279. switch (n) {
  4280. case 1 /* SETUP */:
  4281. return setupState[key];
  4282. case 2 /* DATA */:
  4283. return data[key];
  4284. case 4 /* CONTEXT */:
  4285. return ctx[key];
  4286. case 3 /* PROPS */:
  4287. return props[key];
  4288. }
  4289. } else if (hasSetupBinding(setupState, key)) {
  4290. accessCache[key] = 1 /* SETUP */;
  4291. return setupState[key];
  4292. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  4293. accessCache[key] = 2 /* DATA */;
  4294. return data[key];
  4295. } else if (
  4296. // only cache other properties when instance has declared (thus stable)
  4297. // props
  4298. (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)
  4299. ) {
  4300. accessCache[key] = 3 /* PROPS */;
  4301. return props[key];
  4302. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  4303. accessCache[key] = 4 /* CONTEXT */;
  4304. return ctx[key];
  4305. } else if (shouldCacheAccess) {
  4306. accessCache[key] = 0 /* OTHER */;
  4307. }
  4308. }
  4309. const publicGetter = publicPropertiesMap[key];
  4310. let cssModule, globalProperties;
  4311. if (publicGetter) {
  4312. if (key === "$attrs") {
  4313. track(instance, "get", key);
  4314. markAttrsAccessed();
  4315. } else if (key === "$slots") {
  4316. track(instance, "get", key);
  4317. }
  4318. return publicGetter(instance);
  4319. } else if (
  4320. // css module (injected by vue-loader)
  4321. (cssModule = type.__cssModules) && (cssModule = cssModule[key])
  4322. ) {
  4323. return cssModule;
  4324. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  4325. accessCache[key] = 4 /* CONTEXT */;
  4326. return ctx[key];
  4327. } else if (
  4328. // global properties
  4329. globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)
  4330. ) {
  4331. {
  4332. return globalProperties[key];
  4333. }
  4334. } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading
  4335. // to infinite warning loop
  4336. key.indexOf("__v") !== 0)) {
  4337. if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
  4338. warn(
  4339. `Property ${JSON.stringify(
  4340. key
  4341. )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
  4342. );
  4343. } else if (instance === currentRenderingInstance) {
  4344. warn(
  4345. `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`
  4346. );
  4347. }
  4348. }
  4349. },
  4350. set({ _: instance }, key, value) {
  4351. const { data, setupState, ctx } = instance;
  4352. if (hasSetupBinding(setupState, key)) {
  4353. setupState[key] = value;
  4354. return true;
  4355. } else if (setupState.__isScriptSetup && hasOwn(setupState, key)) {
  4356. warn(`Cannot mutate <script setup> binding "${key}" from Options API.`);
  4357. return false;
  4358. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  4359. data[key] = value;
  4360. return true;
  4361. } else if (hasOwn(instance.props, key)) {
  4362. warn(`Attempting to mutate prop "${key}". Props are readonly.`);
  4363. return false;
  4364. }
  4365. if (key[0] === "$" && key.slice(1) in instance) {
  4366. warn(
  4367. `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`
  4368. );
  4369. return false;
  4370. } else {
  4371. if (key in instance.appContext.config.globalProperties) {
  4372. Object.defineProperty(ctx, key, {
  4373. enumerable: true,
  4374. configurable: true,
  4375. value
  4376. });
  4377. } else {
  4378. ctx[key] = value;
  4379. }
  4380. }
  4381. return true;
  4382. },
  4383. has({
  4384. _: { data, setupState, accessCache, ctx, appContext, propsOptions }
  4385. }, key) {
  4386. let normalizedProps;
  4387. return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);
  4388. },
  4389. defineProperty(target, key, descriptor) {
  4390. if (descriptor.get != null) {
  4391. target._.accessCache[key] = 0;
  4392. } else if (hasOwn(descriptor, "value")) {
  4393. this.set(target, key, descriptor.value, null);
  4394. }
  4395. return Reflect.defineProperty(target, key, descriptor);
  4396. }
  4397. };
  4398. {
  4399. PublicInstanceProxyHandlers.ownKeys = (target) => {
  4400. warn(
  4401. `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`
  4402. );
  4403. return Reflect.ownKeys(target);
  4404. };
  4405. }
  4406. const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend(
  4407. {},
  4408. PublicInstanceProxyHandlers,
  4409. {
  4410. get(target, key) {
  4411. if (key === Symbol.unscopables) {
  4412. return;
  4413. }
  4414. return PublicInstanceProxyHandlers.get(target, key, target);
  4415. },
  4416. has(_, key) {
  4417. const has = key[0] !== "_" && !isGloballyAllowed(key);
  4418. if (!has && PublicInstanceProxyHandlers.has(_, key)) {
  4419. warn(
  4420. `Property ${JSON.stringify(
  4421. key
  4422. )} should not start with _ which is a reserved prefix for Vue internals.`
  4423. );
  4424. }
  4425. return has;
  4426. }
  4427. }
  4428. );
  4429. function createDevRenderContext(instance) {
  4430. const target = {};
  4431. Object.defineProperty(target, `_`, {
  4432. configurable: true,
  4433. enumerable: false,
  4434. get: () => instance
  4435. });
  4436. Object.keys(publicPropertiesMap).forEach((key) => {
  4437. Object.defineProperty(target, key, {
  4438. configurable: true,
  4439. enumerable: false,
  4440. get: () => publicPropertiesMap[key](instance),
  4441. // intercepted by the proxy so no need for implementation,
  4442. // but needed to prevent set errors
  4443. set: NOOP
  4444. });
  4445. });
  4446. return target;
  4447. }
  4448. function exposePropsOnRenderContext(instance) {
  4449. const {
  4450. ctx,
  4451. propsOptions: [propsOptions]
  4452. } = instance;
  4453. if (propsOptions) {
  4454. Object.keys(propsOptions).forEach((key) => {
  4455. Object.defineProperty(ctx, key, {
  4456. enumerable: true,
  4457. configurable: true,
  4458. get: () => instance.props[key],
  4459. set: NOOP
  4460. });
  4461. });
  4462. }
  4463. }
  4464. function exposeSetupStateOnRenderContext(instance) {
  4465. const { ctx, setupState } = instance;
  4466. Object.keys(toRaw(setupState)).forEach((key) => {
  4467. if (!setupState.__isScriptSetup) {
  4468. if (isReservedPrefix(key[0])) {
  4469. warn(
  4470. `setup() return property ${JSON.stringify(
  4471. key
  4472. )} should not start with "$" or "_" which are reserved prefixes for Vue internals.`
  4473. );
  4474. return;
  4475. }
  4476. Object.defineProperty(ctx, key, {
  4477. enumerable: true,
  4478. configurable: true,
  4479. get: () => setupState[key],
  4480. set: NOOP
  4481. });
  4482. }
  4483. });
  4484. }
  4485. const warnRuntimeUsage = (method) => warn(
  4486. `${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.`
  4487. );
  4488. function defineProps() {
  4489. {
  4490. warnRuntimeUsage(`defineProps`);
  4491. }
  4492. return null;
  4493. }
  4494. function defineEmits() {
  4495. {
  4496. warnRuntimeUsage(`defineEmits`);
  4497. }
  4498. return null;
  4499. }
  4500. function defineExpose(exposed) {
  4501. {
  4502. warnRuntimeUsage(`defineExpose`);
  4503. }
  4504. }
  4505. function defineOptions(options) {
  4506. {
  4507. warnRuntimeUsage(`defineOptions`);
  4508. }
  4509. }
  4510. function defineSlots() {
  4511. {
  4512. warnRuntimeUsage(`defineSlots`);
  4513. }
  4514. return null;
  4515. }
  4516. function defineModel() {
  4517. {
  4518. warnRuntimeUsage("defineModel");
  4519. }
  4520. }
  4521. function withDefaults(props, defaults) {
  4522. {
  4523. warnRuntimeUsage(`withDefaults`);
  4524. }
  4525. return null;
  4526. }
  4527. function useSlots() {
  4528. return getContext().slots;
  4529. }
  4530. function useAttrs() {
  4531. return getContext().attrs;
  4532. }
  4533. function useModel(props, name, options) {
  4534. const i = getCurrentInstance();
  4535. if (!i) {
  4536. warn(`useModel() called without active instance.`);
  4537. return ref();
  4538. }
  4539. if (!i.propsOptions[0][name]) {
  4540. warn(`useModel() called with prop "${name}" which is not declared.`);
  4541. return ref();
  4542. }
  4543. if (options && options.local) {
  4544. const proxy = ref(props[name]);
  4545. watch(
  4546. () => props[name],
  4547. (v) => proxy.value = v
  4548. );
  4549. watch(proxy, (value) => {
  4550. if (value !== props[name]) {
  4551. i.emit(`update:${name}`, value);
  4552. }
  4553. });
  4554. return proxy;
  4555. } else {
  4556. return {
  4557. __v_isRef: true,
  4558. get value() {
  4559. return props[name];
  4560. },
  4561. set value(value) {
  4562. i.emit(`update:${name}`, value);
  4563. }
  4564. };
  4565. }
  4566. }
  4567. function getContext() {
  4568. const i = getCurrentInstance();
  4569. if (!i) {
  4570. warn(`useContext() called without active instance.`);
  4571. }
  4572. return i.setupContext || (i.setupContext = createSetupContext(i));
  4573. }
  4574. function normalizePropsOrEmits(props) {
  4575. return isArray(props) ? props.reduce(
  4576. (normalized, p) => (normalized[p] = null, normalized),
  4577. {}
  4578. ) : props;
  4579. }
  4580. function mergeDefaults(raw, defaults) {
  4581. const props = normalizePropsOrEmits(raw);
  4582. for (const key in defaults) {
  4583. if (key.startsWith("__skip"))
  4584. continue;
  4585. let opt = props[key];
  4586. if (opt) {
  4587. if (isArray(opt) || isFunction(opt)) {
  4588. opt = props[key] = { type: opt, default: defaults[key] };
  4589. } else {
  4590. opt.default = defaults[key];
  4591. }
  4592. } else if (opt === null) {
  4593. opt = props[key] = { default: defaults[key] };
  4594. } else {
  4595. warn(`props default key "${key}" has no corresponding declaration.`);
  4596. }
  4597. if (opt && defaults[`__skip_${key}`]) {
  4598. opt.skipFactory = true;
  4599. }
  4600. }
  4601. return props;
  4602. }
  4603. function mergeModels(a, b) {
  4604. if (!a || !b)
  4605. return a || b;
  4606. if (isArray(a) && isArray(b))
  4607. return a.concat(b);
  4608. return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
  4609. }
  4610. function createPropsRestProxy(props, excludedKeys) {
  4611. const ret = {};
  4612. for (const key in props) {
  4613. if (!excludedKeys.includes(key)) {
  4614. Object.defineProperty(ret, key, {
  4615. enumerable: true,
  4616. get: () => props[key]
  4617. });
  4618. }
  4619. }
  4620. return ret;
  4621. }
  4622. function withAsyncContext(getAwaitable) {
  4623. const ctx = getCurrentInstance();
  4624. if (!ctx) {
  4625. warn(
  4626. `withAsyncContext called without active current instance. This is likely a bug.`
  4627. );
  4628. }
  4629. let awaitable = getAwaitable();
  4630. unsetCurrentInstance();
  4631. if (isPromise(awaitable)) {
  4632. awaitable = awaitable.catch((e) => {
  4633. setCurrentInstance(ctx);
  4634. throw e;
  4635. });
  4636. }
  4637. return [awaitable, () => setCurrentInstance(ctx)];
  4638. }
  4639. function createDuplicateChecker() {
  4640. const cache = /* @__PURE__ */ Object.create(null);
  4641. return (type, key) => {
  4642. if (cache[key]) {
  4643. warn(`${type} property "${key}" is already defined in ${cache[key]}.`);
  4644. } else {
  4645. cache[key] = type;
  4646. }
  4647. };
  4648. }
  4649. let shouldCacheAccess = true;
  4650. function applyOptions(instance) {
  4651. const options = resolveMergedOptions(instance);
  4652. const publicThis = instance.proxy;
  4653. const ctx = instance.ctx;
  4654. shouldCacheAccess = false;
  4655. if (options.beforeCreate) {
  4656. callHook$1(options.beforeCreate, instance, "bc");
  4657. }
  4658. const {
  4659. // state
  4660. data: dataOptions,
  4661. computed: computedOptions,
  4662. methods,
  4663. watch: watchOptions,
  4664. provide: provideOptions,
  4665. inject: injectOptions,
  4666. // lifecycle
  4667. created,
  4668. beforeMount,
  4669. mounted,
  4670. beforeUpdate,
  4671. updated,
  4672. activated,
  4673. deactivated,
  4674. beforeDestroy,
  4675. beforeUnmount,
  4676. destroyed,
  4677. unmounted,
  4678. render,
  4679. renderTracked,
  4680. renderTriggered,
  4681. errorCaptured,
  4682. serverPrefetch,
  4683. // public API
  4684. expose,
  4685. inheritAttrs,
  4686. // assets
  4687. components,
  4688. directives,
  4689. filters
  4690. } = options;
  4691. const checkDuplicateProperties = createDuplicateChecker() ;
  4692. {
  4693. const [propsOptions] = instance.propsOptions;
  4694. if (propsOptions) {
  4695. for (const key in propsOptions) {
  4696. checkDuplicateProperties("Props" /* PROPS */, key);
  4697. }
  4698. }
  4699. }
  4700. if (injectOptions) {
  4701. resolveInjections(injectOptions, ctx, checkDuplicateProperties);
  4702. }
  4703. if (methods) {
  4704. for (const key in methods) {
  4705. const methodHandler = methods[key];
  4706. if (isFunction(methodHandler)) {
  4707. {
  4708. Object.defineProperty(ctx, key, {
  4709. value: methodHandler.bind(publicThis),
  4710. configurable: true,
  4711. enumerable: true,
  4712. writable: true
  4713. });
  4714. }
  4715. {
  4716. checkDuplicateProperties("Methods" /* METHODS */, key);
  4717. }
  4718. } else {
  4719. warn(
  4720. `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`
  4721. );
  4722. }
  4723. }
  4724. }
  4725. if (dataOptions) {
  4726. if (!isFunction(dataOptions)) {
  4727. warn(
  4728. `The data option must be a function. Plain object usage is no longer supported.`
  4729. );
  4730. }
  4731. const data = dataOptions.call(publicThis, publicThis);
  4732. if (isPromise(data)) {
  4733. warn(
  4734. `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`
  4735. );
  4736. }
  4737. if (!isObject(data)) {
  4738. warn(`data() should return an object.`);
  4739. } else {
  4740. instance.data = reactive(data);
  4741. {
  4742. for (const key in data) {
  4743. checkDuplicateProperties("Data" /* DATA */, key);
  4744. if (!isReservedPrefix(key[0])) {
  4745. Object.defineProperty(ctx, key, {
  4746. configurable: true,
  4747. enumerable: true,
  4748. get: () => data[key],
  4749. set: NOOP
  4750. });
  4751. }
  4752. }
  4753. }
  4754. }
  4755. }
  4756. shouldCacheAccess = true;
  4757. if (computedOptions) {
  4758. for (const key in computedOptions) {
  4759. const opt = computedOptions[key];
  4760. const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
  4761. if (get === NOOP) {
  4762. warn(`Computed property "${key}" has no getter.`);
  4763. }
  4764. const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
  4765. warn(
  4766. `Write operation failed: computed property "${key}" is readonly.`
  4767. );
  4768. } ;
  4769. const c = computed({
  4770. get,
  4771. set
  4772. });
  4773. Object.defineProperty(ctx, key, {
  4774. enumerable: true,
  4775. configurable: true,
  4776. get: () => c.value,
  4777. set: (v) => c.value = v
  4778. });
  4779. {
  4780. checkDuplicateProperties("Computed" /* COMPUTED */, key);
  4781. }
  4782. }
  4783. }
  4784. if (watchOptions) {
  4785. for (const key in watchOptions) {
  4786. createWatcher(watchOptions[key], ctx, publicThis, key);
  4787. }
  4788. }
  4789. if (provideOptions) {
  4790. const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
  4791. Reflect.ownKeys(provides).forEach((key) => {
  4792. provide(key, provides[key]);
  4793. });
  4794. }
  4795. if (created) {
  4796. callHook$1(created, instance, "c");
  4797. }
  4798. function registerLifecycleHook(register, hook) {
  4799. if (isArray(hook)) {
  4800. hook.forEach((_hook) => register(_hook.bind(publicThis)));
  4801. } else if (hook) {
  4802. register(hook.bind(publicThis));
  4803. }
  4804. }
  4805. registerLifecycleHook(onBeforeMount, beforeMount);
  4806. registerLifecycleHook(onMounted, mounted);
  4807. registerLifecycleHook(onBeforeUpdate, beforeUpdate);
  4808. registerLifecycleHook(onUpdated, updated);
  4809. registerLifecycleHook(onActivated, activated);
  4810. registerLifecycleHook(onDeactivated, deactivated);
  4811. registerLifecycleHook(onErrorCaptured, errorCaptured);
  4812. registerLifecycleHook(onRenderTracked, renderTracked);
  4813. registerLifecycleHook(onRenderTriggered, renderTriggered);
  4814. registerLifecycleHook(onBeforeUnmount, beforeUnmount);
  4815. registerLifecycleHook(onUnmounted, unmounted);
  4816. registerLifecycleHook(onServerPrefetch, serverPrefetch);
  4817. if (isArray(expose)) {
  4818. if (expose.length) {
  4819. const exposed = instance.exposed || (instance.exposed = {});
  4820. expose.forEach((key) => {
  4821. Object.defineProperty(exposed, key, {
  4822. get: () => publicThis[key],
  4823. set: (val) => publicThis[key] = val
  4824. });
  4825. });
  4826. } else if (!instance.exposed) {
  4827. instance.exposed = {};
  4828. }
  4829. }
  4830. if (render && instance.render === NOOP) {
  4831. instance.render = render;
  4832. }
  4833. if (inheritAttrs != null) {
  4834. instance.inheritAttrs = inheritAttrs;
  4835. }
  4836. if (components)
  4837. instance.components = components;
  4838. if (directives)
  4839. instance.directives = directives;
  4840. }
  4841. function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
  4842. if (isArray(injectOptions)) {
  4843. injectOptions = normalizeInject(injectOptions);
  4844. }
  4845. for (const key in injectOptions) {
  4846. const opt = injectOptions[key];
  4847. let injected;
  4848. if (isObject(opt)) {
  4849. if ("default" in opt) {
  4850. injected = inject(
  4851. opt.from || key,
  4852. opt.default,
  4853. true
  4854. /* treat default function as factory */
  4855. );
  4856. } else {
  4857. injected = inject(opt.from || key);
  4858. }
  4859. } else {
  4860. injected = inject(opt);
  4861. }
  4862. if (isRef(injected)) {
  4863. Object.defineProperty(ctx, key, {
  4864. enumerable: true,
  4865. configurable: true,
  4866. get: () => injected.value,
  4867. set: (v) => injected.value = v
  4868. });
  4869. } else {
  4870. ctx[key] = injected;
  4871. }
  4872. {
  4873. checkDuplicateProperties("Inject" /* INJECT */, key);
  4874. }
  4875. }
  4876. }
  4877. function callHook$1(hook, instance, type) {
  4878. callWithAsyncErrorHandling(
  4879. isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy),
  4880. instance,
  4881. type
  4882. );
  4883. }
  4884. function createWatcher(raw, ctx, publicThis, key) {
  4885. const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  4886. if (isString(raw)) {
  4887. const handler = ctx[raw];
  4888. if (isFunction(handler)) {
  4889. watch(getter, handler);
  4890. } else {
  4891. warn(`Invalid watch handler specified by key "${raw}"`, handler);
  4892. }
  4893. } else if (isFunction(raw)) {
  4894. watch(getter, raw.bind(publicThis));
  4895. } else if (isObject(raw)) {
  4896. if (isArray(raw)) {
  4897. raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
  4898. } else {
  4899. const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
  4900. if (isFunction(handler)) {
  4901. watch(getter, handler, raw);
  4902. } else {
  4903. warn(`Invalid watch handler specified by key "${raw.handler}"`, handler);
  4904. }
  4905. }
  4906. } else {
  4907. warn(`Invalid watch option: "${key}"`, raw);
  4908. }
  4909. }
  4910. function resolveMergedOptions(instance) {
  4911. const base = instance.type;
  4912. const { mixins, extends: extendsOptions } = base;
  4913. const {
  4914. mixins: globalMixins,
  4915. optionsCache: cache,
  4916. config: { optionMergeStrategies }
  4917. } = instance.appContext;
  4918. const cached = cache.get(base);
  4919. let resolved;
  4920. if (cached) {
  4921. resolved = cached;
  4922. } else if (!globalMixins.length && !mixins && !extendsOptions) {
  4923. {
  4924. resolved = base;
  4925. }
  4926. } else {
  4927. resolved = {};
  4928. if (globalMixins.length) {
  4929. globalMixins.forEach(
  4930. (m) => mergeOptions(resolved, m, optionMergeStrategies, true)
  4931. );
  4932. }
  4933. mergeOptions(resolved, base, optionMergeStrategies);
  4934. }
  4935. if (isObject(base)) {
  4936. cache.set(base, resolved);
  4937. }
  4938. return resolved;
  4939. }
  4940. function mergeOptions(to, from, strats, asMixin = false) {
  4941. const { mixins, extends: extendsOptions } = from;
  4942. if (extendsOptions) {
  4943. mergeOptions(to, extendsOptions, strats, true);
  4944. }
  4945. if (mixins) {
  4946. mixins.forEach(
  4947. (m) => mergeOptions(to, m, strats, true)
  4948. );
  4949. }
  4950. for (const key in from) {
  4951. if (asMixin && key === "expose") {
  4952. warn(
  4953. `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`
  4954. );
  4955. } else {
  4956. const strat = internalOptionMergeStrats[key] || strats && strats[key];
  4957. to[key] = strat ? strat(to[key], from[key]) : from[key];
  4958. }
  4959. }
  4960. return to;
  4961. }
  4962. const internalOptionMergeStrats = {
  4963. data: mergeDataFn,
  4964. props: mergeEmitsOrPropsOptions,
  4965. emits: mergeEmitsOrPropsOptions,
  4966. // objects
  4967. methods: mergeObjectOptions,
  4968. computed: mergeObjectOptions,
  4969. // lifecycle
  4970. beforeCreate: mergeAsArray,
  4971. created: mergeAsArray,
  4972. beforeMount: mergeAsArray,
  4973. mounted: mergeAsArray,
  4974. beforeUpdate: mergeAsArray,
  4975. updated: mergeAsArray,
  4976. beforeDestroy: mergeAsArray,
  4977. beforeUnmount: mergeAsArray,
  4978. destroyed: mergeAsArray,
  4979. unmounted: mergeAsArray,
  4980. activated: mergeAsArray,
  4981. deactivated: mergeAsArray,
  4982. errorCaptured: mergeAsArray,
  4983. serverPrefetch: mergeAsArray,
  4984. // assets
  4985. components: mergeObjectOptions,
  4986. directives: mergeObjectOptions,
  4987. // watch
  4988. watch: mergeWatchOptions,
  4989. // provide / inject
  4990. provide: mergeDataFn,
  4991. inject: mergeInject
  4992. };
  4993. function mergeDataFn(to, from) {
  4994. if (!from) {
  4995. return to;
  4996. }
  4997. if (!to) {
  4998. return from;
  4999. }
  5000. return function mergedDataFn() {
  5001. return (extend)(
  5002. isFunction(to) ? to.call(this, this) : to,
  5003. isFunction(from) ? from.call(this, this) : from
  5004. );
  5005. };
  5006. }
  5007. function mergeInject(to, from) {
  5008. return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
  5009. }
  5010. function normalizeInject(raw) {
  5011. if (isArray(raw)) {
  5012. const res = {};
  5013. for (let i = 0; i < raw.length; i++) {
  5014. res[raw[i]] = raw[i];
  5015. }
  5016. return res;
  5017. }
  5018. return raw;
  5019. }
  5020. function mergeAsArray(to, from) {
  5021. return to ? [...new Set([].concat(to, from))] : from;
  5022. }
  5023. function mergeObjectOptions(to, from) {
  5024. return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
  5025. }
  5026. function mergeEmitsOrPropsOptions(to, from) {
  5027. if (to) {
  5028. if (isArray(to) && isArray(from)) {
  5029. return [.../* @__PURE__ */ new Set([...to, ...from])];
  5030. }
  5031. return extend(
  5032. /* @__PURE__ */ Object.create(null),
  5033. normalizePropsOrEmits(to),
  5034. normalizePropsOrEmits(from != null ? from : {})
  5035. );
  5036. } else {
  5037. return from;
  5038. }
  5039. }
  5040. function mergeWatchOptions(to, from) {
  5041. if (!to)
  5042. return from;
  5043. if (!from)
  5044. return to;
  5045. const merged = extend(/* @__PURE__ */ Object.create(null), to);
  5046. for (const key in from) {
  5047. merged[key] = mergeAsArray(to[key], from[key]);
  5048. }
  5049. return merged;
  5050. }
  5051. function createAppContext() {
  5052. return {
  5053. app: null,
  5054. config: {
  5055. isNativeTag: NO,
  5056. performance: false,
  5057. globalProperties: {},
  5058. optionMergeStrategies: {},
  5059. errorHandler: void 0,
  5060. warnHandler: void 0,
  5061. compilerOptions: {}
  5062. },
  5063. mixins: [],
  5064. components: {},
  5065. directives: {},
  5066. provides: /* @__PURE__ */ Object.create(null),
  5067. optionsCache: /* @__PURE__ */ new WeakMap(),
  5068. propsCache: /* @__PURE__ */ new WeakMap(),
  5069. emitsCache: /* @__PURE__ */ new WeakMap()
  5070. };
  5071. }
  5072. let uid$1 = 0;
  5073. function createAppAPI(render, hydrate) {
  5074. return function createApp(rootComponent, rootProps = null) {
  5075. if (!isFunction(rootComponent)) {
  5076. rootComponent = extend({}, rootComponent);
  5077. }
  5078. if (rootProps != null && !isObject(rootProps)) {
  5079. warn(`root props passed to app.mount() must be an object.`);
  5080. rootProps = null;
  5081. }
  5082. const context = createAppContext();
  5083. {
  5084. Object.defineProperty(context.config, "unwrapInjectedRef", {
  5085. get() {
  5086. return true;
  5087. },
  5088. set() {
  5089. warn(
  5090. `app.config.unwrapInjectedRef has been deprecated. 3.3 now always unwraps injected refs in Options API.`
  5091. );
  5092. }
  5093. });
  5094. }
  5095. const installedPlugins = /* @__PURE__ */ new WeakSet();
  5096. let isMounted = false;
  5097. const app = context.app = {
  5098. _uid: uid$1++,
  5099. _component: rootComponent,
  5100. _props: rootProps,
  5101. _container: null,
  5102. _context: context,
  5103. _instance: null,
  5104. version,
  5105. get config() {
  5106. return context.config;
  5107. },
  5108. set config(v) {
  5109. {
  5110. warn(
  5111. `app.config cannot be replaced. Modify individual options instead.`
  5112. );
  5113. }
  5114. },
  5115. use(plugin, ...options) {
  5116. if (installedPlugins.has(plugin)) {
  5117. warn(`Plugin has already been applied to target app.`);
  5118. } else if (plugin && isFunction(plugin.install)) {
  5119. installedPlugins.add(plugin);
  5120. plugin.install(app, ...options);
  5121. } else if (isFunction(plugin)) {
  5122. installedPlugins.add(plugin);
  5123. plugin(app, ...options);
  5124. } else {
  5125. warn(
  5126. `A plugin must either be a function or an object with an "install" function.`
  5127. );
  5128. }
  5129. return app;
  5130. },
  5131. mixin(mixin) {
  5132. {
  5133. if (!context.mixins.includes(mixin)) {
  5134. context.mixins.push(mixin);
  5135. } else {
  5136. warn(
  5137. "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
  5138. );
  5139. }
  5140. }
  5141. return app;
  5142. },
  5143. component(name, component) {
  5144. {
  5145. validateComponentName(name, context.config);
  5146. }
  5147. if (!component) {
  5148. return context.components[name];
  5149. }
  5150. if (context.components[name]) {
  5151. warn(`Component "${name}" has already been registered in target app.`);
  5152. }
  5153. context.components[name] = component;
  5154. return app;
  5155. },
  5156. directive(name, directive) {
  5157. {
  5158. validateDirectiveName(name);
  5159. }
  5160. if (!directive) {
  5161. return context.directives[name];
  5162. }
  5163. if (context.directives[name]) {
  5164. warn(`Directive "${name}" has already been registered in target app.`);
  5165. }
  5166. context.directives[name] = directive;
  5167. return app;
  5168. },
  5169. mount(rootContainer, isHydrate, isSVG) {
  5170. if (!isMounted) {
  5171. if (rootContainer.__vue_app__) {
  5172. warn(
  5173. `There is already an app instance mounted on the host container.
  5174. If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
  5175. );
  5176. }
  5177. const vnode = createVNode(rootComponent, rootProps);
  5178. vnode.appContext = context;
  5179. {
  5180. context.reload = () => {
  5181. render(cloneVNode(vnode), rootContainer, isSVG);
  5182. };
  5183. }
  5184. if (isHydrate && hydrate) {
  5185. hydrate(vnode, rootContainer);
  5186. } else {
  5187. render(vnode, rootContainer, isSVG);
  5188. }
  5189. isMounted = true;
  5190. app._container = rootContainer;
  5191. rootContainer.__vue_app__ = app;
  5192. {
  5193. app._instance = vnode.component;
  5194. devtoolsInitApp(app, version);
  5195. }
  5196. return getExposeProxy(vnode.component) || vnode.component.proxy;
  5197. } else {
  5198. warn(
  5199. `App has already been mounted.
  5200. If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\``
  5201. );
  5202. }
  5203. },
  5204. unmount() {
  5205. if (isMounted) {
  5206. render(null, app._container);
  5207. {
  5208. app._instance = null;
  5209. devtoolsUnmountApp(app);
  5210. }
  5211. delete app._container.__vue_app__;
  5212. } else {
  5213. warn(`Cannot unmount an app that is not mounted.`);
  5214. }
  5215. },
  5216. provide(key, value) {
  5217. if (key in context.provides) {
  5218. warn(
  5219. `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
  5220. );
  5221. }
  5222. context.provides[key] = value;
  5223. return app;
  5224. },
  5225. runWithContext(fn) {
  5226. currentApp = app;
  5227. try {
  5228. return fn();
  5229. } finally {
  5230. currentApp = null;
  5231. }
  5232. }
  5233. };
  5234. return app;
  5235. };
  5236. }
  5237. let currentApp = null;
  5238. function provide(key, value) {
  5239. if (!currentInstance) {
  5240. {
  5241. warn(`provide() can only be used inside setup().`);
  5242. }
  5243. } else {
  5244. let provides = currentInstance.provides;
  5245. const parentProvides = currentInstance.parent && currentInstance.parent.provides;
  5246. if (parentProvides === provides) {
  5247. provides = currentInstance.provides = Object.create(parentProvides);
  5248. }
  5249. provides[key] = value;
  5250. }
  5251. }
  5252. function inject(key, defaultValue, treatDefaultAsFactory = false) {
  5253. const instance = currentInstance || currentRenderingInstance;
  5254. if (instance || currentApp) {
  5255. const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
  5256. if (provides && key in provides) {
  5257. return provides[key];
  5258. } else if (arguments.length > 1) {
  5259. return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
  5260. } else {
  5261. warn(`injection "${String(key)}" not found.`);
  5262. }
  5263. } else {
  5264. warn(`inject() can only be used inside setup() or functional components.`);
  5265. }
  5266. }
  5267. function hasInjectionContext() {
  5268. return !!(currentInstance || currentRenderingInstance || currentApp);
  5269. }
  5270. function initProps(instance, rawProps, isStateful, isSSR = false) {
  5271. const props = {};
  5272. const attrs = {};
  5273. def(attrs, InternalObjectKey, 1);
  5274. instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  5275. setFullProps(instance, rawProps, props, attrs);
  5276. for (const key in instance.propsOptions[0]) {
  5277. if (!(key in props)) {
  5278. props[key] = void 0;
  5279. }
  5280. }
  5281. {
  5282. validateProps(rawProps || {}, props, instance);
  5283. }
  5284. if (isStateful) {
  5285. instance.props = isSSR ? props : shallowReactive(props);
  5286. } else {
  5287. if (!instance.type.props) {
  5288. instance.props = attrs;
  5289. } else {
  5290. instance.props = props;
  5291. }
  5292. }
  5293. instance.attrs = attrs;
  5294. }
  5295. function isInHmrContext(instance) {
  5296. while (instance) {
  5297. if (instance.type.__hmrId)
  5298. return true;
  5299. instance = instance.parent;
  5300. }
  5301. }
  5302. function updateProps(instance, rawProps, rawPrevProps, optimized) {
  5303. const {
  5304. props,
  5305. attrs,
  5306. vnode: { patchFlag }
  5307. } = instance;
  5308. const rawCurrentProps = toRaw(props);
  5309. const [options] = instance.propsOptions;
  5310. let hasAttrsChanged = false;
  5311. if (
  5312. // always force full diff in dev
  5313. // - #1942 if hmr is enabled with sfc component
  5314. // - vite#872 non-sfc component used by sfc component
  5315. !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
  5316. ) {
  5317. if (patchFlag & 8) {
  5318. const propsToUpdate = instance.vnode.dynamicProps;
  5319. for (let i = 0; i < propsToUpdate.length; i++) {
  5320. let key = propsToUpdate[i];
  5321. if (isEmitListener(instance.emitsOptions, key)) {
  5322. continue;
  5323. }
  5324. const value = rawProps[key];
  5325. if (options) {
  5326. if (hasOwn(attrs, key)) {
  5327. if (value !== attrs[key]) {
  5328. attrs[key] = value;
  5329. hasAttrsChanged = true;
  5330. }
  5331. } else {
  5332. const camelizedKey = camelize(key);
  5333. props[camelizedKey] = resolvePropValue(
  5334. options,
  5335. rawCurrentProps,
  5336. camelizedKey,
  5337. value,
  5338. instance,
  5339. false
  5340. /* isAbsent */
  5341. );
  5342. }
  5343. } else {
  5344. if (value !== attrs[key]) {
  5345. attrs[key] = value;
  5346. hasAttrsChanged = true;
  5347. }
  5348. }
  5349. }
  5350. }
  5351. } else {
  5352. if (setFullProps(instance, rawProps, props, attrs)) {
  5353. hasAttrsChanged = true;
  5354. }
  5355. let kebabKey;
  5356. for (const key in rawCurrentProps) {
  5357. if (!rawProps || // for camelCase
  5358. !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
  5359. // and converted to camelCase (#955)
  5360. ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
  5361. if (options) {
  5362. if (rawPrevProps && // for camelCase
  5363. (rawPrevProps[key] !== void 0 || // for kebab-case
  5364. rawPrevProps[kebabKey] !== void 0)) {
  5365. props[key] = resolvePropValue(
  5366. options,
  5367. rawCurrentProps,
  5368. key,
  5369. void 0,
  5370. instance,
  5371. true
  5372. /* isAbsent */
  5373. );
  5374. }
  5375. } else {
  5376. delete props[key];
  5377. }
  5378. }
  5379. }
  5380. if (attrs !== rawCurrentProps) {
  5381. for (const key in attrs) {
  5382. if (!rawProps || !hasOwn(rawProps, key) && true) {
  5383. delete attrs[key];
  5384. hasAttrsChanged = true;
  5385. }
  5386. }
  5387. }
  5388. }
  5389. if (hasAttrsChanged) {
  5390. trigger(instance, "set", "$attrs");
  5391. }
  5392. {
  5393. validateProps(rawProps || {}, props, instance);
  5394. }
  5395. }
  5396. function setFullProps(instance, rawProps, props, attrs) {
  5397. const [options, needCastKeys] = instance.propsOptions;
  5398. let hasAttrsChanged = false;
  5399. let rawCastValues;
  5400. if (rawProps) {
  5401. for (let key in rawProps) {
  5402. if (isReservedProp(key)) {
  5403. continue;
  5404. }
  5405. const value = rawProps[key];
  5406. let camelKey;
  5407. if (options && hasOwn(options, camelKey = camelize(key))) {
  5408. if (!needCastKeys || !needCastKeys.includes(camelKey)) {
  5409. props[camelKey] = value;
  5410. } else {
  5411. (rawCastValues || (rawCastValues = {}))[camelKey] = value;
  5412. }
  5413. } else if (!isEmitListener(instance.emitsOptions, key)) {
  5414. if (!(key in attrs) || value !== attrs[key]) {
  5415. attrs[key] = value;
  5416. hasAttrsChanged = true;
  5417. }
  5418. }
  5419. }
  5420. }
  5421. if (needCastKeys) {
  5422. const rawCurrentProps = toRaw(props);
  5423. const castValues = rawCastValues || EMPTY_OBJ;
  5424. for (let i = 0; i < needCastKeys.length; i++) {
  5425. const key = needCastKeys[i];
  5426. props[key] = resolvePropValue(
  5427. options,
  5428. rawCurrentProps,
  5429. key,
  5430. castValues[key],
  5431. instance,
  5432. !hasOwn(castValues, key)
  5433. );
  5434. }
  5435. }
  5436. return hasAttrsChanged;
  5437. }
  5438. function resolvePropValue(options, props, key, value, instance, isAbsent) {
  5439. const opt = options[key];
  5440. if (opt != null) {
  5441. const hasDefault = hasOwn(opt, "default");
  5442. if (hasDefault && value === void 0) {
  5443. const defaultValue = opt.default;
  5444. if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
  5445. const { propsDefaults } = instance;
  5446. if (key in propsDefaults) {
  5447. value = propsDefaults[key];
  5448. } else {
  5449. setCurrentInstance(instance);
  5450. value = propsDefaults[key] = defaultValue.call(
  5451. null,
  5452. props
  5453. );
  5454. unsetCurrentInstance();
  5455. }
  5456. } else {
  5457. value = defaultValue;
  5458. }
  5459. }
  5460. if (opt[0 /* shouldCast */]) {
  5461. if (isAbsent && !hasDefault) {
  5462. value = false;
  5463. } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) {
  5464. value = true;
  5465. }
  5466. }
  5467. }
  5468. return value;
  5469. }
  5470. function normalizePropsOptions(comp, appContext, asMixin = false) {
  5471. const cache = appContext.propsCache;
  5472. const cached = cache.get(comp);
  5473. if (cached) {
  5474. return cached;
  5475. }
  5476. const raw = comp.props;
  5477. const normalized = {};
  5478. const needCastKeys = [];
  5479. let hasExtends = false;
  5480. if (!isFunction(comp)) {
  5481. const extendProps = (raw2) => {
  5482. hasExtends = true;
  5483. const [props, keys] = normalizePropsOptions(raw2, appContext, true);
  5484. extend(normalized, props);
  5485. if (keys)
  5486. needCastKeys.push(...keys);
  5487. };
  5488. if (!asMixin && appContext.mixins.length) {
  5489. appContext.mixins.forEach(extendProps);
  5490. }
  5491. if (comp.extends) {
  5492. extendProps(comp.extends);
  5493. }
  5494. if (comp.mixins) {
  5495. comp.mixins.forEach(extendProps);
  5496. }
  5497. }
  5498. if (!raw && !hasExtends) {
  5499. if (isObject(comp)) {
  5500. cache.set(comp, EMPTY_ARR);
  5501. }
  5502. return EMPTY_ARR;
  5503. }
  5504. if (isArray(raw)) {
  5505. for (let i = 0; i < raw.length; i++) {
  5506. if (!isString(raw[i])) {
  5507. warn(`props must be strings when using array syntax.`, raw[i]);
  5508. }
  5509. const normalizedKey = camelize(raw[i]);
  5510. if (validatePropName(normalizedKey)) {
  5511. normalized[normalizedKey] = EMPTY_OBJ;
  5512. }
  5513. }
  5514. } else if (raw) {
  5515. if (!isObject(raw)) {
  5516. warn(`invalid props options`, raw);
  5517. }
  5518. for (const key in raw) {
  5519. const normalizedKey = camelize(key);
  5520. if (validatePropName(normalizedKey)) {
  5521. const opt = raw[key];
  5522. const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
  5523. if (prop) {
  5524. const booleanIndex = getTypeIndex(Boolean, prop.type);
  5525. const stringIndex = getTypeIndex(String, prop.type);
  5526. prop[0 /* shouldCast */] = booleanIndex > -1;
  5527. prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex;
  5528. if (booleanIndex > -1 || hasOwn(prop, "default")) {
  5529. needCastKeys.push(normalizedKey);
  5530. }
  5531. }
  5532. }
  5533. }
  5534. }
  5535. const res = [normalized, needCastKeys];
  5536. if (isObject(comp)) {
  5537. cache.set(comp, res);
  5538. }
  5539. return res;
  5540. }
  5541. function validatePropName(key) {
  5542. if (key[0] !== "$") {
  5543. return true;
  5544. } else {
  5545. warn(`Invalid prop name: "${key}" is a reserved property.`);
  5546. }
  5547. return false;
  5548. }
  5549. function getType(ctor) {
  5550. const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
  5551. return match ? match[2] : ctor === null ? "null" : "";
  5552. }
  5553. function isSameType(a, b) {
  5554. return getType(a) === getType(b);
  5555. }
  5556. function getTypeIndex(type, expectedTypes) {
  5557. if (isArray(expectedTypes)) {
  5558. return expectedTypes.findIndex((t) => isSameType(t, type));
  5559. } else if (isFunction(expectedTypes)) {
  5560. return isSameType(expectedTypes, type) ? 0 : -1;
  5561. }
  5562. return -1;
  5563. }
  5564. function validateProps(rawProps, props, instance) {
  5565. const resolvedValues = toRaw(props);
  5566. const options = instance.propsOptions[0];
  5567. for (const key in options) {
  5568. let opt = options[key];
  5569. if (opt == null)
  5570. continue;
  5571. validateProp(
  5572. key,
  5573. resolvedValues[key],
  5574. opt,
  5575. !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
  5576. );
  5577. }
  5578. }
  5579. function validateProp(name, value, prop, isAbsent) {
  5580. const { type, required, validator, skipCheck } = prop;
  5581. if (required && isAbsent) {
  5582. warn('Missing required prop: "' + name + '"');
  5583. return;
  5584. }
  5585. if (value == null && !required) {
  5586. return;
  5587. }
  5588. if (type != null && type !== true && !skipCheck) {
  5589. let isValid = false;
  5590. const types = isArray(type) ? type : [type];
  5591. const expectedTypes = [];
  5592. for (let i = 0; i < types.length && !isValid; i++) {
  5593. const { valid, expectedType } = assertType(value, types[i]);
  5594. expectedTypes.push(expectedType || "");
  5595. isValid = valid;
  5596. }
  5597. if (!isValid) {
  5598. warn(getInvalidTypeMessage(name, value, expectedTypes));
  5599. return;
  5600. }
  5601. }
  5602. if (validator && !validator(value)) {
  5603. warn('Invalid prop: custom validator check failed for prop "' + name + '".');
  5604. }
  5605. }
  5606. const isSimpleType = /* @__PURE__ */ makeMap(
  5607. "String,Number,Boolean,Function,Symbol,BigInt"
  5608. );
  5609. function assertType(value, type) {
  5610. let valid;
  5611. const expectedType = getType(type);
  5612. if (isSimpleType(expectedType)) {
  5613. const t = typeof value;
  5614. valid = t === expectedType.toLowerCase();
  5615. if (!valid && t === "object") {
  5616. valid = value instanceof type;
  5617. }
  5618. } else if (expectedType === "Object") {
  5619. valid = isObject(value);
  5620. } else if (expectedType === "Array") {
  5621. valid = isArray(value);
  5622. } else if (expectedType === "null") {
  5623. valid = value === null;
  5624. } else {
  5625. valid = value instanceof type;
  5626. }
  5627. return {
  5628. valid,
  5629. expectedType
  5630. };
  5631. }
  5632. function getInvalidTypeMessage(name, value, expectedTypes) {
  5633. if (expectedTypes.length === 0) {
  5634. return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
  5635. }
  5636. let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
  5637. const expectedType = expectedTypes[0];
  5638. const receivedType = toRawType(value);
  5639. const expectedValue = styleValue(value, expectedType);
  5640. const receivedValue = styleValue(value, receivedType);
  5641. if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
  5642. message += ` with value ${expectedValue}`;
  5643. }
  5644. message += `, got ${receivedType} `;
  5645. if (isExplicable(receivedType)) {
  5646. message += `with value ${receivedValue}.`;
  5647. }
  5648. return message;
  5649. }
  5650. function styleValue(value, type) {
  5651. if (type === "String") {
  5652. return `"${value}"`;
  5653. } else if (type === "Number") {
  5654. return `${Number(value)}`;
  5655. } else {
  5656. return `${value}`;
  5657. }
  5658. }
  5659. function isExplicable(type) {
  5660. const explicitTypes = ["string", "number", "boolean"];
  5661. return explicitTypes.some((elem) => type.toLowerCase() === elem);
  5662. }
  5663. function isBoolean(...args) {
  5664. return args.some((elem) => elem.toLowerCase() === "boolean");
  5665. }
  5666. const isInternalKey = (key) => key[0] === "_" || key === "$stable";
  5667. const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
  5668. const normalizeSlot = (key, rawSlot, ctx) => {
  5669. if (rawSlot._n) {
  5670. return rawSlot;
  5671. }
  5672. const normalized = withCtx((...args) => {
  5673. if (currentInstance) {
  5674. warn(
  5675. `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`
  5676. );
  5677. }
  5678. return normalizeSlotValue(rawSlot(...args));
  5679. }, ctx);
  5680. normalized._c = false;
  5681. return normalized;
  5682. };
  5683. const normalizeObjectSlots = (rawSlots, slots, instance) => {
  5684. const ctx = rawSlots._ctx;
  5685. for (const key in rawSlots) {
  5686. if (isInternalKey(key))
  5687. continue;
  5688. const value = rawSlots[key];
  5689. if (isFunction(value)) {
  5690. slots[key] = normalizeSlot(key, value, ctx);
  5691. } else if (value != null) {
  5692. {
  5693. warn(
  5694. `Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
  5695. );
  5696. }
  5697. const normalized = normalizeSlotValue(value);
  5698. slots[key] = () => normalized;
  5699. }
  5700. }
  5701. };
  5702. const normalizeVNodeSlots = (instance, children) => {
  5703. if (!isKeepAlive(instance.vnode) && true) {
  5704. warn(
  5705. `Non-function value encountered for default slot. Prefer function slots for better performance.`
  5706. );
  5707. }
  5708. const normalized = normalizeSlotValue(children);
  5709. instance.slots.default = () => normalized;
  5710. };
  5711. const initSlots = (instance, children) => {
  5712. if (instance.vnode.shapeFlag & 32) {
  5713. const type = children._;
  5714. if (type) {
  5715. instance.slots = toRaw(children);
  5716. def(children, "_", type);
  5717. } else {
  5718. normalizeObjectSlots(
  5719. children,
  5720. instance.slots = {});
  5721. }
  5722. } else {
  5723. instance.slots = {};
  5724. if (children) {
  5725. normalizeVNodeSlots(instance, children);
  5726. }
  5727. }
  5728. def(instance.slots, InternalObjectKey, 1);
  5729. };
  5730. const updateSlots = (instance, children, optimized) => {
  5731. const { vnode, slots } = instance;
  5732. let needDeletionCheck = true;
  5733. let deletionComparisonTarget = EMPTY_OBJ;
  5734. if (vnode.shapeFlag & 32) {
  5735. const type = children._;
  5736. if (type) {
  5737. if (isHmrUpdating) {
  5738. extend(slots, children);
  5739. trigger(instance, "set", "$slots");
  5740. } else if (optimized && type === 1) {
  5741. needDeletionCheck = false;
  5742. } else {
  5743. extend(slots, children);
  5744. if (!optimized && type === 1) {
  5745. delete slots._;
  5746. }
  5747. }
  5748. } else {
  5749. needDeletionCheck = !children.$stable;
  5750. normalizeObjectSlots(children, slots);
  5751. }
  5752. deletionComparisonTarget = children;
  5753. } else if (children) {
  5754. normalizeVNodeSlots(instance, children);
  5755. deletionComparisonTarget = { default: 1 };
  5756. }
  5757. if (needDeletionCheck) {
  5758. for (const key in slots) {
  5759. if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
  5760. delete slots[key];
  5761. }
  5762. }
  5763. }
  5764. };
  5765. function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
  5766. if (isArray(rawRef)) {
  5767. rawRef.forEach(
  5768. (r, i) => setRef(
  5769. r,
  5770. oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
  5771. parentSuspense,
  5772. vnode,
  5773. isUnmount
  5774. )
  5775. );
  5776. return;
  5777. }
  5778. if (isAsyncWrapper(vnode) && !isUnmount) {
  5779. return;
  5780. }
  5781. const refValue = vnode.shapeFlag & 4 ? getExposeProxy(vnode.component) || vnode.component.proxy : vnode.el;
  5782. const value = isUnmount ? null : refValue;
  5783. const { i: owner, r: ref } = rawRef;
  5784. if (!owner) {
  5785. warn(
  5786. `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`
  5787. );
  5788. return;
  5789. }
  5790. const oldRef = oldRawRef && oldRawRef.r;
  5791. const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
  5792. const setupState = owner.setupState;
  5793. if (oldRef != null && oldRef !== ref) {
  5794. if (isString(oldRef)) {
  5795. refs[oldRef] = null;
  5796. if (hasOwn(setupState, oldRef)) {
  5797. setupState[oldRef] = null;
  5798. }
  5799. } else if (isRef(oldRef)) {
  5800. oldRef.value = null;
  5801. }
  5802. }
  5803. if (isFunction(ref)) {
  5804. callWithErrorHandling(ref, owner, 12, [value, refs]);
  5805. } else {
  5806. const _isString = isString(ref);
  5807. const _isRef = isRef(ref);
  5808. if (_isString || _isRef) {
  5809. const doSet = () => {
  5810. if (rawRef.f) {
  5811. const existing = _isString ? hasOwn(setupState, ref) ? setupState[ref] : refs[ref] : ref.value;
  5812. if (isUnmount) {
  5813. isArray(existing) && remove(existing, refValue);
  5814. } else {
  5815. if (!isArray(existing)) {
  5816. if (_isString) {
  5817. refs[ref] = [refValue];
  5818. if (hasOwn(setupState, ref)) {
  5819. setupState[ref] = refs[ref];
  5820. }
  5821. } else {
  5822. ref.value = [refValue];
  5823. if (rawRef.k)
  5824. refs[rawRef.k] = ref.value;
  5825. }
  5826. } else if (!existing.includes(refValue)) {
  5827. existing.push(refValue);
  5828. }
  5829. }
  5830. } else if (_isString) {
  5831. refs[ref] = value;
  5832. if (hasOwn(setupState, ref)) {
  5833. setupState[ref] = value;
  5834. }
  5835. } else if (_isRef) {
  5836. ref.value = value;
  5837. if (rawRef.k)
  5838. refs[rawRef.k] = value;
  5839. } else {
  5840. warn("Invalid template ref type:", ref, `(${typeof ref})`);
  5841. }
  5842. };
  5843. if (value) {
  5844. doSet.id = -1;
  5845. queuePostRenderEffect(doSet, parentSuspense);
  5846. } else {
  5847. doSet();
  5848. }
  5849. } else {
  5850. warn("Invalid template ref type:", ref, `(${typeof ref})`);
  5851. }
  5852. }
  5853. }
  5854. let hasMismatch = false;
  5855. const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== "foreignObject";
  5856. const isComment = (node) => node.nodeType === 8 /* COMMENT */;
  5857. function createHydrationFunctions(rendererInternals) {
  5858. const {
  5859. mt: mountComponent,
  5860. p: patch,
  5861. o: {
  5862. patchProp,
  5863. createText,
  5864. nextSibling,
  5865. parentNode,
  5866. remove,
  5867. insert,
  5868. createComment
  5869. }
  5870. } = rendererInternals;
  5871. const hydrate = (vnode, container) => {
  5872. if (!container.hasChildNodes()) {
  5873. warn(
  5874. `Attempting to hydrate existing markup but container is empty. Performing full mount instead.`
  5875. );
  5876. patch(null, vnode, container);
  5877. flushPostFlushCbs();
  5878. container._vnode = vnode;
  5879. return;
  5880. }
  5881. hasMismatch = false;
  5882. hydrateNode(container.firstChild, vnode, null, null, null);
  5883. flushPostFlushCbs();
  5884. container._vnode = vnode;
  5885. if (hasMismatch && true) {
  5886. console.error(`Hydration completed but contains mismatches.`);
  5887. }
  5888. };
  5889. const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
  5890. const isFragmentStart = isComment(node) && node.data === "[";
  5891. const onMismatch = () => handleMismatch(
  5892. node,
  5893. vnode,
  5894. parentComponent,
  5895. parentSuspense,
  5896. slotScopeIds,
  5897. isFragmentStart
  5898. );
  5899. const { type, ref, shapeFlag, patchFlag } = vnode;
  5900. let domType = node.nodeType;
  5901. vnode.el = node;
  5902. {
  5903. if (!("__vnode" in node)) {
  5904. Object.defineProperty(node, "__vnode", {
  5905. value: vnode,
  5906. enumerable: false
  5907. });
  5908. }
  5909. if (!("__vueParentComponent" in node)) {
  5910. Object.defineProperty(node, "__vueParentComponent", {
  5911. value: parentComponent,
  5912. enumerable: false
  5913. });
  5914. }
  5915. }
  5916. if (patchFlag === -2) {
  5917. optimized = false;
  5918. vnode.dynamicChildren = null;
  5919. }
  5920. let nextNode = null;
  5921. switch (type) {
  5922. case Text:
  5923. if (domType !== 3 /* TEXT */) {
  5924. if (vnode.children === "") {
  5925. insert(vnode.el = createText(""), parentNode(node), node);
  5926. nextNode = node;
  5927. } else {
  5928. nextNode = onMismatch();
  5929. }
  5930. } else {
  5931. if (node.data !== vnode.children) {
  5932. hasMismatch = true;
  5933. warn(
  5934. `Hydration text mismatch:
  5935. - Server rendered: ${JSON.stringify(
  5936. node.data
  5937. )}
  5938. - Client rendered: ${JSON.stringify(vnode.children)}`
  5939. );
  5940. node.data = vnode.children;
  5941. }
  5942. nextNode = nextSibling(node);
  5943. }
  5944. break;
  5945. case Comment:
  5946. if (isTemplateNode(node)) {
  5947. nextNode = nextSibling(node);
  5948. replaceNode(
  5949. vnode.el = node.content.firstChild,
  5950. node,
  5951. parentComponent
  5952. );
  5953. } else if (domType !== 8 /* COMMENT */ || isFragmentStart) {
  5954. nextNode = onMismatch();
  5955. } else {
  5956. nextNode = nextSibling(node);
  5957. }
  5958. break;
  5959. case Static:
  5960. if (isFragmentStart) {
  5961. node = nextSibling(node);
  5962. domType = node.nodeType;
  5963. }
  5964. if (domType === 1 /* ELEMENT */ || domType === 3 /* TEXT */) {
  5965. nextNode = node;
  5966. const needToAdoptContent = !vnode.children.length;
  5967. for (let i = 0; i < vnode.staticCount; i++) {
  5968. if (needToAdoptContent)
  5969. vnode.children += nextNode.nodeType === 1 /* ELEMENT */ ? nextNode.outerHTML : nextNode.data;
  5970. if (i === vnode.staticCount - 1) {
  5971. vnode.anchor = nextNode;
  5972. }
  5973. nextNode = nextSibling(nextNode);
  5974. }
  5975. return isFragmentStart ? nextSibling(nextNode) : nextNode;
  5976. } else {
  5977. onMismatch();
  5978. }
  5979. break;
  5980. case Fragment:
  5981. if (!isFragmentStart) {
  5982. nextNode = onMismatch();
  5983. } else {
  5984. nextNode = hydrateFragment(
  5985. node,
  5986. vnode,
  5987. parentComponent,
  5988. parentSuspense,
  5989. slotScopeIds,
  5990. optimized
  5991. );
  5992. }
  5993. break;
  5994. default:
  5995. if (shapeFlag & 1) {
  5996. if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
  5997. nextNode = onMismatch();
  5998. } else {
  5999. nextNode = hydrateElement(
  6000. node,
  6001. vnode,
  6002. parentComponent,
  6003. parentSuspense,
  6004. slotScopeIds,
  6005. optimized
  6006. );
  6007. }
  6008. } else if (shapeFlag & 6) {
  6009. vnode.slotScopeIds = slotScopeIds;
  6010. const container = parentNode(node);
  6011. if (isFragmentStart) {
  6012. nextNode = locateClosingAnchor(node);
  6013. } else if (isComment(node) && node.data === "teleport start") {
  6014. nextNode = locateClosingAnchor(node, node.data, "teleport end");
  6015. } else {
  6016. nextNode = nextSibling(node);
  6017. }
  6018. mountComponent(
  6019. vnode,
  6020. container,
  6021. null,
  6022. parentComponent,
  6023. parentSuspense,
  6024. isSVGContainer(container),
  6025. optimized
  6026. );
  6027. if (isAsyncWrapper(vnode)) {
  6028. let subTree;
  6029. if (isFragmentStart) {
  6030. subTree = createVNode(Fragment);
  6031. subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
  6032. } else {
  6033. subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
  6034. }
  6035. subTree.el = node;
  6036. vnode.component.subTree = subTree;
  6037. }
  6038. } else if (shapeFlag & 64) {
  6039. if (domType !== 8 /* COMMENT */) {
  6040. nextNode = onMismatch();
  6041. } else {
  6042. nextNode = vnode.type.hydrate(
  6043. node,
  6044. vnode,
  6045. parentComponent,
  6046. parentSuspense,
  6047. slotScopeIds,
  6048. optimized,
  6049. rendererInternals,
  6050. hydrateChildren
  6051. );
  6052. }
  6053. } else if (shapeFlag & 128) {
  6054. nextNode = vnode.type.hydrate(
  6055. node,
  6056. vnode,
  6057. parentComponent,
  6058. parentSuspense,
  6059. isSVGContainer(parentNode(node)),
  6060. slotScopeIds,
  6061. optimized,
  6062. rendererInternals,
  6063. hydrateNode
  6064. );
  6065. } else {
  6066. warn("Invalid HostVNode type:", type, `(${typeof type})`);
  6067. }
  6068. }
  6069. if (ref != null) {
  6070. setRef(ref, null, parentSuspense, vnode);
  6071. }
  6072. return nextNode;
  6073. };
  6074. const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  6075. optimized = optimized || !!vnode.dynamicChildren;
  6076. const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
  6077. const forcePatch = type === "input" || type === "option";
  6078. {
  6079. if (dirs) {
  6080. invokeDirectiveHook(vnode, null, parentComponent, "created");
  6081. }
  6082. if (props) {
  6083. if (forcePatch || !optimized || patchFlag & (16 | 32)) {
  6084. for (const key in props) {
  6085. if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
  6086. key[0] === ".") {
  6087. patchProp(
  6088. el,
  6089. key,
  6090. null,
  6091. props[key],
  6092. false,
  6093. void 0,
  6094. parentComponent
  6095. );
  6096. }
  6097. }
  6098. } else if (props.onClick) {
  6099. patchProp(
  6100. el,
  6101. "onClick",
  6102. null,
  6103. props.onClick,
  6104. false,
  6105. void 0,
  6106. parentComponent
  6107. );
  6108. }
  6109. }
  6110. let vnodeHooks;
  6111. if (vnodeHooks = props && props.onVnodeBeforeMount) {
  6112. invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  6113. }
  6114. let needCallTransitionHooks = false;
  6115. if (isTemplateNode(el)) {
  6116. needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
  6117. const content = el.content.firstChild;
  6118. if (needCallTransitionHooks) {
  6119. transition.beforeEnter(content);
  6120. }
  6121. replaceNode(content, el, parentComponent);
  6122. vnode.el = el = content;
  6123. }
  6124. if (dirs) {
  6125. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  6126. }
  6127. if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
  6128. queueEffectWithSuspense(() => {
  6129. vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  6130. needCallTransitionHooks && transition.enter(el);
  6131. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  6132. }, parentSuspense);
  6133. }
  6134. if (shapeFlag & 16 && // skip if element has innerHTML / textContent
  6135. !(props && (props.innerHTML || props.textContent))) {
  6136. let next = hydrateChildren(
  6137. el.firstChild,
  6138. vnode,
  6139. el,
  6140. parentComponent,
  6141. parentSuspense,
  6142. slotScopeIds,
  6143. optimized
  6144. );
  6145. let hasWarned = false;
  6146. while (next) {
  6147. hasMismatch = true;
  6148. if (!hasWarned) {
  6149. warn(
  6150. `Hydration children mismatch in <${vnode.type}>: server rendered element contains more child nodes than client vdom.`
  6151. );
  6152. hasWarned = true;
  6153. }
  6154. const cur = next;
  6155. next = next.nextSibling;
  6156. remove(cur);
  6157. }
  6158. } else if (shapeFlag & 8) {
  6159. if (el.textContent !== vnode.children) {
  6160. hasMismatch = true;
  6161. warn(
  6162. `Hydration text content mismatch in <${vnode.type}>:
  6163. - Server rendered: ${el.textContent}
  6164. - Client rendered: ${vnode.children}`
  6165. );
  6166. el.textContent = vnode.children;
  6167. }
  6168. }
  6169. }
  6170. return el.nextSibling;
  6171. };
  6172. const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  6173. optimized = optimized || !!parentVNode.dynamicChildren;
  6174. const children = parentVNode.children;
  6175. const l = children.length;
  6176. let hasWarned = false;
  6177. for (let i = 0; i < l; i++) {
  6178. const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
  6179. if (node) {
  6180. node = hydrateNode(
  6181. node,
  6182. vnode,
  6183. parentComponent,
  6184. parentSuspense,
  6185. slotScopeIds,
  6186. optimized
  6187. );
  6188. } else if (vnode.type === Text && !vnode.children) {
  6189. continue;
  6190. } else {
  6191. hasMismatch = true;
  6192. if (!hasWarned) {
  6193. warn(
  6194. `Hydration children mismatch in <${container.tagName.toLowerCase()}>: server rendered element contains fewer child nodes than client vdom.`
  6195. );
  6196. hasWarned = true;
  6197. }
  6198. patch(
  6199. null,
  6200. vnode,
  6201. container,
  6202. null,
  6203. parentComponent,
  6204. parentSuspense,
  6205. isSVGContainer(container),
  6206. slotScopeIds
  6207. );
  6208. }
  6209. }
  6210. return node;
  6211. };
  6212. const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  6213. const { slotScopeIds: fragmentSlotScopeIds } = vnode;
  6214. if (fragmentSlotScopeIds) {
  6215. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  6216. }
  6217. const container = parentNode(node);
  6218. const next = hydrateChildren(
  6219. nextSibling(node),
  6220. vnode,
  6221. container,
  6222. parentComponent,
  6223. parentSuspense,
  6224. slotScopeIds,
  6225. optimized
  6226. );
  6227. if (next && isComment(next) && next.data === "]") {
  6228. return nextSibling(vnode.anchor = next);
  6229. } else {
  6230. hasMismatch = true;
  6231. insert(vnode.anchor = createComment(`]`), container, next);
  6232. return next;
  6233. }
  6234. };
  6235. const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
  6236. hasMismatch = true;
  6237. warn(
  6238. `Hydration node mismatch:
  6239. - Client vnode:`,
  6240. vnode.type,
  6241. `
  6242. - Server rendered DOM:`,
  6243. node,
  6244. node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``
  6245. );
  6246. vnode.el = null;
  6247. if (isFragment) {
  6248. const end = locateClosingAnchor(node);
  6249. while (true) {
  6250. const next2 = nextSibling(node);
  6251. if (next2 && next2 !== end) {
  6252. remove(next2);
  6253. } else {
  6254. break;
  6255. }
  6256. }
  6257. }
  6258. const next = nextSibling(node);
  6259. const container = parentNode(node);
  6260. remove(node);
  6261. patch(
  6262. null,
  6263. vnode,
  6264. container,
  6265. next,
  6266. parentComponent,
  6267. parentSuspense,
  6268. isSVGContainer(container),
  6269. slotScopeIds
  6270. );
  6271. return next;
  6272. };
  6273. const locateClosingAnchor = (node, open = "[", close = "]") => {
  6274. let match = 0;
  6275. while (node) {
  6276. node = nextSibling(node);
  6277. if (node && isComment(node)) {
  6278. if (node.data === open)
  6279. match++;
  6280. if (node.data === close) {
  6281. if (match === 0) {
  6282. return nextSibling(node);
  6283. } else {
  6284. match--;
  6285. }
  6286. }
  6287. }
  6288. }
  6289. return node;
  6290. };
  6291. const replaceNode = (newNode, oldNode, parentComponent) => {
  6292. const parentNode2 = oldNode.parentNode;
  6293. if (parentNode2) {
  6294. parentNode2.replaceChild(newNode, oldNode);
  6295. }
  6296. let parent = parentComponent;
  6297. while (parent) {
  6298. if (parent.vnode.el === oldNode) {
  6299. parent.vnode.el = parent.subTree.el = newNode;
  6300. }
  6301. parent = parent.parent;
  6302. }
  6303. };
  6304. const isTemplateNode = (node) => {
  6305. return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template";
  6306. };
  6307. return [hydrate, hydrateNode];
  6308. }
  6309. let supported;
  6310. let perf;
  6311. function startMeasure(instance, type) {
  6312. if (instance.appContext.config.performance && isSupported()) {
  6313. perf.mark(`vue-${type}-${instance.uid}`);
  6314. }
  6315. {
  6316. devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
  6317. }
  6318. }
  6319. function endMeasure(instance, type) {
  6320. if (instance.appContext.config.performance && isSupported()) {
  6321. const startTag = `vue-${type}-${instance.uid}`;
  6322. const endTag = startTag + `:end`;
  6323. perf.mark(endTag);
  6324. perf.measure(
  6325. `<${formatComponentName(instance, instance.type)}> ${type}`,
  6326. startTag,
  6327. endTag
  6328. );
  6329. perf.clearMarks(startTag);
  6330. perf.clearMarks(endTag);
  6331. }
  6332. {
  6333. devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
  6334. }
  6335. }
  6336. function isSupported() {
  6337. if (supported !== void 0) {
  6338. return supported;
  6339. }
  6340. if (typeof window !== "undefined" && window.performance) {
  6341. supported = true;
  6342. perf = window.performance;
  6343. } else {
  6344. supported = false;
  6345. }
  6346. return supported;
  6347. }
  6348. const queuePostRenderEffect = queueEffectWithSuspense ;
  6349. function createRenderer(options) {
  6350. return baseCreateRenderer(options);
  6351. }
  6352. function createHydrationRenderer(options) {
  6353. return baseCreateRenderer(options, createHydrationFunctions);
  6354. }
  6355. function baseCreateRenderer(options, createHydrationFns) {
  6356. const target = getGlobalThis();
  6357. target.__VUE__ = true;
  6358. {
  6359. setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
  6360. }
  6361. const {
  6362. insert: hostInsert,
  6363. remove: hostRemove,
  6364. patchProp: hostPatchProp,
  6365. createElement: hostCreateElement,
  6366. createText: hostCreateText,
  6367. createComment: hostCreateComment,
  6368. setText: hostSetText,
  6369. setElementText: hostSetElementText,
  6370. parentNode: hostParentNode,
  6371. nextSibling: hostNextSibling,
  6372. setScopeId: hostSetScopeId = NOOP,
  6373. insertStaticContent: hostInsertStaticContent
  6374. } = options;
  6375. const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
  6376. if (n1 === n2) {
  6377. return;
  6378. }
  6379. if (n1 && !isSameVNodeType(n1, n2)) {
  6380. anchor = getNextHostNode(n1);
  6381. unmount(n1, parentComponent, parentSuspense, true);
  6382. n1 = null;
  6383. }
  6384. if (n2.patchFlag === -2) {
  6385. optimized = false;
  6386. n2.dynamicChildren = null;
  6387. }
  6388. const { type, ref, shapeFlag } = n2;
  6389. switch (type) {
  6390. case Text:
  6391. processText(n1, n2, container, anchor);
  6392. break;
  6393. case Comment:
  6394. processCommentNode(n1, n2, container, anchor);
  6395. break;
  6396. case Static:
  6397. if (n1 == null) {
  6398. mountStaticNode(n2, container, anchor, isSVG);
  6399. } else {
  6400. patchStaticNode(n1, n2, container, isSVG);
  6401. }
  6402. break;
  6403. case Fragment:
  6404. processFragment(
  6405. n1,
  6406. n2,
  6407. container,
  6408. anchor,
  6409. parentComponent,
  6410. parentSuspense,
  6411. isSVG,
  6412. slotScopeIds,
  6413. optimized
  6414. );
  6415. break;
  6416. default:
  6417. if (shapeFlag & 1) {
  6418. processElement(
  6419. n1,
  6420. n2,
  6421. container,
  6422. anchor,
  6423. parentComponent,
  6424. parentSuspense,
  6425. isSVG,
  6426. slotScopeIds,
  6427. optimized
  6428. );
  6429. } else if (shapeFlag & 6) {
  6430. processComponent(
  6431. n1,
  6432. n2,
  6433. container,
  6434. anchor,
  6435. parentComponent,
  6436. parentSuspense,
  6437. isSVG,
  6438. slotScopeIds,
  6439. optimized
  6440. );
  6441. } else if (shapeFlag & 64) {
  6442. type.process(
  6443. n1,
  6444. n2,
  6445. container,
  6446. anchor,
  6447. parentComponent,
  6448. parentSuspense,
  6449. isSVG,
  6450. slotScopeIds,
  6451. optimized,
  6452. internals
  6453. );
  6454. } else if (shapeFlag & 128) {
  6455. type.process(
  6456. n1,
  6457. n2,
  6458. container,
  6459. anchor,
  6460. parentComponent,
  6461. parentSuspense,
  6462. isSVG,
  6463. slotScopeIds,
  6464. optimized,
  6465. internals
  6466. );
  6467. } else {
  6468. warn("Invalid VNode type:", type, `(${typeof type})`);
  6469. }
  6470. }
  6471. if (ref != null && parentComponent) {
  6472. setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
  6473. }
  6474. };
  6475. const processText = (n1, n2, container, anchor) => {
  6476. if (n1 == null) {
  6477. hostInsert(
  6478. n2.el = hostCreateText(n2.children),
  6479. container,
  6480. anchor
  6481. );
  6482. } else {
  6483. const el = n2.el = n1.el;
  6484. if (n2.children !== n1.children) {
  6485. hostSetText(el, n2.children);
  6486. }
  6487. }
  6488. };
  6489. const processCommentNode = (n1, n2, container, anchor) => {
  6490. if (n1 == null) {
  6491. hostInsert(
  6492. n2.el = hostCreateComment(n2.children || ""),
  6493. container,
  6494. anchor
  6495. );
  6496. } else {
  6497. n2.el = n1.el;
  6498. }
  6499. };
  6500. const mountStaticNode = (n2, container, anchor, isSVG) => {
  6501. [n2.el, n2.anchor] = hostInsertStaticContent(
  6502. n2.children,
  6503. container,
  6504. anchor,
  6505. isSVG,
  6506. n2.el,
  6507. n2.anchor
  6508. );
  6509. };
  6510. const patchStaticNode = (n1, n2, container, isSVG) => {
  6511. if (n2.children !== n1.children) {
  6512. const anchor = hostNextSibling(n1.anchor);
  6513. removeStaticNode(n1);
  6514. [n2.el, n2.anchor] = hostInsertStaticContent(
  6515. n2.children,
  6516. container,
  6517. anchor,
  6518. isSVG
  6519. );
  6520. } else {
  6521. n2.el = n1.el;
  6522. n2.anchor = n1.anchor;
  6523. }
  6524. };
  6525. const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
  6526. let next;
  6527. while (el && el !== anchor) {
  6528. next = hostNextSibling(el);
  6529. hostInsert(el, container, nextSibling);
  6530. el = next;
  6531. }
  6532. hostInsert(anchor, container, nextSibling);
  6533. };
  6534. const removeStaticNode = ({ el, anchor }) => {
  6535. let next;
  6536. while (el && el !== anchor) {
  6537. next = hostNextSibling(el);
  6538. hostRemove(el);
  6539. el = next;
  6540. }
  6541. hostRemove(anchor);
  6542. };
  6543. const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
  6544. isSVG = isSVG || n2.type === "svg";
  6545. if (n1 == null) {
  6546. mountElement(
  6547. n2,
  6548. container,
  6549. anchor,
  6550. parentComponent,
  6551. parentSuspense,
  6552. isSVG,
  6553. slotScopeIds,
  6554. optimized
  6555. );
  6556. } else {
  6557. patchElement(
  6558. n1,
  6559. n2,
  6560. parentComponent,
  6561. parentSuspense,
  6562. isSVG,
  6563. slotScopeIds,
  6564. optimized
  6565. );
  6566. }
  6567. };
  6568. const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
  6569. let el;
  6570. let vnodeHook;
  6571. const { type, props, shapeFlag, transition, dirs } = vnode;
  6572. el = vnode.el = hostCreateElement(
  6573. vnode.type,
  6574. isSVG,
  6575. props && props.is,
  6576. props
  6577. );
  6578. if (shapeFlag & 8) {
  6579. hostSetElementText(el, vnode.children);
  6580. } else if (shapeFlag & 16) {
  6581. mountChildren(
  6582. vnode.children,
  6583. el,
  6584. null,
  6585. parentComponent,
  6586. parentSuspense,
  6587. isSVG && type !== "foreignObject",
  6588. slotScopeIds,
  6589. optimized
  6590. );
  6591. }
  6592. if (dirs) {
  6593. invokeDirectiveHook(vnode, null, parentComponent, "created");
  6594. }
  6595. setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
  6596. if (props) {
  6597. for (const key in props) {
  6598. if (key !== "value" && !isReservedProp(key)) {
  6599. hostPatchProp(
  6600. el,
  6601. key,
  6602. null,
  6603. props[key],
  6604. isSVG,
  6605. vnode.children,
  6606. parentComponent,
  6607. parentSuspense,
  6608. unmountChildren
  6609. );
  6610. }
  6611. }
  6612. if ("value" in props) {
  6613. hostPatchProp(el, "value", null, props.value);
  6614. }
  6615. if (vnodeHook = props.onVnodeBeforeMount) {
  6616. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  6617. }
  6618. }
  6619. {
  6620. Object.defineProperty(el, "__vnode", {
  6621. value: vnode,
  6622. enumerable: false
  6623. });
  6624. Object.defineProperty(el, "__vueParentComponent", {
  6625. value: parentComponent,
  6626. enumerable: false
  6627. });
  6628. }
  6629. if (dirs) {
  6630. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  6631. }
  6632. const needCallTransitionHooks = needTransition(parentSuspense, transition);
  6633. if (needCallTransitionHooks) {
  6634. transition.beforeEnter(el);
  6635. }
  6636. hostInsert(el, container, anchor);
  6637. if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
  6638. queuePostRenderEffect(() => {
  6639. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  6640. needCallTransitionHooks && transition.enter(el);
  6641. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  6642. }, parentSuspense);
  6643. }
  6644. };
  6645. const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
  6646. if (scopeId) {
  6647. hostSetScopeId(el, scopeId);
  6648. }
  6649. if (slotScopeIds) {
  6650. for (let i = 0; i < slotScopeIds.length; i++) {
  6651. hostSetScopeId(el, slotScopeIds[i]);
  6652. }
  6653. }
  6654. if (parentComponent) {
  6655. let subTree = parentComponent.subTree;
  6656. if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
  6657. subTree = filterSingleRoot(subTree.children) || subTree;
  6658. }
  6659. if (vnode === subTree) {
  6660. const parentVNode = parentComponent.vnode;
  6661. setScopeId(
  6662. el,
  6663. parentVNode,
  6664. parentVNode.scopeId,
  6665. parentVNode.slotScopeIds,
  6666. parentComponent.parent
  6667. );
  6668. }
  6669. }
  6670. };
  6671. const mountChildren = (children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, start = 0) => {
  6672. for (let i = start; i < children.length; i++) {
  6673. const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
  6674. patch(
  6675. null,
  6676. child,
  6677. container,
  6678. anchor,
  6679. parentComponent,
  6680. parentSuspense,
  6681. isSVG,
  6682. slotScopeIds,
  6683. optimized
  6684. );
  6685. }
  6686. };
  6687. const patchElement = (n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
  6688. const el = n2.el = n1.el;
  6689. let { patchFlag, dynamicChildren, dirs } = n2;
  6690. patchFlag |= n1.patchFlag & 16;
  6691. const oldProps = n1.props || EMPTY_OBJ;
  6692. const newProps = n2.props || EMPTY_OBJ;
  6693. let vnodeHook;
  6694. parentComponent && toggleRecurse(parentComponent, false);
  6695. if (vnodeHook = newProps.onVnodeBeforeUpdate) {
  6696. invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  6697. }
  6698. if (dirs) {
  6699. invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
  6700. }
  6701. parentComponent && toggleRecurse(parentComponent, true);
  6702. if (isHmrUpdating) {
  6703. patchFlag = 0;
  6704. optimized = false;
  6705. dynamicChildren = null;
  6706. }
  6707. const areChildrenSVG = isSVG && n2.type !== "foreignObject";
  6708. if (dynamicChildren) {
  6709. patchBlockChildren(
  6710. n1.dynamicChildren,
  6711. dynamicChildren,
  6712. el,
  6713. parentComponent,
  6714. parentSuspense,
  6715. areChildrenSVG,
  6716. slotScopeIds
  6717. );
  6718. {
  6719. traverseStaticChildren(n1, n2);
  6720. }
  6721. } else if (!optimized) {
  6722. patchChildren(
  6723. n1,
  6724. n2,
  6725. el,
  6726. null,
  6727. parentComponent,
  6728. parentSuspense,
  6729. areChildrenSVG,
  6730. slotScopeIds,
  6731. false
  6732. );
  6733. }
  6734. if (patchFlag > 0) {
  6735. if (patchFlag & 16) {
  6736. patchProps(
  6737. el,
  6738. n2,
  6739. oldProps,
  6740. newProps,
  6741. parentComponent,
  6742. parentSuspense,
  6743. isSVG
  6744. );
  6745. } else {
  6746. if (patchFlag & 2) {
  6747. if (oldProps.class !== newProps.class) {
  6748. hostPatchProp(el, "class", null, newProps.class, isSVG);
  6749. }
  6750. }
  6751. if (patchFlag & 4) {
  6752. hostPatchProp(el, "style", oldProps.style, newProps.style, isSVG);
  6753. }
  6754. if (patchFlag & 8) {
  6755. const propsToUpdate = n2.dynamicProps;
  6756. for (let i = 0; i < propsToUpdate.length; i++) {
  6757. const key = propsToUpdate[i];
  6758. const prev = oldProps[key];
  6759. const next = newProps[key];
  6760. if (next !== prev || key === "value") {
  6761. hostPatchProp(
  6762. el,
  6763. key,
  6764. prev,
  6765. next,
  6766. isSVG,
  6767. n1.children,
  6768. parentComponent,
  6769. parentSuspense,
  6770. unmountChildren
  6771. );
  6772. }
  6773. }
  6774. }
  6775. }
  6776. if (patchFlag & 1) {
  6777. if (n1.children !== n2.children) {
  6778. hostSetElementText(el, n2.children);
  6779. }
  6780. }
  6781. } else if (!optimized && dynamicChildren == null) {
  6782. patchProps(
  6783. el,
  6784. n2,
  6785. oldProps,
  6786. newProps,
  6787. parentComponent,
  6788. parentSuspense,
  6789. isSVG
  6790. );
  6791. }
  6792. if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
  6793. queuePostRenderEffect(() => {
  6794. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  6795. dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
  6796. }, parentSuspense);
  6797. }
  6798. };
  6799. const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, isSVG, slotScopeIds) => {
  6800. for (let i = 0; i < newChildren.length; i++) {
  6801. const oldVNode = oldChildren[i];
  6802. const newVNode = newChildren[i];
  6803. const container = (
  6804. // oldVNode may be an errored async setup() component inside Suspense
  6805. // which will not have a mounted element
  6806. oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
  6807. // of the Fragment itself so it can move its children.
  6808. (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
  6809. // which also requires the correct parent container
  6810. !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
  6811. oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : (
  6812. // In other cases, the parent container is not actually used so we
  6813. // just pass the block element here to avoid a DOM parentNode call.
  6814. fallbackContainer
  6815. )
  6816. );
  6817. patch(
  6818. oldVNode,
  6819. newVNode,
  6820. container,
  6821. null,
  6822. parentComponent,
  6823. parentSuspense,
  6824. isSVG,
  6825. slotScopeIds,
  6826. true
  6827. );
  6828. }
  6829. };
  6830. const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => {
  6831. if (oldProps !== newProps) {
  6832. if (oldProps !== EMPTY_OBJ) {
  6833. for (const key in oldProps) {
  6834. if (!isReservedProp(key) && !(key in newProps)) {
  6835. hostPatchProp(
  6836. el,
  6837. key,
  6838. oldProps[key],
  6839. null,
  6840. isSVG,
  6841. vnode.children,
  6842. parentComponent,
  6843. parentSuspense,
  6844. unmountChildren
  6845. );
  6846. }
  6847. }
  6848. }
  6849. for (const key in newProps) {
  6850. if (isReservedProp(key))
  6851. continue;
  6852. const next = newProps[key];
  6853. const prev = oldProps[key];
  6854. if (next !== prev && key !== "value") {
  6855. hostPatchProp(
  6856. el,
  6857. key,
  6858. prev,
  6859. next,
  6860. isSVG,
  6861. vnode.children,
  6862. parentComponent,
  6863. parentSuspense,
  6864. unmountChildren
  6865. );
  6866. }
  6867. }
  6868. if ("value" in newProps) {
  6869. hostPatchProp(el, "value", oldProps.value, newProps.value);
  6870. }
  6871. }
  6872. };
  6873. const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
  6874. const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
  6875. const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
  6876. let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
  6877. if (
  6878. // #5523 dev root fragment may inherit directives
  6879. isHmrUpdating || patchFlag & 2048
  6880. ) {
  6881. patchFlag = 0;
  6882. optimized = false;
  6883. dynamicChildren = null;
  6884. }
  6885. if (fragmentSlotScopeIds) {
  6886. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  6887. }
  6888. if (n1 == null) {
  6889. hostInsert(fragmentStartAnchor, container, anchor);
  6890. hostInsert(fragmentEndAnchor, container, anchor);
  6891. mountChildren(
  6892. n2.children,
  6893. container,
  6894. fragmentEndAnchor,
  6895. parentComponent,
  6896. parentSuspense,
  6897. isSVG,
  6898. slotScopeIds,
  6899. optimized
  6900. );
  6901. } else {
  6902. if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
  6903. // of renderSlot() with no valid children
  6904. n1.dynamicChildren) {
  6905. patchBlockChildren(
  6906. n1.dynamicChildren,
  6907. dynamicChildren,
  6908. container,
  6909. parentComponent,
  6910. parentSuspense,
  6911. isSVG,
  6912. slotScopeIds
  6913. );
  6914. {
  6915. traverseStaticChildren(n1, n2);
  6916. }
  6917. } else {
  6918. patchChildren(
  6919. n1,
  6920. n2,
  6921. container,
  6922. fragmentEndAnchor,
  6923. parentComponent,
  6924. parentSuspense,
  6925. isSVG,
  6926. slotScopeIds,
  6927. optimized
  6928. );
  6929. }
  6930. }
  6931. };
  6932. const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
  6933. n2.slotScopeIds = slotScopeIds;
  6934. if (n1 == null) {
  6935. if (n2.shapeFlag & 512) {
  6936. parentComponent.ctx.activate(
  6937. n2,
  6938. container,
  6939. anchor,
  6940. isSVG,
  6941. optimized
  6942. );
  6943. } else {
  6944. mountComponent(
  6945. n2,
  6946. container,
  6947. anchor,
  6948. parentComponent,
  6949. parentSuspense,
  6950. isSVG,
  6951. optimized
  6952. );
  6953. }
  6954. } else {
  6955. updateComponent(n1, n2, optimized);
  6956. }
  6957. };
  6958. const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {
  6959. const instance = (initialVNode.component = createComponentInstance(
  6960. initialVNode,
  6961. parentComponent,
  6962. parentSuspense
  6963. ));
  6964. if (instance.type.__hmrId) {
  6965. registerHMR(instance);
  6966. }
  6967. {
  6968. pushWarningContext(initialVNode);
  6969. startMeasure(instance, `mount`);
  6970. }
  6971. if (isKeepAlive(initialVNode)) {
  6972. instance.ctx.renderer = internals;
  6973. }
  6974. {
  6975. {
  6976. startMeasure(instance, `init`);
  6977. }
  6978. setupComponent(instance);
  6979. {
  6980. endMeasure(instance, `init`);
  6981. }
  6982. }
  6983. if (instance.asyncDep) {
  6984. parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect);
  6985. if (!initialVNode.el) {
  6986. const placeholder = instance.subTree = createVNode(Comment);
  6987. processCommentNode(null, placeholder, container, anchor);
  6988. }
  6989. return;
  6990. }
  6991. setupRenderEffect(
  6992. instance,
  6993. initialVNode,
  6994. container,
  6995. anchor,
  6996. parentSuspense,
  6997. isSVG,
  6998. optimized
  6999. );
  7000. {
  7001. popWarningContext();
  7002. endMeasure(instance, `mount`);
  7003. }
  7004. };
  7005. const updateComponent = (n1, n2, optimized) => {
  7006. const instance = n2.component = n1.component;
  7007. if (shouldUpdateComponent(n1, n2, optimized)) {
  7008. if (instance.asyncDep && !instance.asyncResolved) {
  7009. {
  7010. pushWarningContext(n2);
  7011. }
  7012. updateComponentPreRender(instance, n2, optimized);
  7013. {
  7014. popWarningContext();
  7015. }
  7016. return;
  7017. } else {
  7018. instance.next = n2;
  7019. invalidateJob(instance.update);
  7020. instance.update();
  7021. }
  7022. } else {
  7023. n2.el = n1.el;
  7024. instance.vnode = n2;
  7025. }
  7026. };
  7027. const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized) => {
  7028. const componentUpdateFn = () => {
  7029. if (!instance.isMounted) {
  7030. let vnodeHook;
  7031. const { el, props } = initialVNode;
  7032. const { bm, m, parent } = instance;
  7033. const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
  7034. toggleRecurse(instance, false);
  7035. if (bm) {
  7036. invokeArrayFns(bm);
  7037. }
  7038. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
  7039. invokeVNodeHook(vnodeHook, parent, initialVNode);
  7040. }
  7041. toggleRecurse(instance, true);
  7042. if (el && hydrateNode) {
  7043. const hydrateSubTree = () => {
  7044. {
  7045. startMeasure(instance, `render`);
  7046. }
  7047. instance.subTree = renderComponentRoot(instance);
  7048. {
  7049. endMeasure(instance, `render`);
  7050. }
  7051. {
  7052. startMeasure(instance, `hydrate`);
  7053. }
  7054. hydrateNode(
  7055. el,
  7056. instance.subTree,
  7057. instance,
  7058. parentSuspense,
  7059. null
  7060. );
  7061. {
  7062. endMeasure(instance, `hydrate`);
  7063. }
  7064. };
  7065. if (isAsyncWrapperVNode) {
  7066. initialVNode.type.__asyncLoader().then(
  7067. // note: we are moving the render call into an async callback,
  7068. // which means it won't track dependencies - but it's ok because
  7069. // a server-rendered async wrapper is already in resolved state
  7070. // and it will never need to change.
  7071. () => !instance.isUnmounted && hydrateSubTree()
  7072. );
  7073. } else {
  7074. hydrateSubTree();
  7075. }
  7076. } else {
  7077. {
  7078. startMeasure(instance, `render`);
  7079. }
  7080. const subTree = instance.subTree = renderComponentRoot(instance);
  7081. {
  7082. endMeasure(instance, `render`);
  7083. }
  7084. {
  7085. startMeasure(instance, `patch`);
  7086. }
  7087. patch(
  7088. null,
  7089. subTree,
  7090. container,
  7091. anchor,
  7092. instance,
  7093. parentSuspense,
  7094. isSVG
  7095. );
  7096. {
  7097. endMeasure(instance, `patch`);
  7098. }
  7099. initialVNode.el = subTree.el;
  7100. }
  7101. if (m) {
  7102. queuePostRenderEffect(m, parentSuspense);
  7103. }
  7104. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
  7105. const scopedInitialVNode = initialVNode;
  7106. queuePostRenderEffect(
  7107. () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
  7108. parentSuspense
  7109. );
  7110. }
  7111. if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
  7112. instance.a && queuePostRenderEffect(instance.a, parentSuspense);
  7113. }
  7114. instance.isMounted = true;
  7115. {
  7116. devtoolsComponentAdded(instance);
  7117. }
  7118. initialVNode = container = anchor = null;
  7119. } else {
  7120. let { next, bu, u, parent, vnode } = instance;
  7121. let originNext = next;
  7122. let vnodeHook;
  7123. {
  7124. pushWarningContext(next || instance.vnode);
  7125. }
  7126. toggleRecurse(instance, false);
  7127. if (next) {
  7128. next.el = vnode.el;
  7129. updateComponentPreRender(instance, next, optimized);
  7130. } else {
  7131. next = vnode;
  7132. }
  7133. if (bu) {
  7134. invokeArrayFns(bu);
  7135. }
  7136. if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
  7137. invokeVNodeHook(vnodeHook, parent, next, vnode);
  7138. }
  7139. toggleRecurse(instance, true);
  7140. {
  7141. startMeasure(instance, `render`);
  7142. }
  7143. const nextTree = renderComponentRoot(instance);
  7144. {
  7145. endMeasure(instance, `render`);
  7146. }
  7147. const prevTree = instance.subTree;
  7148. instance.subTree = nextTree;
  7149. {
  7150. startMeasure(instance, `patch`);
  7151. }
  7152. patch(
  7153. prevTree,
  7154. nextTree,
  7155. // parent may have changed if it's in a teleport
  7156. hostParentNode(prevTree.el),
  7157. // anchor may have changed if it's in a fragment
  7158. getNextHostNode(prevTree),
  7159. instance,
  7160. parentSuspense,
  7161. isSVG
  7162. );
  7163. {
  7164. endMeasure(instance, `patch`);
  7165. }
  7166. next.el = nextTree.el;
  7167. if (originNext === null) {
  7168. updateHOCHostEl(instance, nextTree.el);
  7169. }
  7170. if (u) {
  7171. queuePostRenderEffect(u, parentSuspense);
  7172. }
  7173. if (vnodeHook = next.props && next.props.onVnodeUpdated) {
  7174. queuePostRenderEffect(
  7175. () => invokeVNodeHook(vnodeHook, parent, next, vnode),
  7176. parentSuspense
  7177. );
  7178. }
  7179. {
  7180. devtoolsComponentUpdated(instance);
  7181. }
  7182. {
  7183. popWarningContext();
  7184. }
  7185. }
  7186. };
  7187. const effect = instance.effect = new ReactiveEffect(
  7188. componentUpdateFn,
  7189. () => queueJob(update),
  7190. instance.scope
  7191. // track it in component's effect scope
  7192. );
  7193. const update = instance.update = () => effect.run();
  7194. update.id = instance.uid;
  7195. toggleRecurse(instance, true);
  7196. {
  7197. effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
  7198. effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
  7199. update.ownerInstance = instance;
  7200. }
  7201. update();
  7202. };
  7203. const updateComponentPreRender = (instance, nextVNode, optimized) => {
  7204. nextVNode.component = instance;
  7205. const prevProps = instance.vnode.props;
  7206. instance.vnode = nextVNode;
  7207. instance.next = null;
  7208. updateProps(instance, nextVNode.props, prevProps, optimized);
  7209. updateSlots(instance, nextVNode.children, optimized);
  7210. pauseTracking();
  7211. flushPreFlushCbs(instance);
  7212. resetTracking();
  7213. };
  7214. const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {
  7215. const c1 = n1 && n1.children;
  7216. const prevShapeFlag = n1 ? n1.shapeFlag : 0;
  7217. const c2 = n2.children;
  7218. const { patchFlag, shapeFlag } = n2;
  7219. if (patchFlag > 0) {
  7220. if (patchFlag & 128) {
  7221. patchKeyedChildren(
  7222. c1,
  7223. c2,
  7224. container,
  7225. anchor,
  7226. parentComponent,
  7227. parentSuspense,
  7228. isSVG,
  7229. slotScopeIds,
  7230. optimized
  7231. );
  7232. return;
  7233. } else if (patchFlag & 256) {
  7234. patchUnkeyedChildren(
  7235. c1,
  7236. c2,
  7237. container,
  7238. anchor,
  7239. parentComponent,
  7240. parentSuspense,
  7241. isSVG,
  7242. slotScopeIds,
  7243. optimized
  7244. );
  7245. return;
  7246. }
  7247. }
  7248. if (shapeFlag & 8) {
  7249. if (prevShapeFlag & 16) {
  7250. unmountChildren(c1, parentComponent, parentSuspense);
  7251. }
  7252. if (c2 !== c1) {
  7253. hostSetElementText(container, c2);
  7254. }
  7255. } else {
  7256. if (prevShapeFlag & 16) {
  7257. if (shapeFlag & 16) {
  7258. patchKeyedChildren(
  7259. c1,
  7260. c2,
  7261. container,
  7262. anchor,
  7263. parentComponent,
  7264. parentSuspense,
  7265. isSVG,
  7266. slotScopeIds,
  7267. optimized
  7268. );
  7269. } else {
  7270. unmountChildren(c1, parentComponent, parentSuspense, true);
  7271. }
  7272. } else {
  7273. if (prevShapeFlag & 8) {
  7274. hostSetElementText(container, "");
  7275. }
  7276. if (shapeFlag & 16) {
  7277. mountChildren(
  7278. c2,
  7279. container,
  7280. anchor,
  7281. parentComponent,
  7282. parentSuspense,
  7283. isSVG,
  7284. slotScopeIds,
  7285. optimized
  7286. );
  7287. }
  7288. }
  7289. }
  7290. };
  7291. const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
  7292. c1 = c1 || EMPTY_ARR;
  7293. c2 = c2 || EMPTY_ARR;
  7294. const oldLength = c1.length;
  7295. const newLength = c2.length;
  7296. const commonLength = Math.min(oldLength, newLength);
  7297. let i;
  7298. for (i = 0; i < commonLength; i++) {
  7299. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  7300. patch(
  7301. c1[i],
  7302. nextChild,
  7303. container,
  7304. null,
  7305. parentComponent,
  7306. parentSuspense,
  7307. isSVG,
  7308. slotScopeIds,
  7309. optimized
  7310. );
  7311. }
  7312. if (oldLength > newLength) {
  7313. unmountChildren(
  7314. c1,
  7315. parentComponent,
  7316. parentSuspense,
  7317. true,
  7318. false,
  7319. commonLength
  7320. );
  7321. } else {
  7322. mountChildren(
  7323. c2,
  7324. container,
  7325. anchor,
  7326. parentComponent,
  7327. parentSuspense,
  7328. isSVG,
  7329. slotScopeIds,
  7330. optimized,
  7331. commonLength
  7332. );
  7333. }
  7334. };
  7335. const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
  7336. let i = 0;
  7337. const l2 = c2.length;
  7338. let e1 = c1.length - 1;
  7339. let e2 = l2 - 1;
  7340. while (i <= e1 && i <= e2) {
  7341. const n1 = c1[i];
  7342. const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  7343. if (isSameVNodeType(n1, n2)) {
  7344. patch(
  7345. n1,
  7346. n2,
  7347. container,
  7348. null,
  7349. parentComponent,
  7350. parentSuspense,
  7351. isSVG,
  7352. slotScopeIds,
  7353. optimized
  7354. );
  7355. } else {
  7356. break;
  7357. }
  7358. i++;
  7359. }
  7360. while (i <= e1 && i <= e2) {
  7361. const n1 = c1[e1];
  7362. const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
  7363. if (isSameVNodeType(n1, n2)) {
  7364. patch(
  7365. n1,
  7366. n2,
  7367. container,
  7368. null,
  7369. parentComponent,
  7370. parentSuspense,
  7371. isSVG,
  7372. slotScopeIds,
  7373. optimized
  7374. );
  7375. } else {
  7376. break;
  7377. }
  7378. e1--;
  7379. e2--;
  7380. }
  7381. if (i > e1) {
  7382. if (i <= e2) {
  7383. const nextPos = e2 + 1;
  7384. const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
  7385. while (i <= e2) {
  7386. patch(
  7387. null,
  7388. c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
  7389. container,
  7390. anchor,
  7391. parentComponent,
  7392. parentSuspense,
  7393. isSVG,
  7394. slotScopeIds,
  7395. optimized
  7396. );
  7397. i++;
  7398. }
  7399. }
  7400. } else if (i > e2) {
  7401. while (i <= e1) {
  7402. unmount(c1[i], parentComponent, parentSuspense, true);
  7403. i++;
  7404. }
  7405. } else {
  7406. const s1 = i;
  7407. const s2 = i;
  7408. const keyToNewIndexMap = /* @__PURE__ */ new Map();
  7409. for (i = s2; i <= e2; i++) {
  7410. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  7411. if (nextChild.key != null) {
  7412. if (keyToNewIndexMap.has(nextChild.key)) {
  7413. warn(
  7414. `Duplicate keys found during update:`,
  7415. JSON.stringify(nextChild.key),
  7416. `Make sure keys are unique.`
  7417. );
  7418. }
  7419. keyToNewIndexMap.set(nextChild.key, i);
  7420. }
  7421. }
  7422. let j;
  7423. let patched = 0;
  7424. const toBePatched = e2 - s2 + 1;
  7425. let moved = false;
  7426. let maxNewIndexSoFar = 0;
  7427. const newIndexToOldIndexMap = new Array(toBePatched);
  7428. for (i = 0; i < toBePatched; i++)
  7429. newIndexToOldIndexMap[i] = 0;
  7430. for (i = s1; i <= e1; i++) {
  7431. const prevChild = c1[i];
  7432. if (patched >= toBePatched) {
  7433. unmount(prevChild, parentComponent, parentSuspense, true);
  7434. continue;
  7435. }
  7436. let newIndex;
  7437. if (prevChild.key != null) {
  7438. newIndex = keyToNewIndexMap.get(prevChild.key);
  7439. } else {
  7440. for (j = s2; j <= e2; j++) {
  7441. if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
  7442. newIndex = j;
  7443. break;
  7444. }
  7445. }
  7446. }
  7447. if (newIndex === void 0) {
  7448. unmount(prevChild, parentComponent, parentSuspense, true);
  7449. } else {
  7450. newIndexToOldIndexMap[newIndex - s2] = i + 1;
  7451. if (newIndex >= maxNewIndexSoFar) {
  7452. maxNewIndexSoFar = newIndex;
  7453. } else {
  7454. moved = true;
  7455. }
  7456. patch(
  7457. prevChild,
  7458. c2[newIndex],
  7459. container,
  7460. null,
  7461. parentComponent,
  7462. parentSuspense,
  7463. isSVG,
  7464. slotScopeIds,
  7465. optimized
  7466. );
  7467. patched++;
  7468. }
  7469. }
  7470. const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
  7471. j = increasingNewIndexSequence.length - 1;
  7472. for (i = toBePatched - 1; i >= 0; i--) {
  7473. const nextIndex = s2 + i;
  7474. const nextChild = c2[nextIndex];
  7475. const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
  7476. if (newIndexToOldIndexMap[i] === 0) {
  7477. patch(
  7478. null,
  7479. nextChild,
  7480. container,
  7481. anchor,
  7482. parentComponent,
  7483. parentSuspense,
  7484. isSVG,
  7485. slotScopeIds,
  7486. optimized
  7487. );
  7488. } else if (moved) {
  7489. if (j < 0 || i !== increasingNewIndexSequence[j]) {
  7490. move(nextChild, container, anchor, 2);
  7491. } else {
  7492. j--;
  7493. }
  7494. }
  7495. }
  7496. }
  7497. };
  7498. const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
  7499. const { el, type, transition, children, shapeFlag } = vnode;
  7500. if (shapeFlag & 6) {
  7501. move(vnode.component.subTree, container, anchor, moveType);
  7502. return;
  7503. }
  7504. if (shapeFlag & 128) {
  7505. vnode.suspense.move(container, anchor, moveType);
  7506. return;
  7507. }
  7508. if (shapeFlag & 64) {
  7509. type.move(vnode, container, anchor, internals);
  7510. return;
  7511. }
  7512. if (type === Fragment) {
  7513. hostInsert(el, container, anchor);
  7514. for (let i = 0; i < children.length; i++) {
  7515. move(children[i], container, anchor, moveType);
  7516. }
  7517. hostInsert(vnode.anchor, container, anchor);
  7518. return;
  7519. }
  7520. if (type === Static) {
  7521. moveStaticNode(vnode, container, anchor);
  7522. return;
  7523. }
  7524. const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
  7525. if (needTransition2) {
  7526. if (moveType === 0) {
  7527. transition.beforeEnter(el);
  7528. hostInsert(el, container, anchor);
  7529. queuePostRenderEffect(() => transition.enter(el), parentSuspense);
  7530. } else {
  7531. const { leave, delayLeave, afterLeave } = transition;
  7532. const remove2 = () => hostInsert(el, container, anchor);
  7533. const performLeave = () => {
  7534. leave(el, () => {
  7535. remove2();
  7536. afterLeave && afterLeave();
  7537. });
  7538. };
  7539. if (delayLeave) {
  7540. delayLeave(el, remove2, performLeave);
  7541. } else {
  7542. performLeave();
  7543. }
  7544. }
  7545. } else {
  7546. hostInsert(el, container, anchor);
  7547. }
  7548. };
  7549. const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
  7550. const {
  7551. type,
  7552. props,
  7553. ref,
  7554. children,
  7555. dynamicChildren,
  7556. shapeFlag,
  7557. patchFlag,
  7558. dirs
  7559. } = vnode;
  7560. if (ref != null) {
  7561. setRef(ref, null, parentSuspense, vnode, true);
  7562. }
  7563. if (shapeFlag & 256) {
  7564. parentComponent.ctx.deactivate(vnode);
  7565. return;
  7566. }
  7567. const shouldInvokeDirs = shapeFlag & 1 && dirs;
  7568. const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
  7569. let vnodeHook;
  7570. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
  7571. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  7572. }
  7573. if (shapeFlag & 6) {
  7574. unmountComponent(vnode.component, parentSuspense, doRemove);
  7575. } else {
  7576. if (shapeFlag & 128) {
  7577. vnode.suspense.unmount(parentSuspense, doRemove);
  7578. return;
  7579. }
  7580. if (shouldInvokeDirs) {
  7581. invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
  7582. }
  7583. if (shapeFlag & 64) {
  7584. vnode.type.remove(
  7585. vnode,
  7586. parentComponent,
  7587. parentSuspense,
  7588. optimized,
  7589. internals,
  7590. doRemove
  7591. );
  7592. } else if (dynamicChildren && // #1153: fast path should not be taken for non-stable (v-for) fragments
  7593. (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
  7594. unmountChildren(
  7595. dynamicChildren,
  7596. parentComponent,
  7597. parentSuspense,
  7598. false,
  7599. true
  7600. );
  7601. } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
  7602. unmountChildren(children, parentComponent, parentSuspense);
  7603. }
  7604. if (doRemove) {
  7605. remove(vnode);
  7606. }
  7607. }
  7608. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
  7609. queuePostRenderEffect(() => {
  7610. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  7611. shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
  7612. }, parentSuspense);
  7613. }
  7614. };
  7615. const remove = (vnode) => {
  7616. const { type, el, anchor, transition } = vnode;
  7617. if (type === Fragment) {
  7618. if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) {
  7619. vnode.children.forEach((child) => {
  7620. if (child.type === Comment) {
  7621. hostRemove(child.el);
  7622. } else {
  7623. remove(child);
  7624. }
  7625. });
  7626. } else {
  7627. removeFragment(el, anchor);
  7628. }
  7629. return;
  7630. }
  7631. if (type === Static) {
  7632. removeStaticNode(vnode);
  7633. return;
  7634. }
  7635. const performRemove = () => {
  7636. hostRemove(el);
  7637. if (transition && !transition.persisted && transition.afterLeave) {
  7638. transition.afterLeave();
  7639. }
  7640. };
  7641. if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
  7642. const { leave, delayLeave } = transition;
  7643. const performLeave = () => leave(el, performRemove);
  7644. if (delayLeave) {
  7645. delayLeave(vnode.el, performRemove, performLeave);
  7646. } else {
  7647. performLeave();
  7648. }
  7649. } else {
  7650. performRemove();
  7651. }
  7652. };
  7653. const removeFragment = (cur, end) => {
  7654. let next;
  7655. while (cur !== end) {
  7656. next = hostNextSibling(cur);
  7657. hostRemove(cur);
  7658. cur = next;
  7659. }
  7660. hostRemove(end);
  7661. };
  7662. const unmountComponent = (instance, parentSuspense, doRemove) => {
  7663. if (instance.type.__hmrId) {
  7664. unregisterHMR(instance);
  7665. }
  7666. const { bum, scope, update, subTree, um } = instance;
  7667. if (bum) {
  7668. invokeArrayFns(bum);
  7669. }
  7670. scope.stop();
  7671. if (update) {
  7672. update.active = false;
  7673. unmount(subTree, instance, parentSuspense, doRemove);
  7674. }
  7675. if (um) {
  7676. queuePostRenderEffect(um, parentSuspense);
  7677. }
  7678. queuePostRenderEffect(() => {
  7679. instance.isUnmounted = true;
  7680. }, parentSuspense);
  7681. if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
  7682. parentSuspense.deps--;
  7683. if (parentSuspense.deps === 0) {
  7684. parentSuspense.resolve();
  7685. }
  7686. }
  7687. {
  7688. devtoolsComponentRemoved(instance);
  7689. }
  7690. };
  7691. const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
  7692. for (let i = start; i < children.length; i++) {
  7693. unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
  7694. }
  7695. };
  7696. const getNextHostNode = (vnode) => {
  7697. if (vnode.shapeFlag & 6) {
  7698. return getNextHostNode(vnode.component.subTree);
  7699. }
  7700. if (vnode.shapeFlag & 128) {
  7701. return vnode.suspense.next();
  7702. }
  7703. return hostNextSibling(vnode.anchor || vnode.el);
  7704. };
  7705. const render = (vnode, container, isSVG) => {
  7706. if (vnode == null) {
  7707. if (container._vnode) {
  7708. unmount(container._vnode, null, null, true);
  7709. }
  7710. } else {
  7711. patch(container._vnode || null, vnode, container, null, null, null, isSVG);
  7712. }
  7713. flushPreFlushCbs();
  7714. flushPostFlushCbs();
  7715. container._vnode = vnode;
  7716. };
  7717. const internals = {
  7718. p: patch,
  7719. um: unmount,
  7720. m: move,
  7721. r: remove,
  7722. mt: mountComponent,
  7723. mc: mountChildren,
  7724. pc: patchChildren,
  7725. pbc: patchBlockChildren,
  7726. n: getNextHostNode,
  7727. o: options
  7728. };
  7729. let hydrate;
  7730. let hydrateNode;
  7731. if (createHydrationFns) {
  7732. [hydrate, hydrateNode] = createHydrationFns(
  7733. internals
  7734. );
  7735. }
  7736. return {
  7737. render,
  7738. hydrate,
  7739. createApp: createAppAPI(render, hydrate)
  7740. };
  7741. }
  7742. function toggleRecurse({ effect, update }, allowed) {
  7743. effect.allowRecurse = update.allowRecurse = allowed;
  7744. }
  7745. function needTransition(parentSuspense, transition) {
  7746. return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
  7747. }
  7748. function traverseStaticChildren(n1, n2, shallow = false) {
  7749. const ch1 = n1.children;
  7750. const ch2 = n2.children;
  7751. if (isArray(ch1) && isArray(ch2)) {
  7752. for (let i = 0; i < ch1.length; i++) {
  7753. const c1 = ch1[i];
  7754. let c2 = ch2[i];
  7755. if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
  7756. if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
  7757. c2 = ch2[i] = cloneIfMounted(ch2[i]);
  7758. c2.el = c1.el;
  7759. }
  7760. if (!shallow)
  7761. traverseStaticChildren(c1, c2);
  7762. }
  7763. if (c2.type === Text) {
  7764. c2.el = c1.el;
  7765. }
  7766. if (c2.type === Comment && !c2.el) {
  7767. c2.el = c1.el;
  7768. }
  7769. }
  7770. }
  7771. }
  7772. function getSequence(arr) {
  7773. const p = arr.slice();
  7774. const result = [0];
  7775. let i, j, u, v, c;
  7776. const len = arr.length;
  7777. for (i = 0; i < len; i++) {
  7778. const arrI = arr[i];
  7779. if (arrI !== 0) {
  7780. j = result[result.length - 1];
  7781. if (arr[j] < arrI) {
  7782. p[i] = j;
  7783. result.push(i);
  7784. continue;
  7785. }
  7786. u = 0;
  7787. v = result.length - 1;
  7788. while (u < v) {
  7789. c = u + v >> 1;
  7790. if (arr[result[c]] < arrI) {
  7791. u = c + 1;
  7792. } else {
  7793. v = c;
  7794. }
  7795. }
  7796. if (arrI < arr[result[u]]) {
  7797. if (u > 0) {
  7798. p[i] = result[u - 1];
  7799. }
  7800. result[u] = i;
  7801. }
  7802. }
  7803. }
  7804. u = result.length;
  7805. v = result[u - 1];
  7806. while (u-- > 0) {
  7807. result[u] = v;
  7808. v = p[v];
  7809. }
  7810. return result;
  7811. }
  7812. const isTeleport = (type) => type.__isTeleport;
  7813. const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
  7814. const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
  7815. const resolveTarget = (props, select) => {
  7816. const targetSelector = props && props.to;
  7817. if (isString(targetSelector)) {
  7818. if (!select) {
  7819. warn(
  7820. `Current renderer does not support string target for Teleports. (missing querySelector renderer option)`
  7821. );
  7822. return null;
  7823. } else {
  7824. const target = select(targetSelector);
  7825. if (!target) {
  7826. warn(
  7827. `Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`
  7828. );
  7829. }
  7830. return target;
  7831. }
  7832. } else {
  7833. if (!targetSelector && !isTeleportDisabled(props)) {
  7834. warn(`Invalid Teleport target: ${targetSelector}`);
  7835. }
  7836. return targetSelector;
  7837. }
  7838. };
  7839. const TeleportImpl = {
  7840. name: "Teleport",
  7841. __isTeleport: true,
  7842. process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {
  7843. const {
  7844. mc: mountChildren,
  7845. pc: patchChildren,
  7846. pbc: patchBlockChildren,
  7847. o: { insert, querySelector, createText, createComment }
  7848. } = internals;
  7849. const disabled = isTeleportDisabled(n2.props);
  7850. let { shapeFlag, children, dynamicChildren } = n2;
  7851. if (isHmrUpdating) {
  7852. optimized = false;
  7853. dynamicChildren = null;
  7854. }
  7855. if (n1 == null) {
  7856. const placeholder = n2.el = createComment("teleport start") ;
  7857. const mainAnchor = n2.anchor = createComment("teleport end") ;
  7858. insert(placeholder, container, anchor);
  7859. insert(mainAnchor, container, anchor);
  7860. const target = n2.target = resolveTarget(n2.props, querySelector);
  7861. const targetAnchor = n2.targetAnchor = createText("");
  7862. if (target) {
  7863. insert(targetAnchor, target);
  7864. isSVG = isSVG || isTargetSVG(target);
  7865. } else if (!disabled) {
  7866. warn("Invalid Teleport target on mount:", target, `(${typeof target})`);
  7867. }
  7868. const mount = (container2, anchor2) => {
  7869. if (shapeFlag & 16) {
  7870. mountChildren(
  7871. children,
  7872. container2,
  7873. anchor2,
  7874. parentComponent,
  7875. parentSuspense,
  7876. isSVG,
  7877. slotScopeIds,
  7878. optimized
  7879. );
  7880. }
  7881. };
  7882. if (disabled) {
  7883. mount(container, mainAnchor);
  7884. } else if (target) {
  7885. mount(target, targetAnchor);
  7886. }
  7887. } else {
  7888. n2.el = n1.el;
  7889. const mainAnchor = n2.anchor = n1.anchor;
  7890. const target = n2.target = n1.target;
  7891. const targetAnchor = n2.targetAnchor = n1.targetAnchor;
  7892. const wasDisabled = isTeleportDisabled(n1.props);
  7893. const currentContainer = wasDisabled ? container : target;
  7894. const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
  7895. isSVG = isSVG || isTargetSVG(target);
  7896. if (dynamicChildren) {
  7897. patchBlockChildren(
  7898. n1.dynamicChildren,
  7899. dynamicChildren,
  7900. currentContainer,
  7901. parentComponent,
  7902. parentSuspense,
  7903. isSVG,
  7904. slotScopeIds
  7905. );
  7906. traverseStaticChildren(n1, n2, true);
  7907. } else if (!optimized) {
  7908. patchChildren(
  7909. n1,
  7910. n2,
  7911. currentContainer,
  7912. currentAnchor,
  7913. parentComponent,
  7914. parentSuspense,
  7915. isSVG,
  7916. slotScopeIds,
  7917. false
  7918. );
  7919. }
  7920. if (disabled) {
  7921. if (!wasDisabled) {
  7922. moveTeleport(
  7923. n2,
  7924. container,
  7925. mainAnchor,
  7926. internals,
  7927. 1
  7928. );
  7929. } else {
  7930. if (n2.props && n1.props && n2.props.to !== n1.props.to) {
  7931. n2.props.to = n1.props.to;
  7932. }
  7933. }
  7934. } else {
  7935. if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
  7936. const nextTarget = n2.target = resolveTarget(
  7937. n2.props,
  7938. querySelector
  7939. );
  7940. if (nextTarget) {
  7941. moveTeleport(
  7942. n2,
  7943. nextTarget,
  7944. null,
  7945. internals,
  7946. 0
  7947. );
  7948. } else {
  7949. warn(
  7950. "Invalid Teleport target on update:",
  7951. target,
  7952. `(${typeof target})`
  7953. );
  7954. }
  7955. } else if (wasDisabled) {
  7956. moveTeleport(
  7957. n2,
  7958. target,
  7959. targetAnchor,
  7960. internals,
  7961. 1
  7962. );
  7963. }
  7964. }
  7965. }
  7966. updateCssVars(n2);
  7967. },
  7968. remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
  7969. const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
  7970. if (target) {
  7971. hostRemove(targetAnchor);
  7972. }
  7973. doRemove && hostRemove(anchor);
  7974. if (shapeFlag & 16) {
  7975. const shouldRemove = doRemove || !isTeleportDisabled(props);
  7976. for (let i = 0; i < children.length; i++) {
  7977. const child = children[i];
  7978. unmount(
  7979. child,
  7980. parentComponent,
  7981. parentSuspense,
  7982. shouldRemove,
  7983. !!child.dynamicChildren
  7984. );
  7985. }
  7986. }
  7987. },
  7988. move: moveTeleport,
  7989. hydrate: hydrateTeleport
  7990. };
  7991. function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
  7992. if (moveType === 0) {
  7993. insert(vnode.targetAnchor, container, parentAnchor);
  7994. }
  7995. const { el, anchor, shapeFlag, children, props } = vnode;
  7996. const isReorder = moveType === 2;
  7997. if (isReorder) {
  7998. insert(el, container, parentAnchor);
  7999. }
  8000. if (!isReorder || isTeleportDisabled(props)) {
  8001. if (shapeFlag & 16) {
  8002. for (let i = 0; i < children.length; i++) {
  8003. move(
  8004. children[i],
  8005. container,
  8006. parentAnchor,
  8007. 2
  8008. );
  8009. }
  8010. }
  8011. }
  8012. if (isReorder) {
  8013. insert(anchor, container, parentAnchor);
  8014. }
  8015. }
  8016. function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
  8017. o: { nextSibling, parentNode, querySelector }
  8018. }, hydrateChildren) {
  8019. const target = vnode.target = resolveTarget(
  8020. vnode.props,
  8021. querySelector
  8022. );
  8023. if (target) {
  8024. const targetNode = target._lpa || target.firstChild;
  8025. if (vnode.shapeFlag & 16) {
  8026. if (isTeleportDisabled(vnode.props)) {
  8027. vnode.anchor = hydrateChildren(
  8028. nextSibling(node),
  8029. vnode,
  8030. parentNode(node),
  8031. parentComponent,
  8032. parentSuspense,
  8033. slotScopeIds,
  8034. optimized
  8035. );
  8036. vnode.targetAnchor = targetNode;
  8037. } else {
  8038. vnode.anchor = nextSibling(node);
  8039. let targetAnchor = targetNode;
  8040. while (targetAnchor) {
  8041. targetAnchor = nextSibling(targetAnchor);
  8042. if (targetAnchor && targetAnchor.nodeType === 8 && targetAnchor.data === "teleport anchor") {
  8043. vnode.targetAnchor = targetAnchor;
  8044. target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
  8045. break;
  8046. }
  8047. }
  8048. hydrateChildren(
  8049. targetNode,
  8050. vnode,
  8051. target,
  8052. parentComponent,
  8053. parentSuspense,
  8054. slotScopeIds,
  8055. optimized
  8056. );
  8057. }
  8058. }
  8059. updateCssVars(vnode);
  8060. }
  8061. return vnode.anchor && nextSibling(vnode.anchor);
  8062. }
  8063. const Teleport = TeleportImpl;
  8064. function updateCssVars(vnode) {
  8065. const ctx = vnode.ctx;
  8066. if (ctx && ctx.ut) {
  8067. let node = vnode.children[0].el;
  8068. while (node && node !== vnode.targetAnchor) {
  8069. if (node.nodeType === 1)
  8070. node.setAttribute("data-v-owner", ctx.uid);
  8071. node = node.nextSibling;
  8072. }
  8073. ctx.ut();
  8074. }
  8075. }
  8076. const Fragment = Symbol.for("v-fgt");
  8077. const Text = Symbol.for("v-txt");
  8078. const Comment = Symbol.for("v-cmt");
  8079. const Static = Symbol.for("v-stc");
  8080. const blockStack = [];
  8081. let currentBlock = null;
  8082. function openBlock(disableTracking = false) {
  8083. blockStack.push(currentBlock = disableTracking ? null : []);
  8084. }
  8085. function closeBlock() {
  8086. blockStack.pop();
  8087. currentBlock = blockStack[blockStack.length - 1] || null;
  8088. }
  8089. let isBlockTreeEnabled = 1;
  8090. function setBlockTracking(value) {
  8091. isBlockTreeEnabled += value;
  8092. }
  8093. function setupBlock(vnode) {
  8094. vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
  8095. closeBlock();
  8096. if (isBlockTreeEnabled > 0 && currentBlock) {
  8097. currentBlock.push(vnode);
  8098. }
  8099. return vnode;
  8100. }
  8101. function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
  8102. return setupBlock(
  8103. createBaseVNode(
  8104. type,
  8105. props,
  8106. children,
  8107. patchFlag,
  8108. dynamicProps,
  8109. shapeFlag,
  8110. true
  8111. /* isBlock */
  8112. )
  8113. );
  8114. }
  8115. function createBlock(type, props, children, patchFlag, dynamicProps) {
  8116. return setupBlock(
  8117. createVNode(
  8118. type,
  8119. props,
  8120. children,
  8121. patchFlag,
  8122. dynamicProps,
  8123. true
  8124. /* isBlock: prevent a block from tracking itself */
  8125. )
  8126. );
  8127. }
  8128. function isVNode(value) {
  8129. return value ? value.__v_isVNode === true : false;
  8130. }
  8131. function isSameVNodeType(n1, n2) {
  8132. if (n2.shapeFlag & 6 && hmrDirtyComponents.has(n2.type)) {
  8133. n1.shapeFlag &= ~256;
  8134. n2.shapeFlag &= ~512;
  8135. return false;
  8136. }
  8137. return n1.type === n2.type && n1.key === n2.key;
  8138. }
  8139. let vnodeArgsTransformer;
  8140. function transformVNodeArgs(transformer) {
  8141. vnodeArgsTransformer = transformer;
  8142. }
  8143. const createVNodeWithArgsTransform = (...args) => {
  8144. return _createVNode(
  8145. ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args
  8146. );
  8147. };
  8148. const InternalObjectKey = `__vInternal`;
  8149. const normalizeKey = ({ key }) => key != null ? key : null;
  8150. const normalizeRef = ({
  8151. ref,
  8152. ref_key,
  8153. ref_for
  8154. }) => {
  8155. if (typeof ref === "number") {
  8156. ref = "" + ref;
  8157. }
  8158. return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
  8159. };
  8160. function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
  8161. const vnode = {
  8162. __v_isVNode: true,
  8163. __v_skip: true,
  8164. type,
  8165. props,
  8166. key: props && normalizeKey(props),
  8167. ref: props && normalizeRef(props),
  8168. scopeId: currentScopeId,
  8169. slotScopeIds: null,
  8170. children,
  8171. component: null,
  8172. suspense: null,
  8173. ssContent: null,
  8174. ssFallback: null,
  8175. dirs: null,
  8176. transition: null,
  8177. el: null,
  8178. anchor: null,
  8179. target: null,
  8180. targetAnchor: null,
  8181. staticCount: 0,
  8182. shapeFlag,
  8183. patchFlag,
  8184. dynamicProps,
  8185. dynamicChildren: null,
  8186. appContext: null,
  8187. ctx: currentRenderingInstance
  8188. };
  8189. if (needFullChildrenNormalization) {
  8190. normalizeChildren(vnode, children);
  8191. if (shapeFlag & 128) {
  8192. type.normalize(vnode);
  8193. }
  8194. } else if (children) {
  8195. vnode.shapeFlag |= isString(children) ? 8 : 16;
  8196. }
  8197. if (vnode.key !== vnode.key) {
  8198. warn(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
  8199. }
  8200. if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
  8201. !isBlockNode && // has current parent block
  8202. currentBlock && // presence of a patch flag indicates this node needs patching on updates.
  8203. // component nodes also should always be patched, because even if the
  8204. // component doesn't need to update, it needs to persist the instance on to
  8205. // the next vnode so that it can be properly unmounted later.
  8206. (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
  8207. // vnode should not be considered dynamic due to handler caching.
  8208. vnode.patchFlag !== 32) {
  8209. currentBlock.push(vnode);
  8210. }
  8211. return vnode;
  8212. }
  8213. const createVNode = createVNodeWithArgsTransform ;
  8214. function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
  8215. if (!type || type === NULL_DYNAMIC_COMPONENT) {
  8216. if (!type) {
  8217. warn(`Invalid vnode type when creating vnode: ${type}.`);
  8218. }
  8219. type = Comment;
  8220. }
  8221. if (isVNode(type)) {
  8222. const cloned = cloneVNode(
  8223. type,
  8224. props,
  8225. true
  8226. /* mergeRef: true */
  8227. );
  8228. if (children) {
  8229. normalizeChildren(cloned, children);
  8230. }
  8231. if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
  8232. if (cloned.shapeFlag & 6) {
  8233. currentBlock[currentBlock.indexOf(type)] = cloned;
  8234. } else {
  8235. currentBlock.push(cloned);
  8236. }
  8237. }
  8238. cloned.patchFlag |= -2;
  8239. return cloned;
  8240. }
  8241. if (isClassComponent(type)) {
  8242. type = type.__vccOpts;
  8243. }
  8244. if (props) {
  8245. props = guardReactiveProps(props);
  8246. let { class: klass, style } = props;
  8247. if (klass && !isString(klass)) {
  8248. props.class = normalizeClass(klass);
  8249. }
  8250. if (isObject(style)) {
  8251. if (isProxy(style) && !isArray(style)) {
  8252. style = extend({}, style);
  8253. }
  8254. props.style = normalizeStyle(style);
  8255. }
  8256. }
  8257. const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
  8258. if (shapeFlag & 4 && isProxy(type)) {
  8259. type = toRaw(type);
  8260. warn(
  8261. `Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`,
  8262. `
  8263. Component that was made reactive: `,
  8264. type
  8265. );
  8266. }
  8267. return createBaseVNode(
  8268. type,
  8269. props,
  8270. children,
  8271. patchFlag,
  8272. dynamicProps,
  8273. shapeFlag,
  8274. isBlockNode,
  8275. true
  8276. );
  8277. }
  8278. function guardReactiveProps(props) {
  8279. if (!props)
  8280. return null;
  8281. return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
  8282. }
  8283. function cloneVNode(vnode, extraProps, mergeRef = false) {
  8284. const { props, ref, patchFlag, children } = vnode;
  8285. const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
  8286. const cloned = {
  8287. __v_isVNode: true,
  8288. __v_skip: true,
  8289. type: vnode.type,
  8290. props: mergedProps,
  8291. key: mergedProps && normalizeKey(mergedProps),
  8292. ref: extraProps && extraProps.ref ? (
  8293. // #2078 in the case of <component :is="vnode" ref="extra"/>
  8294. // if the vnode itself already has a ref, cloneVNode will need to merge
  8295. // the refs so the single vnode can be set on multiple refs
  8296. mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps)
  8297. ) : ref,
  8298. scopeId: vnode.scopeId,
  8299. slotScopeIds: vnode.slotScopeIds,
  8300. children: patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children,
  8301. target: vnode.target,
  8302. targetAnchor: vnode.targetAnchor,
  8303. staticCount: vnode.staticCount,
  8304. shapeFlag: vnode.shapeFlag,
  8305. // if the vnode is cloned with extra props, we can no longer assume its
  8306. // existing patch flag to be reliable and need to add the FULL_PROPS flag.
  8307. // note: preserve flag for fragments since they use the flag for children
  8308. // fast paths only.
  8309. patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
  8310. dynamicProps: vnode.dynamicProps,
  8311. dynamicChildren: vnode.dynamicChildren,
  8312. appContext: vnode.appContext,
  8313. dirs: vnode.dirs,
  8314. transition: vnode.transition,
  8315. // These should technically only be non-null on mounted VNodes. However,
  8316. // they *should* be copied for kept-alive vnodes. So we just always copy
  8317. // them since them being non-null during a mount doesn't affect the logic as
  8318. // they will simply be overwritten.
  8319. component: vnode.component,
  8320. suspense: vnode.suspense,
  8321. ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
  8322. ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
  8323. el: vnode.el,
  8324. anchor: vnode.anchor,
  8325. ctx: vnode.ctx,
  8326. ce: vnode.ce
  8327. };
  8328. return cloned;
  8329. }
  8330. function deepCloneVNode(vnode) {
  8331. const cloned = cloneVNode(vnode);
  8332. if (isArray(vnode.children)) {
  8333. cloned.children = vnode.children.map(deepCloneVNode);
  8334. }
  8335. return cloned;
  8336. }
  8337. function createTextVNode(text = " ", flag = 0) {
  8338. return createVNode(Text, null, text, flag);
  8339. }
  8340. function createStaticVNode(content, numberOfNodes) {
  8341. const vnode = createVNode(Static, null, content);
  8342. vnode.staticCount = numberOfNodes;
  8343. return vnode;
  8344. }
  8345. function createCommentVNode(text = "", asBlock = false) {
  8346. return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
  8347. }
  8348. function normalizeVNode(child) {
  8349. if (child == null || typeof child === "boolean") {
  8350. return createVNode(Comment);
  8351. } else if (isArray(child)) {
  8352. return createVNode(
  8353. Fragment,
  8354. null,
  8355. // #3666, avoid reference pollution when reusing vnode
  8356. child.slice()
  8357. );
  8358. } else if (typeof child === "object") {
  8359. return cloneIfMounted(child);
  8360. } else {
  8361. return createVNode(Text, null, String(child));
  8362. }
  8363. }
  8364. function cloneIfMounted(child) {
  8365. return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
  8366. }
  8367. function normalizeChildren(vnode, children) {
  8368. let type = 0;
  8369. const { shapeFlag } = vnode;
  8370. if (children == null) {
  8371. children = null;
  8372. } else if (isArray(children)) {
  8373. type = 16;
  8374. } else if (typeof children === "object") {
  8375. if (shapeFlag & (1 | 64)) {
  8376. const slot = children.default;
  8377. if (slot) {
  8378. slot._c && (slot._d = false);
  8379. normalizeChildren(vnode, slot());
  8380. slot._c && (slot._d = true);
  8381. }
  8382. return;
  8383. } else {
  8384. type = 32;
  8385. const slotFlag = children._;
  8386. if (!slotFlag && !(InternalObjectKey in children)) {
  8387. children._ctx = currentRenderingInstance;
  8388. } else if (slotFlag === 3 && currentRenderingInstance) {
  8389. if (currentRenderingInstance.slots._ === 1) {
  8390. children._ = 1;
  8391. } else {
  8392. children._ = 2;
  8393. vnode.patchFlag |= 1024;
  8394. }
  8395. }
  8396. }
  8397. } else if (isFunction(children)) {
  8398. children = { default: children, _ctx: currentRenderingInstance };
  8399. type = 32;
  8400. } else {
  8401. children = String(children);
  8402. if (shapeFlag & 64) {
  8403. type = 16;
  8404. children = [createTextVNode(children)];
  8405. } else {
  8406. type = 8;
  8407. }
  8408. }
  8409. vnode.children = children;
  8410. vnode.shapeFlag |= type;
  8411. }
  8412. function mergeProps(...args) {
  8413. const ret = {};
  8414. for (let i = 0; i < args.length; i++) {
  8415. const toMerge = args[i];
  8416. for (const key in toMerge) {
  8417. if (key === "class") {
  8418. if (ret.class !== toMerge.class) {
  8419. ret.class = normalizeClass([ret.class, toMerge.class]);
  8420. }
  8421. } else if (key === "style") {
  8422. ret.style = normalizeStyle([ret.style, toMerge.style]);
  8423. } else if (isOn(key)) {
  8424. const existing = ret[key];
  8425. const incoming = toMerge[key];
  8426. if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
  8427. ret[key] = existing ? [].concat(existing, incoming) : incoming;
  8428. }
  8429. } else if (key !== "") {
  8430. ret[key] = toMerge[key];
  8431. }
  8432. }
  8433. }
  8434. return ret;
  8435. }
  8436. function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
  8437. callWithAsyncErrorHandling(hook, instance, 7, [
  8438. vnode,
  8439. prevVNode
  8440. ]);
  8441. }
  8442. const emptyAppContext = createAppContext();
  8443. let uid = 0;
  8444. function createComponentInstance(vnode, parent, suspense) {
  8445. const type = vnode.type;
  8446. const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  8447. const instance = {
  8448. uid: uid++,
  8449. vnode,
  8450. type,
  8451. parent,
  8452. appContext,
  8453. root: null,
  8454. // to be immediately set
  8455. next: null,
  8456. subTree: null,
  8457. // will be set synchronously right after creation
  8458. effect: null,
  8459. update: null,
  8460. // will be set synchronously right after creation
  8461. scope: new EffectScope(
  8462. true
  8463. /* detached */
  8464. ),
  8465. render: null,
  8466. proxy: null,
  8467. exposed: null,
  8468. exposeProxy: null,
  8469. withProxy: null,
  8470. provides: parent ? parent.provides : Object.create(appContext.provides),
  8471. accessCache: null,
  8472. renderCache: [],
  8473. // local resolved assets
  8474. components: null,
  8475. directives: null,
  8476. // resolved props and emits options
  8477. propsOptions: normalizePropsOptions(type, appContext),
  8478. emitsOptions: normalizeEmitsOptions(type, appContext),
  8479. // emit
  8480. emit: null,
  8481. // to be set immediately
  8482. emitted: null,
  8483. // props default value
  8484. propsDefaults: EMPTY_OBJ,
  8485. // inheritAttrs
  8486. inheritAttrs: type.inheritAttrs,
  8487. // state
  8488. ctx: EMPTY_OBJ,
  8489. data: EMPTY_OBJ,
  8490. props: EMPTY_OBJ,
  8491. attrs: EMPTY_OBJ,
  8492. slots: EMPTY_OBJ,
  8493. refs: EMPTY_OBJ,
  8494. setupState: EMPTY_OBJ,
  8495. setupContext: null,
  8496. attrsProxy: null,
  8497. slotsProxy: null,
  8498. // suspense related
  8499. suspense,
  8500. suspenseId: suspense ? suspense.pendingId : 0,
  8501. asyncDep: null,
  8502. asyncResolved: false,
  8503. // lifecycle hooks
  8504. // not using enums here because it results in computed properties
  8505. isMounted: false,
  8506. isUnmounted: false,
  8507. isDeactivated: false,
  8508. bc: null,
  8509. c: null,
  8510. bm: null,
  8511. m: null,
  8512. bu: null,
  8513. u: null,
  8514. um: null,
  8515. bum: null,
  8516. da: null,
  8517. a: null,
  8518. rtg: null,
  8519. rtc: null,
  8520. ec: null,
  8521. sp: null
  8522. };
  8523. {
  8524. instance.ctx = createDevRenderContext(instance);
  8525. }
  8526. instance.root = parent ? parent.root : instance;
  8527. instance.emit = emit.bind(null, instance);
  8528. if (vnode.ce) {
  8529. vnode.ce(instance);
  8530. }
  8531. return instance;
  8532. }
  8533. let currentInstance = null;
  8534. const getCurrentInstance = () => currentInstance || currentRenderingInstance;
  8535. let internalSetCurrentInstance;
  8536. {
  8537. internalSetCurrentInstance = (i) => {
  8538. currentInstance = i;
  8539. };
  8540. }
  8541. const setCurrentInstance = (instance) => {
  8542. internalSetCurrentInstance(instance);
  8543. instance.scope.on();
  8544. };
  8545. const unsetCurrentInstance = () => {
  8546. currentInstance && currentInstance.scope.off();
  8547. internalSetCurrentInstance(null);
  8548. };
  8549. const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
  8550. function validateComponentName(name, config) {
  8551. const appIsNativeTag = config.isNativeTag || NO;
  8552. if (isBuiltInTag(name) || appIsNativeTag(name)) {
  8553. warn(
  8554. "Do not use built-in or reserved HTML elements as component id: " + name
  8555. );
  8556. }
  8557. }
  8558. function isStatefulComponent(instance) {
  8559. return instance.vnode.shapeFlag & 4;
  8560. }
  8561. let isInSSRComponentSetup = false;
  8562. function setupComponent(instance, isSSR = false) {
  8563. isInSSRComponentSetup = isSSR;
  8564. const { props, children } = instance.vnode;
  8565. const isStateful = isStatefulComponent(instance);
  8566. initProps(instance, props, isStateful, isSSR);
  8567. initSlots(instance, children);
  8568. const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  8569. isInSSRComponentSetup = false;
  8570. return setupResult;
  8571. }
  8572. function setupStatefulComponent(instance, isSSR) {
  8573. var _a;
  8574. const Component = instance.type;
  8575. {
  8576. if (Component.name) {
  8577. validateComponentName(Component.name, instance.appContext.config);
  8578. }
  8579. if (Component.components) {
  8580. const names = Object.keys(Component.components);
  8581. for (let i = 0; i < names.length; i++) {
  8582. validateComponentName(names[i], instance.appContext.config);
  8583. }
  8584. }
  8585. if (Component.directives) {
  8586. const names = Object.keys(Component.directives);
  8587. for (let i = 0; i < names.length; i++) {
  8588. validateDirectiveName(names[i]);
  8589. }
  8590. }
  8591. if (Component.compilerOptions && isRuntimeOnly()) {
  8592. warn(
  8593. `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`
  8594. );
  8595. }
  8596. }
  8597. instance.accessCache = /* @__PURE__ */ Object.create(null);
  8598. instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));
  8599. {
  8600. exposePropsOnRenderContext(instance);
  8601. }
  8602. const { setup } = Component;
  8603. if (setup) {
  8604. const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
  8605. setCurrentInstance(instance);
  8606. pauseTracking();
  8607. const setupResult = callWithErrorHandling(
  8608. setup,
  8609. instance,
  8610. 0,
  8611. [shallowReadonly(instance.props) , setupContext]
  8612. );
  8613. resetTracking();
  8614. unsetCurrentInstance();
  8615. if (isPromise(setupResult)) {
  8616. setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
  8617. if (isSSR) {
  8618. return setupResult.then((resolvedResult) => {
  8619. handleSetupResult(instance, resolvedResult, isSSR);
  8620. }).catch((e) => {
  8621. handleError(e, instance, 0);
  8622. });
  8623. } else {
  8624. instance.asyncDep = setupResult;
  8625. if (!instance.suspense) {
  8626. const name = (_a = Component.name) != null ? _a : "Anonymous";
  8627. warn(
  8628. `Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`
  8629. );
  8630. }
  8631. }
  8632. } else {
  8633. handleSetupResult(instance, setupResult, isSSR);
  8634. }
  8635. } else {
  8636. finishComponentSetup(instance, isSSR);
  8637. }
  8638. }
  8639. function handleSetupResult(instance, setupResult, isSSR) {
  8640. if (isFunction(setupResult)) {
  8641. {
  8642. instance.render = setupResult;
  8643. }
  8644. } else if (isObject(setupResult)) {
  8645. if (isVNode(setupResult)) {
  8646. warn(
  8647. `setup() should not return VNodes directly - return a render function instead.`
  8648. );
  8649. }
  8650. {
  8651. instance.devtoolsRawSetupState = setupResult;
  8652. }
  8653. instance.setupState = proxyRefs(setupResult);
  8654. {
  8655. exposeSetupStateOnRenderContext(instance);
  8656. }
  8657. } else if (setupResult !== void 0) {
  8658. warn(
  8659. `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`
  8660. );
  8661. }
  8662. finishComponentSetup(instance, isSSR);
  8663. }
  8664. let compile$1;
  8665. let installWithProxy;
  8666. function registerRuntimeCompiler(_compile) {
  8667. compile$1 = _compile;
  8668. installWithProxy = (i) => {
  8669. if (i.render._rc) {
  8670. i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
  8671. }
  8672. };
  8673. }
  8674. const isRuntimeOnly = () => !compile$1;
  8675. function finishComponentSetup(instance, isSSR, skipOptions) {
  8676. const Component = instance.type;
  8677. if (!instance.render) {
  8678. if (!isSSR && compile$1 && !Component.render) {
  8679. const template = Component.template || resolveMergedOptions(instance).template;
  8680. if (template) {
  8681. {
  8682. startMeasure(instance, `compile`);
  8683. }
  8684. const { isCustomElement, compilerOptions } = instance.appContext.config;
  8685. const { delimiters, compilerOptions: componentCompilerOptions } = Component;
  8686. const finalCompilerOptions = extend(
  8687. extend(
  8688. {
  8689. isCustomElement,
  8690. delimiters
  8691. },
  8692. compilerOptions
  8693. ),
  8694. componentCompilerOptions
  8695. );
  8696. Component.render = compile$1(template, finalCompilerOptions);
  8697. {
  8698. endMeasure(instance, `compile`);
  8699. }
  8700. }
  8701. }
  8702. instance.render = Component.render || NOOP;
  8703. if (installWithProxy) {
  8704. installWithProxy(instance);
  8705. }
  8706. }
  8707. {
  8708. setCurrentInstance(instance);
  8709. pauseTracking();
  8710. try {
  8711. applyOptions(instance);
  8712. } finally {
  8713. resetTracking();
  8714. unsetCurrentInstance();
  8715. }
  8716. }
  8717. if (!Component.render && instance.render === NOOP && !isSSR) {
  8718. if (!compile$1 && Component.template) {
  8719. warn(
  8720. `Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Use "vue.global.js" instead.` )
  8721. /* should not happen */
  8722. );
  8723. } else {
  8724. warn(`Component is missing template or render function.`);
  8725. }
  8726. }
  8727. }
  8728. function getAttrsProxy(instance) {
  8729. return instance.attrsProxy || (instance.attrsProxy = new Proxy(
  8730. instance.attrs,
  8731. {
  8732. get(target, key) {
  8733. markAttrsAccessed();
  8734. track(instance, "get", "$attrs");
  8735. return target[key];
  8736. },
  8737. set() {
  8738. warn(`setupContext.attrs is readonly.`);
  8739. return false;
  8740. },
  8741. deleteProperty() {
  8742. warn(`setupContext.attrs is readonly.`);
  8743. return false;
  8744. }
  8745. }
  8746. ));
  8747. }
  8748. function getSlotsProxy(instance) {
  8749. return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, {
  8750. get(target, key) {
  8751. track(instance, "get", "$slots");
  8752. return target[key];
  8753. }
  8754. }));
  8755. }
  8756. function createSetupContext(instance) {
  8757. const expose = (exposed) => {
  8758. {
  8759. if (instance.exposed) {
  8760. warn(`expose() should be called only once per setup().`);
  8761. }
  8762. if (exposed != null) {
  8763. let exposedType = typeof exposed;
  8764. if (exposedType === "object") {
  8765. if (isArray(exposed)) {
  8766. exposedType = "array";
  8767. } else if (isRef(exposed)) {
  8768. exposedType = "ref";
  8769. }
  8770. }
  8771. if (exposedType !== "object") {
  8772. warn(
  8773. `expose() should be passed a plain object, received ${exposedType}.`
  8774. );
  8775. }
  8776. }
  8777. }
  8778. instance.exposed = exposed || {};
  8779. };
  8780. {
  8781. return Object.freeze({
  8782. get attrs() {
  8783. return getAttrsProxy(instance);
  8784. },
  8785. get slots() {
  8786. return getSlotsProxy(instance);
  8787. },
  8788. get emit() {
  8789. return (event, ...args) => instance.emit(event, ...args);
  8790. },
  8791. expose
  8792. });
  8793. }
  8794. }
  8795. function getExposeProxy(instance) {
  8796. if (instance.exposed) {
  8797. return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
  8798. get(target, key) {
  8799. if (key in target) {
  8800. return target[key];
  8801. } else if (key in publicPropertiesMap) {
  8802. return publicPropertiesMap[key](instance);
  8803. }
  8804. },
  8805. has(target, key) {
  8806. return key in target || key in publicPropertiesMap;
  8807. }
  8808. }));
  8809. }
  8810. }
  8811. const classifyRE = /(?:^|[-_])(\w)/g;
  8812. const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
  8813. function getComponentName(Component, includeInferred = true) {
  8814. return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
  8815. }
  8816. function formatComponentName(instance, Component, isRoot = false) {
  8817. let name = getComponentName(Component);
  8818. if (!name && Component.__file) {
  8819. const match = Component.__file.match(/([^/\\]+)\.\w+$/);
  8820. if (match) {
  8821. name = match[1];
  8822. }
  8823. }
  8824. if (!name && instance && instance.parent) {
  8825. const inferFromRegistry = (registry) => {
  8826. for (const key in registry) {
  8827. if (registry[key] === Component) {
  8828. return key;
  8829. }
  8830. }
  8831. };
  8832. name = inferFromRegistry(
  8833. instance.components || instance.parent.type.components
  8834. ) || inferFromRegistry(instance.appContext.components);
  8835. }
  8836. return name ? classify(name) : isRoot ? `App` : `Anonymous`;
  8837. }
  8838. function isClassComponent(value) {
  8839. return isFunction(value) && "__vccOpts" in value;
  8840. }
  8841. const computed = (getterOrOptions, debugOptions) => {
  8842. return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
  8843. };
  8844. function h(type, propsOrChildren, children) {
  8845. const l = arguments.length;
  8846. if (l === 2) {
  8847. if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
  8848. if (isVNode(propsOrChildren)) {
  8849. return createVNode(type, null, [propsOrChildren]);
  8850. }
  8851. return createVNode(type, propsOrChildren);
  8852. } else {
  8853. return createVNode(type, null, propsOrChildren);
  8854. }
  8855. } else {
  8856. if (l > 3) {
  8857. children = Array.prototype.slice.call(arguments, 2);
  8858. } else if (l === 3 && isVNode(children)) {
  8859. children = [children];
  8860. }
  8861. return createVNode(type, propsOrChildren, children);
  8862. }
  8863. }
  8864. const ssrContextKey = Symbol.for("v-scx");
  8865. const useSSRContext = () => {
  8866. {
  8867. warn(`useSSRContext() is not supported in the global build.`);
  8868. }
  8869. };
  8870. function initCustomFormatter() {
  8871. if (typeof window === "undefined") {
  8872. return;
  8873. }
  8874. const vueStyle = { style: "color:#3ba776" };
  8875. const numberStyle = { style: "color:#1677ff" };
  8876. const stringStyle = { style: "color:#f5222d" };
  8877. const keywordStyle = { style: "color:#eb2f96" };
  8878. const formatter = {
  8879. header(obj) {
  8880. if (!isObject(obj)) {
  8881. return null;
  8882. }
  8883. if (obj.__isVue) {
  8884. return ["div", vueStyle, `VueInstance`];
  8885. } else if (isRef(obj)) {
  8886. return [
  8887. "div",
  8888. {},
  8889. ["span", vueStyle, genRefFlag(obj)],
  8890. "<",
  8891. formatValue(obj.value),
  8892. `>`
  8893. ];
  8894. } else if (isReactive(obj)) {
  8895. return [
  8896. "div",
  8897. {},
  8898. ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"],
  8899. "<",
  8900. formatValue(obj),
  8901. `>${isReadonly(obj) ? ` (readonly)` : ``}`
  8902. ];
  8903. } else if (isReadonly(obj)) {
  8904. return [
  8905. "div",
  8906. {},
  8907. ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"],
  8908. "<",
  8909. formatValue(obj),
  8910. ">"
  8911. ];
  8912. }
  8913. return null;
  8914. },
  8915. hasBody(obj) {
  8916. return obj && obj.__isVue;
  8917. },
  8918. body(obj) {
  8919. if (obj && obj.__isVue) {
  8920. return [
  8921. "div",
  8922. {},
  8923. ...formatInstance(obj.$)
  8924. ];
  8925. }
  8926. }
  8927. };
  8928. function formatInstance(instance) {
  8929. const blocks = [];
  8930. if (instance.type.props && instance.props) {
  8931. blocks.push(createInstanceBlock("props", toRaw(instance.props)));
  8932. }
  8933. if (instance.setupState !== EMPTY_OBJ) {
  8934. blocks.push(createInstanceBlock("setup", instance.setupState));
  8935. }
  8936. if (instance.data !== EMPTY_OBJ) {
  8937. blocks.push(createInstanceBlock("data", toRaw(instance.data)));
  8938. }
  8939. const computed = extractKeys(instance, "computed");
  8940. if (computed) {
  8941. blocks.push(createInstanceBlock("computed", computed));
  8942. }
  8943. const injected = extractKeys(instance, "inject");
  8944. if (injected) {
  8945. blocks.push(createInstanceBlock("injected", injected));
  8946. }
  8947. blocks.push([
  8948. "div",
  8949. {},
  8950. [
  8951. "span",
  8952. {
  8953. style: keywordStyle.style + ";opacity:0.66"
  8954. },
  8955. "$ (internal): "
  8956. ],
  8957. ["object", { object: instance }]
  8958. ]);
  8959. return blocks;
  8960. }
  8961. function createInstanceBlock(type, target) {
  8962. target = extend({}, target);
  8963. if (!Object.keys(target).length) {
  8964. return ["span", {}];
  8965. }
  8966. return [
  8967. "div",
  8968. { style: "line-height:1.25em;margin-bottom:0.6em" },
  8969. [
  8970. "div",
  8971. {
  8972. style: "color:#476582"
  8973. },
  8974. type
  8975. ],
  8976. [
  8977. "div",
  8978. {
  8979. style: "padding-left:1.25em"
  8980. },
  8981. ...Object.keys(target).map((key) => {
  8982. return [
  8983. "div",
  8984. {},
  8985. ["span", keywordStyle, key + ": "],
  8986. formatValue(target[key], false)
  8987. ];
  8988. })
  8989. ]
  8990. ];
  8991. }
  8992. function formatValue(v, asRaw = true) {
  8993. if (typeof v === "number") {
  8994. return ["span", numberStyle, v];
  8995. } else if (typeof v === "string") {
  8996. return ["span", stringStyle, JSON.stringify(v)];
  8997. } else if (typeof v === "boolean") {
  8998. return ["span", keywordStyle, v];
  8999. } else if (isObject(v)) {
  9000. return ["object", { object: asRaw ? toRaw(v) : v }];
  9001. } else {
  9002. return ["span", stringStyle, String(v)];
  9003. }
  9004. }
  9005. function extractKeys(instance, type) {
  9006. const Comp = instance.type;
  9007. if (isFunction(Comp)) {
  9008. return;
  9009. }
  9010. const extracted = {};
  9011. for (const key in instance.ctx) {
  9012. if (isKeyOfType(Comp, key, type)) {
  9013. extracted[key] = instance.ctx[key];
  9014. }
  9015. }
  9016. return extracted;
  9017. }
  9018. function isKeyOfType(Comp, key, type) {
  9019. const opts = Comp[type];
  9020. if (isArray(opts) && opts.includes(key) || isObject(opts) && key in opts) {
  9021. return true;
  9022. }
  9023. if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {
  9024. return true;
  9025. }
  9026. if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) {
  9027. return true;
  9028. }
  9029. }
  9030. function genRefFlag(v) {
  9031. if (isShallow(v)) {
  9032. return `ShallowRef`;
  9033. }
  9034. if (v.effect) {
  9035. return `ComputedRef`;
  9036. }
  9037. return `Ref`;
  9038. }
  9039. if (window.devtoolsFormatters) {
  9040. window.devtoolsFormatters.push(formatter);
  9041. } else {
  9042. window.devtoolsFormatters = [formatter];
  9043. }
  9044. }
  9045. function withMemo(memo, render, cache, index) {
  9046. const cached = cache[index];
  9047. if (cached && isMemoSame(cached, memo)) {
  9048. return cached;
  9049. }
  9050. const ret = render();
  9051. ret.memo = memo.slice();
  9052. return cache[index] = ret;
  9053. }
  9054. function isMemoSame(cached, memo) {
  9055. const prev = cached.memo;
  9056. if (prev.length != memo.length) {
  9057. return false;
  9058. }
  9059. for (let i = 0; i < prev.length; i++) {
  9060. if (hasChanged(prev[i], memo[i])) {
  9061. return false;
  9062. }
  9063. }
  9064. if (isBlockTreeEnabled > 0 && currentBlock) {
  9065. currentBlock.push(cached);
  9066. }
  9067. return true;
  9068. }
  9069. const version = "3.3.11";
  9070. const ssrUtils = null;
  9071. const resolveFilter = null;
  9072. const compatUtils = null;
  9073. const svgNS = "http://www.w3.org/2000/svg";
  9074. const doc = typeof document !== "undefined" ? document : null;
  9075. const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
  9076. const nodeOps = {
  9077. insert: (child, parent, anchor) => {
  9078. parent.insertBefore(child, anchor || null);
  9079. },
  9080. remove: (child) => {
  9081. const parent = child.parentNode;
  9082. if (parent) {
  9083. parent.removeChild(child);
  9084. }
  9085. },
  9086. createElement: (tag, isSVG, is, props) => {
  9087. const el = isSVG ? doc.createElementNS(svgNS, tag) : doc.createElement(tag, is ? { is } : void 0);
  9088. if (tag === "select" && props && props.multiple != null) {
  9089. el.setAttribute("multiple", props.multiple);
  9090. }
  9091. return el;
  9092. },
  9093. createText: (text) => doc.createTextNode(text),
  9094. createComment: (text) => doc.createComment(text),
  9095. setText: (node, text) => {
  9096. node.nodeValue = text;
  9097. },
  9098. setElementText: (el, text) => {
  9099. el.textContent = text;
  9100. },
  9101. parentNode: (node) => node.parentNode,
  9102. nextSibling: (node) => node.nextSibling,
  9103. querySelector: (selector) => doc.querySelector(selector),
  9104. setScopeId(el, id) {
  9105. el.setAttribute(id, "");
  9106. },
  9107. // __UNSAFE__
  9108. // Reason: innerHTML.
  9109. // Static content here can only come from compiled templates.
  9110. // As long as the user only uses trusted templates, this is safe.
  9111. insertStaticContent(content, parent, anchor, isSVG, start, end) {
  9112. const before = anchor ? anchor.previousSibling : parent.lastChild;
  9113. if (start && (start === end || start.nextSibling)) {
  9114. while (true) {
  9115. parent.insertBefore(start.cloneNode(true), anchor);
  9116. if (start === end || !(start = start.nextSibling))
  9117. break;
  9118. }
  9119. } else {
  9120. templateContainer.innerHTML = isSVG ? `<svg>${content}</svg>` : content;
  9121. const template = templateContainer.content;
  9122. if (isSVG) {
  9123. const wrapper = template.firstChild;
  9124. while (wrapper.firstChild) {
  9125. template.appendChild(wrapper.firstChild);
  9126. }
  9127. template.removeChild(wrapper);
  9128. }
  9129. parent.insertBefore(template, anchor);
  9130. }
  9131. return [
  9132. // first
  9133. before ? before.nextSibling : parent.firstChild,
  9134. // last
  9135. anchor ? anchor.previousSibling : parent.lastChild
  9136. ];
  9137. }
  9138. };
  9139. const TRANSITION = "transition";
  9140. const ANIMATION = "animation";
  9141. const vtcKey = Symbol("_vtc");
  9142. const Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);
  9143. Transition.displayName = "Transition";
  9144. const DOMTransitionPropsValidators = {
  9145. name: String,
  9146. type: String,
  9147. css: {
  9148. type: Boolean,
  9149. default: true
  9150. },
  9151. duration: [String, Number, Object],
  9152. enterFromClass: String,
  9153. enterActiveClass: String,
  9154. enterToClass: String,
  9155. appearFromClass: String,
  9156. appearActiveClass: String,
  9157. appearToClass: String,
  9158. leaveFromClass: String,
  9159. leaveActiveClass: String,
  9160. leaveToClass: String
  9161. };
  9162. const TransitionPropsValidators = Transition.props = /* @__PURE__ */ extend(
  9163. {},
  9164. BaseTransitionPropsValidators,
  9165. DOMTransitionPropsValidators
  9166. );
  9167. const callHook = (hook, args = []) => {
  9168. if (isArray(hook)) {
  9169. hook.forEach((h2) => h2(...args));
  9170. } else if (hook) {
  9171. hook(...args);
  9172. }
  9173. };
  9174. const hasExplicitCallback = (hook) => {
  9175. return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
  9176. };
  9177. function resolveTransitionProps(rawProps) {
  9178. const baseProps = {};
  9179. for (const key in rawProps) {
  9180. if (!(key in DOMTransitionPropsValidators)) {
  9181. baseProps[key] = rawProps[key];
  9182. }
  9183. }
  9184. if (rawProps.css === false) {
  9185. return baseProps;
  9186. }
  9187. const {
  9188. name = "v",
  9189. type,
  9190. duration,
  9191. enterFromClass = `${name}-enter-from`,
  9192. enterActiveClass = `${name}-enter-active`,
  9193. enterToClass = `${name}-enter-to`,
  9194. appearFromClass = enterFromClass,
  9195. appearActiveClass = enterActiveClass,
  9196. appearToClass = enterToClass,
  9197. leaveFromClass = `${name}-leave-from`,
  9198. leaveActiveClass = `${name}-leave-active`,
  9199. leaveToClass = `${name}-leave-to`
  9200. } = rawProps;
  9201. const durations = normalizeDuration(duration);
  9202. const enterDuration = durations && durations[0];
  9203. const leaveDuration = durations && durations[1];
  9204. const {
  9205. onBeforeEnter,
  9206. onEnter,
  9207. onEnterCancelled,
  9208. onLeave,
  9209. onLeaveCancelled,
  9210. onBeforeAppear = onBeforeEnter,
  9211. onAppear = onEnter,
  9212. onAppearCancelled = onEnterCancelled
  9213. } = baseProps;
  9214. const finishEnter = (el, isAppear, done) => {
  9215. removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
  9216. removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
  9217. done && done();
  9218. };
  9219. const finishLeave = (el, done) => {
  9220. el._isLeaving = false;
  9221. removeTransitionClass(el, leaveFromClass);
  9222. removeTransitionClass(el, leaveToClass);
  9223. removeTransitionClass(el, leaveActiveClass);
  9224. done && done();
  9225. };
  9226. const makeEnterHook = (isAppear) => {
  9227. return (el, done) => {
  9228. const hook = isAppear ? onAppear : onEnter;
  9229. const resolve = () => finishEnter(el, isAppear, done);
  9230. callHook(hook, [el, resolve]);
  9231. nextFrame(() => {
  9232. removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
  9233. addTransitionClass(el, isAppear ? appearToClass : enterToClass);
  9234. if (!hasExplicitCallback(hook)) {
  9235. whenTransitionEnds(el, type, enterDuration, resolve);
  9236. }
  9237. });
  9238. };
  9239. };
  9240. return extend(baseProps, {
  9241. onBeforeEnter(el) {
  9242. callHook(onBeforeEnter, [el]);
  9243. addTransitionClass(el, enterFromClass);
  9244. addTransitionClass(el, enterActiveClass);
  9245. },
  9246. onBeforeAppear(el) {
  9247. callHook(onBeforeAppear, [el]);
  9248. addTransitionClass(el, appearFromClass);
  9249. addTransitionClass(el, appearActiveClass);
  9250. },
  9251. onEnter: makeEnterHook(false),
  9252. onAppear: makeEnterHook(true),
  9253. onLeave(el, done) {
  9254. el._isLeaving = true;
  9255. const resolve = () => finishLeave(el, done);
  9256. addTransitionClass(el, leaveFromClass);
  9257. forceReflow();
  9258. addTransitionClass(el, leaveActiveClass);
  9259. nextFrame(() => {
  9260. if (!el._isLeaving) {
  9261. return;
  9262. }
  9263. removeTransitionClass(el, leaveFromClass);
  9264. addTransitionClass(el, leaveToClass);
  9265. if (!hasExplicitCallback(onLeave)) {
  9266. whenTransitionEnds(el, type, leaveDuration, resolve);
  9267. }
  9268. });
  9269. callHook(onLeave, [el, resolve]);
  9270. },
  9271. onEnterCancelled(el) {
  9272. finishEnter(el, false);
  9273. callHook(onEnterCancelled, [el]);
  9274. },
  9275. onAppearCancelled(el) {
  9276. finishEnter(el, true);
  9277. callHook(onAppearCancelled, [el]);
  9278. },
  9279. onLeaveCancelled(el) {
  9280. finishLeave(el);
  9281. callHook(onLeaveCancelled, [el]);
  9282. }
  9283. });
  9284. }
  9285. function normalizeDuration(duration) {
  9286. if (duration == null) {
  9287. return null;
  9288. } else if (isObject(duration)) {
  9289. return [NumberOf(duration.enter), NumberOf(duration.leave)];
  9290. } else {
  9291. const n = NumberOf(duration);
  9292. return [n, n];
  9293. }
  9294. }
  9295. function NumberOf(val) {
  9296. const res = toNumber(val);
  9297. {
  9298. assertNumber(res, "<transition> explicit duration");
  9299. }
  9300. return res;
  9301. }
  9302. function addTransitionClass(el, cls) {
  9303. cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
  9304. (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
  9305. }
  9306. function removeTransitionClass(el, cls) {
  9307. cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
  9308. const _vtc = el[vtcKey];
  9309. if (_vtc) {
  9310. _vtc.delete(cls);
  9311. if (!_vtc.size) {
  9312. el[vtcKey] = void 0;
  9313. }
  9314. }
  9315. }
  9316. function nextFrame(cb) {
  9317. requestAnimationFrame(() => {
  9318. requestAnimationFrame(cb);
  9319. });
  9320. }
  9321. let endId = 0;
  9322. function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
  9323. const id = el._endId = ++endId;
  9324. const resolveIfNotStale = () => {
  9325. if (id === el._endId) {
  9326. resolve();
  9327. }
  9328. };
  9329. if (explicitTimeout) {
  9330. return setTimeout(resolveIfNotStale, explicitTimeout);
  9331. }
  9332. const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
  9333. if (!type) {
  9334. return resolve();
  9335. }
  9336. const endEvent = type + "end";
  9337. let ended = 0;
  9338. const end = () => {
  9339. el.removeEventListener(endEvent, onEnd);
  9340. resolveIfNotStale();
  9341. };
  9342. const onEnd = (e) => {
  9343. if (e.target === el && ++ended >= propCount) {
  9344. end();
  9345. }
  9346. };
  9347. setTimeout(() => {
  9348. if (ended < propCount) {
  9349. end();
  9350. }
  9351. }, timeout + 1);
  9352. el.addEventListener(endEvent, onEnd);
  9353. }
  9354. function getTransitionInfo(el, expectedType) {
  9355. const styles = window.getComputedStyle(el);
  9356. const getStyleProperties = (key) => (styles[key] || "").split(", ");
  9357. const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
  9358. const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
  9359. const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  9360. const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
  9361. const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
  9362. const animationTimeout = getTimeout(animationDelays, animationDurations);
  9363. let type = null;
  9364. let timeout = 0;
  9365. let propCount = 0;
  9366. if (expectedType === TRANSITION) {
  9367. if (transitionTimeout > 0) {
  9368. type = TRANSITION;
  9369. timeout = transitionTimeout;
  9370. propCount = transitionDurations.length;
  9371. }
  9372. } else if (expectedType === ANIMATION) {
  9373. if (animationTimeout > 0) {
  9374. type = ANIMATION;
  9375. timeout = animationTimeout;
  9376. propCount = animationDurations.length;
  9377. }
  9378. } else {
  9379. timeout = Math.max(transitionTimeout, animationTimeout);
  9380. type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
  9381. propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
  9382. }
  9383. const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
  9384. getStyleProperties(`${TRANSITION}Property`).toString()
  9385. );
  9386. return {
  9387. type,
  9388. timeout,
  9389. propCount,
  9390. hasTransform
  9391. };
  9392. }
  9393. function getTimeout(delays, durations) {
  9394. while (delays.length < durations.length) {
  9395. delays = delays.concat(delays);
  9396. }
  9397. return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
  9398. }
  9399. function toMs(s) {
  9400. if (s === "auto")
  9401. return 0;
  9402. return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
  9403. }
  9404. function forceReflow() {
  9405. return document.body.offsetHeight;
  9406. }
  9407. function patchClass(el, value, isSVG) {
  9408. const transitionClasses = el[vtcKey];
  9409. if (transitionClasses) {
  9410. value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
  9411. }
  9412. if (value == null) {
  9413. el.removeAttribute("class");
  9414. } else if (isSVG) {
  9415. el.setAttribute("class", value);
  9416. } else {
  9417. el.className = value;
  9418. }
  9419. }
  9420. const vShowOldKey = Symbol("_vod");
  9421. const vShow = {
  9422. beforeMount(el, { value }, { transition }) {
  9423. el[vShowOldKey] = el.style.display === "none" ? "" : el.style.display;
  9424. if (transition && value) {
  9425. transition.beforeEnter(el);
  9426. } else {
  9427. setDisplay(el, value);
  9428. }
  9429. },
  9430. mounted(el, { value }, { transition }) {
  9431. if (transition && value) {
  9432. transition.enter(el);
  9433. }
  9434. },
  9435. updated(el, { value, oldValue }, { transition }) {
  9436. if (!value === !oldValue)
  9437. return;
  9438. if (transition) {
  9439. if (value) {
  9440. transition.beforeEnter(el);
  9441. setDisplay(el, true);
  9442. transition.enter(el);
  9443. } else {
  9444. transition.leave(el, () => {
  9445. setDisplay(el, false);
  9446. });
  9447. }
  9448. } else {
  9449. setDisplay(el, value);
  9450. }
  9451. },
  9452. beforeUnmount(el, { value }) {
  9453. setDisplay(el, value);
  9454. }
  9455. };
  9456. function setDisplay(el, value) {
  9457. el.style.display = value ? el[vShowOldKey] : "none";
  9458. }
  9459. function patchStyle(el, prev, next) {
  9460. const style = el.style;
  9461. const isCssString = isString(next);
  9462. if (next && !isCssString) {
  9463. if (prev && !isString(prev)) {
  9464. for (const key in prev) {
  9465. if (next[key] == null) {
  9466. setStyle(style, key, "");
  9467. }
  9468. }
  9469. }
  9470. for (const key in next) {
  9471. setStyle(style, key, next[key]);
  9472. }
  9473. } else {
  9474. const currentDisplay = style.display;
  9475. if (isCssString) {
  9476. if (prev !== next) {
  9477. style.cssText = next;
  9478. }
  9479. } else if (prev) {
  9480. el.removeAttribute("style");
  9481. }
  9482. if (vShowOldKey in el) {
  9483. style.display = currentDisplay;
  9484. }
  9485. }
  9486. }
  9487. const semicolonRE = /[^\\];\s*$/;
  9488. const importantRE = /\s*!important$/;
  9489. function setStyle(style, name, val) {
  9490. if (isArray(val)) {
  9491. val.forEach((v) => setStyle(style, name, v));
  9492. } else {
  9493. if (val == null)
  9494. val = "";
  9495. {
  9496. if (semicolonRE.test(val)) {
  9497. warn(
  9498. `Unexpected semicolon at the end of '${name}' style value: '${val}'`
  9499. );
  9500. }
  9501. }
  9502. if (name.startsWith("--")) {
  9503. style.setProperty(name, val);
  9504. } else {
  9505. const prefixed = autoPrefix(style, name);
  9506. if (importantRE.test(val)) {
  9507. style.setProperty(
  9508. hyphenate(prefixed),
  9509. val.replace(importantRE, ""),
  9510. "important"
  9511. );
  9512. } else {
  9513. style[prefixed] = val;
  9514. }
  9515. }
  9516. }
  9517. }
  9518. const prefixes = ["Webkit", "Moz", "ms"];
  9519. const prefixCache = {};
  9520. function autoPrefix(style, rawName) {
  9521. const cached = prefixCache[rawName];
  9522. if (cached) {
  9523. return cached;
  9524. }
  9525. let name = camelize(rawName);
  9526. if (name !== "filter" && name in style) {
  9527. return prefixCache[rawName] = name;
  9528. }
  9529. name = capitalize(name);
  9530. for (let i = 0; i < prefixes.length; i++) {
  9531. const prefixed = prefixes[i] + name;
  9532. if (prefixed in style) {
  9533. return prefixCache[rawName] = prefixed;
  9534. }
  9535. }
  9536. return rawName;
  9537. }
  9538. const xlinkNS = "http://www.w3.org/1999/xlink";
  9539. function patchAttr(el, key, value, isSVG, instance) {
  9540. if (isSVG && key.startsWith("xlink:")) {
  9541. if (value == null) {
  9542. el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
  9543. } else {
  9544. el.setAttributeNS(xlinkNS, key, value);
  9545. }
  9546. } else {
  9547. const isBoolean = isSpecialBooleanAttr(key);
  9548. if (value == null || isBoolean && !includeBooleanAttr(value)) {
  9549. el.removeAttribute(key);
  9550. } else {
  9551. el.setAttribute(key, isBoolean ? "" : value);
  9552. }
  9553. }
  9554. }
  9555. function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspense, unmountChildren) {
  9556. if (key === "innerHTML" || key === "textContent") {
  9557. if (prevChildren) {
  9558. unmountChildren(prevChildren, parentComponent, parentSuspense);
  9559. }
  9560. el[key] = value == null ? "" : value;
  9561. return;
  9562. }
  9563. const tag = el.tagName;
  9564. if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
  9565. !tag.includes("-")) {
  9566. el._value = value;
  9567. const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
  9568. const newValue = value == null ? "" : value;
  9569. if (oldValue !== newValue) {
  9570. el.value = newValue;
  9571. }
  9572. if (value == null) {
  9573. el.removeAttribute(key);
  9574. }
  9575. return;
  9576. }
  9577. let needRemove = false;
  9578. if (value === "" || value == null) {
  9579. const type = typeof el[key];
  9580. if (type === "boolean") {
  9581. value = includeBooleanAttr(value);
  9582. } else if (value == null && type === "string") {
  9583. value = "";
  9584. needRemove = true;
  9585. } else if (type === "number") {
  9586. value = 0;
  9587. needRemove = true;
  9588. }
  9589. }
  9590. try {
  9591. el[key] = value;
  9592. } catch (e) {
  9593. if (!needRemove) {
  9594. warn(
  9595. `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
  9596. e
  9597. );
  9598. }
  9599. }
  9600. needRemove && el.removeAttribute(key);
  9601. }
  9602. function addEventListener(el, event, handler, options) {
  9603. el.addEventListener(event, handler, options);
  9604. }
  9605. function removeEventListener(el, event, handler, options) {
  9606. el.removeEventListener(event, handler, options);
  9607. }
  9608. const veiKey = Symbol("_vei");
  9609. function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
  9610. const invokers = el[veiKey] || (el[veiKey] = {});
  9611. const existingInvoker = invokers[rawName];
  9612. if (nextValue && existingInvoker) {
  9613. existingInvoker.value = nextValue;
  9614. } else {
  9615. const [name, options] = parseName(rawName);
  9616. if (nextValue) {
  9617. const invoker = invokers[rawName] = createInvoker(nextValue, instance);
  9618. addEventListener(el, name, invoker, options);
  9619. } else if (existingInvoker) {
  9620. removeEventListener(el, name, existingInvoker, options);
  9621. invokers[rawName] = void 0;
  9622. }
  9623. }
  9624. }
  9625. const optionsModifierRE = /(?:Once|Passive|Capture)$/;
  9626. function parseName(name) {
  9627. let options;
  9628. if (optionsModifierRE.test(name)) {
  9629. options = {};
  9630. let m;
  9631. while (m = name.match(optionsModifierRE)) {
  9632. name = name.slice(0, name.length - m[0].length);
  9633. options[m[0].toLowerCase()] = true;
  9634. }
  9635. }
  9636. const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
  9637. return [event, options];
  9638. }
  9639. let cachedNow = 0;
  9640. const p = /* @__PURE__ */ Promise.resolve();
  9641. const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
  9642. function createInvoker(initialValue, instance) {
  9643. const invoker = (e) => {
  9644. if (!e._vts) {
  9645. e._vts = Date.now();
  9646. } else if (e._vts <= invoker.attached) {
  9647. return;
  9648. }
  9649. callWithAsyncErrorHandling(
  9650. patchStopImmediatePropagation(e, invoker.value),
  9651. instance,
  9652. 5,
  9653. [e]
  9654. );
  9655. };
  9656. invoker.value = initialValue;
  9657. invoker.attached = getNow();
  9658. return invoker;
  9659. }
  9660. function patchStopImmediatePropagation(e, value) {
  9661. if (isArray(value)) {
  9662. const originalStop = e.stopImmediatePropagation;
  9663. e.stopImmediatePropagation = () => {
  9664. originalStop.call(e);
  9665. e._stopped = true;
  9666. };
  9667. return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2));
  9668. } else {
  9669. return value;
  9670. }
  9671. }
  9672. const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
  9673. key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
  9674. const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
  9675. if (key === "class") {
  9676. patchClass(el, nextValue, isSVG);
  9677. } else if (key === "style") {
  9678. patchStyle(el, prevValue, nextValue);
  9679. } else if (isOn(key)) {
  9680. if (!isModelListener(key)) {
  9681. patchEvent(el, key, prevValue, nextValue, parentComponent);
  9682. }
  9683. } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
  9684. patchDOMProp(
  9685. el,
  9686. key,
  9687. nextValue,
  9688. prevChildren,
  9689. parentComponent,
  9690. parentSuspense,
  9691. unmountChildren
  9692. );
  9693. } else {
  9694. if (key === "true-value") {
  9695. el._trueValue = nextValue;
  9696. } else if (key === "false-value") {
  9697. el._falseValue = nextValue;
  9698. }
  9699. patchAttr(el, key, nextValue, isSVG);
  9700. }
  9701. };
  9702. function shouldSetAsProp(el, key, value, isSVG) {
  9703. if (isSVG) {
  9704. if (key === "innerHTML" || key === "textContent") {
  9705. return true;
  9706. }
  9707. if (key in el && isNativeOn(key) && isFunction(value)) {
  9708. return true;
  9709. }
  9710. return false;
  9711. }
  9712. if (key === "spellcheck" || key === "draggable" || key === "translate") {
  9713. return false;
  9714. }
  9715. if (key === "form") {
  9716. return false;
  9717. }
  9718. if (key === "list" && el.tagName === "INPUT") {
  9719. return false;
  9720. }
  9721. if (key === "type" && el.tagName === "TEXTAREA") {
  9722. return false;
  9723. }
  9724. if (key === "width" || key === "height") {
  9725. const tag = el.tagName;
  9726. if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
  9727. return false;
  9728. }
  9729. }
  9730. if (isNativeOn(key) && isString(value)) {
  9731. return false;
  9732. }
  9733. return key in el;
  9734. }
  9735. /*! #__NO_SIDE_EFFECTS__ */
  9736. // @__NO_SIDE_EFFECTS__
  9737. function defineCustomElement(options, hydrate2) {
  9738. const Comp = defineComponent(options);
  9739. class VueCustomElement extends VueElement {
  9740. constructor(initialProps) {
  9741. super(Comp, initialProps, hydrate2);
  9742. }
  9743. }
  9744. VueCustomElement.def = Comp;
  9745. return VueCustomElement;
  9746. }
  9747. /*! #__NO_SIDE_EFFECTS__ */
  9748. const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options) => {
  9749. return /* @__PURE__ */ defineCustomElement(options, hydrate);
  9750. };
  9751. const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
  9752. };
  9753. class VueElement extends BaseClass {
  9754. constructor(_def, _props = {}, hydrate2) {
  9755. super();
  9756. this._def = _def;
  9757. this._props = _props;
  9758. /**
  9759. * @internal
  9760. */
  9761. this._instance = null;
  9762. this._connected = false;
  9763. this._resolved = false;
  9764. this._numberProps = null;
  9765. this._ob = null;
  9766. if (this.shadowRoot && hydrate2) {
  9767. hydrate2(this._createVNode(), this.shadowRoot);
  9768. } else {
  9769. if (this.shadowRoot) {
  9770. warn(
  9771. `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
  9772. );
  9773. }
  9774. this.attachShadow({ mode: "open" });
  9775. if (!this._def.__asyncLoader) {
  9776. this._resolveProps(this._def);
  9777. }
  9778. }
  9779. }
  9780. connectedCallback() {
  9781. this._connected = true;
  9782. if (!this._instance) {
  9783. if (this._resolved) {
  9784. this._update();
  9785. } else {
  9786. this._resolveDef();
  9787. }
  9788. }
  9789. }
  9790. disconnectedCallback() {
  9791. this._connected = false;
  9792. if (this._ob) {
  9793. this._ob.disconnect();
  9794. this._ob = null;
  9795. }
  9796. nextTick(() => {
  9797. if (!this._connected) {
  9798. render(null, this.shadowRoot);
  9799. this._instance = null;
  9800. }
  9801. });
  9802. }
  9803. /**
  9804. * resolve inner component definition (handle possible async component)
  9805. */
  9806. _resolveDef() {
  9807. this._resolved = true;
  9808. for (let i = 0; i < this.attributes.length; i++) {
  9809. this._setAttr(this.attributes[i].name);
  9810. }
  9811. this._ob = new MutationObserver((mutations) => {
  9812. for (const m of mutations) {
  9813. this._setAttr(m.attributeName);
  9814. }
  9815. });
  9816. this._ob.observe(this, { attributes: true });
  9817. const resolve = (def, isAsync = false) => {
  9818. const { props, styles } = def;
  9819. let numberProps;
  9820. if (props && !isArray(props)) {
  9821. for (const key in props) {
  9822. const opt = props[key];
  9823. if (opt === Number || opt && opt.type === Number) {
  9824. if (key in this._props) {
  9825. this._props[key] = toNumber(this._props[key]);
  9826. }
  9827. (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
  9828. }
  9829. }
  9830. }
  9831. this._numberProps = numberProps;
  9832. if (isAsync) {
  9833. this._resolveProps(def);
  9834. }
  9835. this._applyStyles(styles);
  9836. this._update();
  9837. };
  9838. const asyncDef = this._def.__asyncLoader;
  9839. if (asyncDef) {
  9840. asyncDef().then((def) => resolve(def, true));
  9841. } else {
  9842. resolve(this._def);
  9843. }
  9844. }
  9845. _resolveProps(def) {
  9846. const { props } = def;
  9847. const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
  9848. for (const key of Object.keys(this)) {
  9849. if (key[0] !== "_" && declaredPropKeys.includes(key)) {
  9850. this._setProp(key, this[key], true, false);
  9851. }
  9852. }
  9853. for (const key of declaredPropKeys.map(camelize)) {
  9854. Object.defineProperty(this, key, {
  9855. get() {
  9856. return this._getProp(key);
  9857. },
  9858. set(val) {
  9859. this._setProp(key, val);
  9860. }
  9861. });
  9862. }
  9863. }
  9864. _setAttr(key) {
  9865. let value = this.getAttribute(key);
  9866. const camelKey = camelize(key);
  9867. if (this._numberProps && this._numberProps[camelKey]) {
  9868. value = toNumber(value);
  9869. }
  9870. this._setProp(camelKey, value, false);
  9871. }
  9872. /**
  9873. * @internal
  9874. */
  9875. _getProp(key) {
  9876. return this._props[key];
  9877. }
  9878. /**
  9879. * @internal
  9880. */
  9881. _setProp(key, val, shouldReflect = true, shouldUpdate = true) {
  9882. if (val !== this._props[key]) {
  9883. this._props[key] = val;
  9884. if (shouldUpdate && this._instance) {
  9885. this._update();
  9886. }
  9887. if (shouldReflect) {
  9888. if (val === true) {
  9889. this.setAttribute(hyphenate(key), "");
  9890. } else if (typeof val === "string" || typeof val === "number") {
  9891. this.setAttribute(hyphenate(key), val + "");
  9892. } else if (!val) {
  9893. this.removeAttribute(hyphenate(key));
  9894. }
  9895. }
  9896. }
  9897. }
  9898. _update() {
  9899. render(this._createVNode(), this.shadowRoot);
  9900. }
  9901. _createVNode() {
  9902. const vnode = createVNode(this._def, extend({}, this._props));
  9903. if (!this._instance) {
  9904. vnode.ce = (instance) => {
  9905. this._instance = instance;
  9906. instance.isCE = true;
  9907. {
  9908. instance.ceReload = (newStyles) => {
  9909. if (this._styles) {
  9910. this._styles.forEach((s) => this.shadowRoot.removeChild(s));
  9911. this._styles.length = 0;
  9912. }
  9913. this._applyStyles(newStyles);
  9914. this._instance = null;
  9915. this._update();
  9916. };
  9917. }
  9918. const dispatch = (event, args) => {
  9919. this.dispatchEvent(
  9920. new CustomEvent(event, {
  9921. detail: args
  9922. })
  9923. );
  9924. };
  9925. instance.emit = (event, ...args) => {
  9926. dispatch(event, args);
  9927. if (hyphenate(event) !== event) {
  9928. dispatch(hyphenate(event), args);
  9929. }
  9930. };
  9931. let parent = this;
  9932. while (parent = parent && (parent.parentNode || parent.host)) {
  9933. if (parent instanceof VueElement) {
  9934. instance.parent = parent._instance;
  9935. instance.provides = parent._instance.provides;
  9936. break;
  9937. }
  9938. }
  9939. };
  9940. }
  9941. return vnode;
  9942. }
  9943. _applyStyles(styles) {
  9944. if (styles) {
  9945. styles.forEach((css) => {
  9946. const s = document.createElement("style");
  9947. s.textContent = css;
  9948. this.shadowRoot.appendChild(s);
  9949. {
  9950. (this._styles || (this._styles = [])).push(s);
  9951. }
  9952. });
  9953. }
  9954. }
  9955. }
  9956. function useCssModule(name = "$style") {
  9957. {
  9958. {
  9959. warn(`useCssModule() is not supported in the global build.`);
  9960. }
  9961. return EMPTY_OBJ;
  9962. }
  9963. }
  9964. function useCssVars(getter) {
  9965. const instance = getCurrentInstance();
  9966. if (!instance) {
  9967. warn(`useCssVars is called without current active component instance.`);
  9968. return;
  9969. }
  9970. const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
  9971. Array.from(
  9972. document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
  9973. ).forEach((node) => setVarsOnNode(node, vars));
  9974. };
  9975. const setVars = () => {
  9976. const vars = getter(instance.proxy);
  9977. setVarsOnVNode(instance.subTree, vars);
  9978. updateTeleports(vars);
  9979. };
  9980. watchPostEffect(setVars);
  9981. onMounted(() => {
  9982. const ob = new MutationObserver(setVars);
  9983. ob.observe(instance.subTree.el.parentNode, { childList: true });
  9984. onUnmounted(() => ob.disconnect());
  9985. });
  9986. }
  9987. function setVarsOnVNode(vnode, vars) {
  9988. if (vnode.shapeFlag & 128) {
  9989. const suspense = vnode.suspense;
  9990. vnode = suspense.activeBranch;
  9991. if (suspense.pendingBranch && !suspense.isHydrating) {
  9992. suspense.effects.push(() => {
  9993. setVarsOnVNode(suspense.activeBranch, vars);
  9994. });
  9995. }
  9996. }
  9997. while (vnode.component) {
  9998. vnode = vnode.component.subTree;
  9999. }
  10000. if (vnode.shapeFlag & 1 && vnode.el) {
  10001. setVarsOnNode(vnode.el, vars);
  10002. } else if (vnode.type === Fragment) {
  10003. vnode.children.forEach((c) => setVarsOnVNode(c, vars));
  10004. } else if (vnode.type === Static) {
  10005. let { el, anchor } = vnode;
  10006. while (el) {
  10007. setVarsOnNode(el, vars);
  10008. if (el === anchor)
  10009. break;
  10010. el = el.nextSibling;
  10011. }
  10012. }
  10013. }
  10014. function setVarsOnNode(el, vars) {
  10015. if (el.nodeType === 1) {
  10016. const style = el.style;
  10017. for (const key in vars) {
  10018. style.setProperty(`--${key}`, vars[key]);
  10019. }
  10020. }
  10021. }
  10022. const positionMap = /* @__PURE__ */ new WeakMap();
  10023. const newPositionMap = /* @__PURE__ */ new WeakMap();
  10024. const moveCbKey = Symbol("_moveCb");
  10025. const enterCbKey = Symbol("_enterCb");
  10026. const TransitionGroupImpl = {
  10027. name: "TransitionGroup",
  10028. props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
  10029. tag: String,
  10030. moveClass: String
  10031. }),
  10032. setup(props, { slots }) {
  10033. const instance = getCurrentInstance();
  10034. const state = useTransitionState();
  10035. let prevChildren;
  10036. let children;
  10037. onUpdated(() => {
  10038. if (!prevChildren.length) {
  10039. return;
  10040. }
  10041. const moveClass = props.moveClass || `${props.name || "v"}-move`;
  10042. if (!hasCSSTransform(
  10043. prevChildren[0].el,
  10044. instance.vnode.el,
  10045. moveClass
  10046. )) {
  10047. return;
  10048. }
  10049. prevChildren.forEach(callPendingCbs);
  10050. prevChildren.forEach(recordPosition);
  10051. const movedChildren = prevChildren.filter(applyTranslation);
  10052. forceReflow();
  10053. movedChildren.forEach((c) => {
  10054. const el = c.el;
  10055. const style = el.style;
  10056. addTransitionClass(el, moveClass);
  10057. style.transform = style.webkitTransform = style.transitionDuration = "";
  10058. const cb = el[moveCbKey] = (e) => {
  10059. if (e && e.target !== el) {
  10060. return;
  10061. }
  10062. if (!e || /transform$/.test(e.propertyName)) {
  10063. el.removeEventListener("transitionend", cb);
  10064. el[moveCbKey] = null;
  10065. removeTransitionClass(el, moveClass);
  10066. }
  10067. };
  10068. el.addEventListener("transitionend", cb);
  10069. });
  10070. });
  10071. return () => {
  10072. const rawProps = toRaw(props);
  10073. const cssTransitionProps = resolveTransitionProps(rawProps);
  10074. let tag = rawProps.tag || Fragment;
  10075. prevChildren = children;
  10076. children = slots.default ? getTransitionRawChildren(slots.default()) : [];
  10077. for (let i = 0; i < children.length; i++) {
  10078. const child = children[i];
  10079. if (child.key != null) {
  10080. setTransitionHooks(
  10081. child,
  10082. resolveTransitionHooks(child, cssTransitionProps, state, instance)
  10083. );
  10084. } else {
  10085. warn(`<TransitionGroup> children must be keyed.`);
  10086. }
  10087. }
  10088. if (prevChildren) {
  10089. for (let i = 0; i < prevChildren.length; i++) {
  10090. const child = prevChildren[i];
  10091. setTransitionHooks(
  10092. child,
  10093. resolveTransitionHooks(child, cssTransitionProps, state, instance)
  10094. );
  10095. positionMap.set(child, child.el.getBoundingClientRect());
  10096. }
  10097. }
  10098. return createVNode(tag, null, children);
  10099. };
  10100. }
  10101. };
  10102. const removeMode = (props) => delete props.mode;
  10103. /* @__PURE__ */ removeMode(TransitionGroupImpl.props);
  10104. const TransitionGroup = TransitionGroupImpl;
  10105. function callPendingCbs(c) {
  10106. const el = c.el;
  10107. if (el[moveCbKey]) {
  10108. el[moveCbKey]();
  10109. }
  10110. if (el[enterCbKey]) {
  10111. el[enterCbKey]();
  10112. }
  10113. }
  10114. function recordPosition(c) {
  10115. newPositionMap.set(c, c.el.getBoundingClientRect());
  10116. }
  10117. function applyTranslation(c) {
  10118. const oldPos = positionMap.get(c);
  10119. const newPos = newPositionMap.get(c);
  10120. const dx = oldPos.left - newPos.left;
  10121. const dy = oldPos.top - newPos.top;
  10122. if (dx || dy) {
  10123. const s = c.el.style;
  10124. s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
  10125. s.transitionDuration = "0s";
  10126. return c;
  10127. }
  10128. }
  10129. function hasCSSTransform(el, root, moveClass) {
  10130. const clone = el.cloneNode();
  10131. const _vtc = el[vtcKey];
  10132. if (_vtc) {
  10133. _vtc.forEach((cls) => {
  10134. cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
  10135. });
  10136. }
  10137. moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c));
  10138. clone.style.display = "none";
  10139. const container = root.nodeType === 1 ? root : root.parentNode;
  10140. container.appendChild(clone);
  10141. const { hasTransform } = getTransitionInfo(clone);
  10142. container.removeChild(clone);
  10143. return hasTransform;
  10144. }
  10145. const getModelAssigner = (vnode) => {
  10146. const fn = vnode.props["onUpdate:modelValue"] || false;
  10147. return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn;
  10148. };
  10149. function onCompositionStart(e) {
  10150. e.target.composing = true;
  10151. }
  10152. function onCompositionEnd(e) {
  10153. const target = e.target;
  10154. if (target.composing) {
  10155. target.composing = false;
  10156. target.dispatchEvent(new Event("input"));
  10157. }
  10158. }
  10159. const assignKey = Symbol("_assign");
  10160. const vModelText = {
  10161. created(el, { modifiers: { lazy, trim, number } }, vnode) {
  10162. el[assignKey] = getModelAssigner(vnode);
  10163. const castToNumber = number || vnode.props && vnode.props.type === "number";
  10164. addEventListener(el, lazy ? "change" : "input", (e) => {
  10165. if (e.target.composing)
  10166. return;
  10167. let domValue = el.value;
  10168. if (trim) {
  10169. domValue = domValue.trim();
  10170. }
  10171. if (castToNumber) {
  10172. domValue = looseToNumber(domValue);
  10173. }
  10174. el[assignKey](domValue);
  10175. });
  10176. if (trim) {
  10177. addEventListener(el, "change", () => {
  10178. el.value = el.value.trim();
  10179. });
  10180. }
  10181. if (!lazy) {
  10182. addEventListener(el, "compositionstart", onCompositionStart);
  10183. addEventListener(el, "compositionend", onCompositionEnd);
  10184. addEventListener(el, "change", onCompositionEnd);
  10185. }
  10186. },
  10187. // set value on mounted so it's after min/max for type="range"
  10188. mounted(el, { value }) {
  10189. el.value = value == null ? "" : value;
  10190. },
  10191. beforeUpdate(el, { value, modifiers: { lazy, trim, number } }, vnode) {
  10192. el[assignKey] = getModelAssigner(vnode);
  10193. if (el.composing)
  10194. return;
  10195. const elValue = number || el.type === "number" ? looseToNumber(el.value) : el.value;
  10196. const newValue = value == null ? "" : value;
  10197. if (elValue === newValue) {
  10198. return;
  10199. }
  10200. if (document.activeElement === el && el.type !== "range") {
  10201. if (lazy) {
  10202. return;
  10203. }
  10204. if (trim && el.value.trim() === newValue) {
  10205. return;
  10206. }
  10207. }
  10208. el.value = newValue;
  10209. }
  10210. };
  10211. const vModelCheckbox = {
  10212. // #4096 array checkboxes need to be deep traversed
  10213. deep: true,
  10214. created(el, _, vnode) {
  10215. el[assignKey] = getModelAssigner(vnode);
  10216. addEventListener(el, "change", () => {
  10217. const modelValue = el._modelValue;
  10218. const elementValue = getValue(el);
  10219. const checked = el.checked;
  10220. const assign = el[assignKey];
  10221. if (isArray(modelValue)) {
  10222. const index = looseIndexOf(modelValue, elementValue);
  10223. const found = index !== -1;
  10224. if (checked && !found) {
  10225. assign(modelValue.concat(elementValue));
  10226. } else if (!checked && found) {
  10227. const filtered = [...modelValue];
  10228. filtered.splice(index, 1);
  10229. assign(filtered);
  10230. }
  10231. } else if (isSet(modelValue)) {
  10232. const cloned = new Set(modelValue);
  10233. if (checked) {
  10234. cloned.add(elementValue);
  10235. } else {
  10236. cloned.delete(elementValue);
  10237. }
  10238. assign(cloned);
  10239. } else {
  10240. assign(getCheckboxValue(el, checked));
  10241. }
  10242. });
  10243. },
  10244. // set initial checked on mount to wait for true-value/false-value
  10245. mounted: setChecked,
  10246. beforeUpdate(el, binding, vnode) {
  10247. el[assignKey] = getModelAssigner(vnode);
  10248. setChecked(el, binding, vnode);
  10249. }
  10250. };
  10251. function setChecked(el, { value, oldValue }, vnode) {
  10252. el._modelValue = value;
  10253. if (isArray(value)) {
  10254. el.checked = looseIndexOf(value, vnode.props.value) > -1;
  10255. } else if (isSet(value)) {
  10256. el.checked = value.has(vnode.props.value);
  10257. } else if (value !== oldValue) {
  10258. el.checked = looseEqual(value, getCheckboxValue(el, true));
  10259. }
  10260. }
  10261. const vModelRadio = {
  10262. created(el, { value }, vnode) {
  10263. el.checked = looseEqual(value, vnode.props.value);
  10264. el[assignKey] = getModelAssigner(vnode);
  10265. addEventListener(el, "change", () => {
  10266. el[assignKey](getValue(el));
  10267. });
  10268. },
  10269. beforeUpdate(el, { value, oldValue }, vnode) {
  10270. el[assignKey] = getModelAssigner(vnode);
  10271. if (value !== oldValue) {
  10272. el.checked = looseEqual(value, vnode.props.value);
  10273. }
  10274. }
  10275. };
  10276. const vModelSelect = {
  10277. // <select multiple> value need to be deep traversed
  10278. deep: true,
  10279. created(el, { value, modifiers: { number } }, vnode) {
  10280. const isSetModel = isSet(value);
  10281. addEventListener(el, "change", () => {
  10282. const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
  10283. (o) => number ? looseToNumber(getValue(o)) : getValue(o)
  10284. );
  10285. el[assignKey](
  10286. el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
  10287. );
  10288. });
  10289. el[assignKey] = getModelAssigner(vnode);
  10290. },
  10291. // set value in mounted & updated because <select> relies on its children
  10292. // <option>s.
  10293. mounted(el, { value }) {
  10294. setSelected(el, value);
  10295. },
  10296. beforeUpdate(el, _binding, vnode) {
  10297. el[assignKey] = getModelAssigner(vnode);
  10298. },
  10299. updated(el, { value }) {
  10300. setSelected(el, value);
  10301. }
  10302. };
  10303. function setSelected(el, value) {
  10304. const isMultiple = el.multiple;
  10305. if (isMultiple && !isArray(value) && !isSet(value)) {
  10306. warn(
  10307. `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.`
  10308. );
  10309. return;
  10310. }
  10311. for (let i = 0, l = el.options.length; i < l; i++) {
  10312. const option = el.options[i];
  10313. const optionValue = getValue(option);
  10314. if (isMultiple) {
  10315. if (isArray(value)) {
  10316. option.selected = looseIndexOf(value, optionValue) > -1;
  10317. } else {
  10318. option.selected = value.has(optionValue);
  10319. }
  10320. } else {
  10321. if (looseEqual(getValue(option), value)) {
  10322. if (el.selectedIndex !== i)
  10323. el.selectedIndex = i;
  10324. return;
  10325. }
  10326. }
  10327. }
  10328. if (!isMultiple && el.selectedIndex !== -1) {
  10329. el.selectedIndex = -1;
  10330. }
  10331. }
  10332. function getValue(el) {
  10333. return "_value" in el ? el._value : el.value;
  10334. }
  10335. function getCheckboxValue(el, checked) {
  10336. const key = checked ? "_trueValue" : "_falseValue";
  10337. return key in el ? el[key] : checked;
  10338. }
  10339. const vModelDynamic = {
  10340. created(el, binding, vnode) {
  10341. callModelHook(el, binding, vnode, null, "created");
  10342. },
  10343. mounted(el, binding, vnode) {
  10344. callModelHook(el, binding, vnode, null, "mounted");
  10345. },
  10346. beforeUpdate(el, binding, vnode, prevVNode) {
  10347. callModelHook(el, binding, vnode, prevVNode, "beforeUpdate");
  10348. },
  10349. updated(el, binding, vnode, prevVNode) {
  10350. callModelHook(el, binding, vnode, prevVNode, "updated");
  10351. }
  10352. };
  10353. function resolveDynamicModel(tagName, type) {
  10354. switch (tagName) {
  10355. case "SELECT":
  10356. return vModelSelect;
  10357. case "TEXTAREA":
  10358. return vModelText;
  10359. default:
  10360. switch (type) {
  10361. case "checkbox":
  10362. return vModelCheckbox;
  10363. case "radio":
  10364. return vModelRadio;
  10365. default:
  10366. return vModelText;
  10367. }
  10368. }
  10369. }
  10370. function callModelHook(el, binding, vnode, prevVNode, hook) {
  10371. const modelToUse = resolveDynamicModel(
  10372. el.tagName,
  10373. vnode.props && vnode.props.type
  10374. );
  10375. const fn = modelToUse[hook];
  10376. fn && fn(el, binding, vnode, prevVNode);
  10377. }
  10378. const systemModifiers = ["ctrl", "shift", "alt", "meta"];
  10379. const modifierGuards = {
  10380. stop: (e) => e.stopPropagation(),
  10381. prevent: (e) => e.preventDefault(),
  10382. self: (e) => e.target !== e.currentTarget,
  10383. ctrl: (e) => !e.ctrlKey,
  10384. shift: (e) => !e.shiftKey,
  10385. alt: (e) => !e.altKey,
  10386. meta: (e) => !e.metaKey,
  10387. left: (e) => "button" in e && e.button !== 0,
  10388. middle: (e) => "button" in e && e.button !== 1,
  10389. right: (e) => "button" in e && e.button !== 2,
  10390. exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
  10391. };
  10392. const withModifiers = (fn, modifiers) => {
  10393. return fn._withMods || (fn._withMods = (event, ...args) => {
  10394. for (let i = 0; i < modifiers.length; i++) {
  10395. const guard = modifierGuards[modifiers[i]];
  10396. if (guard && guard(event, modifiers))
  10397. return;
  10398. }
  10399. return fn(event, ...args);
  10400. });
  10401. };
  10402. const keyNames = {
  10403. esc: "escape",
  10404. space: " ",
  10405. up: "arrow-up",
  10406. left: "arrow-left",
  10407. right: "arrow-right",
  10408. down: "arrow-down",
  10409. delete: "backspace"
  10410. };
  10411. const withKeys = (fn, modifiers) => {
  10412. return fn._withKeys || (fn._withKeys = (event) => {
  10413. if (!("key" in event)) {
  10414. return;
  10415. }
  10416. const eventKey = hyphenate(event.key);
  10417. if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) {
  10418. return fn(event);
  10419. }
  10420. });
  10421. };
  10422. const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
  10423. let renderer;
  10424. let enabledHydration = false;
  10425. function ensureRenderer() {
  10426. return renderer || (renderer = createRenderer(rendererOptions));
  10427. }
  10428. function ensureHydrationRenderer() {
  10429. renderer = enabledHydration ? renderer : createHydrationRenderer(rendererOptions);
  10430. enabledHydration = true;
  10431. return renderer;
  10432. }
  10433. const render = (...args) => {
  10434. ensureRenderer().render(...args);
  10435. };
  10436. const hydrate = (...args) => {
  10437. ensureHydrationRenderer().hydrate(...args);
  10438. };
  10439. const createApp = (...args) => {
  10440. const app = ensureRenderer().createApp(...args);
  10441. {
  10442. injectNativeTagCheck(app);
  10443. injectCompilerOptionsCheck(app);
  10444. }
  10445. const { mount } = app;
  10446. app.mount = (containerOrSelector) => {
  10447. const container = normalizeContainer(containerOrSelector);
  10448. if (!container)
  10449. return;
  10450. const component = app._component;
  10451. if (!isFunction(component) && !component.render && !component.template) {
  10452. component.template = container.innerHTML;
  10453. }
  10454. container.innerHTML = "";
  10455. const proxy = mount(container, false, container instanceof SVGElement);
  10456. if (container instanceof Element) {
  10457. container.removeAttribute("v-cloak");
  10458. container.setAttribute("data-v-app", "");
  10459. }
  10460. return proxy;
  10461. };
  10462. return app;
  10463. };
  10464. const createSSRApp = (...args) => {
  10465. const app = ensureHydrationRenderer().createApp(...args);
  10466. {
  10467. injectNativeTagCheck(app);
  10468. injectCompilerOptionsCheck(app);
  10469. }
  10470. const { mount } = app;
  10471. app.mount = (containerOrSelector) => {
  10472. const container = normalizeContainer(containerOrSelector);
  10473. if (container) {
  10474. return mount(container, true, container instanceof SVGElement);
  10475. }
  10476. };
  10477. return app;
  10478. };
  10479. function injectNativeTagCheck(app) {
  10480. Object.defineProperty(app.config, "isNativeTag", {
  10481. value: (tag) => isHTMLTag(tag) || isSVGTag(tag),
  10482. writable: false
  10483. });
  10484. }
  10485. function injectCompilerOptionsCheck(app) {
  10486. if (isRuntimeOnly()) {
  10487. const isCustomElement = app.config.isCustomElement;
  10488. Object.defineProperty(app.config, "isCustomElement", {
  10489. get() {
  10490. return isCustomElement;
  10491. },
  10492. set() {
  10493. warn(
  10494. `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.`
  10495. );
  10496. }
  10497. });
  10498. const compilerOptions = app.config.compilerOptions;
  10499. const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead.
  10500. - For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.
  10501. - For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
  10502. - For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`;
  10503. Object.defineProperty(app.config, "compilerOptions", {
  10504. get() {
  10505. warn(msg);
  10506. return compilerOptions;
  10507. },
  10508. set() {
  10509. warn(msg);
  10510. }
  10511. });
  10512. }
  10513. }
  10514. function normalizeContainer(container) {
  10515. if (isString(container)) {
  10516. const res = document.querySelector(container);
  10517. if (!res) {
  10518. warn(
  10519. `Failed to mount app: mount target selector "${container}" returned null.`
  10520. );
  10521. }
  10522. return res;
  10523. }
  10524. if (window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") {
  10525. warn(
  10526. `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`
  10527. );
  10528. }
  10529. return container;
  10530. }
  10531. const initDirectivesForSSR = NOOP;
  10532. function initDev() {
  10533. {
  10534. {
  10535. console.info(
  10536. `You are running a development build of Vue.
  10537. Make sure to use the production build (*.prod.js) when deploying for production.`
  10538. );
  10539. }
  10540. initCustomFormatter();
  10541. }
  10542. }
  10543. {
  10544. initDev();
  10545. }
  10546. const compile = () => {
  10547. {
  10548. warn(
  10549. `Runtime compilation is not supported in this build of Vue.` + (` Use "vue.global.js" instead.` )
  10550. /* should not happen */
  10551. );
  10552. }
  10553. };
  10554. exports.BaseTransition = BaseTransition;
  10555. exports.BaseTransitionPropsValidators = BaseTransitionPropsValidators;
  10556. exports.Comment = Comment;
  10557. exports.EffectScope = EffectScope;
  10558. exports.Fragment = Fragment;
  10559. exports.KeepAlive = KeepAlive;
  10560. exports.ReactiveEffect = ReactiveEffect;
  10561. exports.Static = Static;
  10562. exports.Suspense = Suspense;
  10563. exports.Teleport = Teleport;
  10564. exports.Text = Text;
  10565. exports.Transition = Transition;
  10566. exports.TransitionGroup = TransitionGroup;
  10567. exports.VueElement = VueElement;
  10568. exports.assertNumber = assertNumber;
  10569. exports.callWithAsyncErrorHandling = callWithAsyncErrorHandling;
  10570. exports.callWithErrorHandling = callWithErrorHandling;
  10571. exports.camelize = camelize;
  10572. exports.capitalize = capitalize;
  10573. exports.cloneVNode = cloneVNode;
  10574. exports.compatUtils = compatUtils;
  10575. exports.compile = compile;
  10576. exports.computed = computed;
  10577. exports.createApp = createApp;
  10578. exports.createBlock = createBlock;
  10579. exports.createCommentVNode = createCommentVNode;
  10580. exports.createElementBlock = createElementBlock;
  10581. exports.createElementVNode = createBaseVNode;
  10582. exports.createHydrationRenderer = createHydrationRenderer;
  10583. exports.createPropsRestProxy = createPropsRestProxy;
  10584. exports.createRenderer = createRenderer;
  10585. exports.createSSRApp = createSSRApp;
  10586. exports.createSlots = createSlots;
  10587. exports.createStaticVNode = createStaticVNode;
  10588. exports.createTextVNode = createTextVNode;
  10589. exports.createVNode = createVNode;
  10590. exports.customRef = customRef;
  10591. exports.defineAsyncComponent = defineAsyncComponent;
  10592. exports.defineComponent = defineComponent;
  10593. exports.defineCustomElement = defineCustomElement;
  10594. exports.defineEmits = defineEmits;
  10595. exports.defineExpose = defineExpose;
  10596. exports.defineModel = defineModel;
  10597. exports.defineOptions = defineOptions;
  10598. exports.defineProps = defineProps;
  10599. exports.defineSSRCustomElement = defineSSRCustomElement;
  10600. exports.defineSlots = defineSlots;
  10601. exports.effect = effect;
  10602. exports.effectScope = effectScope;
  10603. exports.getCurrentInstance = getCurrentInstance;
  10604. exports.getCurrentScope = getCurrentScope;
  10605. exports.getTransitionRawChildren = getTransitionRawChildren;
  10606. exports.guardReactiveProps = guardReactiveProps;
  10607. exports.h = h;
  10608. exports.handleError = handleError;
  10609. exports.hasInjectionContext = hasInjectionContext;
  10610. exports.hydrate = hydrate;
  10611. exports.initCustomFormatter = initCustomFormatter;
  10612. exports.initDirectivesForSSR = initDirectivesForSSR;
  10613. exports.inject = inject;
  10614. exports.isMemoSame = isMemoSame;
  10615. exports.isProxy = isProxy;
  10616. exports.isReactive = isReactive;
  10617. exports.isReadonly = isReadonly;
  10618. exports.isRef = isRef;
  10619. exports.isRuntimeOnly = isRuntimeOnly;
  10620. exports.isShallow = isShallow;
  10621. exports.isVNode = isVNode;
  10622. exports.markRaw = markRaw;
  10623. exports.mergeDefaults = mergeDefaults;
  10624. exports.mergeModels = mergeModels;
  10625. exports.mergeProps = mergeProps;
  10626. exports.nextTick = nextTick;
  10627. exports.normalizeClass = normalizeClass;
  10628. exports.normalizeProps = normalizeProps;
  10629. exports.normalizeStyle = normalizeStyle;
  10630. exports.onActivated = onActivated;
  10631. exports.onBeforeMount = onBeforeMount;
  10632. exports.onBeforeUnmount = onBeforeUnmount;
  10633. exports.onBeforeUpdate = onBeforeUpdate;
  10634. exports.onDeactivated = onDeactivated;
  10635. exports.onErrorCaptured = onErrorCaptured;
  10636. exports.onMounted = onMounted;
  10637. exports.onRenderTracked = onRenderTracked;
  10638. exports.onRenderTriggered = onRenderTriggered;
  10639. exports.onScopeDispose = onScopeDispose;
  10640. exports.onServerPrefetch = onServerPrefetch;
  10641. exports.onUnmounted = onUnmounted;
  10642. exports.onUpdated = onUpdated;
  10643. exports.openBlock = openBlock;
  10644. exports.popScopeId = popScopeId;
  10645. exports.provide = provide;
  10646. exports.proxyRefs = proxyRefs;
  10647. exports.pushScopeId = pushScopeId;
  10648. exports.queuePostFlushCb = queuePostFlushCb;
  10649. exports.reactive = reactive;
  10650. exports.readonly = readonly;
  10651. exports.ref = ref;
  10652. exports.registerRuntimeCompiler = registerRuntimeCompiler;
  10653. exports.render = render;
  10654. exports.renderList = renderList;
  10655. exports.renderSlot = renderSlot;
  10656. exports.resolveComponent = resolveComponent;
  10657. exports.resolveDirective = resolveDirective;
  10658. exports.resolveDynamicComponent = resolveDynamicComponent;
  10659. exports.resolveFilter = resolveFilter;
  10660. exports.resolveTransitionHooks = resolveTransitionHooks;
  10661. exports.setBlockTracking = setBlockTracking;
  10662. exports.setDevtoolsHook = setDevtoolsHook;
  10663. exports.setTransitionHooks = setTransitionHooks;
  10664. exports.shallowReactive = shallowReactive;
  10665. exports.shallowReadonly = shallowReadonly;
  10666. exports.shallowRef = shallowRef;
  10667. exports.ssrContextKey = ssrContextKey;
  10668. exports.ssrUtils = ssrUtils;
  10669. exports.stop = stop;
  10670. exports.toDisplayString = toDisplayString;
  10671. exports.toHandlerKey = toHandlerKey;
  10672. exports.toHandlers = toHandlers;
  10673. exports.toRaw = toRaw;
  10674. exports.toRef = toRef;
  10675. exports.toRefs = toRefs;
  10676. exports.toValue = toValue;
  10677. exports.transformVNodeArgs = transformVNodeArgs;
  10678. exports.triggerRef = triggerRef;
  10679. exports.unref = unref;
  10680. exports.useAttrs = useAttrs;
  10681. exports.useCssModule = useCssModule;
  10682. exports.useCssVars = useCssVars;
  10683. exports.useModel = useModel;
  10684. exports.useSSRContext = useSSRContext;
  10685. exports.useSlots = useSlots;
  10686. exports.useTransitionState = useTransitionState;
  10687. exports.vModelCheckbox = vModelCheckbox;
  10688. exports.vModelDynamic = vModelDynamic;
  10689. exports.vModelRadio = vModelRadio;
  10690. exports.vModelSelect = vModelSelect;
  10691. exports.vModelText = vModelText;
  10692. exports.vShow = vShow;
  10693. exports.version = version;
  10694. exports.warn = warn;
  10695. exports.watch = watch;
  10696. exports.watchEffect = watchEffect;
  10697. exports.watchPostEffect = watchPostEffect;
  10698. exports.watchSyncEffect = watchSyncEffect;
  10699. exports.withAsyncContext = withAsyncContext;
  10700. exports.withCtx = withCtx;
  10701. exports.withDefaults = withDefaults;
  10702. exports.withDirectives = withDirectives;
  10703. exports.withKeys = withKeys;
  10704. exports.withMemo = withMemo;
  10705. exports.withModifiers = withModifiers;
  10706. exports.withScopeId = withScopeId;
  10707. return exports;
  10708. })({});