framework.DyMmIvSC.js 269 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268
  1. /**
  2. * @vue/shared v3.4.24
  3. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  4. * @license MIT
  5. **/
  6. /*! #__NO_SIDE_EFFECTS__ */
  7. // @__NO_SIDE_EFFECTS__
  8. function makeMap(str, expectsLowerCase) {
  9. const set2 = new Set(str.split(","));
  10. return expectsLowerCase ? (val) => set2.has(val.toLowerCase()) : (val) => set2.has(val);
  11. }
  12. const EMPTY_OBJ = {};
  13. const EMPTY_ARR = [];
  14. const NOOP = () => {
  15. };
  16. const NO = () => false;
  17. const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
  18. (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
  19. const isModelListener = (key) => key.startsWith("onUpdate:");
  20. const extend = Object.assign;
  21. const remove = (arr, el) => {
  22. const i = arr.indexOf(el);
  23. if (i > -1) {
  24. arr.splice(i, 1);
  25. }
  26. };
  27. const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
  28. const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
  29. const isArray = Array.isArray;
  30. const isMap = (val) => toTypeString(val) === "[object Map]";
  31. const isSet = (val) => toTypeString(val) === "[object Set]";
  32. const isFunction = (val) => typeof val === "function";
  33. const isString = (val) => typeof val === "string";
  34. const isSymbol = (val) => typeof val === "symbol";
  35. const isObject$1 = (val) => val !== null && typeof val === "object";
  36. const isPromise = (val) => {
  37. return (isObject$1(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
  38. };
  39. const objectToString = Object.prototype.toString;
  40. const toTypeString = (value) => objectToString.call(value);
  41. const toRawType = (value) => {
  42. return toTypeString(value).slice(8, -1);
  43. };
  44. const isPlainObject = (val) => toTypeString(val) === "[object Object]";
  45. const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
  46. const isReservedProp = /* @__PURE__ */ makeMap(
  47. // the leading comma is intentional so empty string "" is also included
  48. ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
  49. );
  50. const cacheStringFunction = (fn) => {
  51. const cache = /* @__PURE__ */ Object.create(null);
  52. return (str) => {
  53. const hit = cache[str];
  54. return hit || (cache[str] = fn(str));
  55. };
  56. };
  57. const camelizeRE = /-(\w)/g;
  58. const camelize = cacheStringFunction((str) => {
  59. return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
  60. });
  61. const hyphenateRE = /\B([A-Z])/g;
  62. const hyphenate = cacheStringFunction(
  63. (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
  64. );
  65. const capitalize = cacheStringFunction((str) => {
  66. return str.charAt(0).toUpperCase() + str.slice(1);
  67. });
  68. const toHandlerKey = cacheStringFunction((str) => {
  69. const s = str ? `on${capitalize(str)}` : ``;
  70. return s;
  71. });
  72. const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
  73. const invokeArrayFns = (fns, arg) => {
  74. for (let i = 0; i < fns.length; i++) {
  75. fns[i](arg);
  76. }
  77. };
  78. const def = (obj, key, value) => {
  79. Object.defineProperty(obj, key, {
  80. configurable: true,
  81. enumerable: false,
  82. value
  83. });
  84. };
  85. const looseToNumber = (val) => {
  86. const n = parseFloat(val);
  87. return isNaN(n) ? val : n;
  88. };
  89. const toNumber = (val) => {
  90. const n = isString(val) ? Number(val) : NaN;
  91. return isNaN(n) ? val : n;
  92. };
  93. let _globalThis;
  94. const getGlobalThis = () => {
  95. return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
  96. };
  97. function normalizeStyle(value) {
  98. if (isArray(value)) {
  99. const res = {};
  100. for (let i = 0; i < value.length; i++) {
  101. const item = value[i];
  102. const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
  103. if (normalized) {
  104. for (const key in normalized) {
  105. res[key] = normalized[key];
  106. }
  107. }
  108. }
  109. return res;
  110. } else if (isString(value) || isObject$1(value)) {
  111. return value;
  112. }
  113. }
  114. const listDelimiterRE = /;(?![^(]*\))/g;
  115. const propertyDelimiterRE = /:([^]+)/;
  116. const styleCommentRE = /\/\*[^]*?\*\//g;
  117. function parseStringStyle(cssText) {
  118. const ret = {};
  119. cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
  120. if (item) {
  121. const tmp = item.split(propertyDelimiterRE);
  122. tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
  123. }
  124. });
  125. return ret;
  126. }
  127. function stringifyStyle(styles) {
  128. let ret = "";
  129. if (!styles || isString(styles)) {
  130. return ret;
  131. }
  132. for (const key in styles) {
  133. const value = styles[key];
  134. const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
  135. if (isString(value) || typeof value === "number") {
  136. ret += `${normalizedKey}:${value};`;
  137. }
  138. }
  139. return ret;
  140. }
  141. function normalizeClass(value) {
  142. let res = "";
  143. if (isString(value)) {
  144. res = value;
  145. } else if (isArray(value)) {
  146. for (let i = 0; i < value.length; i++) {
  147. const normalized = normalizeClass(value[i]);
  148. if (normalized) {
  149. res += normalized + " ";
  150. }
  151. }
  152. } else if (isObject$1(value)) {
  153. for (const name in value) {
  154. if (value[name]) {
  155. res += name + " ";
  156. }
  157. }
  158. }
  159. return res.trim();
  160. }
  161. const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
  162. const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
  163. const isBooleanAttr = /* @__PURE__ */ makeMap(
  164. specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
  165. );
  166. function includeBooleanAttr(value) {
  167. return !!value || value === "";
  168. }
  169. const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
  170. `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`
  171. );
  172. const isKnownSvgAttr = /* @__PURE__ */ makeMap(
  173. `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`
  174. );
  175. function isRenderableAttrValue(value) {
  176. if (value == null) {
  177. return false;
  178. }
  179. const type = typeof value;
  180. return type === "string" || type === "number" || type === "boolean";
  181. }
  182. const toDisplayString = (val) => {
  183. return isString(val) ? val : val == null ? "" : isArray(val) || isObject$1(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
  184. };
  185. const replacer = (_key, val) => {
  186. if (val && val.__v_isRef) {
  187. return replacer(_key, val.value);
  188. } else if (isMap(val)) {
  189. return {
  190. [`Map(${val.size})`]: [...val.entries()].reduce(
  191. (entries, [key, val2], i) => {
  192. entries[stringifySymbol(key, i) + " =>"] = val2;
  193. return entries;
  194. },
  195. {}
  196. )
  197. };
  198. } else if (isSet(val)) {
  199. return {
  200. [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
  201. };
  202. } else if (isSymbol(val)) {
  203. return stringifySymbol(val);
  204. } else if (isObject$1(val) && !isArray(val) && !isPlainObject(val)) {
  205. return String(val);
  206. }
  207. return val;
  208. };
  209. const stringifySymbol = (v, i = "") => {
  210. var _a;
  211. return (
  212. // Symbol.description in es2019+ so we need to cast here to pass
  213. // the lib: es2016 check
  214. isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v
  215. );
  216. };
  217. /**
  218. * @vue/reactivity v3.4.24
  219. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  220. * @license MIT
  221. **/
  222. let activeEffectScope;
  223. class EffectScope {
  224. constructor(detached = false) {
  225. this.detached = detached;
  226. this._active = true;
  227. this.effects = [];
  228. this.cleanups = [];
  229. this.parent = activeEffectScope;
  230. if (!detached && activeEffectScope) {
  231. this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
  232. this
  233. ) - 1;
  234. }
  235. }
  236. get active() {
  237. return this._active;
  238. }
  239. run(fn) {
  240. if (this._active) {
  241. const currentEffectScope = activeEffectScope;
  242. try {
  243. activeEffectScope = this;
  244. return fn();
  245. } finally {
  246. activeEffectScope = currentEffectScope;
  247. }
  248. }
  249. }
  250. /**
  251. * This should only be called on non-detached scopes
  252. * @internal
  253. */
  254. on() {
  255. activeEffectScope = this;
  256. }
  257. /**
  258. * This should only be called on non-detached scopes
  259. * @internal
  260. */
  261. off() {
  262. activeEffectScope = this.parent;
  263. }
  264. stop(fromParent) {
  265. if (this._active) {
  266. let i, l;
  267. for (i = 0, l = this.effects.length; i < l; i++) {
  268. this.effects[i].stop();
  269. }
  270. for (i = 0, l = this.cleanups.length; i < l; i++) {
  271. this.cleanups[i]();
  272. }
  273. if (this.scopes) {
  274. for (i = 0, l = this.scopes.length; i < l; i++) {
  275. this.scopes[i].stop(true);
  276. }
  277. }
  278. if (!this.detached && this.parent && !fromParent) {
  279. const last = this.parent.scopes.pop();
  280. if (last && last !== this) {
  281. this.parent.scopes[this.index] = last;
  282. last.index = this.index;
  283. }
  284. }
  285. this.parent = void 0;
  286. this._active = false;
  287. }
  288. }
  289. }
  290. function recordEffectScope(effect2, scope = activeEffectScope) {
  291. if (scope && scope.active) {
  292. scope.effects.push(effect2);
  293. }
  294. }
  295. function getCurrentScope() {
  296. return activeEffectScope;
  297. }
  298. function onScopeDispose(fn) {
  299. if (activeEffectScope) {
  300. activeEffectScope.cleanups.push(fn);
  301. }
  302. }
  303. let activeEffect;
  304. class ReactiveEffect {
  305. constructor(fn, trigger2, scheduler, scope) {
  306. this.fn = fn;
  307. this.trigger = trigger2;
  308. this.scheduler = scheduler;
  309. this.active = true;
  310. this.deps = [];
  311. this._dirtyLevel = 4;
  312. this._trackId = 0;
  313. this._runnings = 0;
  314. this._shouldSchedule = false;
  315. this._depsLength = 0;
  316. recordEffectScope(this, scope);
  317. }
  318. get dirty() {
  319. if (this._dirtyLevel === 2 || this._dirtyLevel === 3) {
  320. this._dirtyLevel = 1;
  321. pauseTracking();
  322. for (let i = 0; i < this._depsLength; i++) {
  323. const dep = this.deps[i];
  324. if (dep.computed) {
  325. triggerComputed(dep.computed);
  326. if (this._dirtyLevel >= 4) {
  327. break;
  328. }
  329. }
  330. }
  331. if (this._dirtyLevel === 1) {
  332. this._dirtyLevel = 0;
  333. }
  334. resetTracking();
  335. }
  336. return this._dirtyLevel >= 4;
  337. }
  338. set dirty(v) {
  339. this._dirtyLevel = v ? 4 : 0;
  340. }
  341. run() {
  342. this._dirtyLevel = 0;
  343. if (!this.active) {
  344. return this.fn();
  345. }
  346. let lastShouldTrack = shouldTrack;
  347. let lastEffect = activeEffect;
  348. try {
  349. shouldTrack = true;
  350. activeEffect = this;
  351. this._runnings++;
  352. preCleanupEffect(this);
  353. return this.fn();
  354. } finally {
  355. postCleanupEffect(this);
  356. this._runnings--;
  357. activeEffect = lastEffect;
  358. shouldTrack = lastShouldTrack;
  359. }
  360. }
  361. stop() {
  362. var _a;
  363. if (this.active) {
  364. preCleanupEffect(this);
  365. postCleanupEffect(this);
  366. (_a = this.onStop) == null ? void 0 : _a.call(this);
  367. this.active = false;
  368. }
  369. }
  370. }
  371. function triggerComputed(computed2) {
  372. return computed2.value;
  373. }
  374. function preCleanupEffect(effect2) {
  375. effect2._trackId++;
  376. effect2._depsLength = 0;
  377. }
  378. function postCleanupEffect(effect2) {
  379. if (effect2.deps.length > effect2._depsLength) {
  380. for (let i = effect2._depsLength; i < effect2.deps.length; i++) {
  381. cleanupDepEffect(effect2.deps[i], effect2);
  382. }
  383. effect2.deps.length = effect2._depsLength;
  384. }
  385. }
  386. function cleanupDepEffect(dep, effect2) {
  387. const trackId = dep.get(effect2);
  388. if (trackId !== void 0 && effect2._trackId !== trackId) {
  389. dep.delete(effect2);
  390. if (dep.size === 0) {
  391. dep.cleanup();
  392. }
  393. }
  394. }
  395. let shouldTrack = true;
  396. let pauseScheduleStack = 0;
  397. const trackStack = [];
  398. function pauseTracking() {
  399. trackStack.push(shouldTrack);
  400. shouldTrack = false;
  401. }
  402. function resetTracking() {
  403. const last = trackStack.pop();
  404. shouldTrack = last === void 0 ? true : last;
  405. }
  406. function pauseScheduling() {
  407. pauseScheduleStack++;
  408. }
  409. function resetScheduling() {
  410. pauseScheduleStack--;
  411. while (!pauseScheduleStack && queueEffectSchedulers.length) {
  412. queueEffectSchedulers.shift()();
  413. }
  414. }
  415. function trackEffect(effect2, dep, debuggerEventExtraInfo) {
  416. if (dep.get(effect2) !== effect2._trackId) {
  417. dep.set(effect2, effect2._trackId);
  418. const oldDep = effect2.deps[effect2._depsLength];
  419. if (oldDep !== dep) {
  420. if (oldDep) {
  421. cleanupDepEffect(oldDep, effect2);
  422. }
  423. effect2.deps[effect2._depsLength++] = dep;
  424. } else {
  425. effect2._depsLength++;
  426. }
  427. }
  428. }
  429. const queueEffectSchedulers = [];
  430. function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
  431. pauseScheduling();
  432. for (const effect2 of dep.keys()) {
  433. let tracking;
  434. if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
  435. effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
  436. effect2._dirtyLevel = dirtyLevel;
  437. }
  438. if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
  439. effect2.trigger();
  440. if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) {
  441. effect2._shouldSchedule = false;
  442. if (effect2.scheduler) {
  443. queueEffectSchedulers.push(effect2.scheduler);
  444. }
  445. }
  446. }
  447. }
  448. resetScheduling();
  449. }
  450. const createDep = (cleanup, computed2) => {
  451. const dep = /* @__PURE__ */ new Map();
  452. dep.cleanup = cleanup;
  453. dep.computed = computed2;
  454. return dep;
  455. };
  456. const targetMap = /* @__PURE__ */ new WeakMap();
  457. const ITERATE_KEY = Symbol("");
  458. const MAP_KEY_ITERATE_KEY = Symbol("");
  459. function track(target, type, key) {
  460. if (shouldTrack && activeEffect) {
  461. let depsMap = targetMap.get(target);
  462. if (!depsMap) {
  463. targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
  464. }
  465. let dep = depsMap.get(key);
  466. if (!dep) {
  467. depsMap.set(key, dep = createDep(() => depsMap.delete(key)));
  468. }
  469. trackEffect(
  470. activeEffect,
  471. dep
  472. );
  473. }
  474. }
  475. function trigger(target, type, key, newValue, oldValue, oldTarget) {
  476. const depsMap = targetMap.get(target);
  477. if (!depsMap) {
  478. return;
  479. }
  480. let deps = [];
  481. if (type === "clear") {
  482. deps = [...depsMap.values()];
  483. } else if (key === "length" && isArray(target)) {
  484. const newLength = Number(newValue);
  485. depsMap.forEach((dep, key2) => {
  486. if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) {
  487. deps.push(dep);
  488. }
  489. });
  490. } else {
  491. if (key !== void 0) {
  492. deps.push(depsMap.get(key));
  493. }
  494. switch (type) {
  495. case "add":
  496. if (!isArray(target)) {
  497. deps.push(depsMap.get(ITERATE_KEY));
  498. if (isMap(target)) {
  499. deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
  500. }
  501. } else if (isIntegerKey(key)) {
  502. deps.push(depsMap.get("length"));
  503. }
  504. break;
  505. case "delete":
  506. if (!isArray(target)) {
  507. deps.push(depsMap.get(ITERATE_KEY));
  508. if (isMap(target)) {
  509. deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
  510. }
  511. }
  512. break;
  513. case "set":
  514. if (isMap(target)) {
  515. deps.push(depsMap.get(ITERATE_KEY));
  516. }
  517. break;
  518. }
  519. }
  520. pauseScheduling();
  521. for (const dep of deps) {
  522. if (dep) {
  523. triggerEffects(
  524. dep,
  525. 4
  526. );
  527. }
  528. }
  529. resetScheduling();
  530. }
  531. function getDepFromReactive(object, key) {
  532. var _a;
  533. return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
  534. }
  535. const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
  536. const builtInSymbols = new Set(
  537. /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
  538. );
  539. const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
  540. function createArrayInstrumentations() {
  541. const instrumentations = {};
  542. ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
  543. instrumentations[key] = function(...args) {
  544. const arr = toRaw(this);
  545. for (let i = 0, l = this.length; i < l; i++) {
  546. track(arr, "get", i + "");
  547. }
  548. const res = arr[key](...args);
  549. if (res === -1 || res === false) {
  550. return arr[key](...args.map(toRaw));
  551. } else {
  552. return res;
  553. }
  554. };
  555. });
  556. ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
  557. instrumentations[key] = function(...args) {
  558. pauseTracking();
  559. pauseScheduling();
  560. const res = toRaw(this)[key].apply(this, args);
  561. resetScheduling();
  562. resetTracking();
  563. return res;
  564. };
  565. });
  566. return instrumentations;
  567. }
  568. function hasOwnProperty(key) {
  569. if (!isSymbol(key))
  570. key = String(key);
  571. const obj = toRaw(this);
  572. track(obj, "has", key);
  573. return obj.hasOwnProperty(key);
  574. }
  575. class BaseReactiveHandler {
  576. constructor(_isReadonly = false, _isShallow = false) {
  577. this._isReadonly = _isReadonly;
  578. this._isShallow = _isShallow;
  579. }
  580. get(target, key, receiver) {
  581. const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
  582. if (key === "__v_isReactive") {
  583. return !isReadonly2;
  584. } else if (key === "__v_isReadonly") {
  585. return isReadonly2;
  586. } else if (key === "__v_isShallow") {
  587. return isShallow2;
  588. } else if (key === "__v_raw") {
  589. if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
  590. // this means the reciever is a user proxy of the reactive proxy
  591. Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
  592. return target;
  593. }
  594. return;
  595. }
  596. const targetIsArray = isArray(target);
  597. if (!isReadonly2) {
  598. if (targetIsArray && hasOwn(arrayInstrumentations, key)) {
  599. return Reflect.get(arrayInstrumentations, key, receiver);
  600. }
  601. if (key === "hasOwnProperty") {
  602. return hasOwnProperty;
  603. }
  604. }
  605. const res = Reflect.get(target, key, receiver);
  606. if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
  607. return res;
  608. }
  609. if (!isReadonly2) {
  610. track(target, "get", key);
  611. }
  612. if (isShallow2) {
  613. return res;
  614. }
  615. if (isRef(res)) {
  616. return targetIsArray && isIntegerKey(key) ? res : res.value;
  617. }
  618. if (isObject$1(res)) {
  619. return isReadonly2 ? readonly(res) : reactive(res);
  620. }
  621. return res;
  622. }
  623. }
  624. class MutableReactiveHandler extends BaseReactiveHandler {
  625. constructor(isShallow2 = false) {
  626. super(false, isShallow2);
  627. }
  628. set(target, key, value, receiver) {
  629. let oldValue = target[key];
  630. if (!this._isShallow) {
  631. const isOldValueReadonly = isReadonly(oldValue);
  632. if (!isShallow(value) && !isReadonly(value)) {
  633. oldValue = toRaw(oldValue);
  634. value = toRaw(value);
  635. }
  636. if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
  637. if (isOldValueReadonly) {
  638. return false;
  639. } else {
  640. oldValue.value = value;
  641. return true;
  642. }
  643. }
  644. }
  645. const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
  646. const result = Reflect.set(target, key, value, receiver);
  647. if (target === toRaw(receiver)) {
  648. if (!hadKey) {
  649. trigger(target, "add", key, value);
  650. } else if (hasChanged(value, oldValue)) {
  651. trigger(target, "set", key, value);
  652. }
  653. }
  654. return result;
  655. }
  656. deleteProperty(target, key) {
  657. const hadKey = hasOwn(target, key);
  658. target[key];
  659. const result = Reflect.deleteProperty(target, key);
  660. if (result && hadKey) {
  661. trigger(target, "delete", key, void 0);
  662. }
  663. return result;
  664. }
  665. has(target, key) {
  666. const result = Reflect.has(target, key);
  667. if (!isSymbol(key) || !builtInSymbols.has(key)) {
  668. track(target, "has", key);
  669. }
  670. return result;
  671. }
  672. ownKeys(target) {
  673. track(
  674. target,
  675. "iterate",
  676. isArray(target) ? "length" : ITERATE_KEY
  677. );
  678. return Reflect.ownKeys(target);
  679. }
  680. }
  681. class ReadonlyReactiveHandler extends BaseReactiveHandler {
  682. constructor(isShallow2 = false) {
  683. super(true, isShallow2);
  684. }
  685. set(target, key) {
  686. return true;
  687. }
  688. deleteProperty(target, key) {
  689. return true;
  690. }
  691. }
  692. const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
  693. const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
  694. const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(
  695. true
  696. );
  697. const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
  698. const toShallow = (value) => value;
  699. const getProto = (v) => Reflect.getPrototypeOf(v);
  700. function get(target, key, isReadonly2 = false, isShallow2 = false) {
  701. target = target["__v_raw"];
  702. const rawTarget = toRaw(target);
  703. const rawKey = toRaw(key);
  704. if (!isReadonly2) {
  705. if (hasChanged(key, rawKey)) {
  706. track(rawTarget, "get", key);
  707. }
  708. track(rawTarget, "get", rawKey);
  709. }
  710. const { has: has2 } = getProto(rawTarget);
  711. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  712. if (has2.call(rawTarget, key)) {
  713. return wrap(target.get(key));
  714. } else if (has2.call(rawTarget, rawKey)) {
  715. return wrap(target.get(rawKey));
  716. } else if (target !== rawTarget) {
  717. target.get(key);
  718. }
  719. }
  720. function has(key, isReadonly2 = false) {
  721. const target = this["__v_raw"];
  722. const rawTarget = toRaw(target);
  723. const rawKey = toRaw(key);
  724. if (!isReadonly2) {
  725. if (hasChanged(key, rawKey)) {
  726. track(rawTarget, "has", key);
  727. }
  728. track(rawTarget, "has", rawKey);
  729. }
  730. return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
  731. }
  732. function size(target, isReadonly2 = false) {
  733. target = target["__v_raw"];
  734. !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
  735. return Reflect.get(target, "size", target);
  736. }
  737. function add(value) {
  738. value = toRaw(value);
  739. const target = toRaw(this);
  740. const proto = getProto(target);
  741. const hadKey = proto.has.call(target, value);
  742. if (!hadKey) {
  743. target.add(value);
  744. trigger(target, "add", value, value);
  745. }
  746. return this;
  747. }
  748. function set(key, value) {
  749. value = toRaw(value);
  750. const target = toRaw(this);
  751. const { has: has2, get: get2 } = getProto(target);
  752. let hadKey = has2.call(target, key);
  753. if (!hadKey) {
  754. key = toRaw(key);
  755. hadKey = has2.call(target, key);
  756. }
  757. const oldValue = get2.call(target, key);
  758. target.set(key, value);
  759. if (!hadKey) {
  760. trigger(target, "add", key, value);
  761. } else if (hasChanged(value, oldValue)) {
  762. trigger(target, "set", key, value);
  763. }
  764. return this;
  765. }
  766. function deleteEntry(key) {
  767. const target = toRaw(this);
  768. const { has: has2, get: get2 } = getProto(target);
  769. let hadKey = has2.call(target, key);
  770. if (!hadKey) {
  771. key = toRaw(key);
  772. hadKey = has2.call(target, key);
  773. }
  774. get2 ? get2.call(target, key) : void 0;
  775. const result = target.delete(key);
  776. if (hadKey) {
  777. trigger(target, "delete", key, void 0);
  778. }
  779. return result;
  780. }
  781. function clear() {
  782. const target = toRaw(this);
  783. const hadItems = target.size !== 0;
  784. const result = target.clear();
  785. if (hadItems) {
  786. trigger(target, "clear", void 0, void 0);
  787. }
  788. return result;
  789. }
  790. function createForEach(isReadonly2, isShallow2) {
  791. return function forEach(callback, thisArg) {
  792. const observed = this;
  793. const target = observed["__v_raw"];
  794. const rawTarget = toRaw(target);
  795. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  796. !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
  797. return target.forEach((value, key) => {
  798. return callback.call(thisArg, wrap(value), wrap(key), observed);
  799. });
  800. };
  801. }
  802. function createIterableMethod(method, isReadonly2, isShallow2) {
  803. return function(...args) {
  804. const target = this["__v_raw"];
  805. const rawTarget = toRaw(target);
  806. const targetIsMap = isMap(rawTarget);
  807. const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
  808. const isKeyOnly = method === "keys" && targetIsMap;
  809. const innerIterator = target[method](...args);
  810. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  811. !isReadonly2 && track(
  812. rawTarget,
  813. "iterate",
  814. isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
  815. );
  816. return {
  817. // iterator protocol
  818. next() {
  819. const { value, done } = innerIterator.next();
  820. return done ? { value, done } : {
  821. value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
  822. done
  823. };
  824. },
  825. // iterable protocol
  826. [Symbol.iterator]() {
  827. return this;
  828. }
  829. };
  830. };
  831. }
  832. function createReadonlyMethod(type) {
  833. return function(...args) {
  834. return type === "delete" ? false : type === "clear" ? void 0 : this;
  835. };
  836. }
  837. function createInstrumentations() {
  838. const mutableInstrumentations2 = {
  839. get(key) {
  840. return get(this, key);
  841. },
  842. get size() {
  843. return size(this);
  844. },
  845. has,
  846. add,
  847. set,
  848. delete: deleteEntry,
  849. clear,
  850. forEach: createForEach(false, false)
  851. };
  852. const shallowInstrumentations2 = {
  853. get(key) {
  854. return get(this, key, false, true);
  855. },
  856. get size() {
  857. return size(this);
  858. },
  859. has,
  860. add,
  861. set,
  862. delete: deleteEntry,
  863. clear,
  864. forEach: createForEach(false, true)
  865. };
  866. const readonlyInstrumentations2 = {
  867. get(key) {
  868. return get(this, key, true);
  869. },
  870. get size() {
  871. return size(this, true);
  872. },
  873. has(key) {
  874. return has.call(this, key, true);
  875. },
  876. add: createReadonlyMethod("add"),
  877. set: createReadonlyMethod("set"),
  878. delete: createReadonlyMethod("delete"),
  879. clear: createReadonlyMethod("clear"),
  880. forEach: createForEach(true, false)
  881. };
  882. const shallowReadonlyInstrumentations2 = {
  883. get(key) {
  884. return get(this, key, true, true);
  885. },
  886. get size() {
  887. return size(this, true);
  888. },
  889. has(key) {
  890. return has.call(this, key, true);
  891. },
  892. add: createReadonlyMethod("add"),
  893. set: createReadonlyMethod("set"),
  894. delete: createReadonlyMethod("delete"),
  895. clear: createReadonlyMethod("clear"),
  896. forEach: createForEach(true, true)
  897. };
  898. const iteratorMethods = [
  899. "keys",
  900. "values",
  901. "entries",
  902. Symbol.iterator
  903. ];
  904. iteratorMethods.forEach((method) => {
  905. mutableInstrumentations2[method] = createIterableMethod(method, false, false);
  906. readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
  907. shallowInstrumentations2[method] = createIterableMethod(method, false, true);
  908. shallowReadonlyInstrumentations2[method] = createIterableMethod(
  909. method,
  910. true,
  911. true
  912. );
  913. });
  914. return [
  915. mutableInstrumentations2,
  916. readonlyInstrumentations2,
  917. shallowInstrumentations2,
  918. shallowReadonlyInstrumentations2
  919. ];
  920. }
  921. const [
  922. mutableInstrumentations,
  923. readonlyInstrumentations,
  924. shallowInstrumentations,
  925. shallowReadonlyInstrumentations
  926. ] = /* @__PURE__ */ createInstrumentations();
  927. function createInstrumentationGetter(isReadonly2, shallow) {
  928. const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
  929. return (target, key, receiver) => {
  930. if (key === "__v_isReactive") {
  931. return !isReadonly2;
  932. } else if (key === "__v_isReadonly") {
  933. return isReadonly2;
  934. } else if (key === "__v_raw") {
  935. return target;
  936. }
  937. return Reflect.get(
  938. hasOwn(instrumentations, key) && key in target ? instrumentations : target,
  939. key,
  940. receiver
  941. );
  942. };
  943. }
  944. const mutableCollectionHandlers = {
  945. get: /* @__PURE__ */ createInstrumentationGetter(false, false)
  946. };
  947. const shallowCollectionHandlers = {
  948. get: /* @__PURE__ */ createInstrumentationGetter(false, true)
  949. };
  950. const readonlyCollectionHandlers = {
  951. get: /* @__PURE__ */ createInstrumentationGetter(true, false)
  952. };
  953. const shallowReadonlyCollectionHandlers = {
  954. get: /* @__PURE__ */ createInstrumentationGetter(true, true)
  955. };
  956. const reactiveMap = /* @__PURE__ */ new WeakMap();
  957. const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
  958. const readonlyMap = /* @__PURE__ */ new WeakMap();
  959. const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
  960. function targetTypeMap(rawType) {
  961. switch (rawType) {
  962. case "Object":
  963. case "Array":
  964. return 1;
  965. case "Map":
  966. case "Set":
  967. case "WeakMap":
  968. case "WeakSet":
  969. return 2;
  970. default:
  971. return 0;
  972. }
  973. }
  974. function getTargetType(value) {
  975. return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
  976. }
  977. function reactive(target) {
  978. if (isReadonly(target)) {
  979. return target;
  980. }
  981. return createReactiveObject(
  982. target,
  983. false,
  984. mutableHandlers,
  985. mutableCollectionHandlers,
  986. reactiveMap
  987. );
  988. }
  989. function shallowReactive(target) {
  990. return createReactiveObject(
  991. target,
  992. false,
  993. shallowReactiveHandlers,
  994. shallowCollectionHandlers,
  995. shallowReactiveMap
  996. );
  997. }
  998. function readonly(target) {
  999. return createReactiveObject(
  1000. target,
  1001. true,
  1002. readonlyHandlers,
  1003. readonlyCollectionHandlers,
  1004. readonlyMap
  1005. );
  1006. }
  1007. function shallowReadonly(target) {
  1008. return createReactiveObject(
  1009. target,
  1010. true,
  1011. shallowReadonlyHandlers,
  1012. shallowReadonlyCollectionHandlers,
  1013. shallowReadonlyMap
  1014. );
  1015. }
  1016. function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
  1017. if (!isObject$1(target)) {
  1018. return target;
  1019. }
  1020. if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
  1021. return target;
  1022. }
  1023. const existingProxy = proxyMap.get(target);
  1024. if (existingProxy) {
  1025. return existingProxy;
  1026. }
  1027. const targetType = getTargetType(target);
  1028. if (targetType === 0) {
  1029. return target;
  1030. }
  1031. const proxy = new Proxy(
  1032. target,
  1033. targetType === 2 ? collectionHandlers : baseHandlers
  1034. );
  1035. proxyMap.set(target, proxy);
  1036. return proxy;
  1037. }
  1038. function isReactive(value) {
  1039. if (isReadonly(value)) {
  1040. return isReactive(value["__v_raw"]);
  1041. }
  1042. return !!(value && value["__v_isReactive"]);
  1043. }
  1044. function isReadonly(value) {
  1045. return !!(value && value["__v_isReadonly"]);
  1046. }
  1047. function isShallow(value) {
  1048. return !!(value && value["__v_isShallow"]);
  1049. }
  1050. function isProxy(value) {
  1051. return value ? !!value["__v_raw"] : false;
  1052. }
  1053. function toRaw(observed) {
  1054. const raw = observed && observed["__v_raw"];
  1055. return raw ? toRaw(raw) : observed;
  1056. }
  1057. function markRaw(value) {
  1058. if (Object.isExtensible(value)) {
  1059. def(value, "__v_skip", true);
  1060. }
  1061. return value;
  1062. }
  1063. const toReactive = (value) => isObject$1(value) ? reactive(value) : value;
  1064. const toReadonly = (value) => isObject$1(value) ? readonly(value) : value;
  1065. class ComputedRefImpl {
  1066. constructor(getter, _setter, isReadonly2, isSSR) {
  1067. this.getter = getter;
  1068. this._setter = _setter;
  1069. this.dep = void 0;
  1070. this.__v_isRef = true;
  1071. this["__v_isReadonly"] = false;
  1072. this.effect = new ReactiveEffect(
  1073. () => getter(this._value),
  1074. () => triggerRefValue(
  1075. this,
  1076. this.effect._dirtyLevel === 2 ? 2 : 3
  1077. )
  1078. );
  1079. this.effect.computed = this;
  1080. this.effect.active = this._cacheable = !isSSR;
  1081. this["__v_isReadonly"] = isReadonly2;
  1082. }
  1083. get value() {
  1084. const self2 = toRaw(this);
  1085. if ((!self2._cacheable || self2.effect.dirty) && hasChanged(self2._value, self2._value = self2.effect.run())) {
  1086. triggerRefValue(self2, 4);
  1087. }
  1088. trackRefValue(self2);
  1089. if (self2.effect._dirtyLevel >= 2) {
  1090. triggerRefValue(self2, 2);
  1091. }
  1092. return self2._value;
  1093. }
  1094. set value(newValue) {
  1095. this._setter(newValue);
  1096. }
  1097. // #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x
  1098. get _dirty() {
  1099. return this.effect.dirty;
  1100. }
  1101. set _dirty(v) {
  1102. this.effect.dirty = v;
  1103. }
  1104. // #endregion
  1105. }
  1106. function computed$1(getterOrOptions, debugOptions, isSSR = false) {
  1107. let getter;
  1108. let setter;
  1109. const onlyGetter = isFunction(getterOrOptions);
  1110. if (onlyGetter) {
  1111. getter = getterOrOptions;
  1112. setter = NOOP;
  1113. } else {
  1114. getter = getterOrOptions.get;
  1115. setter = getterOrOptions.set;
  1116. }
  1117. const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
  1118. return cRef;
  1119. }
  1120. function trackRefValue(ref2) {
  1121. var _a;
  1122. if (shouldTrack && activeEffect) {
  1123. ref2 = toRaw(ref2);
  1124. trackEffect(
  1125. activeEffect,
  1126. (_a = ref2.dep) != null ? _a : ref2.dep = createDep(
  1127. () => ref2.dep = void 0,
  1128. ref2 instanceof ComputedRefImpl ? ref2 : void 0
  1129. )
  1130. );
  1131. }
  1132. }
  1133. function triggerRefValue(ref2, dirtyLevel = 4, newVal) {
  1134. ref2 = toRaw(ref2);
  1135. const dep = ref2.dep;
  1136. if (dep) {
  1137. triggerEffects(
  1138. dep,
  1139. dirtyLevel
  1140. );
  1141. }
  1142. }
  1143. function isRef(r) {
  1144. return !!(r && r.__v_isRef === true);
  1145. }
  1146. function ref(value) {
  1147. return createRef(value, false);
  1148. }
  1149. function shallowRef(value) {
  1150. return createRef(value, true);
  1151. }
  1152. function createRef(rawValue, shallow) {
  1153. if (isRef(rawValue)) {
  1154. return rawValue;
  1155. }
  1156. return new RefImpl(rawValue, shallow);
  1157. }
  1158. class RefImpl {
  1159. constructor(value, __v_isShallow) {
  1160. this.__v_isShallow = __v_isShallow;
  1161. this.dep = void 0;
  1162. this.__v_isRef = true;
  1163. this._rawValue = __v_isShallow ? value : toRaw(value);
  1164. this._value = __v_isShallow ? value : toReactive(value);
  1165. }
  1166. get value() {
  1167. trackRefValue(this);
  1168. return this._value;
  1169. }
  1170. set value(newVal) {
  1171. const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
  1172. newVal = useDirectValue ? newVal : toRaw(newVal);
  1173. if (hasChanged(newVal, this._rawValue)) {
  1174. this._rawValue = newVal;
  1175. this._value = useDirectValue ? newVal : toReactive(newVal);
  1176. triggerRefValue(this, 4);
  1177. }
  1178. }
  1179. }
  1180. function unref(ref2) {
  1181. return isRef(ref2) ? ref2.value : ref2;
  1182. }
  1183. const shallowUnwrapHandlers = {
  1184. get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
  1185. set: (target, key, value, receiver) => {
  1186. const oldValue = target[key];
  1187. if (isRef(oldValue) && !isRef(value)) {
  1188. oldValue.value = value;
  1189. return true;
  1190. } else {
  1191. return Reflect.set(target, key, value, receiver);
  1192. }
  1193. }
  1194. };
  1195. function proxyRefs(objectWithRefs) {
  1196. return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
  1197. }
  1198. class CustomRefImpl {
  1199. constructor(factory) {
  1200. this.dep = void 0;
  1201. this.__v_isRef = true;
  1202. const { get: get2, set: set2 } = factory(
  1203. () => trackRefValue(this),
  1204. () => triggerRefValue(this)
  1205. );
  1206. this._get = get2;
  1207. this._set = set2;
  1208. }
  1209. get value() {
  1210. return this._get();
  1211. }
  1212. set value(newVal) {
  1213. this._set(newVal);
  1214. }
  1215. }
  1216. function customRef(factory) {
  1217. return new CustomRefImpl(factory);
  1218. }
  1219. class ObjectRefImpl {
  1220. constructor(_object, _key, _defaultValue) {
  1221. this._object = _object;
  1222. this._key = _key;
  1223. this._defaultValue = _defaultValue;
  1224. this.__v_isRef = true;
  1225. }
  1226. get value() {
  1227. const val = this._object[this._key];
  1228. return val === void 0 ? this._defaultValue : val;
  1229. }
  1230. set value(newVal) {
  1231. this._object[this._key] = newVal;
  1232. }
  1233. get dep() {
  1234. return getDepFromReactive(toRaw(this._object), this._key);
  1235. }
  1236. }
  1237. class GetterRefImpl {
  1238. constructor(_getter) {
  1239. this._getter = _getter;
  1240. this.__v_isRef = true;
  1241. this.__v_isReadonly = true;
  1242. }
  1243. get value() {
  1244. return this._getter();
  1245. }
  1246. }
  1247. function toRef$1(source, key, defaultValue) {
  1248. if (isRef(source)) {
  1249. return source;
  1250. } else if (isFunction(source)) {
  1251. return new GetterRefImpl(source);
  1252. } else if (isObject$1(source) && arguments.length > 1) {
  1253. return propertyToRef(source, key, defaultValue);
  1254. } else {
  1255. return ref(source);
  1256. }
  1257. }
  1258. function propertyToRef(source, key, defaultValue) {
  1259. const val = source[key];
  1260. return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
  1261. }
  1262. /**
  1263. * @vue/runtime-core v3.4.24
  1264. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  1265. * @license MIT
  1266. **/
  1267. const stack = [];
  1268. function warn$1(msg, ...args) {
  1269. pauseTracking();
  1270. const instance = stack.length ? stack[stack.length - 1].component : null;
  1271. const appWarnHandler = instance && instance.appContext.config.warnHandler;
  1272. const trace = getComponentTrace();
  1273. if (appWarnHandler) {
  1274. callWithErrorHandling(
  1275. appWarnHandler,
  1276. instance,
  1277. 11,
  1278. [
  1279. msg + args.map((a) => {
  1280. var _a, _b;
  1281. return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
  1282. }).join(""),
  1283. instance && instance.proxy,
  1284. trace.map(
  1285. ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
  1286. ).join("\n"),
  1287. trace
  1288. ]
  1289. );
  1290. } else {
  1291. const warnArgs = [`[Vue warn]: ${msg}`, ...args];
  1292. if (trace.length && // avoid spamming console during tests
  1293. true) {
  1294. warnArgs.push(`
  1295. `, ...formatTrace(trace));
  1296. }
  1297. console.warn(...warnArgs);
  1298. }
  1299. resetTracking();
  1300. }
  1301. function getComponentTrace() {
  1302. let currentVNode = stack[stack.length - 1];
  1303. if (!currentVNode) {
  1304. return [];
  1305. }
  1306. const normalizedStack = [];
  1307. while (currentVNode) {
  1308. const last = normalizedStack[0];
  1309. if (last && last.vnode === currentVNode) {
  1310. last.recurseCount++;
  1311. } else {
  1312. normalizedStack.push({
  1313. vnode: currentVNode,
  1314. recurseCount: 0
  1315. });
  1316. }
  1317. const parentInstance = currentVNode.component && currentVNode.component.parent;
  1318. currentVNode = parentInstance && parentInstance.vnode;
  1319. }
  1320. return normalizedStack;
  1321. }
  1322. function formatTrace(trace) {
  1323. const logs = [];
  1324. trace.forEach((entry, i) => {
  1325. logs.push(...i === 0 ? [] : [`
  1326. `], ...formatTraceEntry(entry));
  1327. });
  1328. return logs;
  1329. }
  1330. function formatTraceEntry({ vnode, recurseCount }) {
  1331. const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
  1332. const isRoot = vnode.component ? vnode.component.parent == null : false;
  1333. const open = ` at <${formatComponentName(
  1334. vnode.component,
  1335. vnode.type,
  1336. isRoot
  1337. )}`;
  1338. const close = `>` + postfix;
  1339. return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
  1340. }
  1341. function formatProps(props) {
  1342. const res = [];
  1343. const keys = Object.keys(props);
  1344. keys.slice(0, 3).forEach((key) => {
  1345. res.push(...formatProp(key, props[key]));
  1346. });
  1347. if (keys.length > 3) {
  1348. res.push(` ...`);
  1349. }
  1350. return res;
  1351. }
  1352. function formatProp(key, value, raw) {
  1353. if (isString(value)) {
  1354. value = JSON.stringify(value);
  1355. return raw ? value : [`${key}=${value}`];
  1356. } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
  1357. return raw ? value : [`${key}=${value}`];
  1358. } else if (isRef(value)) {
  1359. value = formatProp(key, toRaw(value.value), true);
  1360. return raw ? value : [`${key}=Ref<`, value, `>`];
  1361. } else if (isFunction(value)) {
  1362. return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
  1363. } else {
  1364. value = toRaw(value);
  1365. return raw ? value : [`${key}=`, value];
  1366. }
  1367. }
  1368. function callWithErrorHandling(fn, instance, type, args) {
  1369. try {
  1370. return args ? fn(...args) : fn();
  1371. } catch (err) {
  1372. handleError(err, instance, type);
  1373. }
  1374. }
  1375. function callWithAsyncErrorHandling(fn, instance, type, args) {
  1376. if (isFunction(fn)) {
  1377. const res = callWithErrorHandling(fn, instance, type, args);
  1378. if (res && isPromise(res)) {
  1379. res.catch((err) => {
  1380. handleError(err, instance, type);
  1381. });
  1382. }
  1383. return res;
  1384. }
  1385. if (isArray(fn)) {
  1386. const values = [];
  1387. for (let i = 0; i < fn.length; i++) {
  1388. values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
  1389. }
  1390. return values;
  1391. }
  1392. }
  1393. function handleError(err, instance, type, throwInDev = true) {
  1394. const contextVNode = instance ? instance.vnode : null;
  1395. if (instance) {
  1396. let cur = instance.parent;
  1397. const exposedInstance = instance.proxy;
  1398. const errorInfo = `https://vuejs.org/error-reference/#runtime-${type}`;
  1399. while (cur) {
  1400. const errorCapturedHooks = cur.ec;
  1401. if (errorCapturedHooks) {
  1402. for (let i = 0; i < errorCapturedHooks.length; i++) {
  1403. if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
  1404. return;
  1405. }
  1406. }
  1407. }
  1408. cur = cur.parent;
  1409. }
  1410. const appErrorHandler = instance.appContext.config.errorHandler;
  1411. if (appErrorHandler) {
  1412. pauseTracking();
  1413. callWithErrorHandling(
  1414. appErrorHandler,
  1415. null,
  1416. 10,
  1417. [err, exposedInstance, errorInfo]
  1418. );
  1419. resetTracking();
  1420. return;
  1421. }
  1422. }
  1423. logError(err, type, contextVNode, throwInDev);
  1424. }
  1425. function logError(err, type, contextVNode, throwInDev = true) {
  1426. {
  1427. console.error(err);
  1428. }
  1429. }
  1430. let isFlushing = false;
  1431. let isFlushPending = false;
  1432. const queue = [];
  1433. let flushIndex = 0;
  1434. const pendingPostFlushCbs = [];
  1435. let activePostFlushCbs = null;
  1436. let postFlushIndex = 0;
  1437. const resolvedPromise = /* @__PURE__ */ Promise.resolve();
  1438. let currentFlushPromise = null;
  1439. function nextTick(fn) {
  1440. const p2 = currentFlushPromise || resolvedPromise;
  1441. return fn ? p2.then(this ? fn.bind(this) : fn) : p2;
  1442. }
  1443. function findInsertionIndex(id) {
  1444. let start = flushIndex + 1;
  1445. let end = queue.length;
  1446. while (start < end) {
  1447. const middle = start + end >>> 1;
  1448. const middleJob = queue[middle];
  1449. const middleJobId = getId(middleJob);
  1450. if (middleJobId < id || middleJobId === id && middleJob.pre) {
  1451. start = middle + 1;
  1452. } else {
  1453. end = middle;
  1454. }
  1455. }
  1456. return start;
  1457. }
  1458. function queueJob(job) {
  1459. if (!queue.length || !queue.includes(
  1460. job,
  1461. isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex
  1462. )) {
  1463. if (job.id == null) {
  1464. queue.push(job);
  1465. } else {
  1466. queue.splice(findInsertionIndex(job.id), 0, job);
  1467. }
  1468. queueFlush();
  1469. }
  1470. }
  1471. function queueFlush() {
  1472. if (!isFlushing && !isFlushPending) {
  1473. isFlushPending = true;
  1474. currentFlushPromise = resolvedPromise.then(flushJobs);
  1475. }
  1476. }
  1477. function invalidateJob(job) {
  1478. const i = queue.indexOf(job);
  1479. if (i > flushIndex) {
  1480. queue.splice(i, 1);
  1481. }
  1482. }
  1483. function queuePostFlushCb(cb) {
  1484. if (!isArray(cb)) {
  1485. if (!activePostFlushCbs || !activePostFlushCbs.includes(
  1486. cb,
  1487. cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex
  1488. )) {
  1489. pendingPostFlushCbs.push(cb);
  1490. }
  1491. } else {
  1492. pendingPostFlushCbs.push(...cb);
  1493. }
  1494. queueFlush();
  1495. }
  1496. function flushPreFlushCbs(instance, seen2, i = isFlushing ? flushIndex + 1 : 0) {
  1497. for (; i < queue.length; i++) {
  1498. const cb = queue[i];
  1499. if (cb && cb.pre) {
  1500. if (instance && cb.id !== instance.uid) {
  1501. continue;
  1502. }
  1503. queue.splice(i, 1);
  1504. i--;
  1505. cb();
  1506. }
  1507. }
  1508. }
  1509. function flushPostFlushCbs(seen2) {
  1510. if (pendingPostFlushCbs.length) {
  1511. const deduped = [...new Set(pendingPostFlushCbs)].sort(
  1512. (a, b) => getId(a) - getId(b)
  1513. );
  1514. pendingPostFlushCbs.length = 0;
  1515. if (activePostFlushCbs) {
  1516. activePostFlushCbs.push(...deduped);
  1517. return;
  1518. }
  1519. activePostFlushCbs = deduped;
  1520. for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
  1521. activePostFlushCbs[postFlushIndex]();
  1522. }
  1523. activePostFlushCbs = null;
  1524. postFlushIndex = 0;
  1525. }
  1526. }
  1527. const getId = (job) => job.id == null ? Infinity : job.id;
  1528. const comparator = (a, b) => {
  1529. const diff = getId(a) - getId(b);
  1530. if (diff === 0) {
  1531. if (a.pre && !b.pre)
  1532. return -1;
  1533. if (b.pre && !a.pre)
  1534. return 1;
  1535. }
  1536. return diff;
  1537. };
  1538. function flushJobs(seen2) {
  1539. isFlushPending = false;
  1540. isFlushing = true;
  1541. queue.sort(comparator);
  1542. try {
  1543. for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
  1544. const job = queue[flushIndex];
  1545. if (job && job.active !== false) {
  1546. if (false)
  1547. ;
  1548. callWithErrorHandling(job, null, 14);
  1549. }
  1550. }
  1551. } finally {
  1552. flushIndex = 0;
  1553. queue.length = 0;
  1554. flushPostFlushCbs();
  1555. isFlushing = false;
  1556. currentFlushPromise = null;
  1557. if (queue.length || pendingPostFlushCbs.length) {
  1558. flushJobs();
  1559. }
  1560. }
  1561. }
  1562. function emit(instance, event, ...rawArgs) {
  1563. if (instance.isUnmounted)
  1564. return;
  1565. const props = instance.vnode.props || EMPTY_OBJ;
  1566. let args = rawArgs;
  1567. const isModelListener2 = event.startsWith("update:");
  1568. const modelArg = isModelListener2 && event.slice(7);
  1569. if (modelArg && modelArg in props) {
  1570. const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`;
  1571. const { number, trim } = props[modifiersKey] || EMPTY_OBJ;
  1572. if (trim) {
  1573. args = rawArgs.map((a) => isString(a) ? a.trim() : a);
  1574. }
  1575. if (number) {
  1576. args = rawArgs.map(looseToNumber);
  1577. }
  1578. }
  1579. let handlerName;
  1580. let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
  1581. props[handlerName = toHandlerKey(camelize(event))];
  1582. if (!handler && isModelListener2) {
  1583. handler = props[handlerName = toHandlerKey(hyphenate(event))];
  1584. }
  1585. if (handler) {
  1586. callWithAsyncErrorHandling(
  1587. handler,
  1588. instance,
  1589. 6,
  1590. args
  1591. );
  1592. }
  1593. const onceHandler = props[handlerName + `Once`];
  1594. if (onceHandler) {
  1595. if (!instance.emitted) {
  1596. instance.emitted = {};
  1597. } else if (instance.emitted[handlerName]) {
  1598. return;
  1599. }
  1600. instance.emitted[handlerName] = true;
  1601. callWithAsyncErrorHandling(
  1602. onceHandler,
  1603. instance,
  1604. 6,
  1605. args
  1606. );
  1607. }
  1608. }
  1609. function normalizeEmitsOptions(comp, appContext, asMixin = false) {
  1610. const cache = appContext.emitsCache;
  1611. const cached = cache.get(comp);
  1612. if (cached !== void 0) {
  1613. return cached;
  1614. }
  1615. const raw = comp.emits;
  1616. let normalized = {};
  1617. let hasExtends = false;
  1618. if (!isFunction(comp)) {
  1619. const extendEmits = (raw2) => {
  1620. const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
  1621. if (normalizedFromExtend) {
  1622. hasExtends = true;
  1623. extend(normalized, normalizedFromExtend);
  1624. }
  1625. };
  1626. if (!asMixin && appContext.mixins.length) {
  1627. appContext.mixins.forEach(extendEmits);
  1628. }
  1629. if (comp.extends) {
  1630. extendEmits(comp.extends);
  1631. }
  1632. if (comp.mixins) {
  1633. comp.mixins.forEach(extendEmits);
  1634. }
  1635. }
  1636. if (!raw && !hasExtends) {
  1637. if (isObject$1(comp)) {
  1638. cache.set(comp, null);
  1639. }
  1640. return null;
  1641. }
  1642. if (isArray(raw)) {
  1643. raw.forEach((key) => normalized[key] = null);
  1644. } else {
  1645. extend(normalized, raw);
  1646. }
  1647. if (isObject$1(comp)) {
  1648. cache.set(comp, normalized);
  1649. }
  1650. return normalized;
  1651. }
  1652. function isEmitListener(options, key) {
  1653. if (!options || !isOn(key)) {
  1654. return false;
  1655. }
  1656. key = key.slice(2).replace(/Once$/, "");
  1657. return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
  1658. }
  1659. let currentRenderingInstance = null;
  1660. let currentScopeId = null;
  1661. function setCurrentRenderingInstance(instance) {
  1662. const prev = currentRenderingInstance;
  1663. currentRenderingInstance = instance;
  1664. currentScopeId = instance && instance.type.__scopeId || null;
  1665. return prev;
  1666. }
  1667. function pushScopeId(id) {
  1668. currentScopeId = id;
  1669. }
  1670. function popScopeId() {
  1671. currentScopeId = null;
  1672. }
  1673. function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
  1674. if (!ctx)
  1675. return fn;
  1676. if (fn._n) {
  1677. return fn;
  1678. }
  1679. const renderFnWithContext = (...args) => {
  1680. if (renderFnWithContext._d) {
  1681. setBlockTracking(-1);
  1682. }
  1683. const prevInstance = setCurrentRenderingInstance(ctx);
  1684. let res;
  1685. try {
  1686. res = fn(...args);
  1687. } finally {
  1688. setCurrentRenderingInstance(prevInstance);
  1689. if (renderFnWithContext._d) {
  1690. setBlockTracking(1);
  1691. }
  1692. }
  1693. return res;
  1694. };
  1695. renderFnWithContext._n = true;
  1696. renderFnWithContext._c = true;
  1697. renderFnWithContext._d = true;
  1698. return renderFnWithContext;
  1699. }
  1700. function markAttrsAccessed() {
  1701. }
  1702. function renderComponentRoot(instance) {
  1703. const {
  1704. type: Component,
  1705. vnode,
  1706. proxy,
  1707. withProxy,
  1708. propsOptions: [propsOptions],
  1709. slots,
  1710. attrs,
  1711. emit: emit2,
  1712. render,
  1713. renderCache,
  1714. props,
  1715. data,
  1716. setupState,
  1717. ctx,
  1718. inheritAttrs
  1719. } = instance;
  1720. const prev = setCurrentRenderingInstance(instance);
  1721. let result;
  1722. let fallthroughAttrs;
  1723. try {
  1724. if (vnode.shapeFlag & 4) {
  1725. const proxyToUse = withProxy || proxy;
  1726. const thisProxy = false ? new Proxy(proxyToUse, {
  1727. get(target, key, receiver) {
  1728. warn$1(
  1729. `Property '${String(
  1730. key
  1731. )}' was accessed via 'this'. Avoid using 'this' in templates.`
  1732. );
  1733. return Reflect.get(target, key, receiver);
  1734. }
  1735. }) : proxyToUse;
  1736. result = normalizeVNode(
  1737. render.call(
  1738. thisProxy,
  1739. proxyToUse,
  1740. renderCache,
  1741. false ? shallowReadonly(props) : props,
  1742. setupState,
  1743. data,
  1744. ctx
  1745. )
  1746. );
  1747. fallthroughAttrs = attrs;
  1748. } else {
  1749. const render2 = Component;
  1750. if (false)
  1751. ;
  1752. result = normalizeVNode(
  1753. render2.length > 1 ? render2(
  1754. false ? shallowReadonly(props) : props,
  1755. false ? {
  1756. get attrs() {
  1757. markAttrsAccessed();
  1758. return attrs;
  1759. },
  1760. slots,
  1761. emit: emit2
  1762. } : { attrs, slots, emit: emit2 }
  1763. ) : render2(
  1764. false ? shallowReadonly(props) : props,
  1765. null
  1766. )
  1767. );
  1768. fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
  1769. }
  1770. } catch (err) {
  1771. blockStack.length = 0;
  1772. handleError(err, instance, 1);
  1773. result = createVNode(Comment);
  1774. }
  1775. let root = result;
  1776. if (fallthroughAttrs && inheritAttrs !== false) {
  1777. const keys = Object.keys(fallthroughAttrs);
  1778. const { shapeFlag } = root;
  1779. if (keys.length) {
  1780. if (shapeFlag & (1 | 6)) {
  1781. if (propsOptions && keys.some(isModelListener)) {
  1782. fallthroughAttrs = filterModelListeners(
  1783. fallthroughAttrs,
  1784. propsOptions
  1785. );
  1786. }
  1787. root = cloneVNode(root, fallthroughAttrs);
  1788. }
  1789. }
  1790. }
  1791. if (vnode.dirs) {
  1792. root = cloneVNode(root);
  1793. root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
  1794. }
  1795. if (vnode.transition) {
  1796. root.transition = vnode.transition;
  1797. }
  1798. {
  1799. result = root;
  1800. }
  1801. setCurrentRenderingInstance(prev);
  1802. return result;
  1803. }
  1804. const getFunctionalFallthrough = (attrs) => {
  1805. let res;
  1806. for (const key in attrs) {
  1807. if (key === "class" || key === "style" || isOn(key)) {
  1808. (res || (res = {}))[key] = attrs[key];
  1809. }
  1810. }
  1811. return res;
  1812. };
  1813. const filterModelListeners = (attrs, props) => {
  1814. const res = {};
  1815. for (const key in attrs) {
  1816. if (!isModelListener(key) || !(key.slice(9) in props)) {
  1817. res[key] = attrs[key];
  1818. }
  1819. }
  1820. return res;
  1821. };
  1822. function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
  1823. const { props: prevProps, children: prevChildren, component } = prevVNode;
  1824. const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
  1825. const emits = component.emitsOptions;
  1826. if (nextVNode.dirs || nextVNode.transition) {
  1827. return true;
  1828. }
  1829. if (optimized && patchFlag >= 0) {
  1830. if (patchFlag & 1024) {
  1831. return true;
  1832. }
  1833. if (patchFlag & 16) {
  1834. if (!prevProps) {
  1835. return !!nextProps;
  1836. }
  1837. return hasPropsChanged(prevProps, nextProps, emits);
  1838. } else if (patchFlag & 8) {
  1839. const dynamicProps = nextVNode.dynamicProps;
  1840. for (let i = 0; i < dynamicProps.length; i++) {
  1841. const key = dynamicProps[i];
  1842. if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
  1843. return true;
  1844. }
  1845. }
  1846. }
  1847. } else {
  1848. if (prevChildren || nextChildren) {
  1849. if (!nextChildren || !nextChildren.$stable) {
  1850. return true;
  1851. }
  1852. }
  1853. if (prevProps === nextProps) {
  1854. return false;
  1855. }
  1856. if (!prevProps) {
  1857. return !!nextProps;
  1858. }
  1859. if (!nextProps) {
  1860. return true;
  1861. }
  1862. return hasPropsChanged(prevProps, nextProps, emits);
  1863. }
  1864. return false;
  1865. }
  1866. function hasPropsChanged(prevProps, nextProps, emitsOptions) {
  1867. const nextKeys = Object.keys(nextProps);
  1868. if (nextKeys.length !== Object.keys(prevProps).length) {
  1869. return true;
  1870. }
  1871. for (let i = 0; i < nextKeys.length; i++) {
  1872. const key = nextKeys[i];
  1873. if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
  1874. return true;
  1875. }
  1876. }
  1877. return false;
  1878. }
  1879. function updateHOCHostEl({ vnode, parent }, el) {
  1880. while (parent) {
  1881. const root = parent.subTree;
  1882. if (root.suspense && root.suspense.activeBranch === vnode) {
  1883. root.el = vnode.el;
  1884. }
  1885. if (root === vnode) {
  1886. (vnode = parent.vnode).el = el;
  1887. parent = parent.parent;
  1888. } else {
  1889. break;
  1890. }
  1891. }
  1892. }
  1893. const COMPONENTS = "components";
  1894. function resolveComponent(name, maybeSelfReference) {
  1895. return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
  1896. }
  1897. const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
  1898. function resolveDynamicComponent(component) {
  1899. if (isString(component)) {
  1900. return resolveAsset(COMPONENTS, component, false) || component;
  1901. } else {
  1902. return component || NULL_DYNAMIC_COMPONENT;
  1903. }
  1904. }
  1905. function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
  1906. const instance = currentRenderingInstance || currentInstance;
  1907. if (instance) {
  1908. const Component = instance.type;
  1909. if (type === COMPONENTS) {
  1910. const selfName = getComponentName(
  1911. Component,
  1912. false
  1913. );
  1914. if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
  1915. return Component;
  1916. }
  1917. }
  1918. const res = (
  1919. // local registration
  1920. // check instance[type] first which is resolved for options API
  1921. resolve(instance[type] || Component[type], name) || // global registration
  1922. resolve(instance.appContext[type], name)
  1923. );
  1924. if (!res && maybeSelfReference) {
  1925. return Component;
  1926. }
  1927. return res;
  1928. }
  1929. }
  1930. function resolve(registry, name) {
  1931. return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
  1932. }
  1933. const isSuspense = (type) => type.__isSuspense;
  1934. function queueEffectWithSuspense(fn, suspense) {
  1935. if (suspense && suspense.pendingBranch) {
  1936. if (isArray(fn)) {
  1937. suspense.effects.push(...fn);
  1938. } else {
  1939. suspense.effects.push(fn);
  1940. }
  1941. } else {
  1942. queuePostFlushCb(fn);
  1943. }
  1944. }
  1945. const ssrContextKey = Symbol.for("v-scx");
  1946. const useSSRContext = () => {
  1947. {
  1948. const ctx = inject(ssrContextKey);
  1949. return ctx;
  1950. }
  1951. };
  1952. function watchEffect(effect2, options) {
  1953. return doWatch(effect2, null, options);
  1954. }
  1955. function watchPostEffect(effect2, options) {
  1956. return doWatch(
  1957. effect2,
  1958. null,
  1959. { flush: "post" }
  1960. );
  1961. }
  1962. const INITIAL_WATCHER_VALUE = {};
  1963. function watch(source, cb, options) {
  1964. return doWatch(source, cb, options);
  1965. }
  1966. function doWatch(source, cb, {
  1967. immediate,
  1968. deep,
  1969. flush,
  1970. once,
  1971. onTrack,
  1972. onTrigger
  1973. } = EMPTY_OBJ) {
  1974. if (cb && once) {
  1975. const _cb = cb;
  1976. cb = (...args) => {
  1977. _cb(...args);
  1978. unwatch();
  1979. };
  1980. }
  1981. const instance = currentInstance;
  1982. const reactiveGetter = (source2) => deep === true ? source2 : (
  1983. // for deep: false, only traverse root-level properties
  1984. traverse(source2, deep === false ? 1 : void 0)
  1985. );
  1986. let getter;
  1987. let forceTrigger = false;
  1988. let isMultiSource = false;
  1989. if (isRef(source)) {
  1990. getter = () => source.value;
  1991. forceTrigger = isShallow(source);
  1992. } else if (isReactive(source)) {
  1993. getter = () => reactiveGetter(source);
  1994. forceTrigger = true;
  1995. } else if (isArray(source)) {
  1996. isMultiSource = true;
  1997. forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
  1998. getter = () => source.map((s) => {
  1999. if (isRef(s)) {
  2000. return s.value;
  2001. } else if (isReactive(s)) {
  2002. return reactiveGetter(s);
  2003. } else if (isFunction(s)) {
  2004. return callWithErrorHandling(s, instance, 2);
  2005. } else
  2006. ;
  2007. });
  2008. } else if (isFunction(source)) {
  2009. if (cb) {
  2010. getter = () => callWithErrorHandling(source, instance, 2);
  2011. } else {
  2012. getter = () => {
  2013. if (cleanup) {
  2014. cleanup();
  2015. }
  2016. return callWithAsyncErrorHandling(
  2017. source,
  2018. instance,
  2019. 3,
  2020. [onCleanup]
  2021. );
  2022. };
  2023. }
  2024. } else {
  2025. getter = NOOP;
  2026. }
  2027. if (cb && deep) {
  2028. const baseGetter = getter;
  2029. getter = () => traverse(baseGetter());
  2030. }
  2031. let cleanup;
  2032. let onCleanup = (fn) => {
  2033. cleanup = effect2.onStop = () => {
  2034. callWithErrorHandling(fn, instance, 4);
  2035. cleanup = effect2.onStop = void 0;
  2036. };
  2037. };
  2038. let ssrCleanup;
  2039. if (isInSSRComponentSetup) {
  2040. onCleanup = NOOP;
  2041. if (!cb) {
  2042. getter();
  2043. } else if (immediate) {
  2044. callWithAsyncErrorHandling(cb, instance, 3, [
  2045. getter(),
  2046. isMultiSource ? [] : void 0,
  2047. onCleanup
  2048. ]);
  2049. }
  2050. if (flush === "sync") {
  2051. const ctx = useSSRContext();
  2052. ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
  2053. } else {
  2054. return NOOP;
  2055. }
  2056. }
  2057. let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
  2058. const job = () => {
  2059. if (!effect2.active || !effect2.dirty) {
  2060. return;
  2061. }
  2062. if (cb) {
  2063. const newValue = effect2.run();
  2064. if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {
  2065. if (cleanup) {
  2066. cleanup();
  2067. }
  2068. callWithAsyncErrorHandling(cb, instance, 3, [
  2069. newValue,
  2070. // pass undefined as the old value when it's changed for the first time
  2071. oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
  2072. onCleanup
  2073. ]);
  2074. oldValue = newValue;
  2075. }
  2076. } else {
  2077. effect2.run();
  2078. }
  2079. };
  2080. job.allowRecurse = !!cb;
  2081. let scheduler;
  2082. if (flush === "sync") {
  2083. scheduler = job;
  2084. } else if (flush === "post") {
  2085. scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
  2086. } else {
  2087. job.pre = true;
  2088. if (instance)
  2089. job.id = instance.uid;
  2090. scheduler = () => queueJob(job);
  2091. }
  2092. const effect2 = new ReactiveEffect(getter, NOOP, scheduler);
  2093. const scope = getCurrentScope();
  2094. const unwatch = () => {
  2095. effect2.stop();
  2096. if (scope) {
  2097. remove(scope.effects, effect2);
  2098. }
  2099. };
  2100. if (cb) {
  2101. if (immediate) {
  2102. job();
  2103. } else {
  2104. oldValue = effect2.run();
  2105. }
  2106. } else if (flush === "post") {
  2107. queuePostRenderEffect(
  2108. effect2.run.bind(effect2),
  2109. instance && instance.suspense
  2110. );
  2111. } else {
  2112. effect2.run();
  2113. }
  2114. if (ssrCleanup)
  2115. ssrCleanup.push(unwatch);
  2116. return unwatch;
  2117. }
  2118. function instanceWatch(source, value, options) {
  2119. const publicThis = this.proxy;
  2120. const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  2121. let cb;
  2122. if (isFunction(value)) {
  2123. cb = value;
  2124. } else {
  2125. cb = value.handler;
  2126. options = value;
  2127. }
  2128. const reset = setCurrentInstance(this);
  2129. const res = doWatch(getter, cb.bind(publicThis), options);
  2130. reset();
  2131. return res;
  2132. }
  2133. function createPathGetter(ctx, path) {
  2134. const segments = path.split(".");
  2135. return () => {
  2136. let cur = ctx;
  2137. for (let i = 0; i < segments.length && cur; i++) {
  2138. cur = cur[segments[i]];
  2139. }
  2140. return cur;
  2141. };
  2142. }
  2143. function traverse(value, depth, currentDepth = 0, seen2) {
  2144. if (!isObject$1(value) || value["__v_skip"]) {
  2145. return value;
  2146. }
  2147. if (depth && depth > 0) {
  2148. if (currentDepth >= depth) {
  2149. return value;
  2150. }
  2151. currentDepth++;
  2152. }
  2153. seen2 = seen2 || /* @__PURE__ */ new Set();
  2154. if (seen2.has(value)) {
  2155. return value;
  2156. }
  2157. seen2.add(value);
  2158. if (isRef(value)) {
  2159. traverse(value.value, depth, currentDepth, seen2);
  2160. } else if (isArray(value)) {
  2161. for (let i = 0; i < value.length; i++) {
  2162. traverse(value[i], depth, currentDepth, seen2);
  2163. }
  2164. } else if (isSet(value) || isMap(value)) {
  2165. value.forEach((v) => {
  2166. traverse(v, depth, currentDepth, seen2);
  2167. });
  2168. } else if (isPlainObject(value)) {
  2169. for (const key in value) {
  2170. traverse(value[key], depth, currentDepth, seen2);
  2171. }
  2172. }
  2173. return value;
  2174. }
  2175. function withDirectives(vnode, directives) {
  2176. if (currentRenderingInstance === null) {
  2177. return vnode;
  2178. }
  2179. const instance = getExposeProxy(currentRenderingInstance) || currentRenderingInstance.proxy;
  2180. const bindings = vnode.dirs || (vnode.dirs = []);
  2181. for (let i = 0; i < directives.length; i++) {
  2182. let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
  2183. if (dir) {
  2184. if (isFunction(dir)) {
  2185. dir = {
  2186. mounted: dir,
  2187. updated: dir
  2188. };
  2189. }
  2190. if (dir.deep) {
  2191. traverse(value);
  2192. }
  2193. bindings.push({
  2194. dir,
  2195. instance,
  2196. value,
  2197. oldValue: void 0,
  2198. arg,
  2199. modifiers
  2200. });
  2201. }
  2202. }
  2203. return vnode;
  2204. }
  2205. function invokeDirectiveHook(vnode, prevVNode, instance, name) {
  2206. const bindings = vnode.dirs;
  2207. const oldBindings = prevVNode && prevVNode.dirs;
  2208. for (let i = 0; i < bindings.length; i++) {
  2209. const binding = bindings[i];
  2210. if (oldBindings) {
  2211. binding.oldValue = oldBindings[i].value;
  2212. }
  2213. let hook = binding.dir[name];
  2214. if (hook) {
  2215. pauseTracking();
  2216. callWithAsyncErrorHandling(hook, instance, 8, [
  2217. vnode.el,
  2218. binding,
  2219. vnode,
  2220. prevVNode
  2221. ]);
  2222. resetTracking();
  2223. }
  2224. }
  2225. }
  2226. const leaveCbKey = Symbol("_leaveCb");
  2227. const enterCbKey = Symbol("_enterCb");
  2228. function useTransitionState() {
  2229. const state = {
  2230. isMounted: false,
  2231. isLeaving: false,
  2232. isUnmounting: false,
  2233. leavingVNodes: /* @__PURE__ */ new Map()
  2234. };
  2235. onMounted(() => {
  2236. state.isMounted = true;
  2237. });
  2238. onBeforeUnmount(() => {
  2239. state.isUnmounting = true;
  2240. });
  2241. return state;
  2242. }
  2243. const TransitionHookValidator = [Function, Array];
  2244. const BaseTransitionPropsValidators = {
  2245. mode: String,
  2246. appear: Boolean,
  2247. persisted: Boolean,
  2248. // enter
  2249. onBeforeEnter: TransitionHookValidator,
  2250. onEnter: TransitionHookValidator,
  2251. onAfterEnter: TransitionHookValidator,
  2252. onEnterCancelled: TransitionHookValidator,
  2253. // leave
  2254. onBeforeLeave: TransitionHookValidator,
  2255. onLeave: TransitionHookValidator,
  2256. onAfterLeave: TransitionHookValidator,
  2257. onLeaveCancelled: TransitionHookValidator,
  2258. // appear
  2259. onBeforeAppear: TransitionHookValidator,
  2260. onAppear: TransitionHookValidator,
  2261. onAfterAppear: TransitionHookValidator,
  2262. onAppearCancelled: TransitionHookValidator
  2263. };
  2264. const BaseTransitionImpl = {
  2265. name: `BaseTransition`,
  2266. props: BaseTransitionPropsValidators,
  2267. setup(props, { slots }) {
  2268. const instance = getCurrentInstance();
  2269. const state = useTransitionState();
  2270. return () => {
  2271. const children = slots.default && getTransitionRawChildren(slots.default(), true);
  2272. if (!children || !children.length) {
  2273. return;
  2274. }
  2275. let child = children[0];
  2276. if (children.length > 1) {
  2277. for (const c of children) {
  2278. if (c.type !== Comment) {
  2279. child = c;
  2280. break;
  2281. }
  2282. }
  2283. }
  2284. const rawProps = toRaw(props);
  2285. const { mode } = rawProps;
  2286. if (state.isLeaving) {
  2287. return emptyPlaceholder(child);
  2288. }
  2289. const innerChild = getKeepAliveChild(child);
  2290. if (!innerChild) {
  2291. return emptyPlaceholder(child);
  2292. }
  2293. const enterHooks = resolveTransitionHooks(
  2294. innerChild,
  2295. rawProps,
  2296. state,
  2297. instance
  2298. );
  2299. setTransitionHooks(innerChild, enterHooks);
  2300. const oldChild = instance.subTree;
  2301. const oldInnerChild = oldChild && getKeepAliveChild(oldChild);
  2302. if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild)) {
  2303. const leavingHooks = resolveTransitionHooks(
  2304. oldInnerChild,
  2305. rawProps,
  2306. state,
  2307. instance
  2308. );
  2309. setTransitionHooks(oldInnerChild, leavingHooks);
  2310. if (mode === "out-in") {
  2311. state.isLeaving = true;
  2312. leavingHooks.afterLeave = () => {
  2313. state.isLeaving = false;
  2314. if (instance.update.active !== false) {
  2315. instance.effect.dirty = true;
  2316. instance.update();
  2317. }
  2318. };
  2319. return emptyPlaceholder(child);
  2320. } else if (mode === "in-out" && innerChild.type !== Comment) {
  2321. leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
  2322. const leavingVNodesCache = getLeavingNodesForType(
  2323. state,
  2324. oldInnerChild
  2325. );
  2326. leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
  2327. el[leaveCbKey] = () => {
  2328. earlyRemove();
  2329. el[leaveCbKey] = void 0;
  2330. delete enterHooks.delayedLeave;
  2331. };
  2332. enterHooks.delayedLeave = delayedLeave;
  2333. };
  2334. }
  2335. }
  2336. return child;
  2337. };
  2338. }
  2339. };
  2340. const BaseTransition = BaseTransitionImpl;
  2341. function getLeavingNodesForType(state, vnode) {
  2342. const { leavingVNodes } = state;
  2343. let leavingVNodesCache = leavingVNodes.get(vnode.type);
  2344. if (!leavingVNodesCache) {
  2345. leavingVNodesCache = /* @__PURE__ */ Object.create(null);
  2346. leavingVNodes.set(vnode.type, leavingVNodesCache);
  2347. }
  2348. return leavingVNodesCache;
  2349. }
  2350. function resolveTransitionHooks(vnode, props, state, instance) {
  2351. const {
  2352. appear,
  2353. mode,
  2354. persisted = false,
  2355. onBeforeEnter,
  2356. onEnter,
  2357. onAfterEnter,
  2358. onEnterCancelled,
  2359. onBeforeLeave,
  2360. onLeave,
  2361. onAfterLeave,
  2362. onLeaveCancelled,
  2363. onBeforeAppear,
  2364. onAppear,
  2365. onAfterAppear,
  2366. onAppearCancelled
  2367. } = props;
  2368. const key = String(vnode.key);
  2369. const leavingVNodesCache = getLeavingNodesForType(state, vnode);
  2370. const callHook2 = (hook, args) => {
  2371. hook && callWithAsyncErrorHandling(
  2372. hook,
  2373. instance,
  2374. 9,
  2375. args
  2376. );
  2377. };
  2378. const callAsyncHook = (hook, args) => {
  2379. const done = args[1];
  2380. callHook2(hook, args);
  2381. if (isArray(hook)) {
  2382. if (hook.every((hook2) => hook2.length <= 1))
  2383. done();
  2384. } else if (hook.length <= 1) {
  2385. done();
  2386. }
  2387. };
  2388. const hooks = {
  2389. mode,
  2390. persisted,
  2391. beforeEnter(el) {
  2392. let hook = onBeforeEnter;
  2393. if (!state.isMounted) {
  2394. if (appear) {
  2395. hook = onBeforeAppear || onBeforeEnter;
  2396. } else {
  2397. return;
  2398. }
  2399. }
  2400. if (el[leaveCbKey]) {
  2401. el[leaveCbKey](
  2402. true
  2403. /* cancelled */
  2404. );
  2405. }
  2406. const leavingVNode = leavingVNodesCache[key];
  2407. if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
  2408. leavingVNode.el[leaveCbKey]();
  2409. }
  2410. callHook2(hook, [el]);
  2411. },
  2412. enter(el) {
  2413. let hook = onEnter;
  2414. let afterHook = onAfterEnter;
  2415. let cancelHook = onEnterCancelled;
  2416. if (!state.isMounted) {
  2417. if (appear) {
  2418. hook = onAppear || onEnter;
  2419. afterHook = onAfterAppear || onAfterEnter;
  2420. cancelHook = onAppearCancelled || onEnterCancelled;
  2421. } else {
  2422. return;
  2423. }
  2424. }
  2425. let called = false;
  2426. const done = el[enterCbKey] = (cancelled) => {
  2427. if (called)
  2428. return;
  2429. called = true;
  2430. if (cancelled) {
  2431. callHook2(cancelHook, [el]);
  2432. } else {
  2433. callHook2(afterHook, [el]);
  2434. }
  2435. if (hooks.delayedLeave) {
  2436. hooks.delayedLeave();
  2437. }
  2438. el[enterCbKey] = void 0;
  2439. };
  2440. if (hook) {
  2441. callAsyncHook(hook, [el, done]);
  2442. } else {
  2443. done();
  2444. }
  2445. },
  2446. leave(el, remove2) {
  2447. const key2 = String(vnode.key);
  2448. if (el[enterCbKey]) {
  2449. el[enterCbKey](
  2450. true
  2451. /* cancelled */
  2452. );
  2453. }
  2454. if (state.isUnmounting) {
  2455. return remove2();
  2456. }
  2457. callHook2(onBeforeLeave, [el]);
  2458. let called = false;
  2459. const done = el[leaveCbKey] = (cancelled) => {
  2460. if (called)
  2461. return;
  2462. called = true;
  2463. remove2();
  2464. if (cancelled) {
  2465. callHook2(onLeaveCancelled, [el]);
  2466. } else {
  2467. callHook2(onAfterLeave, [el]);
  2468. }
  2469. el[leaveCbKey] = void 0;
  2470. if (leavingVNodesCache[key2] === vnode) {
  2471. delete leavingVNodesCache[key2];
  2472. }
  2473. };
  2474. leavingVNodesCache[key2] = vnode;
  2475. if (onLeave) {
  2476. callAsyncHook(onLeave, [el, done]);
  2477. } else {
  2478. done();
  2479. }
  2480. },
  2481. clone(vnode2) {
  2482. return resolveTransitionHooks(vnode2, props, state, instance);
  2483. }
  2484. };
  2485. return hooks;
  2486. }
  2487. function emptyPlaceholder(vnode) {
  2488. if (isKeepAlive(vnode)) {
  2489. vnode = cloneVNode(vnode);
  2490. vnode.children = null;
  2491. return vnode;
  2492. }
  2493. }
  2494. function getKeepAliveChild(vnode) {
  2495. if (!isKeepAlive(vnode)) {
  2496. return vnode;
  2497. }
  2498. const { shapeFlag, children } = vnode;
  2499. if (shapeFlag & 16) {
  2500. return children[0];
  2501. }
  2502. if (shapeFlag & 32 && isFunction(children.default)) {
  2503. return children.default();
  2504. }
  2505. }
  2506. function setTransitionHooks(vnode, hooks) {
  2507. if (vnode.shapeFlag & 6 && vnode.component) {
  2508. setTransitionHooks(vnode.component.subTree, hooks);
  2509. } else if (vnode.shapeFlag & 128) {
  2510. vnode.ssContent.transition = hooks.clone(vnode.ssContent);
  2511. vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
  2512. } else {
  2513. vnode.transition = hooks;
  2514. }
  2515. }
  2516. function getTransitionRawChildren(children, keepComment = false, parentKey) {
  2517. let ret = [];
  2518. let keyedFragmentCount = 0;
  2519. for (let i = 0; i < children.length; i++) {
  2520. let child = children[i];
  2521. const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);
  2522. if (child.type === Fragment) {
  2523. if (child.patchFlag & 128)
  2524. keyedFragmentCount++;
  2525. ret = ret.concat(
  2526. getTransitionRawChildren(child.children, keepComment, key)
  2527. );
  2528. } else if (keepComment || child.type !== Comment) {
  2529. ret.push(key != null ? cloneVNode(child, { key }) : child);
  2530. }
  2531. }
  2532. if (keyedFragmentCount > 1) {
  2533. for (let i = 0; i < ret.length; i++) {
  2534. ret[i].patchFlag = -2;
  2535. }
  2536. }
  2537. return ret;
  2538. }
  2539. /*! #__NO_SIDE_EFFECTS__ */
  2540. // @__NO_SIDE_EFFECTS__
  2541. function defineComponent(options, extraOptions) {
  2542. return isFunction(options) ? (
  2543. // #8326: extend call and options.name access are considered side-effects
  2544. // by Rollup, so we have to wrap it in a pure-annotated IIFE.
  2545. /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
  2546. ) : options;
  2547. }
  2548. const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
  2549. /*! #__NO_SIDE_EFFECTS__ */
  2550. // @__NO_SIDE_EFFECTS__
  2551. function defineAsyncComponent(source) {
  2552. if (isFunction(source)) {
  2553. source = { loader: source };
  2554. }
  2555. const {
  2556. loader,
  2557. loadingComponent,
  2558. errorComponent,
  2559. delay = 200,
  2560. timeout,
  2561. // undefined = never times out
  2562. suspensible = true,
  2563. onError: userOnError
  2564. } = source;
  2565. let pendingRequest = null;
  2566. let resolvedComp;
  2567. let retries = 0;
  2568. const retry = () => {
  2569. retries++;
  2570. pendingRequest = null;
  2571. return load();
  2572. };
  2573. const load = () => {
  2574. let thisRequest;
  2575. return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
  2576. err = err instanceof Error ? err : new Error(String(err));
  2577. if (userOnError) {
  2578. return new Promise((resolve2, reject) => {
  2579. const userRetry = () => resolve2(retry());
  2580. const userFail = () => reject(err);
  2581. userOnError(err, userRetry, userFail, retries + 1);
  2582. });
  2583. } else {
  2584. throw err;
  2585. }
  2586. }).then((comp) => {
  2587. if (thisRequest !== pendingRequest && pendingRequest) {
  2588. return pendingRequest;
  2589. }
  2590. if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
  2591. comp = comp.default;
  2592. }
  2593. resolvedComp = comp;
  2594. return comp;
  2595. }));
  2596. };
  2597. return /* @__PURE__ */ defineComponent({
  2598. name: "AsyncComponentWrapper",
  2599. __asyncLoader: load,
  2600. get __asyncResolved() {
  2601. return resolvedComp;
  2602. },
  2603. setup() {
  2604. const instance = currentInstance;
  2605. if (resolvedComp) {
  2606. return () => createInnerComp(resolvedComp, instance);
  2607. }
  2608. const onError = (err) => {
  2609. pendingRequest = null;
  2610. handleError(
  2611. err,
  2612. instance,
  2613. 13,
  2614. !errorComponent
  2615. );
  2616. };
  2617. if (suspensible && instance.suspense || isInSSRComponentSetup) {
  2618. return load().then((comp) => {
  2619. return () => createInnerComp(comp, instance);
  2620. }).catch((err) => {
  2621. onError(err);
  2622. return () => errorComponent ? createVNode(errorComponent, {
  2623. error: err
  2624. }) : null;
  2625. });
  2626. }
  2627. const loaded = ref(false);
  2628. const error = ref();
  2629. const delayed = ref(!!delay);
  2630. if (delay) {
  2631. setTimeout(() => {
  2632. delayed.value = false;
  2633. }, delay);
  2634. }
  2635. if (timeout != null) {
  2636. setTimeout(() => {
  2637. if (!loaded.value && !error.value) {
  2638. const err = new Error(
  2639. `Async component timed out after ${timeout}ms.`
  2640. );
  2641. onError(err);
  2642. error.value = err;
  2643. }
  2644. }, timeout);
  2645. }
  2646. load().then(() => {
  2647. loaded.value = true;
  2648. if (instance.parent && isKeepAlive(instance.parent.vnode)) {
  2649. instance.parent.effect.dirty = true;
  2650. queueJob(instance.parent.update);
  2651. }
  2652. }).catch((err) => {
  2653. onError(err);
  2654. error.value = err;
  2655. });
  2656. return () => {
  2657. if (loaded.value && resolvedComp) {
  2658. return createInnerComp(resolvedComp, instance);
  2659. } else if (error.value && errorComponent) {
  2660. return createVNode(errorComponent, {
  2661. error: error.value
  2662. });
  2663. } else if (loadingComponent && !delayed.value) {
  2664. return createVNode(loadingComponent);
  2665. }
  2666. };
  2667. }
  2668. });
  2669. }
  2670. function createInnerComp(comp, parent) {
  2671. const { ref: ref22, props, children, ce } = parent.vnode;
  2672. const vnode = createVNode(comp, props, children);
  2673. vnode.ref = ref22;
  2674. vnode.ce = ce;
  2675. delete parent.vnode.ce;
  2676. return vnode;
  2677. }
  2678. const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
  2679. function onActivated(hook, target) {
  2680. registerKeepAliveHook(hook, "a", target);
  2681. }
  2682. function onDeactivated(hook, target) {
  2683. registerKeepAliveHook(hook, "da", target);
  2684. }
  2685. function registerKeepAliveHook(hook, type, target = currentInstance) {
  2686. const wrappedHook = hook.__wdc || (hook.__wdc = () => {
  2687. let current = target;
  2688. while (current) {
  2689. if (current.isDeactivated) {
  2690. return;
  2691. }
  2692. current = current.parent;
  2693. }
  2694. return hook();
  2695. });
  2696. injectHook(type, wrappedHook, target);
  2697. if (target) {
  2698. let current = target.parent;
  2699. while (current && current.parent) {
  2700. if (isKeepAlive(current.parent.vnode)) {
  2701. injectToKeepAliveRoot(wrappedHook, type, target, current);
  2702. }
  2703. current = current.parent;
  2704. }
  2705. }
  2706. }
  2707. function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  2708. const injected = injectHook(
  2709. type,
  2710. hook,
  2711. keepAliveRoot,
  2712. true
  2713. /* prepend */
  2714. );
  2715. onUnmounted(() => {
  2716. remove(keepAliveRoot[type], injected);
  2717. }, target);
  2718. }
  2719. function injectHook(type, hook, target = currentInstance, prepend = false) {
  2720. if (target) {
  2721. const hooks = target[type] || (target[type] = []);
  2722. const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
  2723. if (target.isUnmounted) {
  2724. return;
  2725. }
  2726. pauseTracking();
  2727. const reset = setCurrentInstance(target);
  2728. const res = callWithAsyncErrorHandling(hook, target, type, args);
  2729. reset();
  2730. resetTracking();
  2731. return res;
  2732. });
  2733. if (prepend) {
  2734. hooks.unshift(wrappedHook);
  2735. } else {
  2736. hooks.push(wrappedHook);
  2737. }
  2738. return wrappedHook;
  2739. }
  2740. }
  2741. const createHook = (lifecycle) => (hook, target = currentInstance) => (
  2742. // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
  2743. (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target)
  2744. );
  2745. const onBeforeMount = createHook("bm");
  2746. const onMounted = createHook("m");
  2747. const onBeforeUpdate = createHook("bu");
  2748. const onUpdated = createHook("u");
  2749. const onBeforeUnmount = createHook("bum");
  2750. const onUnmounted = createHook("um");
  2751. const onServerPrefetch = createHook("sp");
  2752. const onRenderTriggered = createHook(
  2753. "rtg"
  2754. );
  2755. const onRenderTracked = createHook(
  2756. "rtc"
  2757. );
  2758. function onErrorCaptured(hook, target = currentInstance) {
  2759. injectHook("ec", hook, target);
  2760. }
  2761. function renderList(source, renderItem, cache, index) {
  2762. let ret;
  2763. const cached = cache && cache[index];
  2764. if (isArray(source) || isString(source)) {
  2765. ret = new Array(source.length);
  2766. for (let i = 0, l = source.length; i < l; i++) {
  2767. ret[i] = renderItem(source[i], i, void 0, cached && cached[i]);
  2768. }
  2769. } else if (typeof source === "number") {
  2770. ret = new Array(source);
  2771. for (let i = 0; i < source; i++) {
  2772. ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
  2773. }
  2774. } else if (isObject$1(source)) {
  2775. if (source[Symbol.iterator]) {
  2776. ret = Array.from(
  2777. source,
  2778. (item, i) => renderItem(item, i, void 0, cached && cached[i])
  2779. );
  2780. } else {
  2781. const keys = Object.keys(source);
  2782. ret = new Array(keys.length);
  2783. for (let i = 0, l = keys.length; i < l; i++) {
  2784. const key = keys[i];
  2785. ret[i] = renderItem(source[key], key, i, cached && cached[i]);
  2786. }
  2787. }
  2788. } else {
  2789. ret = [];
  2790. }
  2791. if (cache) {
  2792. cache[index] = ret;
  2793. }
  2794. return ret;
  2795. }
  2796. function renderSlot(slots, name, props = {}, fallback, noSlotted) {
  2797. if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) {
  2798. if (name !== "default")
  2799. props.name = name;
  2800. return createVNode("slot", props, fallback && fallback());
  2801. }
  2802. let slot = slots[name];
  2803. if (slot && slot._c) {
  2804. slot._d = false;
  2805. }
  2806. openBlock();
  2807. const validSlotContent = slot && ensureValidVNode(slot(props));
  2808. const rendered = createBlock(
  2809. Fragment,
  2810. {
  2811. key: props.key || // slot content array of a dynamic conditional slot may have a branch
  2812. // key attached in the `createSlots` helper, respect that
  2813. validSlotContent && validSlotContent.key || `_${name}`
  2814. },
  2815. validSlotContent || (fallback ? fallback() : []),
  2816. validSlotContent && slots._ === 1 ? 64 : -2
  2817. );
  2818. if (!noSlotted && rendered.scopeId) {
  2819. rendered.slotScopeIds = [rendered.scopeId + "-s"];
  2820. }
  2821. if (slot && slot._c) {
  2822. slot._d = true;
  2823. }
  2824. return rendered;
  2825. }
  2826. function ensureValidVNode(vnodes) {
  2827. return vnodes.some((child) => {
  2828. if (!isVNode(child))
  2829. return true;
  2830. if (child.type === Comment)
  2831. return false;
  2832. if (child.type === Fragment && !ensureValidVNode(child.children))
  2833. return false;
  2834. return true;
  2835. }) ? vnodes : null;
  2836. }
  2837. function toHandlers(obj, preserveCaseIfNecessary) {
  2838. const ret = {};
  2839. for (const key in obj) {
  2840. ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];
  2841. }
  2842. return ret;
  2843. }
  2844. const getPublicInstance = (i) => {
  2845. if (!i)
  2846. return null;
  2847. if (isStatefulComponent(i))
  2848. return getExposeProxy(i) || i.proxy;
  2849. return getPublicInstance(i.parent);
  2850. };
  2851. const publicPropertiesMap = (
  2852. // Move PURE marker to new line to workaround compiler discarding it
  2853. // due to type annotation
  2854. /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
  2855. $: (i) => i,
  2856. $el: (i) => i.vnode.el,
  2857. $data: (i) => i.data,
  2858. $props: (i) => i.props,
  2859. $attrs: (i) => i.attrs,
  2860. $slots: (i) => i.slots,
  2861. $refs: (i) => i.refs,
  2862. $parent: (i) => getPublicInstance(i.parent),
  2863. $root: (i) => getPublicInstance(i.root),
  2864. $emit: (i) => i.emit,
  2865. $options: (i) => resolveMergedOptions(i),
  2866. $forceUpdate: (i) => i.f || (i.f = () => {
  2867. i.effect.dirty = true;
  2868. queueJob(i.update);
  2869. }),
  2870. $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
  2871. $watch: (i) => instanceWatch.bind(i)
  2872. })
  2873. );
  2874. const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
  2875. const PublicInstanceProxyHandlers = {
  2876. get({ _: instance }, key) {
  2877. if (key === "__v_skip") {
  2878. return true;
  2879. }
  2880. const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
  2881. let normalizedProps;
  2882. if (key[0] !== "$") {
  2883. const n = accessCache[key];
  2884. if (n !== void 0) {
  2885. switch (n) {
  2886. case 1:
  2887. return setupState[key];
  2888. case 2:
  2889. return data[key];
  2890. case 4:
  2891. return ctx[key];
  2892. case 3:
  2893. return props[key];
  2894. }
  2895. } else if (hasSetupBinding(setupState, key)) {
  2896. accessCache[key] = 1;
  2897. return setupState[key];
  2898. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  2899. accessCache[key] = 2;
  2900. return data[key];
  2901. } else if (
  2902. // only cache other properties when instance has declared (thus stable)
  2903. // props
  2904. (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)
  2905. ) {
  2906. accessCache[key] = 3;
  2907. return props[key];
  2908. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  2909. accessCache[key] = 4;
  2910. return ctx[key];
  2911. } else if (shouldCacheAccess) {
  2912. accessCache[key] = 0;
  2913. }
  2914. }
  2915. const publicGetter = publicPropertiesMap[key];
  2916. let cssModule, globalProperties;
  2917. if (publicGetter) {
  2918. if (key === "$attrs") {
  2919. track(instance.attrs, "get", "");
  2920. }
  2921. return publicGetter(instance);
  2922. } else if (
  2923. // css module (injected by vue-loader)
  2924. (cssModule = type.__cssModules) && (cssModule = cssModule[key])
  2925. ) {
  2926. return cssModule;
  2927. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  2928. accessCache[key] = 4;
  2929. return ctx[key];
  2930. } else if (
  2931. // global properties
  2932. globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)
  2933. ) {
  2934. {
  2935. return globalProperties[key];
  2936. }
  2937. } else
  2938. ;
  2939. },
  2940. set({ _: instance }, key, value) {
  2941. const { data, setupState, ctx } = instance;
  2942. if (hasSetupBinding(setupState, key)) {
  2943. setupState[key] = value;
  2944. return true;
  2945. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  2946. data[key] = value;
  2947. return true;
  2948. } else if (hasOwn(instance.props, key)) {
  2949. return false;
  2950. }
  2951. if (key[0] === "$" && key.slice(1) in instance) {
  2952. return false;
  2953. } else {
  2954. {
  2955. ctx[key] = value;
  2956. }
  2957. }
  2958. return true;
  2959. },
  2960. has({
  2961. _: { data, setupState, accessCache, ctx, appContext, propsOptions }
  2962. }, key) {
  2963. let normalizedProps;
  2964. 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);
  2965. },
  2966. defineProperty(target, key, descriptor) {
  2967. if (descriptor.get != null) {
  2968. target._.accessCache[key] = 0;
  2969. } else if (hasOwn(descriptor, "value")) {
  2970. this.set(target, key, descriptor.value, null);
  2971. }
  2972. return Reflect.defineProperty(target, key, descriptor);
  2973. }
  2974. };
  2975. function useSlots() {
  2976. return getContext().slots;
  2977. }
  2978. function getContext() {
  2979. const i = getCurrentInstance();
  2980. return i.setupContext || (i.setupContext = createSetupContext(i));
  2981. }
  2982. function normalizePropsOrEmits(props) {
  2983. return isArray(props) ? props.reduce(
  2984. (normalized, p2) => (normalized[p2] = null, normalized),
  2985. {}
  2986. ) : props;
  2987. }
  2988. let shouldCacheAccess = true;
  2989. function applyOptions(instance) {
  2990. const options = resolveMergedOptions(instance);
  2991. const publicThis = instance.proxy;
  2992. const ctx = instance.ctx;
  2993. shouldCacheAccess = false;
  2994. if (options.beforeCreate) {
  2995. callHook$1(options.beforeCreate, instance, "bc");
  2996. }
  2997. const {
  2998. // state
  2999. data: dataOptions,
  3000. computed: computedOptions,
  3001. methods,
  3002. watch: watchOptions,
  3003. provide: provideOptions,
  3004. inject: injectOptions,
  3005. // lifecycle
  3006. created,
  3007. beforeMount,
  3008. mounted,
  3009. beforeUpdate,
  3010. updated,
  3011. activated,
  3012. deactivated,
  3013. beforeDestroy,
  3014. beforeUnmount,
  3015. destroyed,
  3016. unmounted,
  3017. render,
  3018. renderTracked,
  3019. renderTriggered,
  3020. errorCaptured,
  3021. serverPrefetch,
  3022. // public API
  3023. expose,
  3024. inheritAttrs,
  3025. // assets
  3026. components,
  3027. directives,
  3028. filters
  3029. } = options;
  3030. const checkDuplicateProperties = null;
  3031. if (injectOptions) {
  3032. resolveInjections(injectOptions, ctx, checkDuplicateProperties);
  3033. }
  3034. if (methods) {
  3035. for (const key in methods) {
  3036. const methodHandler = methods[key];
  3037. if (isFunction(methodHandler)) {
  3038. {
  3039. ctx[key] = methodHandler.bind(publicThis);
  3040. }
  3041. }
  3042. }
  3043. }
  3044. if (dataOptions) {
  3045. const data = dataOptions.call(publicThis, publicThis);
  3046. if (!isObject$1(data))
  3047. ;
  3048. else {
  3049. instance.data = reactive(data);
  3050. }
  3051. }
  3052. shouldCacheAccess = true;
  3053. if (computedOptions) {
  3054. for (const key in computedOptions) {
  3055. const opt = computedOptions[key];
  3056. const get2 = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
  3057. const set2 = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : NOOP;
  3058. const c = computed({
  3059. get: get2,
  3060. set: set2
  3061. });
  3062. Object.defineProperty(ctx, key, {
  3063. enumerable: true,
  3064. configurable: true,
  3065. get: () => c.value,
  3066. set: (v) => c.value = v
  3067. });
  3068. }
  3069. }
  3070. if (watchOptions) {
  3071. for (const key in watchOptions) {
  3072. createWatcher(watchOptions[key], ctx, publicThis, key);
  3073. }
  3074. }
  3075. if (provideOptions) {
  3076. const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
  3077. Reflect.ownKeys(provides).forEach((key) => {
  3078. provide(key, provides[key]);
  3079. });
  3080. }
  3081. if (created) {
  3082. callHook$1(created, instance, "c");
  3083. }
  3084. function registerLifecycleHook(register, hook) {
  3085. if (isArray(hook)) {
  3086. hook.forEach((_hook) => register(_hook.bind(publicThis)));
  3087. } else if (hook) {
  3088. register(hook.bind(publicThis));
  3089. }
  3090. }
  3091. registerLifecycleHook(onBeforeMount, beforeMount);
  3092. registerLifecycleHook(onMounted, mounted);
  3093. registerLifecycleHook(onBeforeUpdate, beforeUpdate);
  3094. registerLifecycleHook(onUpdated, updated);
  3095. registerLifecycleHook(onActivated, activated);
  3096. registerLifecycleHook(onDeactivated, deactivated);
  3097. registerLifecycleHook(onErrorCaptured, errorCaptured);
  3098. registerLifecycleHook(onRenderTracked, renderTracked);
  3099. registerLifecycleHook(onRenderTriggered, renderTriggered);
  3100. registerLifecycleHook(onBeforeUnmount, beforeUnmount);
  3101. registerLifecycleHook(onUnmounted, unmounted);
  3102. registerLifecycleHook(onServerPrefetch, serverPrefetch);
  3103. if (isArray(expose)) {
  3104. if (expose.length) {
  3105. const exposed = instance.exposed || (instance.exposed = {});
  3106. expose.forEach((key) => {
  3107. Object.defineProperty(exposed, key, {
  3108. get: () => publicThis[key],
  3109. set: (val) => publicThis[key] = val
  3110. });
  3111. });
  3112. } else if (!instance.exposed) {
  3113. instance.exposed = {};
  3114. }
  3115. }
  3116. if (render && instance.render === NOOP) {
  3117. instance.render = render;
  3118. }
  3119. if (inheritAttrs != null) {
  3120. instance.inheritAttrs = inheritAttrs;
  3121. }
  3122. if (components)
  3123. instance.components = components;
  3124. if (directives)
  3125. instance.directives = directives;
  3126. }
  3127. function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
  3128. if (isArray(injectOptions)) {
  3129. injectOptions = normalizeInject(injectOptions);
  3130. }
  3131. for (const key in injectOptions) {
  3132. const opt = injectOptions[key];
  3133. let injected;
  3134. if (isObject$1(opt)) {
  3135. if ("default" in opt) {
  3136. injected = inject(
  3137. opt.from || key,
  3138. opt.default,
  3139. true
  3140. );
  3141. } else {
  3142. injected = inject(opt.from || key);
  3143. }
  3144. } else {
  3145. injected = inject(opt);
  3146. }
  3147. if (isRef(injected)) {
  3148. Object.defineProperty(ctx, key, {
  3149. enumerable: true,
  3150. configurable: true,
  3151. get: () => injected.value,
  3152. set: (v) => injected.value = v
  3153. });
  3154. } else {
  3155. ctx[key] = injected;
  3156. }
  3157. }
  3158. }
  3159. function callHook$1(hook, instance, type) {
  3160. callWithAsyncErrorHandling(
  3161. isArray(hook) ? hook.map((h2) => h2.bind(instance.proxy)) : hook.bind(instance.proxy),
  3162. instance,
  3163. type
  3164. );
  3165. }
  3166. function createWatcher(raw, ctx, publicThis, key) {
  3167. const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  3168. if (isString(raw)) {
  3169. const handler = ctx[raw];
  3170. if (isFunction(handler)) {
  3171. watch(getter, handler);
  3172. }
  3173. } else if (isFunction(raw)) {
  3174. watch(getter, raw.bind(publicThis));
  3175. } else if (isObject$1(raw)) {
  3176. if (isArray(raw)) {
  3177. raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
  3178. } else {
  3179. const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
  3180. if (isFunction(handler)) {
  3181. watch(getter, handler, raw);
  3182. }
  3183. }
  3184. } else
  3185. ;
  3186. }
  3187. function resolveMergedOptions(instance) {
  3188. const base = instance.type;
  3189. const { mixins, extends: extendsOptions } = base;
  3190. const {
  3191. mixins: globalMixins,
  3192. optionsCache: cache,
  3193. config: { optionMergeStrategies }
  3194. } = instance.appContext;
  3195. const cached = cache.get(base);
  3196. let resolved;
  3197. if (cached) {
  3198. resolved = cached;
  3199. } else if (!globalMixins.length && !mixins && !extendsOptions) {
  3200. {
  3201. resolved = base;
  3202. }
  3203. } else {
  3204. resolved = {};
  3205. if (globalMixins.length) {
  3206. globalMixins.forEach(
  3207. (m) => mergeOptions(resolved, m, optionMergeStrategies, true)
  3208. );
  3209. }
  3210. mergeOptions(resolved, base, optionMergeStrategies);
  3211. }
  3212. if (isObject$1(base)) {
  3213. cache.set(base, resolved);
  3214. }
  3215. return resolved;
  3216. }
  3217. function mergeOptions(to, from, strats, asMixin = false) {
  3218. const { mixins, extends: extendsOptions } = from;
  3219. if (extendsOptions) {
  3220. mergeOptions(to, extendsOptions, strats, true);
  3221. }
  3222. if (mixins) {
  3223. mixins.forEach(
  3224. (m) => mergeOptions(to, m, strats, true)
  3225. );
  3226. }
  3227. for (const key in from) {
  3228. if (asMixin && key === "expose")
  3229. ;
  3230. else {
  3231. const strat = internalOptionMergeStrats[key] || strats && strats[key];
  3232. to[key] = strat ? strat(to[key], from[key]) : from[key];
  3233. }
  3234. }
  3235. return to;
  3236. }
  3237. const internalOptionMergeStrats = {
  3238. data: mergeDataFn,
  3239. props: mergeEmitsOrPropsOptions,
  3240. emits: mergeEmitsOrPropsOptions,
  3241. // objects
  3242. methods: mergeObjectOptions,
  3243. computed: mergeObjectOptions,
  3244. // lifecycle
  3245. beforeCreate: mergeAsArray,
  3246. created: mergeAsArray,
  3247. beforeMount: mergeAsArray,
  3248. mounted: mergeAsArray,
  3249. beforeUpdate: mergeAsArray,
  3250. updated: mergeAsArray,
  3251. beforeDestroy: mergeAsArray,
  3252. beforeUnmount: mergeAsArray,
  3253. destroyed: mergeAsArray,
  3254. unmounted: mergeAsArray,
  3255. activated: mergeAsArray,
  3256. deactivated: mergeAsArray,
  3257. errorCaptured: mergeAsArray,
  3258. serverPrefetch: mergeAsArray,
  3259. // assets
  3260. components: mergeObjectOptions,
  3261. directives: mergeObjectOptions,
  3262. // watch
  3263. watch: mergeWatchOptions,
  3264. // provide / inject
  3265. provide: mergeDataFn,
  3266. inject: mergeInject
  3267. };
  3268. function mergeDataFn(to, from) {
  3269. if (!from) {
  3270. return to;
  3271. }
  3272. if (!to) {
  3273. return from;
  3274. }
  3275. return function mergedDataFn() {
  3276. return extend(
  3277. isFunction(to) ? to.call(this, this) : to,
  3278. isFunction(from) ? from.call(this, this) : from
  3279. );
  3280. };
  3281. }
  3282. function mergeInject(to, from) {
  3283. return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
  3284. }
  3285. function normalizeInject(raw) {
  3286. if (isArray(raw)) {
  3287. const res = {};
  3288. for (let i = 0; i < raw.length; i++) {
  3289. res[raw[i]] = raw[i];
  3290. }
  3291. return res;
  3292. }
  3293. return raw;
  3294. }
  3295. function mergeAsArray(to, from) {
  3296. return to ? [...new Set([].concat(to, from))] : from;
  3297. }
  3298. function mergeObjectOptions(to, from) {
  3299. return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
  3300. }
  3301. function mergeEmitsOrPropsOptions(to, from) {
  3302. if (to) {
  3303. if (isArray(to) && isArray(from)) {
  3304. return [.../* @__PURE__ */ new Set([...to, ...from])];
  3305. }
  3306. return extend(
  3307. /* @__PURE__ */ Object.create(null),
  3308. normalizePropsOrEmits(to),
  3309. normalizePropsOrEmits(from != null ? from : {})
  3310. );
  3311. } else {
  3312. return from;
  3313. }
  3314. }
  3315. function mergeWatchOptions(to, from) {
  3316. if (!to)
  3317. return from;
  3318. if (!from)
  3319. return to;
  3320. const merged = extend(/* @__PURE__ */ Object.create(null), to);
  3321. for (const key in from) {
  3322. merged[key] = mergeAsArray(to[key], from[key]);
  3323. }
  3324. return merged;
  3325. }
  3326. function createAppContext() {
  3327. return {
  3328. app: null,
  3329. config: {
  3330. isNativeTag: NO,
  3331. performance: false,
  3332. globalProperties: {},
  3333. optionMergeStrategies: {},
  3334. errorHandler: void 0,
  3335. warnHandler: void 0,
  3336. compilerOptions: {}
  3337. },
  3338. mixins: [],
  3339. components: {},
  3340. directives: {},
  3341. provides: /* @__PURE__ */ Object.create(null),
  3342. optionsCache: /* @__PURE__ */ new WeakMap(),
  3343. propsCache: /* @__PURE__ */ new WeakMap(),
  3344. emitsCache: /* @__PURE__ */ new WeakMap()
  3345. };
  3346. }
  3347. let uid$1 = 0;
  3348. function createAppAPI(render, hydrate) {
  3349. return function createApp2(rootComponent, rootProps = null) {
  3350. if (!isFunction(rootComponent)) {
  3351. rootComponent = extend({}, rootComponent);
  3352. }
  3353. if (rootProps != null && !isObject$1(rootProps)) {
  3354. rootProps = null;
  3355. }
  3356. const context = createAppContext();
  3357. const installedPlugins = /* @__PURE__ */ new WeakSet();
  3358. let isMounted = false;
  3359. const app = context.app = {
  3360. _uid: uid$1++,
  3361. _component: rootComponent,
  3362. _props: rootProps,
  3363. _container: null,
  3364. _context: context,
  3365. _instance: null,
  3366. version,
  3367. get config() {
  3368. return context.config;
  3369. },
  3370. set config(v) {
  3371. },
  3372. use(plugin, ...options) {
  3373. if (installedPlugins.has(plugin))
  3374. ;
  3375. else if (plugin && isFunction(plugin.install)) {
  3376. installedPlugins.add(plugin);
  3377. plugin.install(app, ...options);
  3378. } else if (isFunction(plugin)) {
  3379. installedPlugins.add(plugin);
  3380. plugin(app, ...options);
  3381. } else
  3382. ;
  3383. return app;
  3384. },
  3385. mixin(mixin) {
  3386. {
  3387. if (!context.mixins.includes(mixin)) {
  3388. context.mixins.push(mixin);
  3389. }
  3390. }
  3391. return app;
  3392. },
  3393. component(name, component) {
  3394. if (!component) {
  3395. return context.components[name];
  3396. }
  3397. context.components[name] = component;
  3398. return app;
  3399. },
  3400. directive(name, directive) {
  3401. if (!directive) {
  3402. return context.directives[name];
  3403. }
  3404. context.directives[name] = directive;
  3405. return app;
  3406. },
  3407. mount(rootContainer, isHydrate, namespace) {
  3408. if (!isMounted) {
  3409. const vnode = createVNode(rootComponent, rootProps);
  3410. vnode.appContext = context;
  3411. if (namespace === true) {
  3412. namespace = "svg";
  3413. } else if (namespace === false) {
  3414. namespace = void 0;
  3415. }
  3416. if (isHydrate && hydrate) {
  3417. hydrate(vnode, rootContainer);
  3418. } else {
  3419. render(vnode, rootContainer, namespace);
  3420. }
  3421. isMounted = true;
  3422. app._container = rootContainer;
  3423. rootContainer.__vue_app__ = app;
  3424. return getExposeProxy(vnode.component) || vnode.component.proxy;
  3425. }
  3426. },
  3427. unmount() {
  3428. if (isMounted) {
  3429. render(null, app._container);
  3430. delete app._container.__vue_app__;
  3431. }
  3432. },
  3433. provide(key, value) {
  3434. context.provides[key] = value;
  3435. return app;
  3436. },
  3437. runWithContext(fn) {
  3438. const lastApp = currentApp;
  3439. currentApp = app;
  3440. try {
  3441. return fn();
  3442. } finally {
  3443. currentApp = lastApp;
  3444. }
  3445. }
  3446. };
  3447. return app;
  3448. };
  3449. }
  3450. let currentApp = null;
  3451. function provide(key, value) {
  3452. if (!currentInstance)
  3453. ;
  3454. else {
  3455. let provides = currentInstance.provides;
  3456. const parentProvides = currentInstance.parent && currentInstance.parent.provides;
  3457. if (parentProvides === provides) {
  3458. provides = currentInstance.provides = Object.create(parentProvides);
  3459. }
  3460. provides[key] = value;
  3461. }
  3462. }
  3463. function inject(key, defaultValue, treatDefaultAsFactory = false) {
  3464. const instance = currentInstance || currentRenderingInstance;
  3465. if (instance || currentApp) {
  3466. const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
  3467. if (provides && key in provides) {
  3468. return provides[key];
  3469. } else if (arguments.length > 1) {
  3470. return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
  3471. } else
  3472. ;
  3473. }
  3474. }
  3475. const internalObjectProto = /* @__PURE__ */ Object.create(null);
  3476. const createInternalObject = () => Object.create(internalObjectProto);
  3477. const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
  3478. function initProps(instance, rawProps, isStateful, isSSR = false) {
  3479. const props = {};
  3480. const attrs = createInternalObject();
  3481. instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  3482. setFullProps(instance, rawProps, props, attrs);
  3483. for (const key in instance.propsOptions[0]) {
  3484. if (!(key in props)) {
  3485. props[key] = void 0;
  3486. }
  3487. }
  3488. if (isStateful) {
  3489. instance.props = isSSR ? props : shallowReactive(props);
  3490. } else {
  3491. if (!instance.type.props) {
  3492. instance.props = attrs;
  3493. } else {
  3494. instance.props = props;
  3495. }
  3496. }
  3497. instance.attrs = attrs;
  3498. }
  3499. function updateProps(instance, rawProps, rawPrevProps, optimized) {
  3500. const {
  3501. props,
  3502. attrs,
  3503. vnode: { patchFlag }
  3504. } = instance;
  3505. const rawCurrentProps = toRaw(props);
  3506. const [options] = instance.propsOptions;
  3507. let hasAttrsChanged = false;
  3508. if (
  3509. // always force full diff in dev
  3510. // - #1942 if hmr is enabled with sfc component
  3511. // - vite#872 non-sfc component used by sfc component
  3512. (optimized || patchFlag > 0) && !(patchFlag & 16)
  3513. ) {
  3514. if (patchFlag & 8) {
  3515. const propsToUpdate = instance.vnode.dynamicProps;
  3516. for (let i = 0; i < propsToUpdate.length; i++) {
  3517. let key = propsToUpdate[i];
  3518. if (isEmitListener(instance.emitsOptions, key)) {
  3519. continue;
  3520. }
  3521. const value = rawProps[key];
  3522. if (options) {
  3523. if (hasOwn(attrs, key)) {
  3524. if (value !== attrs[key]) {
  3525. attrs[key] = value;
  3526. hasAttrsChanged = true;
  3527. }
  3528. } else {
  3529. const camelizedKey = camelize(key);
  3530. props[camelizedKey] = resolvePropValue(
  3531. options,
  3532. rawCurrentProps,
  3533. camelizedKey,
  3534. value,
  3535. instance,
  3536. false
  3537. );
  3538. }
  3539. } else {
  3540. if (value !== attrs[key]) {
  3541. attrs[key] = value;
  3542. hasAttrsChanged = true;
  3543. }
  3544. }
  3545. }
  3546. }
  3547. } else {
  3548. if (setFullProps(instance, rawProps, props, attrs)) {
  3549. hasAttrsChanged = true;
  3550. }
  3551. let kebabKey;
  3552. for (const key in rawCurrentProps) {
  3553. if (!rawProps || // for camelCase
  3554. !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
  3555. // and converted to camelCase (#955)
  3556. ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
  3557. if (options) {
  3558. if (rawPrevProps && // for camelCase
  3559. (rawPrevProps[key] !== void 0 || // for kebab-case
  3560. rawPrevProps[kebabKey] !== void 0)) {
  3561. props[key] = resolvePropValue(
  3562. options,
  3563. rawCurrentProps,
  3564. key,
  3565. void 0,
  3566. instance,
  3567. true
  3568. );
  3569. }
  3570. } else {
  3571. delete props[key];
  3572. }
  3573. }
  3574. }
  3575. if (attrs !== rawCurrentProps) {
  3576. for (const key in attrs) {
  3577. if (!rawProps || !hasOwn(rawProps, key) && true) {
  3578. delete attrs[key];
  3579. hasAttrsChanged = true;
  3580. }
  3581. }
  3582. }
  3583. }
  3584. if (hasAttrsChanged) {
  3585. trigger(instance.attrs, "set", "");
  3586. }
  3587. }
  3588. function setFullProps(instance, rawProps, props, attrs) {
  3589. const [options, needCastKeys] = instance.propsOptions;
  3590. let hasAttrsChanged = false;
  3591. let rawCastValues;
  3592. if (rawProps) {
  3593. for (let key in rawProps) {
  3594. if (isReservedProp(key)) {
  3595. continue;
  3596. }
  3597. const value = rawProps[key];
  3598. let camelKey;
  3599. if (options && hasOwn(options, camelKey = camelize(key))) {
  3600. if (!needCastKeys || !needCastKeys.includes(camelKey)) {
  3601. props[camelKey] = value;
  3602. } else {
  3603. (rawCastValues || (rawCastValues = {}))[camelKey] = value;
  3604. }
  3605. } else if (!isEmitListener(instance.emitsOptions, key)) {
  3606. if (!(key in attrs) || value !== attrs[key]) {
  3607. attrs[key] = value;
  3608. hasAttrsChanged = true;
  3609. }
  3610. }
  3611. }
  3612. }
  3613. if (needCastKeys) {
  3614. const rawCurrentProps = toRaw(props);
  3615. const castValues = rawCastValues || EMPTY_OBJ;
  3616. for (let i = 0; i < needCastKeys.length; i++) {
  3617. const key = needCastKeys[i];
  3618. props[key] = resolvePropValue(
  3619. options,
  3620. rawCurrentProps,
  3621. key,
  3622. castValues[key],
  3623. instance,
  3624. !hasOwn(castValues, key)
  3625. );
  3626. }
  3627. }
  3628. return hasAttrsChanged;
  3629. }
  3630. function resolvePropValue(options, props, key, value, instance, isAbsent) {
  3631. const opt = options[key];
  3632. if (opt != null) {
  3633. const hasDefault = hasOwn(opt, "default");
  3634. if (hasDefault && value === void 0) {
  3635. const defaultValue = opt.default;
  3636. if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
  3637. const { propsDefaults } = instance;
  3638. if (key in propsDefaults) {
  3639. value = propsDefaults[key];
  3640. } else {
  3641. const reset = setCurrentInstance(instance);
  3642. value = propsDefaults[key] = defaultValue.call(
  3643. null,
  3644. props
  3645. );
  3646. reset();
  3647. }
  3648. } else {
  3649. value = defaultValue;
  3650. }
  3651. }
  3652. if (opt[
  3653. 0
  3654. /* shouldCast */
  3655. ]) {
  3656. if (isAbsent && !hasDefault) {
  3657. value = false;
  3658. } else if (opt[
  3659. 1
  3660. /* shouldCastTrue */
  3661. ] && (value === "" || value === hyphenate(key))) {
  3662. value = true;
  3663. }
  3664. }
  3665. }
  3666. return value;
  3667. }
  3668. function normalizePropsOptions(comp, appContext, asMixin = false) {
  3669. const cache = appContext.propsCache;
  3670. const cached = cache.get(comp);
  3671. if (cached) {
  3672. return cached;
  3673. }
  3674. const raw = comp.props;
  3675. const normalized = {};
  3676. const needCastKeys = [];
  3677. let hasExtends = false;
  3678. if (!isFunction(comp)) {
  3679. const extendProps = (raw2) => {
  3680. hasExtends = true;
  3681. const [props, keys] = normalizePropsOptions(raw2, appContext, true);
  3682. extend(normalized, props);
  3683. if (keys)
  3684. needCastKeys.push(...keys);
  3685. };
  3686. if (!asMixin && appContext.mixins.length) {
  3687. appContext.mixins.forEach(extendProps);
  3688. }
  3689. if (comp.extends) {
  3690. extendProps(comp.extends);
  3691. }
  3692. if (comp.mixins) {
  3693. comp.mixins.forEach(extendProps);
  3694. }
  3695. }
  3696. if (!raw && !hasExtends) {
  3697. if (isObject$1(comp)) {
  3698. cache.set(comp, EMPTY_ARR);
  3699. }
  3700. return EMPTY_ARR;
  3701. }
  3702. if (isArray(raw)) {
  3703. for (let i = 0; i < raw.length; i++) {
  3704. const normalizedKey = camelize(raw[i]);
  3705. if (validatePropName(normalizedKey)) {
  3706. normalized[normalizedKey] = EMPTY_OBJ;
  3707. }
  3708. }
  3709. } else if (raw) {
  3710. for (const key in raw) {
  3711. const normalizedKey = camelize(key);
  3712. if (validatePropName(normalizedKey)) {
  3713. const opt = raw[key];
  3714. const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
  3715. if (prop) {
  3716. const booleanIndex = getTypeIndex(Boolean, prop.type);
  3717. const stringIndex = getTypeIndex(String, prop.type);
  3718. prop[
  3719. 0
  3720. /* shouldCast */
  3721. ] = booleanIndex > -1;
  3722. prop[
  3723. 1
  3724. /* shouldCastTrue */
  3725. ] = stringIndex < 0 || booleanIndex < stringIndex;
  3726. if (booleanIndex > -1 || hasOwn(prop, "default")) {
  3727. needCastKeys.push(normalizedKey);
  3728. }
  3729. }
  3730. }
  3731. }
  3732. }
  3733. const res = [normalized, needCastKeys];
  3734. if (isObject$1(comp)) {
  3735. cache.set(comp, res);
  3736. }
  3737. return res;
  3738. }
  3739. function validatePropName(key) {
  3740. if (key[0] !== "$" && !isReservedProp(key)) {
  3741. return true;
  3742. }
  3743. return false;
  3744. }
  3745. function getType(ctor) {
  3746. if (ctor === null) {
  3747. return "null";
  3748. }
  3749. if (typeof ctor === "function") {
  3750. return ctor.name || "";
  3751. } else if (typeof ctor === "object") {
  3752. const name = ctor.constructor && ctor.constructor.name;
  3753. return name || "";
  3754. }
  3755. return "";
  3756. }
  3757. function isSameType(a, b) {
  3758. return getType(a) === getType(b);
  3759. }
  3760. function getTypeIndex(type, expectedTypes) {
  3761. if (isArray(expectedTypes)) {
  3762. return expectedTypes.findIndex((t) => isSameType(t, type));
  3763. } else if (isFunction(expectedTypes)) {
  3764. return isSameType(expectedTypes, type) ? 0 : -1;
  3765. }
  3766. return -1;
  3767. }
  3768. const isInternalKey = (key) => key[0] === "_" || key === "$stable";
  3769. const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
  3770. const normalizeSlot = (key, rawSlot, ctx) => {
  3771. if (rawSlot._n) {
  3772. return rawSlot;
  3773. }
  3774. const normalized = withCtx((...args) => {
  3775. if (false)
  3776. ;
  3777. return normalizeSlotValue(rawSlot(...args));
  3778. }, ctx);
  3779. normalized._c = false;
  3780. return normalized;
  3781. };
  3782. const normalizeObjectSlots = (rawSlots, slots, instance) => {
  3783. const ctx = rawSlots._ctx;
  3784. for (const key in rawSlots) {
  3785. if (isInternalKey(key))
  3786. continue;
  3787. const value = rawSlots[key];
  3788. if (isFunction(value)) {
  3789. slots[key] = normalizeSlot(key, value, ctx);
  3790. } else if (value != null) {
  3791. const normalized = normalizeSlotValue(value);
  3792. slots[key] = () => normalized;
  3793. }
  3794. }
  3795. };
  3796. const normalizeVNodeSlots = (instance, children) => {
  3797. const normalized = normalizeSlotValue(children);
  3798. instance.slots.default = () => normalized;
  3799. };
  3800. const initSlots = (instance, children) => {
  3801. const slots = instance.slots = createInternalObject();
  3802. if (instance.vnode.shapeFlag & 32) {
  3803. const type = children._;
  3804. if (type) {
  3805. extend(slots, children);
  3806. def(slots, "_", type);
  3807. } else {
  3808. normalizeObjectSlots(children, slots);
  3809. }
  3810. } else if (children) {
  3811. normalizeVNodeSlots(instance, children);
  3812. }
  3813. };
  3814. const updateSlots = (instance, children, optimized) => {
  3815. const { vnode, slots } = instance;
  3816. let needDeletionCheck = true;
  3817. let deletionComparisonTarget = EMPTY_OBJ;
  3818. if (vnode.shapeFlag & 32) {
  3819. const type = children._;
  3820. if (type) {
  3821. if (optimized && type === 1) {
  3822. needDeletionCheck = false;
  3823. } else {
  3824. extend(slots, children);
  3825. if (!optimized && type === 1) {
  3826. delete slots._;
  3827. }
  3828. }
  3829. } else {
  3830. needDeletionCheck = !children.$stable;
  3831. normalizeObjectSlots(children, slots);
  3832. }
  3833. deletionComparisonTarget = children;
  3834. } else if (children) {
  3835. normalizeVNodeSlots(instance, children);
  3836. deletionComparisonTarget = { default: 1 };
  3837. }
  3838. if (needDeletionCheck) {
  3839. for (const key in slots) {
  3840. if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
  3841. delete slots[key];
  3842. }
  3843. }
  3844. }
  3845. };
  3846. function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
  3847. if (isArray(rawRef)) {
  3848. rawRef.forEach(
  3849. (r, i) => setRef(
  3850. r,
  3851. oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
  3852. parentSuspense,
  3853. vnode,
  3854. isUnmount
  3855. )
  3856. );
  3857. return;
  3858. }
  3859. if (isAsyncWrapper(vnode) && !isUnmount) {
  3860. return;
  3861. }
  3862. const refValue = vnode.shapeFlag & 4 ? getExposeProxy(vnode.component) || vnode.component.proxy : vnode.el;
  3863. const value = isUnmount ? null : refValue;
  3864. const { i: owner, r: ref3 } = rawRef;
  3865. const oldRef = oldRawRef && oldRawRef.r;
  3866. const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
  3867. const setupState = owner.setupState;
  3868. if (oldRef != null && oldRef !== ref3) {
  3869. if (isString(oldRef)) {
  3870. refs[oldRef] = null;
  3871. if (hasOwn(setupState, oldRef)) {
  3872. setupState[oldRef] = null;
  3873. }
  3874. } else if (isRef(oldRef)) {
  3875. oldRef.value = null;
  3876. }
  3877. }
  3878. if (isFunction(ref3)) {
  3879. callWithErrorHandling(ref3, owner, 12, [value, refs]);
  3880. } else {
  3881. const _isString = isString(ref3);
  3882. const _isRef = isRef(ref3);
  3883. if (_isString || _isRef) {
  3884. const doSet = () => {
  3885. if (rawRef.f) {
  3886. const existing = _isString ? hasOwn(setupState, ref3) ? setupState[ref3] : refs[ref3] : ref3.value;
  3887. if (isUnmount) {
  3888. isArray(existing) && remove(existing, refValue);
  3889. } else {
  3890. if (!isArray(existing)) {
  3891. if (_isString) {
  3892. refs[ref3] = [refValue];
  3893. if (hasOwn(setupState, ref3)) {
  3894. setupState[ref3] = refs[ref3];
  3895. }
  3896. } else {
  3897. ref3.value = [refValue];
  3898. if (rawRef.k)
  3899. refs[rawRef.k] = ref3.value;
  3900. }
  3901. } else if (!existing.includes(refValue)) {
  3902. existing.push(refValue);
  3903. }
  3904. }
  3905. } else if (_isString) {
  3906. refs[ref3] = value;
  3907. if (hasOwn(setupState, ref3)) {
  3908. setupState[ref3] = value;
  3909. }
  3910. } else if (_isRef) {
  3911. ref3.value = value;
  3912. if (rawRef.k)
  3913. refs[rawRef.k] = value;
  3914. } else
  3915. ;
  3916. };
  3917. if (value) {
  3918. doSet.id = -1;
  3919. queuePostRenderEffect(doSet, parentSuspense);
  3920. } else {
  3921. doSet();
  3922. }
  3923. }
  3924. }
  3925. }
  3926. let hasMismatch = false;
  3927. const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
  3928. const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
  3929. const getContainerType = (container) => {
  3930. if (isSVGContainer(container))
  3931. return "svg";
  3932. if (isMathMLContainer(container))
  3933. return "mathml";
  3934. return void 0;
  3935. };
  3936. const isComment = (node) => node.nodeType === 8;
  3937. function createHydrationFunctions(rendererInternals) {
  3938. const {
  3939. mt: mountComponent,
  3940. p: patch,
  3941. o: {
  3942. patchProp: patchProp2,
  3943. createText,
  3944. nextSibling,
  3945. parentNode,
  3946. remove: remove2,
  3947. insert,
  3948. createComment
  3949. }
  3950. } = rendererInternals;
  3951. const hydrate = (vnode, container) => {
  3952. if (!container.hasChildNodes()) {
  3953. warn$1(
  3954. `Attempting to hydrate existing markup but container is empty. Performing full mount instead.`
  3955. );
  3956. patch(null, vnode, container);
  3957. flushPostFlushCbs();
  3958. container._vnode = vnode;
  3959. return;
  3960. }
  3961. hasMismatch = false;
  3962. hydrateNode(container.firstChild, vnode, null, null, null);
  3963. flushPostFlushCbs();
  3964. container._vnode = vnode;
  3965. if (hasMismatch && true) {
  3966. console.error(`Hydration completed but contains mismatches.`);
  3967. }
  3968. };
  3969. const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
  3970. optimized = optimized || !!vnode.dynamicChildren;
  3971. const isFragmentStart = isComment(node) && node.data === "[";
  3972. const onMismatch = () => handleMismatch(
  3973. node,
  3974. vnode,
  3975. parentComponent,
  3976. parentSuspense,
  3977. slotScopeIds,
  3978. isFragmentStart
  3979. );
  3980. const { type, ref: ref3, shapeFlag, patchFlag } = vnode;
  3981. let domType = node.nodeType;
  3982. vnode.el = node;
  3983. if (patchFlag === -2) {
  3984. optimized = false;
  3985. vnode.dynamicChildren = null;
  3986. }
  3987. let nextNode = null;
  3988. switch (type) {
  3989. case Text:
  3990. if (domType !== 3) {
  3991. if (vnode.children === "") {
  3992. insert(vnode.el = createText(""), parentNode(node), node);
  3993. nextNode = node;
  3994. } else {
  3995. nextNode = onMismatch();
  3996. }
  3997. } else {
  3998. if (node.data !== vnode.children) {
  3999. hasMismatch = true;
  4000. warn$1(
  4001. `Hydration text mismatch in`,
  4002. node.parentNode,
  4003. `
  4004. - rendered on server: ${JSON.stringify(
  4005. node.data
  4006. )}
  4007. - expected on client: ${JSON.stringify(vnode.children)}`
  4008. );
  4009. node.data = vnode.children;
  4010. }
  4011. nextNode = nextSibling(node);
  4012. }
  4013. break;
  4014. case Comment:
  4015. if (isTemplateNode(node)) {
  4016. nextNode = nextSibling(node);
  4017. replaceNode(
  4018. vnode.el = node.content.firstChild,
  4019. node,
  4020. parentComponent
  4021. );
  4022. } else if (domType !== 8 || isFragmentStart) {
  4023. nextNode = onMismatch();
  4024. } else {
  4025. nextNode = nextSibling(node);
  4026. }
  4027. break;
  4028. case Static:
  4029. if (isFragmentStart) {
  4030. node = nextSibling(node);
  4031. domType = node.nodeType;
  4032. }
  4033. if (domType === 1 || domType === 3) {
  4034. nextNode = node;
  4035. const needToAdoptContent = !vnode.children.length;
  4036. for (let i = 0; i < vnode.staticCount; i++) {
  4037. if (needToAdoptContent)
  4038. vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data;
  4039. if (i === vnode.staticCount - 1) {
  4040. vnode.anchor = nextNode;
  4041. }
  4042. nextNode = nextSibling(nextNode);
  4043. }
  4044. return isFragmentStart ? nextSibling(nextNode) : nextNode;
  4045. } else {
  4046. onMismatch();
  4047. }
  4048. break;
  4049. case Fragment:
  4050. if (!isFragmentStart) {
  4051. nextNode = onMismatch();
  4052. } else {
  4053. nextNode = hydrateFragment(
  4054. node,
  4055. vnode,
  4056. parentComponent,
  4057. parentSuspense,
  4058. slotScopeIds,
  4059. optimized
  4060. );
  4061. }
  4062. break;
  4063. default:
  4064. if (shapeFlag & 1) {
  4065. if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
  4066. nextNode = onMismatch();
  4067. } else {
  4068. nextNode = hydrateElement(
  4069. node,
  4070. vnode,
  4071. parentComponent,
  4072. parentSuspense,
  4073. slotScopeIds,
  4074. optimized
  4075. );
  4076. }
  4077. } else if (shapeFlag & 6) {
  4078. vnode.slotScopeIds = slotScopeIds;
  4079. const container = parentNode(node);
  4080. if (isFragmentStart) {
  4081. nextNode = locateClosingAnchor(node);
  4082. } else if (isComment(node) && node.data === "teleport start") {
  4083. nextNode = locateClosingAnchor(node, node.data, "teleport end");
  4084. } else {
  4085. nextNode = nextSibling(node);
  4086. }
  4087. mountComponent(
  4088. vnode,
  4089. container,
  4090. null,
  4091. parentComponent,
  4092. parentSuspense,
  4093. getContainerType(container),
  4094. optimized
  4095. );
  4096. if (isAsyncWrapper(vnode)) {
  4097. let subTree;
  4098. if (isFragmentStart) {
  4099. subTree = createVNode(Fragment);
  4100. subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
  4101. } else {
  4102. subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
  4103. }
  4104. subTree.el = node;
  4105. vnode.component.subTree = subTree;
  4106. }
  4107. } else if (shapeFlag & 64) {
  4108. if (domType !== 8) {
  4109. nextNode = onMismatch();
  4110. } else {
  4111. nextNode = vnode.type.hydrate(
  4112. node,
  4113. vnode,
  4114. parentComponent,
  4115. parentSuspense,
  4116. slotScopeIds,
  4117. optimized,
  4118. rendererInternals,
  4119. hydrateChildren
  4120. );
  4121. }
  4122. } else if (shapeFlag & 128) {
  4123. nextNode = vnode.type.hydrate(
  4124. node,
  4125. vnode,
  4126. parentComponent,
  4127. parentSuspense,
  4128. getContainerType(parentNode(node)),
  4129. slotScopeIds,
  4130. optimized,
  4131. rendererInternals,
  4132. hydrateNode
  4133. );
  4134. } else {
  4135. warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
  4136. }
  4137. }
  4138. if (ref3 != null) {
  4139. setRef(ref3, null, parentSuspense, vnode);
  4140. }
  4141. return nextNode;
  4142. };
  4143. const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  4144. optimized = optimized || !!vnode.dynamicChildren;
  4145. const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
  4146. const forcePatch = type === "input" || type === "option";
  4147. if (forcePatch || patchFlag !== -1) {
  4148. if (dirs) {
  4149. invokeDirectiveHook(vnode, null, parentComponent, "created");
  4150. }
  4151. let needCallTransitionHooks = false;
  4152. if (isTemplateNode(el)) {
  4153. needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
  4154. const content = el.content.firstChild;
  4155. if (needCallTransitionHooks) {
  4156. transition.beforeEnter(content);
  4157. }
  4158. replaceNode(content, el, parentComponent);
  4159. vnode.el = el = content;
  4160. }
  4161. if (shapeFlag & 16 && // skip if element has innerHTML / textContent
  4162. !(props && (props.innerHTML || props.textContent))) {
  4163. let next = hydrateChildren(
  4164. el.firstChild,
  4165. vnode,
  4166. el,
  4167. parentComponent,
  4168. parentSuspense,
  4169. slotScopeIds,
  4170. optimized
  4171. );
  4172. let hasWarned2 = false;
  4173. while (next) {
  4174. hasMismatch = true;
  4175. if (!hasWarned2) {
  4176. warn$1(
  4177. `Hydration children mismatch on`,
  4178. el,
  4179. `
  4180. Server rendered element contains more child nodes than client vdom.`
  4181. );
  4182. hasWarned2 = true;
  4183. }
  4184. const cur = next;
  4185. next = next.nextSibling;
  4186. remove2(cur);
  4187. }
  4188. } else if (shapeFlag & 8) {
  4189. if (el.textContent !== vnode.children) {
  4190. hasMismatch = true;
  4191. warn$1(
  4192. `Hydration text content mismatch on`,
  4193. el,
  4194. `
  4195. - rendered on server: ${el.textContent}
  4196. - expected on client: ${vnode.children}`
  4197. );
  4198. el.textContent = vnode.children;
  4199. }
  4200. }
  4201. if (props) {
  4202. {
  4203. for (const key in props) {
  4204. if (propHasMismatch(el, key, props[key], vnode, parentComponent)) {
  4205. hasMismatch = true;
  4206. }
  4207. if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
  4208. key[0] === ".") {
  4209. patchProp2(
  4210. el,
  4211. key,
  4212. null,
  4213. props[key],
  4214. void 0,
  4215. void 0,
  4216. parentComponent
  4217. );
  4218. }
  4219. }
  4220. }
  4221. }
  4222. let vnodeHooks;
  4223. if (vnodeHooks = props && props.onVnodeBeforeMount) {
  4224. invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  4225. }
  4226. if (dirs) {
  4227. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  4228. }
  4229. if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
  4230. queueEffectWithSuspense(() => {
  4231. vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  4232. needCallTransitionHooks && transition.enter(el);
  4233. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  4234. }, parentSuspense);
  4235. }
  4236. }
  4237. return el.nextSibling;
  4238. };
  4239. const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  4240. optimized = optimized || !!parentVNode.dynamicChildren;
  4241. const children = parentVNode.children;
  4242. const l = children.length;
  4243. let hasWarned2 = false;
  4244. for (let i = 0; i < l; i++) {
  4245. const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
  4246. if (node) {
  4247. node = hydrateNode(
  4248. node,
  4249. vnode,
  4250. parentComponent,
  4251. parentSuspense,
  4252. slotScopeIds,
  4253. optimized
  4254. );
  4255. } else if (vnode.type === Text && !vnode.children) {
  4256. continue;
  4257. } else {
  4258. hasMismatch = true;
  4259. if (!hasWarned2) {
  4260. warn$1(
  4261. `Hydration children mismatch on`,
  4262. container,
  4263. `
  4264. Server rendered element contains fewer child nodes than client vdom.`
  4265. );
  4266. hasWarned2 = true;
  4267. }
  4268. patch(
  4269. null,
  4270. vnode,
  4271. container,
  4272. null,
  4273. parentComponent,
  4274. parentSuspense,
  4275. getContainerType(container),
  4276. slotScopeIds
  4277. );
  4278. }
  4279. }
  4280. return node;
  4281. };
  4282. const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  4283. const { slotScopeIds: fragmentSlotScopeIds } = vnode;
  4284. if (fragmentSlotScopeIds) {
  4285. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  4286. }
  4287. const container = parentNode(node);
  4288. const next = hydrateChildren(
  4289. nextSibling(node),
  4290. vnode,
  4291. container,
  4292. parentComponent,
  4293. parentSuspense,
  4294. slotScopeIds,
  4295. optimized
  4296. );
  4297. if (next && isComment(next) && next.data === "]") {
  4298. return nextSibling(vnode.anchor = next);
  4299. } else {
  4300. hasMismatch = true;
  4301. insert(vnode.anchor = createComment(`]`), container, next);
  4302. return next;
  4303. }
  4304. };
  4305. const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
  4306. hasMismatch = true;
  4307. warn$1(
  4308. `Hydration node mismatch:
  4309. - rendered on server:`,
  4310. node,
  4311. node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
  4312. `
  4313. - expected on client:`,
  4314. vnode.type
  4315. );
  4316. vnode.el = null;
  4317. if (isFragment) {
  4318. const end = locateClosingAnchor(node);
  4319. while (true) {
  4320. const next2 = nextSibling(node);
  4321. if (next2 && next2 !== end) {
  4322. remove2(next2);
  4323. } else {
  4324. break;
  4325. }
  4326. }
  4327. }
  4328. const next = nextSibling(node);
  4329. const container = parentNode(node);
  4330. remove2(node);
  4331. patch(
  4332. null,
  4333. vnode,
  4334. container,
  4335. next,
  4336. parentComponent,
  4337. parentSuspense,
  4338. getContainerType(container),
  4339. slotScopeIds
  4340. );
  4341. return next;
  4342. };
  4343. const locateClosingAnchor = (node, open = "[", close = "]") => {
  4344. let match = 0;
  4345. while (node) {
  4346. node = nextSibling(node);
  4347. if (node && isComment(node)) {
  4348. if (node.data === open)
  4349. match++;
  4350. if (node.data === close) {
  4351. if (match === 0) {
  4352. return nextSibling(node);
  4353. } else {
  4354. match--;
  4355. }
  4356. }
  4357. }
  4358. }
  4359. return node;
  4360. };
  4361. const replaceNode = (newNode, oldNode, parentComponent) => {
  4362. const parentNode2 = oldNode.parentNode;
  4363. if (parentNode2) {
  4364. parentNode2.replaceChild(newNode, oldNode);
  4365. }
  4366. let parent = parentComponent;
  4367. while (parent) {
  4368. if (parent.vnode.el === oldNode) {
  4369. parent.vnode.el = parent.subTree.el = newNode;
  4370. }
  4371. parent = parent.parent;
  4372. }
  4373. };
  4374. const isTemplateNode = (node) => {
  4375. return node.nodeType === 1 && node.tagName.toLowerCase() === "template";
  4376. };
  4377. return [hydrate, hydrateNode];
  4378. }
  4379. function propHasMismatch(el, key, clientValue, vnode, instance) {
  4380. var _a;
  4381. let mismatchType;
  4382. let mismatchKey;
  4383. let actual;
  4384. let expected;
  4385. if (key === "class") {
  4386. actual = el.getAttribute("class");
  4387. expected = normalizeClass(clientValue);
  4388. if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
  4389. mismatchType = mismatchKey = `class`;
  4390. }
  4391. } else if (key === "style") {
  4392. actual = el.getAttribute("style");
  4393. expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
  4394. const actualMap = toStyleMap(actual);
  4395. const expectedMap = toStyleMap(expected);
  4396. if (vnode.dirs) {
  4397. for (const { dir, value } of vnode.dirs) {
  4398. if (dir.name === "show" && !value) {
  4399. expectedMap.set("display", "none");
  4400. }
  4401. }
  4402. }
  4403. const root = instance == null ? void 0 : instance.subTree;
  4404. if (vnode === root || (root == null ? void 0 : root.type) === Fragment && root.children.includes(vnode)) {
  4405. const cssVars = (_a = instance == null ? void 0 : instance.getCssVars) == null ? void 0 : _a.call(instance);
  4406. for (const key2 in cssVars) {
  4407. expectedMap.set(`--${key2}`, String(cssVars[key2]));
  4408. }
  4409. }
  4410. if (!isMapEqual(actualMap, expectedMap)) {
  4411. mismatchType = mismatchKey = "style";
  4412. }
  4413. } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
  4414. if (isBooleanAttr(key)) {
  4415. actual = el.hasAttribute(key);
  4416. expected = includeBooleanAttr(clientValue);
  4417. } else if (clientValue == null) {
  4418. actual = el.hasAttribute(key);
  4419. expected = false;
  4420. } else {
  4421. if (el.hasAttribute(key)) {
  4422. actual = el.getAttribute(key);
  4423. } else if (key === "value" && el.tagName === "TEXTAREA") {
  4424. actual = el.value;
  4425. } else {
  4426. actual = false;
  4427. }
  4428. expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
  4429. }
  4430. if (actual !== expected) {
  4431. mismatchType = `attribute`;
  4432. mismatchKey = key;
  4433. }
  4434. }
  4435. if (mismatchType) {
  4436. const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
  4437. const preSegment = `Hydration ${mismatchType} mismatch on`;
  4438. const postSegment = `
  4439. - rendered on server: ${format(actual)}
  4440. - expected on client: ${format(expected)}
  4441. Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
  4442. You should fix the source of the mismatch.`;
  4443. {
  4444. warn$1(preSegment, el, postSegment);
  4445. }
  4446. return true;
  4447. }
  4448. return false;
  4449. }
  4450. function toClassSet(str) {
  4451. return new Set(str.trim().split(/\s+/));
  4452. }
  4453. function isSetEqual(a, b) {
  4454. if (a.size !== b.size) {
  4455. return false;
  4456. }
  4457. for (const s of a) {
  4458. if (!b.has(s)) {
  4459. return false;
  4460. }
  4461. }
  4462. return true;
  4463. }
  4464. function toStyleMap(str) {
  4465. const styleMap = /* @__PURE__ */ new Map();
  4466. for (const item of str.split(";")) {
  4467. let [key, value] = item.split(":");
  4468. key = key == null ? void 0 : key.trim();
  4469. value = value == null ? void 0 : value.trim();
  4470. if (key && value) {
  4471. styleMap.set(key, value);
  4472. }
  4473. }
  4474. return styleMap;
  4475. }
  4476. function isMapEqual(a, b) {
  4477. if (a.size !== b.size) {
  4478. return false;
  4479. }
  4480. for (const [key, value] of a) {
  4481. if (value !== b.get(key)) {
  4482. return false;
  4483. }
  4484. }
  4485. return true;
  4486. }
  4487. const queuePostRenderEffect = queueEffectWithSuspense;
  4488. function createRenderer(options) {
  4489. return baseCreateRenderer(options);
  4490. }
  4491. function createHydrationRenderer(options) {
  4492. return baseCreateRenderer(options, createHydrationFunctions);
  4493. }
  4494. function baseCreateRenderer(options, createHydrationFns) {
  4495. const target = getGlobalThis();
  4496. target.__VUE__ = true;
  4497. const {
  4498. insert: hostInsert,
  4499. remove: hostRemove,
  4500. patchProp: hostPatchProp,
  4501. createElement: hostCreateElement,
  4502. createText: hostCreateText,
  4503. createComment: hostCreateComment,
  4504. setText: hostSetText,
  4505. setElementText: hostSetElementText,
  4506. parentNode: hostParentNode,
  4507. nextSibling: hostNextSibling,
  4508. setScopeId: hostSetScopeId = NOOP,
  4509. insertStaticContent: hostInsertStaticContent
  4510. } = options;
  4511. const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!n2.dynamicChildren) => {
  4512. if (n1 === n2) {
  4513. return;
  4514. }
  4515. if (n1 && !isSameVNodeType(n1, n2)) {
  4516. anchor = getNextHostNode(n1);
  4517. unmount(n1, parentComponent, parentSuspense, true);
  4518. n1 = null;
  4519. }
  4520. if (n2.patchFlag === -2) {
  4521. optimized = false;
  4522. n2.dynamicChildren = null;
  4523. }
  4524. const { type, ref: ref3, shapeFlag } = n2;
  4525. switch (type) {
  4526. case Text:
  4527. processText(n1, n2, container, anchor);
  4528. break;
  4529. case Comment:
  4530. processCommentNode(n1, n2, container, anchor);
  4531. break;
  4532. case Static:
  4533. if (n1 == null) {
  4534. mountStaticNode(n2, container, anchor, namespace);
  4535. }
  4536. break;
  4537. case Fragment:
  4538. processFragment(
  4539. n1,
  4540. n2,
  4541. container,
  4542. anchor,
  4543. parentComponent,
  4544. parentSuspense,
  4545. namespace,
  4546. slotScopeIds,
  4547. optimized
  4548. );
  4549. break;
  4550. default:
  4551. if (shapeFlag & 1) {
  4552. processElement(
  4553. n1,
  4554. n2,
  4555. container,
  4556. anchor,
  4557. parentComponent,
  4558. parentSuspense,
  4559. namespace,
  4560. slotScopeIds,
  4561. optimized
  4562. );
  4563. } else if (shapeFlag & 6) {
  4564. processComponent(
  4565. n1,
  4566. n2,
  4567. container,
  4568. anchor,
  4569. parentComponent,
  4570. parentSuspense,
  4571. namespace,
  4572. slotScopeIds,
  4573. optimized
  4574. );
  4575. } else if (shapeFlag & 64) {
  4576. type.process(
  4577. n1,
  4578. n2,
  4579. container,
  4580. anchor,
  4581. parentComponent,
  4582. parentSuspense,
  4583. namespace,
  4584. slotScopeIds,
  4585. optimized,
  4586. internals
  4587. );
  4588. } else if (shapeFlag & 128) {
  4589. type.process(
  4590. n1,
  4591. n2,
  4592. container,
  4593. anchor,
  4594. parentComponent,
  4595. parentSuspense,
  4596. namespace,
  4597. slotScopeIds,
  4598. optimized,
  4599. internals
  4600. );
  4601. } else
  4602. ;
  4603. }
  4604. if (ref3 != null && parentComponent) {
  4605. setRef(ref3, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
  4606. }
  4607. };
  4608. const processText = (n1, n2, container, anchor) => {
  4609. if (n1 == null) {
  4610. hostInsert(
  4611. n2.el = hostCreateText(n2.children),
  4612. container,
  4613. anchor
  4614. );
  4615. } else {
  4616. const el = n2.el = n1.el;
  4617. if (n2.children !== n1.children) {
  4618. hostSetText(el, n2.children);
  4619. }
  4620. }
  4621. };
  4622. const processCommentNode = (n1, n2, container, anchor) => {
  4623. if (n1 == null) {
  4624. hostInsert(
  4625. n2.el = hostCreateComment(n2.children || ""),
  4626. container,
  4627. anchor
  4628. );
  4629. } else {
  4630. n2.el = n1.el;
  4631. }
  4632. };
  4633. const mountStaticNode = (n2, container, anchor, namespace) => {
  4634. [n2.el, n2.anchor] = hostInsertStaticContent(
  4635. n2.children,
  4636. container,
  4637. anchor,
  4638. namespace,
  4639. n2.el,
  4640. n2.anchor
  4641. );
  4642. };
  4643. const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
  4644. let next;
  4645. while (el && el !== anchor) {
  4646. next = hostNextSibling(el);
  4647. hostInsert(el, container, nextSibling);
  4648. el = next;
  4649. }
  4650. hostInsert(anchor, container, nextSibling);
  4651. };
  4652. const removeStaticNode = ({ el, anchor }) => {
  4653. let next;
  4654. while (el && el !== anchor) {
  4655. next = hostNextSibling(el);
  4656. hostRemove(el);
  4657. el = next;
  4658. }
  4659. hostRemove(anchor);
  4660. };
  4661. const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4662. if (n2.type === "svg") {
  4663. namespace = "svg";
  4664. } else if (n2.type === "math") {
  4665. namespace = "mathml";
  4666. }
  4667. if (n1 == null) {
  4668. mountElement(
  4669. n2,
  4670. container,
  4671. anchor,
  4672. parentComponent,
  4673. parentSuspense,
  4674. namespace,
  4675. slotScopeIds,
  4676. optimized
  4677. );
  4678. } else {
  4679. patchElement(
  4680. n1,
  4681. n2,
  4682. parentComponent,
  4683. parentSuspense,
  4684. namespace,
  4685. slotScopeIds,
  4686. optimized
  4687. );
  4688. }
  4689. };
  4690. const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4691. let el;
  4692. let vnodeHook;
  4693. const { props, shapeFlag, transition, dirs } = vnode;
  4694. el = vnode.el = hostCreateElement(
  4695. vnode.type,
  4696. namespace,
  4697. props && props.is,
  4698. props
  4699. );
  4700. if (shapeFlag & 8) {
  4701. hostSetElementText(el, vnode.children);
  4702. } else if (shapeFlag & 16) {
  4703. mountChildren(
  4704. vnode.children,
  4705. el,
  4706. null,
  4707. parentComponent,
  4708. parentSuspense,
  4709. resolveChildrenNamespace(vnode, namespace),
  4710. slotScopeIds,
  4711. optimized
  4712. );
  4713. }
  4714. if (dirs) {
  4715. invokeDirectiveHook(vnode, null, parentComponent, "created");
  4716. }
  4717. setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
  4718. if (props) {
  4719. for (const key in props) {
  4720. if (key !== "value" && !isReservedProp(key)) {
  4721. hostPatchProp(
  4722. el,
  4723. key,
  4724. null,
  4725. props[key],
  4726. namespace,
  4727. vnode.children,
  4728. parentComponent,
  4729. parentSuspense,
  4730. unmountChildren
  4731. );
  4732. }
  4733. }
  4734. if ("value" in props) {
  4735. hostPatchProp(el, "value", null, props.value, namespace);
  4736. }
  4737. if (vnodeHook = props.onVnodeBeforeMount) {
  4738. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  4739. }
  4740. }
  4741. if (dirs) {
  4742. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  4743. }
  4744. const needCallTransitionHooks = needTransition(parentSuspense, transition);
  4745. if (needCallTransitionHooks) {
  4746. transition.beforeEnter(el);
  4747. }
  4748. hostInsert(el, container, anchor);
  4749. if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
  4750. queuePostRenderEffect(() => {
  4751. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  4752. needCallTransitionHooks && transition.enter(el);
  4753. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  4754. }, parentSuspense);
  4755. }
  4756. };
  4757. const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
  4758. if (scopeId) {
  4759. hostSetScopeId(el, scopeId);
  4760. }
  4761. if (slotScopeIds) {
  4762. for (let i = 0; i < slotScopeIds.length; i++) {
  4763. hostSetScopeId(el, slotScopeIds[i]);
  4764. }
  4765. }
  4766. if (parentComponent) {
  4767. let subTree = parentComponent.subTree;
  4768. if (vnode === subTree) {
  4769. const parentVNode = parentComponent.vnode;
  4770. setScopeId(
  4771. el,
  4772. parentVNode,
  4773. parentVNode.scopeId,
  4774. parentVNode.slotScopeIds,
  4775. parentComponent.parent
  4776. );
  4777. }
  4778. }
  4779. };
  4780. const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
  4781. for (let i = start; i < children.length; i++) {
  4782. const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
  4783. patch(
  4784. null,
  4785. child,
  4786. container,
  4787. anchor,
  4788. parentComponent,
  4789. parentSuspense,
  4790. namespace,
  4791. slotScopeIds,
  4792. optimized
  4793. );
  4794. }
  4795. };
  4796. const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4797. const el = n2.el = n1.el;
  4798. let { patchFlag, dynamicChildren, dirs } = n2;
  4799. patchFlag |= n1.patchFlag & 16;
  4800. const oldProps = n1.props || EMPTY_OBJ;
  4801. const newProps = n2.props || EMPTY_OBJ;
  4802. let vnodeHook;
  4803. parentComponent && toggleRecurse(parentComponent, false);
  4804. if (vnodeHook = newProps.onVnodeBeforeUpdate) {
  4805. invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  4806. }
  4807. if (dirs) {
  4808. invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
  4809. }
  4810. parentComponent && toggleRecurse(parentComponent, true);
  4811. if (dynamicChildren) {
  4812. patchBlockChildren(
  4813. n1.dynamicChildren,
  4814. dynamicChildren,
  4815. el,
  4816. parentComponent,
  4817. parentSuspense,
  4818. resolveChildrenNamespace(n2, namespace),
  4819. slotScopeIds
  4820. );
  4821. } else if (!optimized) {
  4822. patchChildren(
  4823. n1,
  4824. n2,
  4825. el,
  4826. null,
  4827. parentComponent,
  4828. parentSuspense,
  4829. resolveChildrenNamespace(n2, namespace),
  4830. slotScopeIds,
  4831. false
  4832. );
  4833. }
  4834. if (patchFlag > 0) {
  4835. if (patchFlag & 16) {
  4836. patchProps(
  4837. el,
  4838. n2,
  4839. oldProps,
  4840. newProps,
  4841. parentComponent,
  4842. parentSuspense,
  4843. namespace
  4844. );
  4845. } else {
  4846. if (patchFlag & 2) {
  4847. if (oldProps.class !== newProps.class) {
  4848. hostPatchProp(el, "class", null, newProps.class, namespace);
  4849. }
  4850. }
  4851. if (patchFlag & 4) {
  4852. hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
  4853. }
  4854. if (patchFlag & 8) {
  4855. const propsToUpdate = n2.dynamicProps;
  4856. for (let i = 0; i < propsToUpdate.length; i++) {
  4857. const key = propsToUpdate[i];
  4858. const prev = oldProps[key];
  4859. const next = newProps[key];
  4860. if (next !== prev || key === "value") {
  4861. hostPatchProp(
  4862. el,
  4863. key,
  4864. prev,
  4865. next,
  4866. namespace,
  4867. n1.children,
  4868. parentComponent,
  4869. parentSuspense,
  4870. unmountChildren
  4871. );
  4872. }
  4873. }
  4874. }
  4875. }
  4876. if (patchFlag & 1) {
  4877. if (n1.children !== n2.children) {
  4878. hostSetElementText(el, n2.children);
  4879. }
  4880. }
  4881. } else if (!optimized && dynamicChildren == null) {
  4882. patchProps(
  4883. el,
  4884. n2,
  4885. oldProps,
  4886. newProps,
  4887. parentComponent,
  4888. parentSuspense,
  4889. namespace
  4890. );
  4891. }
  4892. if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
  4893. queuePostRenderEffect(() => {
  4894. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  4895. dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
  4896. }, parentSuspense);
  4897. }
  4898. };
  4899. const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
  4900. for (let i = 0; i < newChildren.length; i++) {
  4901. const oldVNode = oldChildren[i];
  4902. const newVNode = newChildren[i];
  4903. const container = (
  4904. // oldVNode may be an errored async setup() component inside Suspense
  4905. // which will not have a mounted element
  4906. oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
  4907. // of the Fragment itself so it can move its children.
  4908. (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
  4909. // which also requires the correct parent container
  4910. !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
  4911. oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : (
  4912. // In other cases, the parent container is not actually used so we
  4913. // just pass the block element here to avoid a DOM parentNode call.
  4914. fallbackContainer
  4915. )
  4916. );
  4917. patch(
  4918. oldVNode,
  4919. newVNode,
  4920. container,
  4921. null,
  4922. parentComponent,
  4923. parentSuspense,
  4924. namespace,
  4925. slotScopeIds,
  4926. true
  4927. );
  4928. }
  4929. };
  4930. const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, namespace) => {
  4931. if (oldProps !== newProps) {
  4932. if (oldProps !== EMPTY_OBJ) {
  4933. for (const key in oldProps) {
  4934. if (!isReservedProp(key) && !(key in newProps)) {
  4935. hostPatchProp(
  4936. el,
  4937. key,
  4938. oldProps[key],
  4939. null,
  4940. namespace,
  4941. vnode.children,
  4942. parentComponent,
  4943. parentSuspense,
  4944. unmountChildren
  4945. );
  4946. }
  4947. }
  4948. }
  4949. for (const key in newProps) {
  4950. if (isReservedProp(key))
  4951. continue;
  4952. const next = newProps[key];
  4953. const prev = oldProps[key];
  4954. if (next !== prev && key !== "value") {
  4955. hostPatchProp(
  4956. el,
  4957. key,
  4958. prev,
  4959. next,
  4960. namespace,
  4961. vnode.children,
  4962. parentComponent,
  4963. parentSuspense,
  4964. unmountChildren
  4965. );
  4966. }
  4967. }
  4968. if ("value" in newProps) {
  4969. hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
  4970. }
  4971. }
  4972. };
  4973. const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4974. const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
  4975. const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
  4976. let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
  4977. if (fragmentSlotScopeIds) {
  4978. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  4979. }
  4980. if (n1 == null) {
  4981. hostInsert(fragmentStartAnchor, container, anchor);
  4982. hostInsert(fragmentEndAnchor, container, anchor);
  4983. mountChildren(
  4984. // #10007
  4985. // such fragment like `<></>` will be compiled into
  4986. // a fragment which doesn't have a children.
  4987. // In this case fallback to an empty array
  4988. n2.children || [],
  4989. container,
  4990. fragmentEndAnchor,
  4991. parentComponent,
  4992. parentSuspense,
  4993. namespace,
  4994. slotScopeIds,
  4995. optimized
  4996. );
  4997. } else {
  4998. if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
  4999. // of renderSlot() with no valid children
  5000. n1.dynamicChildren) {
  5001. patchBlockChildren(
  5002. n1.dynamicChildren,
  5003. dynamicChildren,
  5004. container,
  5005. parentComponent,
  5006. parentSuspense,
  5007. namespace,
  5008. slotScopeIds
  5009. );
  5010. if (
  5011. // #2080 if the stable fragment has a key, it's a <template v-for> that may
  5012. // get moved around. Make sure all root level vnodes inherit el.
  5013. // #2134 or if it's a component root, it may also get moved around
  5014. // as the component is being moved.
  5015. n2.key != null || parentComponent && n2 === parentComponent.subTree
  5016. ) {
  5017. traverseStaticChildren(
  5018. n1,
  5019. n2,
  5020. true
  5021. /* shallow */
  5022. );
  5023. }
  5024. } else {
  5025. patchChildren(
  5026. n1,
  5027. n2,
  5028. container,
  5029. fragmentEndAnchor,
  5030. parentComponent,
  5031. parentSuspense,
  5032. namespace,
  5033. slotScopeIds,
  5034. optimized
  5035. );
  5036. }
  5037. }
  5038. };
  5039. const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  5040. n2.slotScopeIds = slotScopeIds;
  5041. if (n1 == null) {
  5042. if (n2.shapeFlag & 512) {
  5043. parentComponent.ctx.activate(
  5044. n2,
  5045. container,
  5046. anchor,
  5047. namespace,
  5048. optimized
  5049. );
  5050. } else {
  5051. mountComponent(
  5052. n2,
  5053. container,
  5054. anchor,
  5055. parentComponent,
  5056. parentSuspense,
  5057. namespace,
  5058. optimized
  5059. );
  5060. }
  5061. } else {
  5062. updateComponent(n1, n2, optimized);
  5063. }
  5064. };
  5065. const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
  5066. const instance = initialVNode.component = createComponentInstance(
  5067. initialVNode,
  5068. parentComponent,
  5069. parentSuspense
  5070. );
  5071. if (isKeepAlive(initialVNode)) {
  5072. instance.ctx.renderer = internals;
  5073. }
  5074. {
  5075. setupComponent(instance);
  5076. }
  5077. if (instance.asyncDep) {
  5078. parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect);
  5079. if (!initialVNode.el) {
  5080. const placeholder = instance.subTree = createVNode(Comment);
  5081. processCommentNode(null, placeholder, container, anchor);
  5082. }
  5083. } else {
  5084. setupRenderEffect(
  5085. instance,
  5086. initialVNode,
  5087. container,
  5088. anchor,
  5089. parentSuspense,
  5090. namespace,
  5091. optimized
  5092. );
  5093. }
  5094. };
  5095. const updateComponent = (n1, n2, optimized) => {
  5096. const instance = n2.component = n1.component;
  5097. if (shouldUpdateComponent(n1, n2, optimized)) {
  5098. if (instance.asyncDep && !instance.asyncResolved) {
  5099. updateComponentPreRender(instance, n2, optimized);
  5100. return;
  5101. } else {
  5102. instance.next = n2;
  5103. invalidateJob(instance.update);
  5104. instance.effect.dirty = true;
  5105. instance.update();
  5106. }
  5107. } else {
  5108. n2.el = n1.el;
  5109. instance.vnode = n2;
  5110. }
  5111. };
  5112. const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
  5113. const componentUpdateFn = () => {
  5114. if (!instance.isMounted) {
  5115. let vnodeHook;
  5116. const { el, props } = initialVNode;
  5117. const { bm, m, parent } = instance;
  5118. const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
  5119. toggleRecurse(instance, false);
  5120. if (bm) {
  5121. invokeArrayFns(bm);
  5122. }
  5123. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
  5124. invokeVNodeHook(vnodeHook, parent, initialVNode);
  5125. }
  5126. toggleRecurse(instance, true);
  5127. if (el && hydrateNode) {
  5128. const hydrateSubTree = () => {
  5129. instance.subTree = renderComponentRoot(instance);
  5130. hydrateNode(
  5131. el,
  5132. instance.subTree,
  5133. instance,
  5134. parentSuspense,
  5135. null
  5136. );
  5137. };
  5138. if (isAsyncWrapperVNode) {
  5139. initialVNode.type.__asyncLoader().then(
  5140. // note: we are moving the render call into an async callback,
  5141. // which means it won't track dependencies - but it's ok because
  5142. // a server-rendered async wrapper is already in resolved state
  5143. // and it will never need to change.
  5144. () => !instance.isUnmounted && hydrateSubTree()
  5145. );
  5146. } else {
  5147. hydrateSubTree();
  5148. }
  5149. } else {
  5150. const subTree = instance.subTree = renderComponentRoot(instance);
  5151. patch(
  5152. null,
  5153. subTree,
  5154. container,
  5155. anchor,
  5156. instance,
  5157. parentSuspense,
  5158. namespace
  5159. );
  5160. initialVNode.el = subTree.el;
  5161. }
  5162. if (m) {
  5163. queuePostRenderEffect(m, parentSuspense);
  5164. }
  5165. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
  5166. const scopedInitialVNode = initialVNode;
  5167. queuePostRenderEffect(
  5168. () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
  5169. parentSuspense
  5170. );
  5171. }
  5172. if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
  5173. instance.a && queuePostRenderEffect(instance.a, parentSuspense);
  5174. }
  5175. instance.isMounted = true;
  5176. initialVNode = container = anchor = null;
  5177. } else {
  5178. let { next, bu, u, parent, vnode } = instance;
  5179. {
  5180. const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
  5181. if (nonHydratedAsyncRoot) {
  5182. if (next) {
  5183. next.el = vnode.el;
  5184. updateComponentPreRender(instance, next, optimized);
  5185. }
  5186. nonHydratedAsyncRoot.asyncDep.then(() => {
  5187. if (!instance.isUnmounted) {
  5188. componentUpdateFn();
  5189. }
  5190. });
  5191. return;
  5192. }
  5193. }
  5194. let originNext = next;
  5195. let vnodeHook;
  5196. toggleRecurse(instance, false);
  5197. if (next) {
  5198. next.el = vnode.el;
  5199. updateComponentPreRender(instance, next, optimized);
  5200. } else {
  5201. next = vnode;
  5202. }
  5203. if (bu) {
  5204. invokeArrayFns(bu);
  5205. }
  5206. if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
  5207. invokeVNodeHook(vnodeHook, parent, next, vnode);
  5208. }
  5209. toggleRecurse(instance, true);
  5210. const nextTree = renderComponentRoot(instance);
  5211. const prevTree = instance.subTree;
  5212. instance.subTree = nextTree;
  5213. patch(
  5214. prevTree,
  5215. nextTree,
  5216. // parent may have changed if it's in a teleport
  5217. hostParentNode(prevTree.el),
  5218. // anchor may have changed if it's in a fragment
  5219. getNextHostNode(prevTree),
  5220. instance,
  5221. parentSuspense,
  5222. namespace
  5223. );
  5224. next.el = nextTree.el;
  5225. if (originNext === null) {
  5226. updateHOCHostEl(instance, nextTree.el);
  5227. }
  5228. if (u) {
  5229. queuePostRenderEffect(u, parentSuspense);
  5230. }
  5231. if (vnodeHook = next.props && next.props.onVnodeUpdated) {
  5232. queuePostRenderEffect(
  5233. () => invokeVNodeHook(vnodeHook, parent, next, vnode),
  5234. parentSuspense
  5235. );
  5236. }
  5237. }
  5238. };
  5239. const effect2 = instance.effect = new ReactiveEffect(
  5240. componentUpdateFn,
  5241. NOOP,
  5242. () => queueJob(update),
  5243. instance.scope
  5244. // track it in component's effect scope
  5245. );
  5246. const update = instance.update = () => {
  5247. if (effect2.dirty) {
  5248. effect2.run();
  5249. }
  5250. };
  5251. update.id = instance.uid;
  5252. toggleRecurse(instance, true);
  5253. update();
  5254. };
  5255. const updateComponentPreRender = (instance, nextVNode, optimized) => {
  5256. nextVNode.component = instance;
  5257. const prevProps = instance.vnode.props;
  5258. instance.vnode = nextVNode;
  5259. instance.next = null;
  5260. updateProps(instance, nextVNode.props, prevProps, optimized);
  5261. updateSlots(instance, nextVNode.children, optimized);
  5262. pauseTracking();
  5263. flushPreFlushCbs(instance);
  5264. resetTracking();
  5265. };
  5266. const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
  5267. const c1 = n1 && n1.children;
  5268. const prevShapeFlag = n1 ? n1.shapeFlag : 0;
  5269. const c2 = n2.children;
  5270. const { patchFlag, shapeFlag } = n2;
  5271. if (patchFlag > 0) {
  5272. if (patchFlag & 128) {
  5273. patchKeyedChildren(
  5274. c1,
  5275. c2,
  5276. container,
  5277. anchor,
  5278. parentComponent,
  5279. parentSuspense,
  5280. namespace,
  5281. slotScopeIds,
  5282. optimized
  5283. );
  5284. return;
  5285. } else if (patchFlag & 256) {
  5286. patchUnkeyedChildren(
  5287. c1,
  5288. c2,
  5289. container,
  5290. anchor,
  5291. parentComponent,
  5292. parentSuspense,
  5293. namespace,
  5294. slotScopeIds,
  5295. optimized
  5296. );
  5297. return;
  5298. }
  5299. }
  5300. if (shapeFlag & 8) {
  5301. if (prevShapeFlag & 16) {
  5302. unmountChildren(c1, parentComponent, parentSuspense);
  5303. }
  5304. if (c2 !== c1) {
  5305. hostSetElementText(container, c2);
  5306. }
  5307. } else {
  5308. if (prevShapeFlag & 16) {
  5309. if (shapeFlag & 16) {
  5310. patchKeyedChildren(
  5311. c1,
  5312. c2,
  5313. container,
  5314. anchor,
  5315. parentComponent,
  5316. parentSuspense,
  5317. namespace,
  5318. slotScopeIds,
  5319. optimized
  5320. );
  5321. } else {
  5322. unmountChildren(c1, parentComponent, parentSuspense, true);
  5323. }
  5324. } else {
  5325. if (prevShapeFlag & 8) {
  5326. hostSetElementText(container, "");
  5327. }
  5328. if (shapeFlag & 16) {
  5329. mountChildren(
  5330. c2,
  5331. container,
  5332. anchor,
  5333. parentComponent,
  5334. parentSuspense,
  5335. namespace,
  5336. slotScopeIds,
  5337. optimized
  5338. );
  5339. }
  5340. }
  5341. }
  5342. };
  5343. const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  5344. c1 = c1 || EMPTY_ARR;
  5345. c2 = c2 || EMPTY_ARR;
  5346. const oldLength = c1.length;
  5347. const newLength = c2.length;
  5348. const commonLength = Math.min(oldLength, newLength);
  5349. let i;
  5350. for (i = 0; i < commonLength; i++) {
  5351. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  5352. patch(
  5353. c1[i],
  5354. nextChild,
  5355. container,
  5356. null,
  5357. parentComponent,
  5358. parentSuspense,
  5359. namespace,
  5360. slotScopeIds,
  5361. optimized
  5362. );
  5363. }
  5364. if (oldLength > newLength) {
  5365. unmountChildren(
  5366. c1,
  5367. parentComponent,
  5368. parentSuspense,
  5369. true,
  5370. false,
  5371. commonLength
  5372. );
  5373. } else {
  5374. mountChildren(
  5375. c2,
  5376. container,
  5377. anchor,
  5378. parentComponent,
  5379. parentSuspense,
  5380. namespace,
  5381. slotScopeIds,
  5382. optimized,
  5383. commonLength
  5384. );
  5385. }
  5386. };
  5387. const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  5388. let i = 0;
  5389. const l2 = c2.length;
  5390. let e1 = c1.length - 1;
  5391. let e2 = l2 - 1;
  5392. while (i <= e1 && i <= e2) {
  5393. const n1 = c1[i];
  5394. const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  5395. if (isSameVNodeType(n1, n2)) {
  5396. patch(
  5397. n1,
  5398. n2,
  5399. container,
  5400. null,
  5401. parentComponent,
  5402. parentSuspense,
  5403. namespace,
  5404. slotScopeIds,
  5405. optimized
  5406. );
  5407. } else {
  5408. break;
  5409. }
  5410. i++;
  5411. }
  5412. while (i <= e1 && i <= e2) {
  5413. const n1 = c1[e1];
  5414. const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
  5415. if (isSameVNodeType(n1, n2)) {
  5416. patch(
  5417. n1,
  5418. n2,
  5419. container,
  5420. null,
  5421. parentComponent,
  5422. parentSuspense,
  5423. namespace,
  5424. slotScopeIds,
  5425. optimized
  5426. );
  5427. } else {
  5428. break;
  5429. }
  5430. e1--;
  5431. e2--;
  5432. }
  5433. if (i > e1) {
  5434. if (i <= e2) {
  5435. const nextPos = e2 + 1;
  5436. const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
  5437. while (i <= e2) {
  5438. patch(
  5439. null,
  5440. c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
  5441. container,
  5442. anchor,
  5443. parentComponent,
  5444. parentSuspense,
  5445. namespace,
  5446. slotScopeIds,
  5447. optimized
  5448. );
  5449. i++;
  5450. }
  5451. }
  5452. } else if (i > e2) {
  5453. while (i <= e1) {
  5454. unmount(c1[i], parentComponent, parentSuspense, true);
  5455. i++;
  5456. }
  5457. } else {
  5458. const s1 = i;
  5459. const s2 = i;
  5460. const keyToNewIndexMap = /* @__PURE__ */ new Map();
  5461. for (i = s2; i <= e2; i++) {
  5462. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  5463. if (nextChild.key != null) {
  5464. keyToNewIndexMap.set(nextChild.key, i);
  5465. }
  5466. }
  5467. let j;
  5468. let patched = 0;
  5469. const toBePatched = e2 - s2 + 1;
  5470. let moved = false;
  5471. let maxNewIndexSoFar = 0;
  5472. const newIndexToOldIndexMap = new Array(toBePatched);
  5473. for (i = 0; i < toBePatched; i++)
  5474. newIndexToOldIndexMap[i] = 0;
  5475. for (i = s1; i <= e1; i++) {
  5476. const prevChild = c1[i];
  5477. if (patched >= toBePatched) {
  5478. unmount(prevChild, parentComponent, parentSuspense, true);
  5479. continue;
  5480. }
  5481. let newIndex;
  5482. if (prevChild.key != null) {
  5483. newIndex = keyToNewIndexMap.get(prevChild.key);
  5484. } else {
  5485. for (j = s2; j <= e2; j++) {
  5486. if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
  5487. newIndex = j;
  5488. break;
  5489. }
  5490. }
  5491. }
  5492. if (newIndex === void 0) {
  5493. unmount(prevChild, parentComponent, parentSuspense, true);
  5494. } else {
  5495. newIndexToOldIndexMap[newIndex - s2] = i + 1;
  5496. if (newIndex >= maxNewIndexSoFar) {
  5497. maxNewIndexSoFar = newIndex;
  5498. } else {
  5499. moved = true;
  5500. }
  5501. patch(
  5502. prevChild,
  5503. c2[newIndex],
  5504. container,
  5505. null,
  5506. parentComponent,
  5507. parentSuspense,
  5508. namespace,
  5509. slotScopeIds,
  5510. optimized
  5511. );
  5512. patched++;
  5513. }
  5514. }
  5515. const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
  5516. j = increasingNewIndexSequence.length - 1;
  5517. for (i = toBePatched - 1; i >= 0; i--) {
  5518. const nextIndex = s2 + i;
  5519. const nextChild = c2[nextIndex];
  5520. const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
  5521. if (newIndexToOldIndexMap[i] === 0) {
  5522. patch(
  5523. null,
  5524. nextChild,
  5525. container,
  5526. anchor,
  5527. parentComponent,
  5528. parentSuspense,
  5529. namespace,
  5530. slotScopeIds,
  5531. optimized
  5532. );
  5533. } else if (moved) {
  5534. if (j < 0 || i !== increasingNewIndexSequence[j]) {
  5535. move(nextChild, container, anchor, 2);
  5536. } else {
  5537. j--;
  5538. }
  5539. }
  5540. }
  5541. }
  5542. };
  5543. const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
  5544. const { el, type, transition, children, shapeFlag } = vnode;
  5545. if (shapeFlag & 6) {
  5546. move(vnode.component.subTree, container, anchor, moveType);
  5547. return;
  5548. }
  5549. if (shapeFlag & 128) {
  5550. vnode.suspense.move(container, anchor, moveType);
  5551. return;
  5552. }
  5553. if (shapeFlag & 64) {
  5554. type.move(vnode, container, anchor, internals);
  5555. return;
  5556. }
  5557. if (type === Fragment) {
  5558. hostInsert(el, container, anchor);
  5559. for (let i = 0; i < children.length; i++) {
  5560. move(children[i], container, anchor, moveType);
  5561. }
  5562. hostInsert(vnode.anchor, container, anchor);
  5563. return;
  5564. }
  5565. if (type === Static) {
  5566. moveStaticNode(vnode, container, anchor);
  5567. return;
  5568. }
  5569. const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
  5570. if (needTransition2) {
  5571. if (moveType === 0) {
  5572. transition.beforeEnter(el);
  5573. hostInsert(el, container, anchor);
  5574. queuePostRenderEffect(() => transition.enter(el), parentSuspense);
  5575. } else {
  5576. const { leave, delayLeave, afterLeave } = transition;
  5577. const remove22 = () => hostInsert(el, container, anchor);
  5578. const performLeave = () => {
  5579. leave(el, () => {
  5580. remove22();
  5581. afterLeave && afterLeave();
  5582. });
  5583. };
  5584. if (delayLeave) {
  5585. delayLeave(el, remove22, performLeave);
  5586. } else {
  5587. performLeave();
  5588. }
  5589. }
  5590. } else {
  5591. hostInsert(el, container, anchor);
  5592. }
  5593. };
  5594. const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
  5595. const {
  5596. type,
  5597. props,
  5598. ref: ref3,
  5599. children,
  5600. dynamicChildren,
  5601. shapeFlag,
  5602. patchFlag,
  5603. dirs
  5604. } = vnode;
  5605. if (ref3 != null) {
  5606. setRef(ref3, null, parentSuspense, vnode, true);
  5607. }
  5608. if (shapeFlag & 256) {
  5609. parentComponent.ctx.deactivate(vnode);
  5610. return;
  5611. }
  5612. const shouldInvokeDirs = shapeFlag & 1 && dirs;
  5613. const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
  5614. let vnodeHook;
  5615. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
  5616. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  5617. }
  5618. if (shapeFlag & 6) {
  5619. unmountComponent(vnode.component, parentSuspense, doRemove);
  5620. } else {
  5621. if (shapeFlag & 128) {
  5622. vnode.suspense.unmount(parentSuspense, doRemove);
  5623. return;
  5624. }
  5625. if (shouldInvokeDirs) {
  5626. invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
  5627. }
  5628. if (shapeFlag & 64) {
  5629. vnode.type.remove(
  5630. vnode,
  5631. parentComponent,
  5632. parentSuspense,
  5633. optimized,
  5634. internals,
  5635. doRemove
  5636. );
  5637. } else if (dynamicChildren && // #1153: fast path should not be taken for non-stable (v-for) fragments
  5638. (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
  5639. unmountChildren(
  5640. dynamicChildren,
  5641. parentComponent,
  5642. parentSuspense,
  5643. false,
  5644. true
  5645. );
  5646. } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
  5647. unmountChildren(children, parentComponent, parentSuspense);
  5648. }
  5649. if (doRemove) {
  5650. remove2(vnode);
  5651. }
  5652. }
  5653. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
  5654. queuePostRenderEffect(() => {
  5655. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  5656. shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
  5657. }, parentSuspense);
  5658. }
  5659. };
  5660. const remove2 = (vnode) => {
  5661. const { type, el, anchor, transition } = vnode;
  5662. if (type === Fragment) {
  5663. {
  5664. removeFragment(el, anchor);
  5665. }
  5666. return;
  5667. }
  5668. if (type === Static) {
  5669. removeStaticNode(vnode);
  5670. return;
  5671. }
  5672. const performRemove = () => {
  5673. hostRemove(el);
  5674. if (transition && !transition.persisted && transition.afterLeave) {
  5675. transition.afterLeave();
  5676. }
  5677. };
  5678. if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
  5679. const { leave, delayLeave } = transition;
  5680. const performLeave = () => leave(el, performRemove);
  5681. if (delayLeave) {
  5682. delayLeave(vnode.el, performRemove, performLeave);
  5683. } else {
  5684. performLeave();
  5685. }
  5686. } else {
  5687. performRemove();
  5688. }
  5689. };
  5690. const removeFragment = (cur, end) => {
  5691. let next;
  5692. while (cur !== end) {
  5693. next = hostNextSibling(cur);
  5694. hostRemove(cur);
  5695. cur = next;
  5696. }
  5697. hostRemove(end);
  5698. };
  5699. const unmountComponent = (instance, parentSuspense, doRemove) => {
  5700. const { bum, scope, update, subTree, um } = instance;
  5701. if (bum) {
  5702. invokeArrayFns(bum);
  5703. }
  5704. scope.stop();
  5705. if (update) {
  5706. update.active = false;
  5707. unmount(subTree, instance, parentSuspense, doRemove);
  5708. }
  5709. if (um) {
  5710. queuePostRenderEffect(um, parentSuspense);
  5711. }
  5712. queuePostRenderEffect(() => {
  5713. instance.isUnmounted = true;
  5714. }, parentSuspense);
  5715. if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
  5716. parentSuspense.deps--;
  5717. if (parentSuspense.deps === 0) {
  5718. parentSuspense.resolve();
  5719. }
  5720. }
  5721. };
  5722. const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
  5723. for (let i = start; i < children.length; i++) {
  5724. unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
  5725. }
  5726. };
  5727. const getNextHostNode = (vnode) => {
  5728. if (vnode.shapeFlag & 6) {
  5729. return getNextHostNode(vnode.component.subTree);
  5730. }
  5731. if (vnode.shapeFlag & 128) {
  5732. return vnode.suspense.next();
  5733. }
  5734. return hostNextSibling(vnode.anchor || vnode.el);
  5735. };
  5736. let isFlushing2 = false;
  5737. const render = (vnode, container, namespace) => {
  5738. if (vnode == null) {
  5739. if (container._vnode) {
  5740. unmount(container._vnode, null, null, true);
  5741. }
  5742. } else {
  5743. patch(
  5744. container._vnode || null,
  5745. vnode,
  5746. container,
  5747. null,
  5748. null,
  5749. null,
  5750. namespace
  5751. );
  5752. }
  5753. if (!isFlushing2) {
  5754. isFlushing2 = true;
  5755. flushPreFlushCbs();
  5756. flushPostFlushCbs();
  5757. isFlushing2 = false;
  5758. }
  5759. container._vnode = vnode;
  5760. };
  5761. const internals = {
  5762. p: patch,
  5763. um: unmount,
  5764. m: move,
  5765. r: remove2,
  5766. mt: mountComponent,
  5767. mc: mountChildren,
  5768. pc: patchChildren,
  5769. pbc: patchBlockChildren,
  5770. n: getNextHostNode,
  5771. o: options
  5772. };
  5773. let hydrate;
  5774. let hydrateNode;
  5775. if (createHydrationFns) {
  5776. [hydrate, hydrateNode] = createHydrationFns(
  5777. internals
  5778. );
  5779. }
  5780. return {
  5781. render,
  5782. hydrate,
  5783. createApp: createAppAPI(render, hydrate)
  5784. };
  5785. }
  5786. function resolveChildrenNamespace({ type, props }, currentNamespace) {
  5787. return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
  5788. }
  5789. function toggleRecurse({ effect: effect2, update }, allowed) {
  5790. effect2.allowRecurse = update.allowRecurse = allowed;
  5791. }
  5792. function needTransition(parentSuspense, transition) {
  5793. return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
  5794. }
  5795. function traverseStaticChildren(n1, n2, shallow = false) {
  5796. const ch1 = n1.children;
  5797. const ch2 = n2.children;
  5798. if (isArray(ch1) && isArray(ch2)) {
  5799. for (let i = 0; i < ch1.length; i++) {
  5800. const c1 = ch1[i];
  5801. let c2 = ch2[i];
  5802. if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
  5803. if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
  5804. c2 = ch2[i] = cloneIfMounted(ch2[i]);
  5805. c2.el = c1.el;
  5806. }
  5807. if (!shallow)
  5808. traverseStaticChildren(c1, c2);
  5809. }
  5810. if (c2.type === Text) {
  5811. c2.el = c1.el;
  5812. }
  5813. }
  5814. }
  5815. }
  5816. function getSequence(arr) {
  5817. const p2 = arr.slice();
  5818. const result = [0];
  5819. let i, j, u, v, c;
  5820. const len = arr.length;
  5821. for (i = 0; i < len; i++) {
  5822. const arrI = arr[i];
  5823. if (arrI !== 0) {
  5824. j = result[result.length - 1];
  5825. if (arr[j] < arrI) {
  5826. p2[i] = j;
  5827. result.push(i);
  5828. continue;
  5829. }
  5830. u = 0;
  5831. v = result.length - 1;
  5832. while (u < v) {
  5833. c = u + v >> 1;
  5834. if (arr[result[c]] < arrI) {
  5835. u = c + 1;
  5836. } else {
  5837. v = c;
  5838. }
  5839. }
  5840. if (arrI < arr[result[u]]) {
  5841. if (u > 0) {
  5842. p2[i] = result[u - 1];
  5843. }
  5844. result[u] = i;
  5845. }
  5846. }
  5847. }
  5848. u = result.length;
  5849. v = result[u - 1];
  5850. while (u-- > 0) {
  5851. result[u] = v;
  5852. v = p2[v];
  5853. }
  5854. return result;
  5855. }
  5856. function locateNonHydratedAsyncRoot(instance) {
  5857. const subComponent = instance.subTree.component;
  5858. if (subComponent) {
  5859. if (subComponent.asyncDep && !subComponent.asyncResolved) {
  5860. return subComponent;
  5861. } else {
  5862. return locateNonHydratedAsyncRoot(subComponent);
  5863. }
  5864. }
  5865. }
  5866. const isTeleport = (type) => type.__isTeleport;
  5867. const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
  5868. const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
  5869. const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
  5870. const resolveTarget = (props, select) => {
  5871. const targetSelector = props && props.to;
  5872. if (isString(targetSelector)) {
  5873. if (!select) {
  5874. return null;
  5875. } else {
  5876. const target = select(targetSelector);
  5877. return target;
  5878. }
  5879. } else {
  5880. return targetSelector;
  5881. }
  5882. };
  5883. const TeleportImpl = {
  5884. name: "Teleport",
  5885. __isTeleport: true,
  5886. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
  5887. const {
  5888. mc: mountChildren,
  5889. pc: patchChildren,
  5890. pbc: patchBlockChildren,
  5891. o: { insert, querySelector, createText, createComment }
  5892. } = internals;
  5893. const disabled = isTeleportDisabled(n2.props);
  5894. let { shapeFlag, children, dynamicChildren } = n2;
  5895. if (n1 == null) {
  5896. const placeholder = n2.el = createText("");
  5897. const mainAnchor = n2.anchor = createText("");
  5898. insert(placeholder, container, anchor);
  5899. insert(mainAnchor, container, anchor);
  5900. const target = n2.target = resolveTarget(n2.props, querySelector);
  5901. const targetAnchor = n2.targetAnchor = createText("");
  5902. if (target) {
  5903. insert(targetAnchor, target);
  5904. if (namespace === "svg" || isTargetSVG(target)) {
  5905. namespace = "svg";
  5906. } else if (namespace === "mathml" || isTargetMathML(target)) {
  5907. namespace = "mathml";
  5908. }
  5909. }
  5910. const mount = (container2, anchor2) => {
  5911. if (shapeFlag & 16) {
  5912. mountChildren(
  5913. children,
  5914. container2,
  5915. anchor2,
  5916. parentComponent,
  5917. parentSuspense,
  5918. namespace,
  5919. slotScopeIds,
  5920. optimized
  5921. );
  5922. }
  5923. };
  5924. if (disabled) {
  5925. mount(container, mainAnchor);
  5926. } else if (target) {
  5927. mount(target, targetAnchor);
  5928. }
  5929. } else {
  5930. n2.el = n1.el;
  5931. const mainAnchor = n2.anchor = n1.anchor;
  5932. const target = n2.target = n1.target;
  5933. const targetAnchor = n2.targetAnchor = n1.targetAnchor;
  5934. const wasDisabled = isTeleportDisabled(n1.props);
  5935. const currentContainer = wasDisabled ? container : target;
  5936. const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
  5937. if (namespace === "svg" || isTargetSVG(target)) {
  5938. namespace = "svg";
  5939. } else if (namespace === "mathml" || isTargetMathML(target)) {
  5940. namespace = "mathml";
  5941. }
  5942. if (dynamicChildren) {
  5943. patchBlockChildren(
  5944. n1.dynamicChildren,
  5945. dynamicChildren,
  5946. currentContainer,
  5947. parentComponent,
  5948. parentSuspense,
  5949. namespace,
  5950. slotScopeIds
  5951. );
  5952. traverseStaticChildren(n1, n2, true);
  5953. } else if (!optimized) {
  5954. patchChildren(
  5955. n1,
  5956. n2,
  5957. currentContainer,
  5958. currentAnchor,
  5959. parentComponent,
  5960. parentSuspense,
  5961. namespace,
  5962. slotScopeIds,
  5963. false
  5964. );
  5965. }
  5966. if (disabled) {
  5967. if (!wasDisabled) {
  5968. moveTeleport(
  5969. n2,
  5970. container,
  5971. mainAnchor,
  5972. internals,
  5973. 1
  5974. );
  5975. } else {
  5976. if (n2.props && n1.props && n2.props.to !== n1.props.to) {
  5977. n2.props.to = n1.props.to;
  5978. }
  5979. }
  5980. } else {
  5981. if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
  5982. const nextTarget = n2.target = resolveTarget(
  5983. n2.props,
  5984. querySelector
  5985. );
  5986. if (nextTarget) {
  5987. moveTeleport(
  5988. n2,
  5989. nextTarget,
  5990. null,
  5991. internals,
  5992. 0
  5993. );
  5994. }
  5995. } else if (wasDisabled) {
  5996. moveTeleport(
  5997. n2,
  5998. target,
  5999. targetAnchor,
  6000. internals,
  6001. 1
  6002. );
  6003. }
  6004. }
  6005. }
  6006. updateCssVars(n2);
  6007. },
  6008. remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
  6009. const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
  6010. if (target) {
  6011. hostRemove(targetAnchor);
  6012. }
  6013. doRemove && hostRemove(anchor);
  6014. if (shapeFlag & 16) {
  6015. const shouldRemove = doRemove || !isTeleportDisabled(props);
  6016. for (let i = 0; i < children.length; i++) {
  6017. const child = children[i];
  6018. unmount(
  6019. child,
  6020. parentComponent,
  6021. parentSuspense,
  6022. shouldRemove,
  6023. !!child.dynamicChildren
  6024. );
  6025. }
  6026. }
  6027. },
  6028. move: moveTeleport,
  6029. hydrate: hydrateTeleport
  6030. };
  6031. function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
  6032. if (moveType === 0) {
  6033. insert(vnode.targetAnchor, container, parentAnchor);
  6034. }
  6035. const { el, anchor, shapeFlag, children, props } = vnode;
  6036. const isReorder = moveType === 2;
  6037. if (isReorder) {
  6038. insert(el, container, parentAnchor);
  6039. }
  6040. if (!isReorder || isTeleportDisabled(props)) {
  6041. if (shapeFlag & 16) {
  6042. for (let i = 0; i < children.length; i++) {
  6043. move(
  6044. children[i],
  6045. container,
  6046. parentAnchor,
  6047. 2
  6048. );
  6049. }
  6050. }
  6051. }
  6052. if (isReorder) {
  6053. insert(anchor, container, parentAnchor);
  6054. }
  6055. }
  6056. function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
  6057. o: { nextSibling, parentNode, querySelector }
  6058. }, hydrateChildren) {
  6059. const target = vnode.target = resolveTarget(
  6060. vnode.props,
  6061. querySelector
  6062. );
  6063. if (target) {
  6064. const targetNode = target._lpa || target.firstChild;
  6065. if (vnode.shapeFlag & 16) {
  6066. if (isTeleportDisabled(vnode.props)) {
  6067. vnode.anchor = hydrateChildren(
  6068. nextSibling(node),
  6069. vnode,
  6070. parentNode(node),
  6071. parentComponent,
  6072. parentSuspense,
  6073. slotScopeIds,
  6074. optimized
  6075. );
  6076. vnode.targetAnchor = targetNode;
  6077. } else {
  6078. vnode.anchor = nextSibling(node);
  6079. let targetAnchor = targetNode;
  6080. while (targetAnchor) {
  6081. targetAnchor = nextSibling(targetAnchor);
  6082. if (targetAnchor && targetAnchor.nodeType === 8 && targetAnchor.data === "teleport anchor") {
  6083. vnode.targetAnchor = targetAnchor;
  6084. target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
  6085. break;
  6086. }
  6087. }
  6088. hydrateChildren(
  6089. targetNode,
  6090. vnode,
  6091. target,
  6092. parentComponent,
  6093. parentSuspense,
  6094. slotScopeIds,
  6095. optimized
  6096. );
  6097. }
  6098. }
  6099. updateCssVars(vnode);
  6100. }
  6101. return vnode.anchor && nextSibling(vnode.anchor);
  6102. }
  6103. const Teleport = TeleportImpl;
  6104. function updateCssVars(vnode) {
  6105. const ctx = vnode.ctx;
  6106. if (ctx && ctx.ut) {
  6107. let node = vnode.children[0].el;
  6108. while (node && node !== vnode.targetAnchor) {
  6109. if (node.nodeType === 1)
  6110. node.setAttribute("data-v-owner", ctx.uid);
  6111. node = node.nextSibling;
  6112. }
  6113. ctx.ut();
  6114. }
  6115. }
  6116. const Fragment = Symbol.for("v-fgt");
  6117. const Text = Symbol.for("v-txt");
  6118. const Comment = Symbol.for("v-cmt");
  6119. const Static = Symbol.for("v-stc");
  6120. const blockStack = [];
  6121. let currentBlock = null;
  6122. function openBlock(disableTracking = false) {
  6123. blockStack.push(currentBlock = disableTracking ? null : []);
  6124. }
  6125. function closeBlock() {
  6126. blockStack.pop();
  6127. currentBlock = blockStack[blockStack.length - 1] || null;
  6128. }
  6129. let isBlockTreeEnabled = 1;
  6130. function setBlockTracking(value) {
  6131. isBlockTreeEnabled += value;
  6132. }
  6133. function setupBlock(vnode) {
  6134. vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
  6135. closeBlock();
  6136. if (isBlockTreeEnabled > 0 && currentBlock) {
  6137. currentBlock.push(vnode);
  6138. }
  6139. return vnode;
  6140. }
  6141. function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
  6142. return setupBlock(
  6143. createBaseVNode(
  6144. type,
  6145. props,
  6146. children,
  6147. patchFlag,
  6148. dynamicProps,
  6149. shapeFlag,
  6150. true
  6151. )
  6152. );
  6153. }
  6154. function createBlock(type, props, children, patchFlag, dynamicProps) {
  6155. return setupBlock(
  6156. createVNode(
  6157. type,
  6158. props,
  6159. children,
  6160. patchFlag,
  6161. dynamicProps,
  6162. true
  6163. )
  6164. );
  6165. }
  6166. function isVNode(value) {
  6167. return value ? value.__v_isVNode === true : false;
  6168. }
  6169. function isSameVNodeType(n1, n2) {
  6170. return n1.type === n2.type && n1.key === n2.key;
  6171. }
  6172. const normalizeKey = ({ key }) => key != null ? key : null;
  6173. const normalizeRef = ({
  6174. ref: ref3,
  6175. ref_key,
  6176. ref_for
  6177. }) => {
  6178. if (typeof ref3 === "number") {
  6179. ref3 = "" + ref3;
  6180. }
  6181. return ref3 != null ? isString(ref3) || isRef(ref3) || isFunction(ref3) ? { i: currentRenderingInstance, r: ref3, k: ref_key, f: !!ref_for } : ref3 : null;
  6182. };
  6183. function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
  6184. const vnode = {
  6185. __v_isVNode: true,
  6186. __v_skip: true,
  6187. type,
  6188. props,
  6189. key: props && normalizeKey(props),
  6190. ref: props && normalizeRef(props),
  6191. scopeId: currentScopeId,
  6192. slotScopeIds: null,
  6193. children,
  6194. component: null,
  6195. suspense: null,
  6196. ssContent: null,
  6197. ssFallback: null,
  6198. dirs: null,
  6199. transition: null,
  6200. el: null,
  6201. anchor: null,
  6202. target: null,
  6203. targetAnchor: null,
  6204. staticCount: 0,
  6205. shapeFlag,
  6206. patchFlag,
  6207. dynamicProps,
  6208. dynamicChildren: null,
  6209. appContext: null,
  6210. ctx: currentRenderingInstance
  6211. };
  6212. if (needFullChildrenNormalization) {
  6213. normalizeChildren(vnode, children);
  6214. if (shapeFlag & 128) {
  6215. type.normalize(vnode);
  6216. }
  6217. } else if (children) {
  6218. vnode.shapeFlag |= isString(children) ? 8 : 16;
  6219. }
  6220. if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
  6221. !isBlockNode && // has current parent block
  6222. currentBlock && // presence of a patch flag indicates this node needs patching on updates.
  6223. // component nodes also should always be patched, because even if the
  6224. // component doesn't need to update, it needs to persist the instance on to
  6225. // the next vnode so that it can be properly unmounted later.
  6226. (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
  6227. // vnode should not be considered dynamic due to handler caching.
  6228. vnode.patchFlag !== 32) {
  6229. currentBlock.push(vnode);
  6230. }
  6231. return vnode;
  6232. }
  6233. const createVNode = _createVNode;
  6234. function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
  6235. if (!type || type === NULL_DYNAMIC_COMPONENT) {
  6236. type = Comment;
  6237. }
  6238. if (isVNode(type)) {
  6239. const cloned = cloneVNode(
  6240. type,
  6241. props,
  6242. true
  6243. /* mergeRef: true */
  6244. );
  6245. if (children) {
  6246. normalizeChildren(cloned, children);
  6247. }
  6248. if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
  6249. if (cloned.shapeFlag & 6) {
  6250. currentBlock[currentBlock.indexOf(type)] = cloned;
  6251. } else {
  6252. currentBlock.push(cloned);
  6253. }
  6254. }
  6255. cloned.patchFlag |= -2;
  6256. return cloned;
  6257. }
  6258. if (isClassComponent(type)) {
  6259. type = type.__vccOpts;
  6260. }
  6261. if (props) {
  6262. props = guardReactiveProps(props);
  6263. let { class: klass, style } = props;
  6264. if (klass && !isString(klass)) {
  6265. props.class = normalizeClass(klass);
  6266. }
  6267. if (isObject$1(style)) {
  6268. if (isProxy(style) && !isArray(style)) {
  6269. style = extend({}, style);
  6270. }
  6271. props.style = normalizeStyle(style);
  6272. }
  6273. }
  6274. const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject$1(type) ? 4 : isFunction(type) ? 2 : 0;
  6275. return createBaseVNode(
  6276. type,
  6277. props,
  6278. children,
  6279. patchFlag,
  6280. dynamicProps,
  6281. shapeFlag,
  6282. isBlockNode,
  6283. true
  6284. );
  6285. }
  6286. function guardReactiveProps(props) {
  6287. if (!props)
  6288. return null;
  6289. return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
  6290. }
  6291. function cloneVNode(vnode, extraProps, mergeRef = false) {
  6292. const { props, ref: ref3, patchFlag, children } = vnode;
  6293. const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
  6294. const cloned = {
  6295. __v_isVNode: true,
  6296. __v_skip: true,
  6297. type: vnode.type,
  6298. props: mergedProps,
  6299. key: mergedProps && normalizeKey(mergedProps),
  6300. ref: extraProps && extraProps.ref ? (
  6301. // #2078 in the case of <component :is="vnode" ref="extra"/>
  6302. // if the vnode itself already has a ref, cloneVNode will need to merge
  6303. // the refs so the single vnode can be set on multiple refs
  6304. mergeRef && ref3 ? isArray(ref3) ? ref3.concat(normalizeRef(extraProps)) : [ref3, normalizeRef(extraProps)] : normalizeRef(extraProps)
  6305. ) : ref3,
  6306. scopeId: vnode.scopeId,
  6307. slotScopeIds: vnode.slotScopeIds,
  6308. children,
  6309. target: vnode.target,
  6310. targetAnchor: vnode.targetAnchor,
  6311. staticCount: vnode.staticCount,
  6312. shapeFlag: vnode.shapeFlag,
  6313. // if the vnode is cloned with extra props, we can no longer assume its
  6314. // existing patch flag to be reliable and need to add the FULL_PROPS flag.
  6315. // note: preserve flag for fragments since they use the flag for children
  6316. // fast paths only.
  6317. patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
  6318. dynamicProps: vnode.dynamicProps,
  6319. dynamicChildren: vnode.dynamicChildren,
  6320. appContext: vnode.appContext,
  6321. dirs: vnode.dirs,
  6322. transition: vnode.transition,
  6323. // These should technically only be non-null on mounted VNodes. However,
  6324. // they *should* be copied for kept-alive vnodes. So we just always copy
  6325. // them since them being non-null during a mount doesn't affect the logic as
  6326. // they will simply be overwritten.
  6327. component: vnode.component,
  6328. suspense: vnode.suspense,
  6329. ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
  6330. ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
  6331. el: vnode.el,
  6332. anchor: vnode.anchor,
  6333. ctx: vnode.ctx,
  6334. ce: vnode.ce
  6335. };
  6336. return cloned;
  6337. }
  6338. function createTextVNode(text = " ", flag = 0) {
  6339. return createVNode(Text, null, text, flag);
  6340. }
  6341. function createStaticVNode(content, numberOfNodes) {
  6342. const vnode = createVNode(Static, null, content);
  6343. vnode.staticCount = numberOfNodes;
  6344. return vnode;
  6345. }
  6346. function createCommentVNode(text = "", asBlock = false) {
  6347. return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
  6348. }
  6349. function normalizeVNode(child) {
  6350. if (child == null || typeof child === "boolean") {
  6351. return createVNode(Comment);
  6352. } else if (isArray(child)) {
  6353. return createVNode(
  6354. Fragment,
  6355. null,
  6356. // #3666, avoid reference pollution when reusing vnode
  6357. child.slice()
  6358. );
  6359. } else if (typeof child === "object") {
  6360. return cloneIfMounted(child);
  6361. } else {
  6362. return createVNode(Text, null, String(child));
  6363. }
  6364. }
  6365. function cloneIfMounted(child) {
  6366. return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
  6367. }
  6368. function normalizeChildren(vnode, children) {
  6369. let type = 0;
  6370. const { shapeFlag } = vnode;
  6371. if (children == null) {
  6372. children = null;
  6373. } else if (isArray(children)) {
  6374. type = 16;
  6375. } else if (typeof children === "object") {
  6376. if (shapeFlag & (1 | 64)) {
  6377. const slot = children.default;
  6378. if (slot) {
  6379. slot._c && (slot._d = false);
  6380. normalizeChildren(vnode, slot());
  6381. slot._c && (slot._d = true);
  6382. }
  6383. return;
  6384. } else {
  6385. type = 32;
  6386. const slotFlag = children._;
  6387. if (!slotFlag && !isInternalObject(children)) {
  6388. children._ctx = currentRenderingInstance;
  6389. } else if (slotFlag === 3 && currentRenderingInstance) {
  6390. if (currentRenderingInstance.slots._ === 1) {
  6391. children._ = 1;
  6392. } else {
  6393. children._ = 2;
  6394. vnode.patchFlag |= 1024;
  6395. }
  6396. }
  6397. }
  6398. } else if (isFunction(children)) {
  6399. children = { default: children, _ctx: currentRenderingInstance };
  6400. type = 32;
  6401. } else {
  6402. children = String(children);
  6403. if (shapeFlag & 64) {
  6404. type = 16;
  6405. children = [createTextVNode(children)];
  6406. } else {
  6407. type = 8;
  6408. }
  6409. }
  6410. vnode.children = children;
  6411. vnode.shapeFlag |= type;
  6412. }
  6413. function mergeProps(...args) {
  6414. const ret = {};
  6415. for (let i = 0; i < args.length; i++) {
  6416. const toMerge = args[i];
  6417. for (const key in toMerge) {
  6418. if (key === "class") {
  6419. if (ret.class !== toMerge.class) {
  6420. ret.class = normalizeClass([ret.class, toMerge.class]);
  6421. }
  6422. } else if (key === "style") {
  6423. ret.style = normalizeStyle([ret.style, toMerge.style]);
  6424. } else if (isOn(key)) {
  6425. const existing = ret[key];
  6426. const incoming = toMerge[key];
  6427. if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
  6428. ret[key] = existing ? [].concat(existing, incoming) : incoming;
  6429. }
  6430. } else if (key !== "") {
  6431. ret[key] = toMerge[key];
  6432. }
  6433. }
  6434. }
  6435. return ret;
  6436. }
  6437. function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
  6438. callWithAsyncErrorHandling(hook, instance, 7, [
  6439. vnode,
  6440. prevVNode
  6441. ]);
  6442. }
  6443. const emptyAppContext = createAppContext();
  6444. let uid = 0;
  6445. function createComponentInstance(vnode, parent, suspense) {
  6446. const type = vnode.type;
  6447. const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  6448. const instance = {
  6449. uid: uid++,
  6450. vnode,
  6451. type,
  6452. parent,
  6453. appContext,
  6454. root: null,
  6455. // to be immediately set
  6456. next: null,
  6457. subTree: null,
  6458. // will be set synchronously right after creation
  6459. effect: null,
  6460. update: null,
  6461. // will be set synchronously right after creation
  6462. scope: new EffectScope(
  6463. true
  6464. /* detached */
  6465. ),
  6466. render: null,
  6467. proxy: null,
  6468. exposed: null,
  6469. exposeProxy: null,
  6470. withProxy: null,
  6471. provides: parent ? parent.provides : Object.create(appContext.provides),
  6472. accessCache: null,
  6473. renderCache: [],
  6474. // local resolved assets
  6475. components: null,
  6476. directives: null,
  6477. // resolved props and emits options
  6478. propsOptions: normalizePropsOptions(type, appContext),
  6479. emitsOptions: normalizeEmitsOptions(type, appContext),
  6480. // emit
  6481. emit: null,
  6482. // to be set immediately
  6483. emitted: null,
  6484. // props default value
  6485. propsDefaults: EMPTY_OBJ,
  6486. // inheritAttrs
  6487. inheritAttrs: type.inheritAttrs,
  6488. // state
  6489. ctx: EMPTY_OBJ,
  6490. data: EMPTY_OBJ,
  6491. props: EMPTY_OBJ,
  6492. attrs: EMPTY_OBJ,
  6493. slots: EMPTY_OBJ,
  6494. refs: EMPTY_OBJ,
  6495. setupState: EMPTY_OBJ,
  6496. setupContext: null,
  6497. attrsProxy: null,
  6498. slotsProxy: null,
  6499. // suspense related
  6500. suspense,
  6501. suspenseId: suspense ? suspense.pendingId : 0,
  6502. asyncDep: null,
  6503. asyncResolved: false,
  6504. // lifecycle hooks
  6505. // not using enums here because it results in computed properties
  6506. isMounted: false,
  6507. isUnmounted: false,
  6508. isDeactivated: false,
  6509. bc: null,
  6510. c: null,
  6511. bm: null,
  6512. m: null,
  6513. bu: null,
  6514. u: null,
  6515. um: null,
  6516. bum: null,
  6517. da: null,
  6518. a: null,
  6519. rtg: null,
  6520. rtc: null,
  6521. ec: null,
  6522. sp: null
  6523. };
  6524. {
  6525. instance.ctx = { _: instance };
  6526. }
  6527. instance.root = parent ? parent.root : instance;
  6528. instance.emit = emit.bind(null, instance);
  6529. if (vnode.ce) {
  6530. vnode.ce(instance);
  6531. }
  6532. return instance;
  6533. }
  6534. let currentInstance = null;
  6535. const getCurrentInstance = () => currentInstance || currentRenderingInstance;
  6536. let internalSetCurrentInstance;
  6537. let setInSSRSetupState;
  6538. {
  6539. const g = getGlobalThis();
  6540. const registerGlobalSetter = (key, setter) => {
  6541. let setters;
  6542. if (!(setters = g[key]))
  6543. setters = g[key] = [];
  6544. setters.push(setter);
  6545. return (v) => {
  6546. if (setters.length > 1)
  6547. setters.forEach((set2) => set2(v));
  6548. else
  6549. setters[0](v);
  6550. };
  6551. };
  6552. internalSetCurrentInstance = registerGlobalSetter(
  6553. `__VUE_INSTANCE_SETTERS__`,
  6554. (v) => currentInstance = v
  6555. );
  6556. setInSSRSetupState = registerGlobalSetter(
  6557. `__VUE_SSR_SETTERS__`,
  6558. (v) => isInSSRComponentSetup = v
  6559. );
  6560. }
  6561. const setCurrentInstance = (instance) => {
  6562. const prev = currentInstance;
  6563. internalSetCurrentInstance(instance);
  6564. instance.scope.on();
  6565. return () => {
  6566. instance.scope.off();
  6567. internalSetCurrentInstance(prev);
  6568. };
  6569. };
  6570. const unsetCurrentInstance = () => {
  6571. currentInstance && currentInstance.scope.off();
  6572. internalSetCurrentInstance(null);
  6573. };
  6574. function isStatefulComponent(instance) {
  6575. return instance.vnode.shapeFlag & 4;
  6576. }
  6577. let isInSSRComponentSetup = false;
  6578. function setupComponent(instance, isSSR = false) {
  6579. isSSR && setInSSRSetupState(isSSR);
  6580. const { props, children } = instance.vnode;
  6581. const isStateful = isStatefulComponent(instance);
  6582. initProps(instance, props, isStateful, isSSR);
  6583. initSlots(instance, children);
  6584. const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  6585. isSSR && setInSSRSetupState(false);
  6586. return setupResult;
  6587. }
  6588. function setupStatefulComponent(instance, isSSR) {
  6589. const Component = instance.type;
  6590. instance.accessCache = /* @__PURE__ */ Object.create(null);
  6591. instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
  6592. const { setup } = Component;
  6593. if (setup) {
  6594. const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
  6595. const reset = setCurrentInstance(instance);
  6596. pauseTracking();
  6597. const setupResult = callWithErrorHandling(
  6598. setup,
  6599. instance,
  6600. 0,
  6601. [
  6602. instance.props,
  6603. setupContext
  6604. ]
  6605. );
  6606. resetTracking();
  6607. reset();
  6608. if (isPromise(setupResult)) {
  6609. setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
  6610. if (isSSR) {
  6611. return setupResult.then((resolvedResult) => {
  6612. handleSetupResult(instance, resolvedResult, isSSR);
  6613. }).catch((e) => {
  6614. handleError(e, instance, 0);
  6615. });
  6616. } else {
  6617. instance.asyncDep = setupResult;
  6618. }
  6619. } else {
  6620. handleSetupResult(instance, setupResult, isSSR);
  6621. }
  6622. } else {
  6623. finishComponentSetup(instance, isSSR);
  6624. }
  6625. }
  6626. function handleSetupResult(instance, setupResult, isSSR) {
  6627. if (isFunction(setupResult)) {
  6628. if (instance.type.__ssrInlineRender) {
  6629. instance.ssrRender = setupResult;
  6630. } else {
  6631. instance.render = setupResult;
  6632. }
  6633. } else if (isObject$1(setupResult)) {
  6634. instance.setupState = proxyRefs(setupResult);
  6635. } else
  6636. ;
  6637. finishComponentSetup(instance, isSSR);
  6638. }
  6639. let compile;
  6640. function finishComponentSetup(instance, isSSR, skipOptions) {
  6641. const Component = instance.type;
  6642. if (!instance.render) {
  6643. if (!isSSR && compile && !Component.render) {
  6644. const template = Component.template || resolveMergedOptions(instance).template;
  6645. if (template) {
  6646. const { isCustomElement, compilerOptions } = instance.appContext.config;
  6647. const { delimiters, compilerOptions: componentCompilerOptions } = Component;
  6648. const finalCompilerOptions = extend(
  6649. extend(
  6650. {
  6651. isCustomElement,
  6652. delimiters
  6653. },
  6654. compilerOptions
  6655. ),
  6656. componentCompilerOptions
  6657. );
  6658. Component.render = compile(template, finalCompilerOptions);
  6659. }
  6660. }
  6661. instance.render = Component.render || NOOP;
  6662. }
  6663. {
  6664. const reset = setCurrentInstance(instance);
  6665. pauseTracking();
  6666. try {
  6667. applyOptions(instance);
  6668. } finally {
  6669. resetTracking();
  6670. reset();
  6671. }
  6672. }
  6673. }
  6674. const attrsProxyHandlers = {
  6675. get(target, key) {
  6676. track(target, "get", "");
  6677. return target[key];
  6678. }
  6679. };
  6680. function createSetupContext(instance) {
  6681. const expose = (exposed) => {
  6682. instance.exposed = exposed || {};
  6683. };
  6684. {
  6685. return {
  6686. attrs: new Proxy(instance.attrs, attrsProxyHandlers),
  6687. slots: instance.slots,
  6688. emit: instance.emit,
  6689. expose
  6690. };
  6691. }
  6692. }
  6693. function getExposeProxy(instance) {
  6694. if (instance.exposed) {
  6695. return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
  6696. get(target, key) {
  6697. if (key in target) {
  6698. return target[key];
  6699. } else if (key in publicPropertiesMap) {
  6700. return publicPropertiesMap[key](instance);
  6701. }
  6702. },
  6703. has(target, key) {
  6704. return key in target || key in publicPropertiesMap;
  6705. }
  6706. }));
  6707. }
  6708. }
  6709. const classifyRE = /(?:^|[-_])(\w)/g;
  6710. const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
  6711. function getComponentName(Component, includeInferred = true) {
  6712. return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
  6713. }
  6714. function formatComponentName(instance, Component, isRoot = false) {
  6715. let name = getComponentName(Component);
  6716. if (!name && Component.__file) {
  6717. const match = Component.__file.match(/([^/\\]+)\.\w+$/);
  6718. if (match) {
  6719. name = match[1];
  6720. }
  6721. }
  6722. if (!name && instance && instance.parent) {
  6723. const inferFromRegistry = (registry) => {
  6724. for (const key in registry) {
  6725. if (registry[key] === Component) {
  6726. return key;
  6727. }
  6728. }
  6729. };
  6730. name = inferFromRegistry(
  6731. instance.components || instance.parent.type.components
  6732. ) || inferFromRegistry(instance.appContext.components);
  6733. }
  6734. return name ? classify(name) : isRoot ? `App` : `Anonymous`;
  6735. }
  6736. function isClassComponent(value) {
  6737. return isFunction(value) && "__vccOpts" in value;
  6738. }
  6739. const computed = (getterOrOptions, debugOptions) => {
  6740. const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
  6741. return c;
  6742. };
  6743. function h(type, propsOrChildren, children) {
  6744. const l = arguments.length;
  6745. if (l === 2) {
  6746. if (isObject$1(propsOrChildren) && !isArray(propsOrChildren)) {
  6747. if (isVNode(propsOrChildren)) {
  6748. return createVNode(type, null, [propsOrChildren]);
  6749. }
  6750. return createVNode(type, propsOrChildren);
  6751. } else {
  6752. return createVNode(type, null, propsOrChildren);
  6753. }
  6754. } else {
  6755. if (l > 3) {
  6756. children = Array.prototype.slice.call(arguments, 2);
  6757. } else if (l === 3 && isVNode(children)) {
  6758. children = [children];
  6759. }
  6760. return createVNode(type, propsOrChildren, children);
  6761. }
  6762. }
  6763. const version = "3.4.24";
  6764. /**
  6765. * @vue/runtime-dom v3.4.24
  6766. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  6767. * @license MIT
  6768. **/
  6769. const svgNS = "http://www.w3.org/2000/svg";
  6770. const mathmlNS = "http://www.w3.org/1998/Math/MathML";
  6771. const doc = typeof document !== "undefined" ? document : null;
  6772. const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
  6773. const nodeOps = {
  6774. insert: (child, parent, anchor) => {
  6775. parent.insertBefore(child, anchor || null);
  6776. },
  6777. remove: (child) => {
  6778. const parent = child.parentNode;
  6779. if (parent) {
  6780. parent.removeChild(child);
  6781. }
  6782. },
  6783. createElement: (tag, namespace, is, props) => {
  6784. const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : doc.createElement(tag, is ? { is } : void 0);
  6785. if (tag === "select" && props && props.multiple != null) {
  6786. el.setAttribute("multiple", props.multiple);
  6787. }
  6788. return el;
  6789. },
  6790. createText: (text) => doc.createTextNode(text),
  6791. createComment: (text) => doc.createComment(text),
  6792. setText: (node, text) => {
  6793. node.nodeValue = text;
  6794. },
  6795. setElementText: (el, text) => {
  6796. el.textContent = text;
  6797. },
  6798. parentNode: (node) => node.parentNode,
  6799. nextSibling: (node) => node.nextSibling,
  6800. querySelector: (selector) => doc.querySelector(selector),
  6801. setScopeId(el, id) {
  6802. el.setAttribute(id, "");
  6803. },
  6804. // __UNSAFE__
  6805. // Reason: innerHTML.
  6806. // Static content here can only come from compiled templates.
  6807. // As long as the user only uses trusted templates, this is safe.
  6808. insertStaticContent(content, parent, anchor, namespace, start, end) {
  6809. const before = anchor ? anchor.previousSibling : parent.lastChild;
  6810. if (start && (start === end || start.nextSibling)) {
  6811. while (true) {
  6812. parent.insertBefore(start.cloneNode(true), anchor);
  6813. if (start === end || !(start = start.nextSibling))
  6814. break;
  6815. }
  6816. } else {
  6817. templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content;
  6818. const template = templateContainer.content;
  6819. if (namespace === "svg" || namespace === "mathml") {
  6820. const wrapper = template.firstChild;
  6821. while (wrapper.firstChild) {
  6822. template.appendChild(wrapper.firstChild);
  6823. }
  6824. template.removeChild(wrapper);
  6825. }
  6826. parent.insertBefore(template, anchor);
  6827. }
  6828. return [
  6829. // first
  6830. before ? before.nextSibling : parent.firstChild,
  6831. // last
  6832. anchor ? anchor.previousSibling : parent.lastChild
  6833. ];
  6834. }
  6835. };
  6836. const TRANSITION = "transition";
  6837. const ANIMATION = "animation";
  6838. const vtcKey = Symbol("_vtc");
  6839. const Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);
  6840. Transition.displayName = "Transition";
  6841. const DOMTransitionPropsValidators = {
  6842. name: String,
  6843. type: String,
  6844. css: {
  6845. type: Boolean,
  6846. default: true
  6847. },
  6848. duration: [String, Number, Object],
  6849. enterFromClass: String,
  6850. enterActiveClass: String,
  6851. enterToClass: String,
  6852. appearFromClass: String,
  6853. appearActiveClass: String,
  6854. appearToClass: String,
  6855. leaveFromClass: String,
  6856. leaveActiveClass: String,
  6857. leaveToClass: String
  6858. };
  6859. Transition.props = /* @__PURE__ */ extend(
  6860. {},
  6861. BaseTransitionPropsValidators,
  6862. DOMTransitionPropsValidators
  6863. );
  6864. const callHook = (hook, args = []) => {
  6865. if (isArray(hook)) {
  6866. hook.forEach((h2) => h2(...args));
  6867. } else if (hook) {
  6868. hook(...args);
  6869. }
  6870. };
  6871. const hasExplicitCallback = (hook) => {
  6872. return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
  6873. };
  6874. function resolveTransitionProps(rawProps) {
  6875. const baseProps = {};
  6876. for (const key in rawProps) {
  6877. if (!(key in DOMTransitionPropsValidators)) {
  6878. baseProps[key] = rawProps[key];
  6879. }
  6880. }
  6881. if (rawProps.css === false) {
  6882. return baseProps;
  6883. }
  6884. const {
  6885. name = "v",
  6886. type,
  6887. duration,
  6888. enterFromClass = `${name}-enter-from`,
  6889. enterActiveClass = `${name}-enter-active`,
  6890. enterToClass = `${name}-enter-to`,
  6891. appearFromClass = enterFromClass,
  6892. appearActiveClass = enterActiveClass,
  6893. appearToClass = enterToClass,
  6894. leaveFromClass = `${name}-leave-from`,
  6895. leaveActiveClass = `${name}-leave-active`,
  6896. leaveToClass = `${name}-leave-to`
  6897. } = rawProps;
  6898. const durations = normalizeDuration(duration);
  6899. const enterDuration = durations && durations[0];
  6900. const leaveDuration = durations && durations[1];
  6901. const {
  6902. onBeforeEnter,
  6903. onEnter,
  6904. onEnterCancelled,
  6905. onLeave,
  6906. onLeaveCancelled,
  6907. onBeforeAppear = onBeforeEnter,
  6908. onAppear = onEnter,
  6909. onAppearCancelled = onEnterCancelled
  6910. } = baseProps;
  6911. const finishEnter = (el, isAppear, done) => {
  6912. removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
  6913. removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
  6914. done && done();
  6915. };
  6916. const finishLeave = (el, done) => {
  6917. el._isLeaving = false;
  6918. removeTransitionClass(el, leaveFromClass);
  6919. removeTransitionClass(el, leaveToClass);
  6920. removeTransitionClass(el, leaveActiveClass);
  6921. done && done();
  6922. };
  6923. const makeEnterHook = (isAppear) => {
  6924. return (el, done) => {
  6925. const hook = isAppear ? onAppear : onEnter;
  6926. const resolve2 = () => finishEnter(el, isAppear, done);
  6927. callHook(hook, [el, resolve2]);
  6928. nextFrame(() => {
  6929. removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
  6930. addTransitionClass(el, isAppear ? appearToClass : enterToClass);
  6931. if (!hasExplicitCallback(hook)) {
  6932. whenTransitionEnds(el, type, enterDuration, resolve2);
  6933. }
  6934. });
  6935. };
  6936. };
  6937. return extend(baseProps, {
  6938. onBeforeEnter(el) {
  6939. callHook(onBeforeEnter, [el]);
  6940. addTransitionClass(el, enterFromClass);
  6941. addTransitionClass(el, enterActiveClass);
  6942. },
  6943. onBeforeAppear(el) {
  6944. callHook(onBeforeAppear, [el]);
  6945. addTransitionClass(el, appearFromClass);
  6946. addTransitionClass(el, appearActiveClass);
  6947. },
  6948. onEnter: makeEnterHook(false),
  6949. onAppear: makeEnterHook(true),
  6950. onLeave(el, done) {
  6951. el._isLeaving = true;
  6952. const resolve2 = () => finishLeave(el, done);
  6953. addTransitionClass(el, leaveFromClass);
  6954. addTransitionClass(el, leaveActiveClass);
  6955. forceReflow();
  6956. nextFrame(() => {
  6957. if (!el._isLeaving) {
  6958. return;
  6959. }
  6960. removeTransitionClass(el, leaveFromClass);
  6961. addTransitionClass(el, leaveToClass);
  6962. if (!hasExplicitCallback(onLeave)) {
  6963. whenTransitionEnds(el, type, leaveDuration, resolve2);
  6964. }
  6965. });
  6966. callHook(onLeave, [el, resolve2]);
  6967. },
  6968. onEnterCancelled(el) {
  6969. finishEnter(el, false);
  6970. callHook(onEnterCancelled, [el]);
  6971. },
  6972. onAppearCancelled(el) {
  6973. finishEnter(el, true);
  6974. callHook(onAppearCancelled, [el]);
  6975. },
  6976. onLeaveCancelled(el) {
  6977. finishLeave(el);
  6978. callHook(onLeaveCancelled, [el]);
  6979. }
  6980. });
  6981. }
  6982. function normalizeDuration(duration) {
  6983. if (duration == null) {
  6984. return null;
  6985. } else if (isObject$1(duration)) {
  6986. return [NumberOf(duration.enter), NumberOf(duration.leave)];
  6987. } else {
  6988. const n = NumberOf(duration);
  6989. return [n, n];
  6990. }
  6991. }
  6992. function NumberOf(val) {
  6993. const res = toNumber(val);
  6994. return res;
  6995. }
  6996. function addTransitionClass(el, cls) {
  6997. cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
  6998. (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
  6999. }
  7000. function removeTransitionClass(el, cls) {
  7001. cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
  7002. const _vtc = el[vtcKey];
  7003. if (_vtc) {
  7004. _vtc.delete(cls);
  7005. if (!_vtc.size) {
  7006. el[vtcKey] = void 0;
  7007. }
  7008. }
  7009. }
  7010. function nextFrame(cb) {
  7011. requestAnimationFrame(() => {
  7012. requestAnimationFrame(cb);
  7013. });
  7014. }
  7015. let endId = 0;
  7016. function whenTransitionEnds(el, expectedType, explicitTimeout, resolve2) {
  7017. const id = el._endId = ++endId;
  7018. const resolveIfNotStale = () => {
  7019. if (id === el._endId) {
  7020. resolve2();
  7021. }
  7022. };
  7023. if (explicitTimeout) {
  7024. return setTimeout(resolveIfNotStale, explicitTimeout);
  7025. }
  7026. const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
  7027. if (!type) {
  7028. return resolve2();
  7029. }
  7030. const endEvent = type + "end";
  7031. let ended = 0;
  7032. const end = () => {
  7033. el.removeEventListener(endEvent, onEnd);
  7034. resolveIfNotStale();
  7035. };
  7036. const onEnd = (e) => {
  7037. if (e.target === el && ++ended >= propCount) {
  7038. end();
  7039. }
  7040. };
  7041. setTimeout(() => {
  7042. if (ended < propCount) {
  7043. end();
  7044. }
  7045. }, timeout + 1);
  7046. el.addEventListener(endEvent, onEnd);
  7047. }
  7048. function getTransitionInfo(el, expectedType) {
  7049. const styles = window.getComputedStyle(el);
  7050. const getStyleProperties = (key) => (styles[key] || "").split(", ");
  7051. const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
  7052. const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
  7053. const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  7054. const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
  7055. const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
  7056. const animationTimeout = getTimeout(animationDelays, animationDurations);
  7057. let type = null;
  7058. let timeout = 0;
  7059. let propCount = 0;
  7060. if (expectedType === TRANSITION) {
  7061. if (transitionTimeout > 0) {
  7062. type = TRANSITION;
  7063. timeout = transitionTimeout;
  7064. propCount = transitionDurations.length;
  7065. }
  7066. } else if (expectedType === ANIMATION) {
  7067. if (animationTimeout > 0) {
  7068. type = ANIMATION;
  7069. timeout = animationTimeout;
  7070. propCount = animationDurations.length;
  7071. }
  7072. } else {
  7073. timeout = Math.max(transitionTimeout, animationTimeout);
  7074. type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
  7075. propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
  7076. }
  7077. const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
  7078. getStyleProperties(`${TRANSITION}Property`).toString()
  7079. );
  7080. return {
  7081. type,
  7082. timeout,
  7083. propCount,
  7084. hasTransform
  7085. };
  7086. }
  7087. function getTimeout(delays, durations) {
  7088. while (delays.length < durations.length) {
  7089. delays = delays.concat(delays);
  7090. }
  7091. return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
  7092. }
  7093. function toMs(s) {
  7094. if (s === "auto")
  7095. return 0;
  7096. return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
  7097. }
  7098. function forceReflow() {
  7099. return document.body.offsetHeight;
  7100. }
  7101. function patchClass(el, value, isSVG) {
  7102. const transitionClasses = el[vtcKey];
  7103. if (transitionClasses) {
  7104. value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
  7105. }
  7106. if (value == null) {
  7107. el.removeAttribute("class");
  7108. } else if (isSVG) {
  7109. el.setAttribute("class", value);
  7110. } else {
  7111. el.className = value;
  7112. }
  7113. }
  7114. const vShowOriginalDisplay = Symbol("_vod");
  7115. const vShowHidden = Symbol("_vsh");
  7116. const CSS_VAR_TEXT = Symbol("");
  7117. const displayRE = /(^|;)\s*display\s*:/;
  7118. function patchStyle(el, prev, next) {
  7119. const style = el.style;
  7120. const isCssString = isString(next);
  7121. let hasControlledDisplay = false;
  7122. if (next && !isCssString) {
  7123. if (prev) {
  7124. if (!isString(prev)) {
  7125. for (const key in prev) {
  7126. if (next[key] == null) {
  7127. setStyle(style, key, "");
  7128. }
  7129. }
  7130. } else {
  7131. for (const prevStyle of prev.split(";")) {
  7132. const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
  7133. if (next[key] == null) {
  7134. setStyle(style, key, "");
  7135. }
  7136. }
  7137. }
  7138. }
  7139. for (const key in next) {
  7140. if (key === "display") {
  7141. hasControlledDisplay = true;
  7142. }
  7143. setStyle(style, key, next[key]);
  7144. }
  7145. } else {
  7146. if (isCssString) {
  7147. if (prev !== next) {
  7148. const cssVarText = style[CSS_VAR_TEXT];
  7149. if (cssVarText) {
  7150. next += ";" + cssVarText;
  7151. }
  7152. style.cssText = next;
  7153. hasControlledDisplay = displayRE.test(next);
  7154. }
  7155. } else if (prev) {
  7156. el.removeAttribute("style");
  7157. }
  7158. }
  7159. if (vShowOriginalDisplay in el) {
  7160. el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
  7161. if (el[vShowHidden]) {
  7162. style.display = "none";
  7163. }
  7164. }
  7165. }
  7166. const importantRE = /\s*!important$/;
  7167. function setStyle(style, name, val) {
  7168. if (isArray(val)) {
  7169. val.forEach((v) => setStyle(style, name, v));
  7170. } else {
  7171. if (val == null)
  7172. val = "";
  7173. if (name.startsWith("--")) {
  7174. style.setProperty(name, val);
  7175. } else {
  7176. const prefixed = autoPrefix(style, name);
  7177. if (importantRE.test(val)) {
  7178. style.setProperty(
  7179. hyphenate(prefixed),
  7180. val.replace(importantRE, ""),
  7181. "important"
  7182. );
  7183. } else {
  7184. style[prefixed] = val;
  7185. }
  7186. }
  7187. }
  7188. }
  7189. const prefixes = ["Webkit", "Moz", "ms"];
  7190. const prefixCache = {};
  7191. function autoPrefix(style, rawName) {
  7192. const cached = prefixCache[rawName];
  7193. if (cached) {
  7194. return cached;
  7195. }
  7196. let name = camelize(rawName);
  7197. if (name !== "filter" && name in style) {
  7198. return prefixCache[rawName] = name;
  7199. }
  7200. name = capitalize(name);
  7201. for (let i = 0; i < prefixes.length; i++) {
  7202. const prefixed = prefixes[i] + name;
  7203. if (prefixed in style) {
  7204. return prefixCache[rawName] = prefixed;
  7205. }
  7206. }
  7207. return rawName;
  7208. }
  7209. const xlinkNS = "http://www.w3.org/1999/xlink";
  7210. function patchAttr(el, key, value, isSVG, instance) {
  7211. if (isSVG && key.startsWith("xlink:")) {
  7212. if (value == null) {
  7213. el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
  7214. } else {
  7215. el.setAttributeNS(xlinkNS, key, value);
  7216. }
  7217. } else {
  7218. const isBoolean = isSpecialBooleanAttr(key);
  7219. if (value == null || isBoolean && !includeBooleanAttr(value)) {
  7220. el.removeAttribute(key);
  7221. } else {
  7222. el.setAttribute(key, isBoolean ? "" : value);
  7223. }
  7224. }
  7225. }
  7226. function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspense, unmountChildren) {
  7227. if (key === "innerHTML" || key === "textContent") {
  7228. if (prevChildren) {
  7229. unmountChildren(prevChildren, parentComponent, parentSuspense);
  7230. }
  7231. el[key] = value == null ? "" : value;
  7232. return;
  7233. }
  7234. const tag = el.tagName;
  7235. if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
  7236. !tag.includes("-")) {
  7237. const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
  7238. const newValue = value == null ? "" : value;
  7239. if (oldValue !== newValue || !("_value" in el)) {
  7240. el.value = newValue;
  7241. }
  7242. if (value == null) {
  7243. el.removeAttribute(key);
  7244. }
  7245. el._value = value;
  7246. return;
  7247. }
  7248. let needRemove = false;
  7249. if (value === "" || value == null) {
  7250. const type = typeof el[key];
  7251. if (type === "boolean") {
  7252. value = includeBooleanAttr(value);
  7253. } else if (value == null && type === "string") {
  7254. value = "";
  7255. needRemove = true;
  7256. } else if (type === "number") {
  7257. value = 0;
  7258. needRemove = true;
  7259. }
  7260. }
  7261. try {
  7262. el[key] = value;
  7263. } catch (e) {
  7264. }
  7265. needRemove && el.removeAttribute(key);
  7266. }
  7267. function addEventListener(el, event, handler, options) {
  7268. el.addEventListener(event, handler, options);
  7269. }
  7270. function removeEventListener(el, event, handler, options) {
  7271. el.removeEventListener(event, handler, options);
  7272. }
  7273. const veiKey = Symbol("_vei");
  7274. function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
  7275. const invokers = el[veiKey] || (el[veiKey] = {});
  7276. const existingInvoker = invokers[rawName];
  7277. if (nextValue && existingInvoker) {
  7278. existingInvoker.value = nextValue;
  7279. } else {
  7280. const [name, options] = parseName(rawName);
  7281. if (nextValue) {
  7282. const invoker = invokers[rawName] = createInvoker(
  7283. nextValue,
  7284. instance
  7285. );
  7286. addEventListener(el, name, invoker, options);
  7287. } else if (existingInvoker) {
  7288. removeEventListener(el, name, existingInvoker, options);
  7289. invokers[rawName] = void 0;
  7290. }
  7291. }
  7292. }
  7293. const optionsModifierRE = /(?:Once|Passive|Capture)$/;
  7294. function parseName(name) {
  7295. let options;
  7296. if (optionsModifierRE.test(name)) {
  7297. options = {};
  7298. let m;
  7299. while (m = name.match(optionsModifierRE)) {
  7300. name = name.slice(0, name.length - m[0].length);
  7301. options[m[0].toLowerCase()] = true;
  7302. }
  7303. }
  7304. const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
  7305. return [event, options];
  7306. }
  7307. let cachedNow = 0;
  7308. const p = /* @__PURE__ */ Promise.resolve();
  7309. const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
  7310. function createInvoker(initialValue, instance) {
  7311. const invoker = (e) => {
  7312. if (!e._vts) {
  7313. e._vts = Date.now();
  7314. } else if (e._vts <= invoker.attached) {
  7315. return;
  7316. }
  7317. callWithAsyncErrorHandling(
  7318. patchStopImmediatePropagation(e, invoker.value),
  7319. instance,
  7320. 5,
  7321. [e]
  7322. );
  7323. };
  7324. invoker.value = initialValue;
  7325. invoker.attached = getNow();
  7326. return invoker;
  7327. }
  7328. function patchStopImmediatePropagation(e, value) {
  7329. if (isArray(value)) {
  7330. const originalStop = e.stopImmediatePropagation;
  7331. e.stopImmediatePropagation = () => {
  7332. originalStop.call(e);
  7333. e._stopped = true;
  7334. };
  7335. return value.map(
  7336. (fn) => (e2) => !e2._stopped && fn && fn(e2)
  7337. );
  7338. } else {
  7339. return value;
  7340. }
  7341. }
  7342. const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
  7343. key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
  7344. const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
  7345. const isSVG = namespace === "svg";
  7346. if (key === "class") {
  7347. patchClass(el, nextValue, isSVG);
  7348. } else if (key === "style") {
  7349. patchStyle(el, prevValue, nextValue);
  7350. } else if (isOn(key)) {
  7351. if (!isModelListener(key)) {
  7352. patchEvent(el, key, prevValue, nextValue, parentComponent);
  7353. }
  7354. } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
  7355. patchDOMProp(
  7356. el,
  7357. key,
  7358. nextValue,
  7359. prevChildren,
  7360. parentComponent,
  7361. parentSuspense,
  7362. unmountChildren
  7363. );
  7364. } else {
  7365. if (key === "true-value") {
  7366. el._trueValue = nextValue;
  7367. } else if (key === "false-value") {
  7368. el._falseValue = nextValue;
  7369. }
  7370. patchAttr(el, key, nextValue, isSVG);
  7371. }
  7372. };
  7373. function shouldSetAsProp(el, key, value, isSVG) {
  7374. if (isSVG) {
  7375. if (key === "innerHTML" || key === "textContent") {
  7376. return true;
  7377. }
  7378. if (key in el && isNativeOn(key) && isFunction(value)) {
  7379. return true;
  7380. }
  7381. return false;
  7382. }
  7383. if (key === "spellcheck" || key === "draggable" || key === "translate") {
  7384. return false;
  7385. }
  7386. if (key === "form") {
  7387. return false;
  7388. }
  7389. if (key === "list" && el.tagName === "INPUT") {
  7390. return false;
  7391. }
  7392. if (key === "type" && el.tagName === "TEXTAREA") {
  7393. return false;
  7394. }
  7395. if (key === "width" || key === "height") {
  7396. const tag = el.tagName;
  7397. if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
  7398. return false;
  7399. }
  7400. }
  7401. if (isNativeOn(key) && isString(value)) {
  7402. return false;
  7403. }
  7404. return key in el;
  7405. }
  7406. const getModelAssigner = (vnode) => {
  7407. const fn = vnode.props["onUpdate:modelValue"] || false;
  7408. return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn;
  7409. };
  7410. function onCompositionStart(e) {
  7411. e.target.composing = true;
  7412. }
  7413. function onCompositionEnd(e) {
  7414. const target = e.target;
  7415. if (target.composing) {
  7416. target.composing = false;
  7417. target.dispatchEvent(new Event("input"));
  7418. }
  7419. }
  7420. const assignKey = Symbol("_assign");
  7421. const vModelText = {
  7422. created(el, { modifiers: { lazy, trim, number } }, vnode) {
  7423. el[assignKey] = getModelAssigner(vnode);
  7424. const castToNumber = number || vnode.props && vnode.props.type === "number";
  7425. addEventListener(el, lazy ? "change" : "input", (e) => {
  7426. if (e.target.composing)
  7427. return;
  7428. let domValue = el.value;
  7429. if (trim) {
  7430. domValue = domValue.trim();
  7431. }
  7432. if (castToNumber) {
  7433. domValue = looseToNumber(domValue);
  7434. }
  7435. el[assignKey](domValue);
  7436. });
  7437. if (trim) {
  7438. addEventListener(el, "change", () => {
  7439. el.value = el.value.trim();
  7440. });
  7441. }
  7442. if (!lazy) {
  7443. addEventListener(el, "compositionstart", onCompositionStart);
  7444. addEventListener(el, "compositionend", onCompositionEnd);
  7445. addEventListener(el, "change", onCompositionEnd);
  7446. }
  7447. },
  7448. // set value on mounted so it's after min/max for type="range"
  7449. mounted(el, { value }) {
  7450. el.value = value == null ? "" : value;
  7451. },
  7452. beforeUpdate(el, { value, modifiers: { lazy, trim, number } }, vnode) {
  7453. el[assignKey] = getModelAssigner(vnode);
  7454. if (el.composing)
  7455. return;
  7456. const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
  7457. const newValue = value == null ? "" : value;
  7458. if (elValue === newValue) {
  7459. return;
  7460. }
  7461. if (document.activeElement === el && el.type !== "range") {
  7462. if (lazy) {
  7463. return;
  7464. }
  7465. if (trim && el.value.trim() === newValue) {
  7466. return;
  7467. }
  7468. }
  7469. el.value = newValue;
  7470. }
  7471. };
  7472. const systemModifiers = ["ctrl", "shift", "alt", "meta"];
  7473. const modifierGuards = {
  7474. stop: (e) => e.stopPropagation(),
  7475. prevent: (e) => e.preventDefault(),
  7476. self: (e) => e.target !== e.currentTarget,
  7477. ctrl: (e) => !e.ctrlKey,
  7478. shift: (e) => !e.shiftKey,
  7479. alt: (e) => !e.altKey,
  7480. meta: (e) => !e.metaKey,
  7481. left: (e) => "button" in e && e.button !== 0,
  7482. middle: (e) => "button" in e && e.button !== 1,
  7483. right: (e) => "button" in e && e.button !== 2,
  7484. exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
  7485. };
  7486. const withModifiers = (fn, modifiers) => {
  7487. const cache = fn._withMods || (fn._withMods = {});
  7488. const cacheKey = modifiers.join(".");
  7489. return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
  7490. for (let i = 0; i < modifiers.length; i++) {
  7491. const guard = modifierGuards[modifiers[i]];
  7492. if (guard && guard(event, modifiers))
  7493. return;
  7494. }
  7495. return fn(event, ...args);
  7496. });
  7497. };
  7498. const keyNames = {
  7499. esc: "escape",
  7500. space: " ",
  7501. up: "arrow-up",
  7502. left: "arrow-left",
  7503. right: "arrow-right",
  7504. down: "arrow-down",
  7505. delete: "backspace"
  7506. };
  7507. const withKeys = (fn, modifiers) => {
  7508. const cache = fn._withKeys || (fn._withKeys = {});
  7509. const cacheKey = modifiers.join(".");
  7510. return cache[cacheKey] || (cache[cacheKey] = (event) => {
  7511. if (!("key" in event)) {
  7512. return;
  7513. }
  7514. const eventKey = hyphenate(event.key);
  7515. if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) {
  7516. return fn(event);
  7517. }
  7518. });
  7519. };
  7520. const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
  7521. let renderer;
  7522. let enabledHydration = false;
  7523. function ensureRenderer() {
  7524. return renderer || (renderer = createRenderer(rendererOptions));
  7525. }
  7526. function ensureHydrationRenderer() {
  7527. renderer = enabledHydration ? renderer : createHydrationRenderer(rendererOptions);
  7528. enabledHydration = true;
  7529. return renderer;
  7530. }
  7531. const createApp = (...args) => {
  7532. const app = ensureRenderer().createApp(...args);
  7533. const { mount } = app;
  7534. app.mount = (containerOrSelector) => {
  7535. const container = normalizeContainer(containerOrSelector);
  7536. if (!container)
  7537. return;
  7538. const component = app._component;
  7539. if (!isFunction(component) && !component.render && !component.template) {
  7540. component.template = container.innerHTML;
  7541. }
  7542. container.innerHTML = "";
  7543. const proxy = mount(container, false, resolveRootNamespace(container));
  7544. if (container instanceof Element) {
  7545. container.removeAttribute("v-cloak");
  7546. container.setAttribute("data-v-app", "");
  7547. }
  7548. return proxy;
  7549. };
  7550. return app;
  7551. };
  7552. const createSSRApp = (...args) => {
  7553. const app = ensureHydrationRenderer().createApp(...args);
  7554. const { mount } = app;
  7555. app.mount = (containerOrSelector) => {
  7556. const container = normalizeContainer(containerOrSelector);
  7557. if (container) {
  7558. return mount(container, true, resolveRootNamespace(container));
  7559. }
  7560. };
  7561. return app;
  7562. };
  7563. function resolveRootNamespace(container) {
  7564. if (container instanceof SVGElement) {
  7565. return "svg";
  7566. }
  7567. if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
  7568. return "mathml";
  7569. }
  7570. }
  7571. function normalizeContainer(container) {
  7572. if (isString(container)) {
  7573. const res = document.querySelector(container);
  7574. return res;
  7575. }
  7576. return container;
  7577. }
  7578. const _export_sfc = (sfc, props) => {
  7579. const target = sfc.__vccOpts || sfc;
  7580. for (const [key, val] of props) {
  7581. target[key] = val;
  7582. }
  7583. return target;
  7584. };
  7585. const scriptRel = "modulepreload";
  7586. const assetsURL = function(dep) {
  7587. return "/" + dep;
  7588. };
  7589. const seen = {};
  7590. const __vitePreload = function preload(baseModule, deps, importerUrl) {
  7591. let promise = Promise.resolve();
  7592. if (deps && deps.length > 0) {
  7593. const links = document.getElementsByTagName("link");
  7594. const cspNonceMeta = document.querySelector("meta[property=csp-nonce]");
  7595. const cspNonce = (cspNonceMeta == null ? void 0 : cspNonceMeta.nonce) || (cspNonceMeta == null ? void 0 : cspNonceMeta.getAttribute("nonce"));
  7596. promise = Promise.all(deps.map((dep) => {
  7597. dep = assetsURL(dep);
  7598. if (dep in seen)
  7599. return;
  7600. seen[dep] = true;
  7601. const isCss = dep.endsWith(".css");
  7602. const cssSelector = isCss ? '[rel="stylesheet"]' : "";
  7603. const isBaseRelative = !!importerUrl;
  7604. if (isBaseRelative) {
  7605. for (let i = links.length - 1; i >= 0; i--) {
  7606. const link3 = links[i];
  7607. if (link3.href === dep && (!isCss || link3.rel === "stylesheet")) {
  7608. return;
  7609. }
  7610. }
  7611. } else if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) {
  7612. return;
  7613. }
  7614. const link2 = document.createElement("link");
  7615. link2.rel = isCss ? "stylesheet" : scriptRel;
  7616. if (!isCss) {
  7617. link2.as = "script";
  7618. link2.crossOrigin = "";
  7619. }
  7620. link2.href = dep;
  7621. if (cspNonce) {
  7622. link2.setAttribute("nonce", cspNonce);
  7623. }
  7624. document.head.appendChild(link2);
  7625. if (isCss) {
  7626. return new Promise((res, rej) => {
  7627. link2.addEventListener("load", res);
  7628. link2.addEventListener("error", () => rej(new Error(`Unable to preload CSS for ${dep}`)));
  7629. });
  7630. }
  7631. }));
  7632. }
  7633. return promise.then(() => baseModule()).catch((err) => {
  7634. const e = new Event("vite:preloadError", { cancelable: true });
  7635. e.payload = err;
  7636. window.dispatchEvent(e);
  7637. if (!e.defaultPrevented) {
  7638. throw err;
  7639. }
  7640. });
  7641. };
  7642. const siteData = window.__VP_SITE_DATA__;
  7643. function tryOnScopeDispose(fn) {
  7644. if (getCurrentScope()) {
  7645. onScopeDispose(fn);
  7646. return true;
  7647. }
  7648. return false;
  7649. }
  7650. function toValue(r) {
  7651. return typeof r === "function" ? r() : unref(r);
  7652. }
  7653. const isClient = typeof window !== "undefined" && typeof document !== "undefined";
  7654. typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
  7655. const toString = Object.prototype.toString;
  7656. const isObject = (val) => toString.call(val) === "[object Object]";
  7657. const noop = () => {
  7658. };
  7659. const isIOS = /* @__PURE__ */ getIsIOS();
  7660. function getIsIOS() {
  7661. var _a, _b;
  7662. return isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && (/iP(ad|hone|od)/.test(window.navigator.userAgent) || ((_b = window == null ? void 0 : window.navigator) == null ? void 0 : _b.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
  7663. }
  7664. function createFilterWrapper(filter, fn) {
  7665. function wrapper(...args) {
  7666. return new Promise((resolve2, reject) => {
  7667. Promise.resolve(filter(() => fn.apply(this, args), { fn, thisArg: this, args })).then(resolve2).catch(reject);
  7668. });
  7669. }
  7670. return wrapper;
  7671. }
  7672. const bypassFilter = (invoke2) => {
  7673. return invoke2();
  7674. };
  7675. function debounceFilter(ms, options = {}) {
  7676. let timer;
  7677. let maxTimer;
  7678. let lastRejector = noop;
  7679. const _clearTimeout = (timer2) => {
  7680. clearTimeout(timer2);
  7681. lastRejector();
  7682. lastRejector = noop;
  7683. };
  7684. const filter = (invoke2) => {
  7685. const duration = toValue(ms);
  7686. const maxDuration = toValue(options.maxWait);
  7687. if (timer)
  7688. _clearTimeout(timer);
  7689. if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {
  7690. if (maxTimer) {
  7691. _clearTimeout(maxTimer);
  7692. maxTimer = null;
  7693. }
  7694. return Promise.resolve(invoke2());
  7695. }
  7696. return new Promise((resolve2, reject) => {
  7697. lastRejector = options.rejectOnCancel ? reject : resolve2;
  7698. if (maxDuration && !maxTimer) {
  7699. maxTimer = setTimeout(() => {
  7700. if (timer)
  7701. _clearTimeout(timer);
  7702. maxTimer = null;
  7703. resolve2(invoke2());
  7704. }, maxDuration);
  7705. }
  7706. timer = setTimeout(() => {
  7707. if (maxTimer)
  7708. _clearTimeout(maxTimer);
  7709. maxTimer = null;
  7710. resolve2(invoke2());
  7711. }, duration);
  7712. });
  7713. };
  7714. return filter;
  7715. }
  7716. function pausableFilter(extendFilter = bypassFilter) {
  7717. const isActive2 = ref(true);
  7718. function pause() {
  7719. isActive2.value = false;
  7720. }
  7721. function resume() {
  7722. isActive2.value = true;
  7723. }
  7724. const eventFilter = (...args) => {
  7725. if (isActive2.value)
  7726. extendFilter(...args);
  7727. };
  7728. return { isActive: readonly(isActive2), pause, resume, eventFilter };
  7729. }
  7730. function getLifeCycleTarget(target) {
  7731. return target || getCurrentInstance();
  7732. }
  7733. function toRef(...args) {
  7734. if (args.length !== 1)
  7735. return toRef$1(...args);
  7736. const r = args[0];
  7737. return typeof r === "function" ? readonly(customRef(() => ({ get: r, set: noop }))) : ref(r);
  7738. }
  7739. function watchWithFilter(source, cb, options = {}) {
  7740. const {
  7741. eventFilter = bypassFilter,
  7742. ...watchOptions
  7743. } = options;
  7744. return watch(
  7745. source,
  7746. createFilterWrapper(
  7747. eventFilter,
  7748. cb
  7749. ),
  7750. watchOptions
  7751. );
  7752. }
  7753. function watchPausable(source, cb, options = {}) {
  7754. const {
  7755. eventFilter: filter,
  7756. ...watchOptions
  7757. } = options;
  7758. const { eventFilter, pause, resume, isActive: isActive2 } = pausableFilter(filter);
  7759. const stop = watchWithFilter(
  7760. source,
  7761. cb,
  7762. {
  7763. ...watchOptions,
  7764. eventFilter
  7765. }
  7766. );
  7767. return { stop, pause, resume, isActive: isActive2 };
  7768. }
  7769. function tryOnMounted(fn, sync = true, target) {
  7770. const instance = getLifeCycleTarget();
  7771. if (instance)
  7772. onMounted(fn, target);
  7773. else if (sync)
  7774. fn();
  7775. else
  7776. nextTick(fn);
  7777. }
  7778. function watchDebounced(source, cb, options = {}) {
  7779. const {
  7780. debounce = 0,
  7781. maxWait = void 0,
  7782. ...watchOptions
  7783. } = options;
  7784. return watchWithFilter(
  7785. source,
  7786. cb,
  7787. {
  7788. ...watchOptions,
  7789. eventFilter: debounceFilter(debounce, { maxWait })
  7790. }
  7791. );
  7792. }
  7793. function computedAsync(evaluationCallback, initialState, optionsOrRef) {
  7794. let options;
  7795. if (isRef(optionsOrRef)) {
  7796. options = {
  7797. evaluating: optionsOrRef
  7798. };
  7799. } else {
  7800. options = optionsOrRef || {};
  7801. }
  7802. const {
  7803. lazy = false,
  7804. evaluating = void 0,
  7805. shallow = true,
  7806. onError = noop
  7807. } = options;
  7808. const started = ref(!lazy);
  7809. const current = shallow ? shallowRef(initialState) : ref(initialState);
  7810. let counter = 0;
  7811. watchEffect(async (onInvalidate) => {
  7812. if (!started.value)
  7813. return;
  7814. counter++;
  7815. const counterAtBeginning = counter;
  7816. let hasFinished = false;
  7817. if (evaluating) {
  7818. Promise.resolve().then(() => {
  7819. evaluating.value = true;
  7820. });
  7821. }
  7822. try {
  7823. const result = await evaluationCallback((cancelCallback) => {
  7824. onInvalidate(() => {
  7825. if (evaluating)
  7826. evaluating.value = false;
  7827. if (!hasFinished)
  7828. cancelCallback();
  7829. });
  7830. });
  7831. if (counterAtBeginning === counter)
  7832. current.value = result;
  7833. } catch (e) {
  7834. onError(e);
  7835. } finally {
  7836. if (evaluating && counterAtBeginning === counter)
  7837. evaluating.value = false;
  7838. hasFinished = true;
  7839. }
  7840. });
  7841. if (lazy) {
  7842. return computed(() => {
  7843. started.value = true;
  7844. return current.value;
  7845. });
  7846. } else {
  7847. return current;
  7848. }
  7849. }
  7850. function unrefElement(elRef) {
  7851. var _a;
  7852. const plain = toValue(elRef);
  7853. return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
  7854. }
  7855. const defaultWindow = isClient ? window : void 0;
  7856. function useEventListener(...args) {
  7857. let target;
  7858. let events2;
  7859. let listeners;
  7860. let options;
  7861. if (typeof args[0] === "string" || Array.isArray(args[0])) {
  7862. [events2, listeners, options] = args;
  7863. target = defaultWindow;
  7864. } else {
  7865. [target, events2, listeners, options] = args;
  7866. }
  7867. if (!target)
  7868. return noop;
  7869. if (!Array.isArray(events2))
  7870. events2 = [events2];
  7871. if (!Array.isArray(listeners))
  7872. listeners = [listeners];
  7873. const cleanups = [];
  7874. const cleanup = () => {
  7875. cleanups.forEach((fn) => fn());
  7876. cleanups.length = 0;
  7877. };
  7878. const register = (el, event, listener, options2) => {
  7879. el.addEventListener(event, listener, options2);
  7880. return () => el.removeEventListener(event, listener, options2);
  7881. };
  7882. const stopWatch = watch(
  7883. () => [unrefElement(target), toValue(options)],
  7884. ([el, options2]) => {
  7885. cleanup();
  7886. if (!el)
  7887. return;
  7888. const optionsClone = isObject(options2) ? { ...options2 } : options2;
  7889. cleanups.push(
  7890. ...events2.flatMap((event) => {
  7891. return listeners.map((listener) => register(el, event, listener, optionsClone));
  7892. })
  7893. );
  7894. },
  7895. { immediate: true, flush: "post" }
  7896. );
  7897. const stop = () => {
  7898. stopWatch();
  7899. cleanup();
  7900. };
  7901. tryOnScopeDispose(stop);
  7902. return stop;
  7903. }
  7904. let _iOSWorkaround = false;
  7905. function onClickOutside(target, handler, options = {}) {
  7906. const { window: window2 = defaultWindow, ignore = [], capture = true, detectIframe = false } = options;
  7907. if (!window2)
  7908. return noop;
  7909. if (isIOS && !_iOSWorkaround) {
  7910. _iOSWorkaround = true;
  7911. Array.from(window2.document.body.children).forEach((el) => el.addEventListener("click", noop));
  7912. window2.document.documentElement.addEventListener("click", noop);
  7913. }
  7914. let shouldListen = true;
  7915. const shouldIgnore = (event) => {
  7916. return ignore.some((target2) => {
  7917. if (typeof target2 === "string") {
  7918. return Array.from(window2.document.querySelectorAll(target2)).some((el) => el === event.target || event.composedPath().includes(el));
  7919. } else {
  7920. const el = unrefElement(target2);
  7921. return el && (event.target === el || event.composedPath().includes(el));
  7922. }
  7923. });
  7924. };
  7925. const listener = (event) => {
  7926. const el = unrefElement(target);
  7927. if (!el || el === event.target || event.composedPath().includes(el))
  7928. return;
  7929. if (event.detail === 0)
  7930. shouldListen = !shouldIgnore(event);
  7931. if (!shouldListen) {
  7932. shouldListen = true;
  7933. return;
  7934. }
  7935. handler(event);
  7936. };
  7937. const cleanup = [
  7938. useEventListener(window2, "click", listener, { passive: true, capture }),
  7939. useEventListener(window2, "pointerdown", (e) => {
  7940. const el = unrefElement(target);
  7941. shouldListen = !shouldIgnore(e) && !!(el && !e.composedPath().includes(el));
  7942. }, { passive: true }),
  7943. detectIframe && useEventListener(window2, "blur", (event) => {
  7944. setTimeout(() => {
  7945. var _a;
  7946. const el = unrefElement(target);
  7947. if (((_a = window2.document.activeElement) == null ? void 0 : _a.tagName) === "IFRAME" && !(el == null ? void 0 : el.contains(window2.document.activeElement)))
  7948. handler(event);
  7949. }, 0);
  7950. })
  7951. ].filter(Boolean);
  7952. const stop = () => cleanup.forEach((fn) => fn());
  7953. return stop;
  7954. }
  7955. function createKeyPredicate(keyFilter) {
  7956. if (typeof keyFilter === "function")
  7957. return keyFilter;
  7958. else if (typeof keyFilter === "string")
  7959. return (event) => event.key === keyFilter;
  7960. else if (Array.isArray(keyFilter))
  7961. return (event) => keyFilter.includes(event.key);
  7962. return () => true;
  7963. }
  7964. function onKeyStroke(...args) {
  7965. let key;
  7966. let handler;
  7967. let options = {};
  7968. if (args.length === 3) {
  7969. key = args[0];
  7970. handler = args[1];
  7971. options = args[2];
  7972. } else if (args.length === 2) {
  7973. if (typeof args[1] === "object") {
  7974. key = true;
  7975. handler = args[0];
  7976. options = args[1];
  7977. } else {
  7978. key = args[0];
  7979. handler = args[1];
  7980. }
  7981. } else {
  7982. key = true;
  7983. handler = args[0];
  7984. }
  7985. const {
  7986. target = defaultWindow,
  7987. eventName = "keydown",
  7988. passive = false,
  7989. dedupe = false
  7990. } = options;
  7991. const predicate = createKeyPredicate(key);
  7992. const listener = (e) => {
  7993. if (e.repeat && toValue(dedupe))
  7994. return;
  7995. if (predicate(e))
  7996. handler(e);
  7997. };
  7998. return useEventListener(target, eventName, listener, passive);
  7999. }
  8000. function useMounted() {
  8001. const isMounted = ref(false);
  8002. const instance = getCurrentInstance();
  8003. if (instance) {
  8004. onMounted(() => {
  8005. isMounted.value = true;
  8006. }, instance);
  8007. }
  8008. return isMounted;
  8009. }
  8010. function useSupported(callback) {
  8011. const isMounted = useMounted();
  8012. return computed(() => {
  8013. isMounted.value;
  8014. return Boolean(callback());
  8015. });
  8016. }
  8017. function useMediaQuery(query, options = {}) {
  8018. const { window: window2 = defaultWindow } = options;
  8019. const isSupported = useSupported(() => window2 && "matchMedia" in window2 && typeof window2.matchMedia === "function");
  8020. let mediaQuery;
  8021. const matches = ref(false);
  8022. const handler = (event) => {
  8023. matches.value = event.matches;
  8024. };
  8025. const cleanup = () => {
  8026. if (!mediaQuery)
  8027. return;
  8028. if ("removeEventListener" in mediaQuery)
  8029. mediaQuery.removeEventListener("change", handler);
  8030. else
  8031. mediaQuery.removeListener(handler);
  8032. };
  8033. const stopWatch = watchEffect(() => {
  8034. if (!isSupported.value)
  8035. return;
  8036. cleanup();
  8037. mediaQuery = window2.matchMedia(toValue(query));
  8038. if ("addEventListener" in mediaQuery)
  8039. mediaQuery.addEventListener("change", handler);
  8040. else
  8041. mediaQuery.addListener(handler);
  8042. matches.value = mediaQuery.matches;
  8043. });
  8044. tryOnScopeDispose(() => {
  8045. stopWatch();
  8046. cleanup();
  8047. mediaQuery = void 0;
  8048. });
  8049. return matches;
  8050. }
  8051. const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  8052. const globalKey = "__vueuse_ssr_handlers__";
  8053. const handlers = /* @__PURE__ */ getHandlers();
  8054. function getHandlers() {
  8055. if (!(globalKey in _global))
  8056. _global[globalKey] = _global[globalKey] || {};
  8057. return _global[globalKey];
  8058. }
  8059. function getSSRHandler(key, fallback) {
  8060. return handlers[key] || fallback;
  8061. }
  8062. function guessSerializerType(rawInit) {
  8063. return rawInit == null ? "any" : rawInit instanceof Set ? "set" : rawInit instanceof Map ? "map" : rawInit instanceof Date ? "date" : typeof rawInit === "boolean" ? "boolean" : typeof rawInit === "string" ? "string" : typeof rawInit === "object" ? "object" : !Number.isNaN(rawInit) ? "number" : "any";
  8064. }
  8065. const StorageSerializers = {
  8066. boolean: {
  8067. read: (v) => v === "true",
  8068. write: (v) => String(v)
  8069. },
  8070. object: {
  8071. read: (v) => JSON.parse(v),
  8072. write: (v) => JSON.stringify(v)
  8073. },
  8074. number: {
  8075. read: (v) => Number.parseFloat(v),
  8076. write: (v) => String(v)
  8077. },
  8078. any: {
  8079. read: (v) => v,
  8080. write: (v) => String(v)
  8081. },
  8082. string: {
  8083. read: (v) => v,
  8084. write: (v) => String(v)
  8085. },
  8086. map: {
  8087. read: (v) => new Map(JSON.parse(v)),
  8088. write: (v) => JSON.stringify(Array.from(v.entries()))
  8089. },
  8090. set: {
  8091. read: (v) => new Set(JSON.parse(v)),
  8092. write: (v) => JSON.stringify(Array.from(v))
  8093. },
  8094. date: {
  8095. read: (v) => new Date(v),
  8096. write: (v) => v.toISOString()
  8097. }
  8098. };
  8099. const customStorageEventName = "vueuse-storage";
  8100. function useStorage(key, defaults2, storage, options = {}) {
  8101. var _a;
  8102. const {
  8103. flush = "pre",
  8104. deep = true,
  8105. listenToStorageChanges = true,
  8106. writeDefaults = true,
  8107. mergeDefaults = false,
  8108. shallow,
  8109. window: window2 = defaultWindow,
  8110. eventFilter,
  8111. onError = (e) => {
  8112. console.error(e);
  8113. },
  8114. initOnMounted
  8115. } = options;
  8116. const data = (shallow ? shallowRef : ref)(typeof defaults2 === "function" ? defaults2() : defaults2);
  8117. if (!storage) {
  8118. try {
  8119. storage = getSSRHandler("getDefaultStorage", () => {
  8120. var _a2;
  8121. return (_a2 = defaultWindow) == null ? void 0 : _a2.localStorage;
  8122. })();
  8123. } catch (e) {
  8124. onError(e);
  8125. }
  8126. }
  8127. if (!storage)
  8128. return data;
  8129. const rawInit = toValue(defaults2);
  8130. const type = guessSerializerType(rawInit);
  8131. const serializer = (_a = options.serializer) != null ? _a : StorageSerializers[type];
  8132. const { pause: pauseWatch, resume: resumeWatch } = watchPausable(
  8133. data,
  8134. () => write(data.value),
  8135. { flush, deep, eventFilter }
  8136. );
  8137. if (window2 && listenToStorageChanges) {
  8138. tryOnMounted(() => {
  8139. useEventListener(window2, "storage", update);
  8140. useEventListener(window2, customStorageEventName, updateFromCustomEvent);
  8141. if (initOnMounted)
  8142. update();
  8143. });
  8144. }
  8145. if (!initOnMounted)
  8146. update();
  8147. function dispatchWriteEvent(oldValue, newValue) {
  8148. if (window2) {
  8149. window2.dispatchEvent(new CustomEvent(customStorageEventName, {
  8150. detail: {
  8151. key,
  8152. oldValue,
  8153. newValue,
  8154. storageArea: storage
  8155. }
  8156. }));
  8157. }
  8158. }
  8159. function write(v) {
  8160. try {
  8161. const oldValue = storage.getItem(key);
  8162. if (v == null) {
  8163. dispatchWriteEvent(oldValue, null);
  8164. storage.removeItem(key);
  8165. } else {
  8166. const serialized = serializer.write(v);
  8167. if (oldValue !== serialized) {
  8168. storage.setItem(key, serialized);
  8169. dispatchWriteEvent(oldValue, serialized);
  8170. }
  8171. }
  8172. } catch (e) {
  8173. onError(e);
  8174. }
  8175. }
  8176. function read(event) {
  8177. const rawValue = event ? event.newValue : storage.getItem(key);
  8178. if (rawValue == null) {
  8179. if (writeDefaults && rawInit != null)
  8180. storage.setItem(key, serializer.write(rawInit));
  8181. return rawInit;
  8182. } else if (!event && mergeDefaults) {
  8183. const value = serializer.read(rawValue);
  8184. if (typeof mergeDefaults === "function")
  8185. return mergeDefaults(value, rawInit);
  8186. else if (type === "object" && !Array.isArray(value))
  8187. return { ...rawInit, ...value };
  8188. return value;
  8189. } else if (typeof rawValue !== "string") {
  8190. return rawValue;
  8191. } else {
  8192. return serializer.read(rawValue);
  8193. }
  8194. }
  8195. function update(event) {
  8196. if (event && event.storageArea !== storage)
  8197. return;
  8198. if (event && event.key == null) {
  8199. data.value = rawInit;
  8200. return;
  8201. }
  8202. if (event && event.key !== key)
  8203. return;
  8204. pauseWatch();
  8205. try {
  8206. if ((event == null ? void 0 : event.newValue) !== serializer.write(data.value))
  8207. data.value = read(event);
  8208. } catch (e) {
  8209. onError(e);
  8210. } finally {
  8211. if (event)
  8212. nextTick(resumeWatch);
  8213. else
  8214. resumeWatch();
  8215. }
  8216. }
  8217. function updateFromCustomEvent(event) {
  8218. update(event.detail);
  8219. }
  8220. return data;
  8221. }
  8222. function usePreferredDark(options) {
  8223. return useMediaQuery("(prefers-color-scheme: dark)", options);
  8224. }
  8225. function useColorMode(options = {}) {
  8226. const {
  8227. selector = "html",
  8228. attribute = "class",
  8229. initialValue = "auto",
  8230. window: window2 = defaultWindow,
  8231. storage,
  8232. storageKey = "vueuse-color-scheme",
  8233. listenToStorageChanges = true,
  8234. storageRef,
  8235. emitAuto,
  8236. disableTransition = true
  8237. } = options;
  8238. const modes = {
  8239. auto: "",
  8240. light: "light",
  8241. dark: "dark",
  8242. ...options.modes || {}
  8243. };
  8244. const preferredDark = usePreferredDark({ window: window2 });
  8245. const system = computed(() => preferredDark.value ? "dark" : "light");
  8246. const store = storageRef || (storageKey == null ? toRef(initialValue) : useStorage(storageKey, initialValue, storage, { window: window2, listenToStorageChanges }));
  8247. const state = computed(() => store.value === "auto" ? system.value : store.value);
  8248. const updateHTMLAttrs = getSSRHandler(
  8249. "updateHTMLAttrs",
  8250. (selector2, attribute2, value) => {
  8251. const el = typeof selector2 === "string" ? window2 == null ? void 0 : window2.document.querySelector(selector2) : unrefElement(selector2);
  8252. if (!el)
  8253. return;
  8254. let style;
  8255. if (disableTransition) {
  8256. style = window2.document.createElement("style");
  8257. const styleString = "*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";
  8258. style.appendChild(document.createTextNode(styleString));
  8259. window2.document.head.appendChild(style);
  8260. }
  8261. if (attribute2 === "class") {
  8262. const current = value.split(/\s/g);
  8263. Object.values(modes).flatMap((i) => (i || "").split(/\s/g)).filter(Boolean).forEach((v) => {
  8264. if (current.includes(v))
  8265. el.classList.add(v);
  8266. else
  8267. el.classList.remove(v);
  8268. });
  8269. } else {
  8270. el.setAttribute(attribute2, value);
  8271. }
  8272. if (disableTransition) {
  8273. window2.getComputedStyle(style).opacity;
  8274. document.head.removeChild(style);
  8275. }
  8276. }
  8277. );
  8278. function defaultOnChanged(mode) {
  8279. var _a;
  8280. updateHTMLAttrs(selector, attribute, (_a = modes[mode]) != null ? _a : mode);
  8281. }
  8282. function onChanged(mode) {
  8283. if (options.onChanged)
  8284. options.onChanged(mode, defaultOnChanged);
  8285. else
  8286. defaultOnChanged(mode);
  8287. }
  8288. watch(state, onChanged, { flush: "post", immediate: true });
  8289. tryOnMounted(() => onChanged(state.value));
  8290. const auto = computed({
  8291. get() {
  8292. return emitAuto ? store.value : state.value;
  8293. },
  8294. set(v) {
  8295. store.value = v;
  8296. }
  8297. });
  8298. try {
  8299. return Object.assign(auto, { store, system, state });
  8300. } catch (e) {
  8301. return auto;
  8302. }
  8303. }
  8304. function useDark(options = {}) {
  8305. const {
  8306. valueDark = "dark",
  8307. valueLight = "",
  8308. window: window2 = defaultWindow
  8309. } = options;
  8310. const mode = useColorMode({
  8311. ...options,
  8312. onChanged: (mode2, defaultHandler) => {
  8313. var _a;
  8314. if (options.onChanged)
  8315. (_a = options.onChanged) == null ? void 0 : _a.call(options, mode2 === "dark", defaultHandler, mode2);
  8316. else
  8317. defaultHandler(mode2);
  8318. },
  8319. modes: {
  8320. dark: valueDark,
  8321. light: valueLight
  8322. }
  8323. });
  8324. const system = computed(() => {
  8325. if (mode.system) {
  8326. return mode.system.value;
  8327. } else {
  8328. const preferredDark = usePreferredDark({ window: window2 });
  8329. return preferredDark.value ? "dark" : "light";
  8330. }
  8331. });
  8332. const isDark = computed({
  8333. get() {
  8334. return mode.value === "dark";
  8335. },
  8336. set(v) {
  8337. const modeVal = v ? "dark" : "light";
  8338. if (system.value === modeVal)
  8339. mode.value = "auto";
  8340. else
  8341. mode.value = modeVal;
  8342. }
  8343. });
  8344. return isDark;
  8345. }
  8346. function resolveElement(el) {
  8347. if (typeof Window !== "undefined" && el instanceof Window)
  8348. return el.document.documentElement;
  8349. if (typeof Document !== "undefined" && el instanceof Document)
  8350. return el.documentElement;
  8351. return el;
  8352. }
  8353. function useLocalStorage(key, initialValue, options = {}) {
  8354. const { window: window2 = defaultWindow } = options;
  8355. return useStorage(key, initialValue, window2 == null ? void 0 : window2.localStorage, options);
  8356. }
  8357. function checkOverflowScroll(ele) {
  8358. const style = window.getComputedStyle(ele);
  8359. if (style.overflowX === "scroll" || style.overflowY === "scroll" || style.overflowX === "auto" && ele.clientWidth < ele.scrollWidth || style.overflowY === "auto" && ele.clientHeight < ele.scrollHeight) {
  8360. return true;
  8361. } else {
  8362. const parent = ele.parentNode;
  8363. if (!parent || parent.tagName === "BODY")
  8364. return false;
  8365. return checkOverflowScroll(parent);
  8366. }
  8367. }
  8368. function preventDefault(rawEvent) {
  8369. const e = rawEvent || window.event;
  8370. const _target = e.target;
  8371. if (checkOverflowScroll(_target))
  8372. return false;
  8373. if (e.touches.length > 1)
  8374. return true;
  8375. if (e.preventDefault)
  8376. e.preventDefault();
  8377. return false;
  8378. }
  8379. const elInitialOverflow = /* @__PURE__ */ new WeakMap();
  8380. function useScrollLock(element, initialState = false) {
  8381. const isLocked = ref(initialState);
  8382. let stopTouchMoveListener = null;
  8383. watch(toRef(element), (el) => {
  8384. const target = resolveElement(toValue(el));
  8385. if (target) {
  8386. const ele = target;
  8387. if (!elInitialOverflow.get(ele))
  8388. elInitialOverflow.set(ele, ele.style.overflow);
  8389. if (isLocked.value)
  8390. ele.style.overflow = "hidden";
  8391. }
  8392. }, {
  8393. immediate: true
  8394. });
  8395. const lock = () => {
  8396. const el = resolveElement(toValue(element));
  8397. if (!el || isLocked.value)
  8398. return;
  8399. if (isIOS) {
  8400. stopTouchMoveListener = useEventListener(
  8401. el,
  8402. "touchmove",
  8403. (e) => {
  8404. preventDefault(e);
  8405. },
  8406. { passive: false }
  8407. );
  8408. }
  8409. el.style.overflow = "hidden";
  8410. isLocked.value = true;
  8411. };
  8412. const unlock = () => {
  8413. var _a;
  8414. const el = resolveElement(toValue(element));
  8415. if (!el || !isLocked.value)
  8416. return;
  8417. isIOS && (stopTouchMoveListener == null ? void 0 : stopTouchMoveListener());
  8418. el.style.overflow = (_a = elInitialOverflow.get(el)) != null ? _a : "";
  8419. elInitialOverflow.delete(el);
  8420. isLocked.value = false;
  8421. };
  8422. tryOnScopeDispose(unlock);
  8423. return computed({
  8424. get() {
  8425. return isLocked.value;
  8426. },
  8427. set(v) {
  8428. if (v)
  8429. lock();
  8430. else
  8431. unlock();
  8432. }
  8433. });
  8434. }
  8435. function useSessionStorage(key, initialValue, options = {}) {
  8436. const { window: window2 = defaultWindow } = options;
  8437. return useStorage(key, initialValue, window2 == null ? void 0 : window2.sessionStorage, options);
  8438. }
  8439. function useWindowScroll(options = {}) {
  8440. const { window: window2 = defaultWindow, behavior = "auto" } = options;
  8441. if (!window2) {
  8442. return {
  8443. x: ref(0),
  8444. y: ref(0)
  8445. };
  8446. }
  8447. const internalX = ref(window2.scrollX);
  8448. const internalY = ref(window2.scrollY);
  8449. const x = computed({
  8450. get() {
  8451. return internalX.value;
  8452. },
  8453. set(x2) {
  8454. scrollTo({ left: x2, behavior });
  8455. }
  8456. });
  8457. const y = computed({
  8458. get() {
  8459. return internalY.value;
  8460. },
  8461. set(y2) {
  8462. scrollTo({ top: y2, behavior });
  8463. }
  8464. });
  8465. useEventListener(
  8466. window2,
  8467. "scroll",
  8468. () => {
  8469. internalX.value = window2.scrollX;
  8470. internalY.value = window2.scrollY;
  8471. },
  8472. {
  8473. capture: false,
  8474. passive: true
  8475. }
  8476. );
  8477. return { x, y };
  8478. }
  8479. function useWindowSize(options = {}) {
  8480. const {
  8481. window: window2 = defaultWindow,
  8482. initialWidth = Number.POSITIVE_INFINITY,
  8483. initialHeight = Number.POSITIVE_INFINITY,
  8484. listenOrientation = true,
  8485. includeScrollbar = true
  8486. } = options;
  8487. const width = ref(initialWidth);
  8488. const height = ref(initialHeight);
  8489. const update = () => {
  8490. if (window2) {
  8491. if (includeScrollbar) {
  8492. width.value = window2.innerWidth;
  8493. height.value = window2.innerHeight;
  8494. } else {
  8495. width.value = window2.document.documentElement.clientWidth;
  8496. height.value = window2.document.documentElement.clientHeight;
  8497. }
  8498. }
  8499. };
  8500. update();
  8501. tryOnMounted(update);
  8502. useEventListener("resize", update, { passive: true });
  8503. if (listenOrientation) {
  8504. const matches = useMediaQuery("(orientation: portrait)");
  8505. watch(matches, () => update());
  8506. }
  8507. return { width, height };
  8508. }
  8509. var define_import_meta_env_default = { BASE_URL: "/", MODE: "production", DEV: false, PROD: true, SSR: false };
  8510. var define_process_env_default = {};
  8511. const EXTERNAL_URL_RE = /^(?:[a-z]+:|\/\/)/i;
  8512. const APPEARANCE_KEY = "vitepress-theme-appearance";
  8513. const HASH_RE = /#.*$/;
  8514. const HASH_OR_QUERY_RE = /[?#].*$/;
  8515. const INDEX_OR_EXT_RE = /(?:(^|\/)index)?\.(?:md|html)$/;
  8516. const inBrowser = typeof document !== "undefined";
  8517. const notFoundPageData = {
  8518. relativePath: "",
  8519. filePath: "",
  8520. title: "404",
  8521. description: "Not Found",
  8522. headers: [],
  8523. frontmatter: { sidebar: false, layout: "page" },
  8524. lastUpdated: 0,
  8525. isNotFound: true
  8526. };
  8527. function isActive(currentPath, matchPath, asRegex = false) {
  8528. if (matchPath === void 0) {
  8529. return false;
  8530. }
  8531. currentPath = normalize(`/${currentPath}`);
  8532. if (asRegex) {
  8533. return new RegExp(matchPath).test(currentPath);
  8534. }
  8535. if (normalize(matchPath) !== currentPath) {
  8536. return false;
  8537. }
  8538. const hashMatch = matchPath.match(HASH_RE);
  8539. if (hashMatch) {
  8540. return (inBrowser ? location.hash : "") === hashMatch[0];
  8541. }
  8542. return true;
  8543. }
  8544. function normalize(path) {
  8545. return decodeURI(path).replace(HASH_OR_QUERY_RE, "").replace(INDEX_OR_EXT_RE, "$1");
  8546. }
  8547. function isExternal(path) {
  8548. return EXTERNAL_URL_RE.test(path);
  8549. }
  8550. function resolveSiteDataByRoute(siteData2, relativePath) {
  8551. var _a, _b, _c, _d, _e, _f, _g;
  8552. const localeIndex = Object.keys(siteData2.locales).find((key) => key !== "root" && !isExternal(key) && isActive(relativePath, `/${key}/`, true)) || "root";
  8553. return Object.assign({}, siteData2, {
  8554. localeIndex,
  8555. lang: ((_a = siteData2.locales[localeIndex]) == null ? void 0 : _a.lang) ?? siteData2.lang,
  8556. dir: ((_b = siteData2.locales[localeIndex]) == null ? void 0 : _b.dir) ?? siteData2.dir,
  8557. title: ((_c = siteData2.locales[localeIndex]) == null ? void 0 : _c.title) ?? siteData2.title,
  8558. titleTemplate: ((_d = siteData2.locales[localeIndex]) == null ? void 0 : _d.titleTemplate) ?? siteData2.titleTemplate,
  8559. description: ((_e = siteData2.locales[localeIndex]) == null ? void 0 : _e.description) ?? siteData2.description,
  8560. head: mergeHead(siteData2.head, ((_f = siteData2.locales[localeIndex]) == null ? void 0 : _f.head) ?? []),
  8561. themeConfig: {
  8562. ...siteData2.themeConfig,
  8563. ...(_g = siteData2.locales[localeIndex]) == null ? void 0 : _g.themeConfig
  8564. }
  8565. });
  8566. }
  8567. function createTitle(siteData2, pageData) {
  8568. const title = pageData.title || siteData2.title;
  8569. const template = pageData.titleTemplate ?? siteData2.titleTemplate;
  8570. if (typeof template === "string" && template.includes(":title")) {
  8571. return template.replace(/:title/g, title);
  8572. }
  8573. const templateString = createTitleTemplate(siteData2.title, template);
  8574. if (title === templateString.slice(3)) {
  8575. return title;
  8576. }
  8577. return `${title}${templateString}`;
  8578. }
  8579. function createTitleTemplate(siteTitle, template) {
  8580. if (template === false) {
  8581. return "";
  8582. }
  8583. if (template === true || template === void 0) {
  8584. return ` | ${siteTitle}`;
  8585. }
  8586. if (siteTitle === template) {
  8587. return "";
  8588. }
  8589. return ` | ${template}`;
  8590. }
  8591. function hasTag(head, tag) {
  8592. const [tagType, tagAttrs] = tag;
  8593. if (tagType !== "meta")
  8594. return false;
  8595. const keyAttr = Object.entries(tagAttrs)[0];
  8596. if (keyAttr == null)
  8597. return false;
  8598. return head.some(([type, attrs]) => type === tagType && attrs[keyAttr[0]] === keyAttr[1]);
  8599. }
  8600. function mergeHead(prev, curr) {
  8601. return [...prev.filter((tagAttrs) => !hasTag(curr, tagAttrs)), ...curr];
  8602. }
  8603. const INVALID_CHAR_REGEX = /[\u0000-\u001F"#$&*+,:;<=>?[\]^`{|}\u007F]/g;
  8604. const DRIVE_LETTER_REGEX = /^[a-z]:/i;
  8605. function sanitizeFileName(name) {
  8606. const match = DRIVE_LETTER_REGEX.exec(name);
  8607. const driveLetter = match ? match[0] : "";
  8608. return driveLetter + name.slice(driveLetter.length).replace(INVALID_CHAR_REGEX, "_").replace(/(^|\/)_+(?=[^/]*$)/, "$1");
  8609. }
  8610. const KNOWN_EXTENSIONS = /* @__PURE__ */ new Set();
  8611. function treatAsHtml(filename) {
  8612. if (KNOWN_EXTENSIONS.size === 0) {
  8613. const extraExts = typeof process === "object" && (define_process_env_default == null ? void 0 : define_process_env_default.VITE_EXTRA_EXTENSIONS) || (define_import_meta_env_default == null ? void 0 : define_import_meta_env_default.VITE_EXTRA_EXTENSIONS) || "";
  8614. ("3g2,3gp,aac,ai,apng,au,avif,bin,bmp,cer,class,conf,crl,css,csv,dll,doc,eps,epub,exe,gif,gz,ics,ief,jar,jpe,jpeg,jpg,js,json,jsonld,m4a,man,mid,midi,mjs,mov,mp2,mp3,mp4,mpe,mpeg,mpg,mpp,oga,ogg,ogv,ogx,opus,otf,p10,p7c,p7m,p7s,pdf,png,ps,qt,roff,rtf,rtx,ser,svg,t,tif,tiff,tr,ts,tsv,ttf,txt,vtt,wav,weba,webm,webp,woff,woff2,xhtml,xml,yaml,yml,zip" + (extraExts && typeof extraExts === "string" ? "," + extraExts : "")).split(",").forEach((ext2) => KNOWN_EXTENSIONS.add(ext2));
  8615. }
  8616. const ext = filename.split(".").pop();
  8617. return ext == null || !KNOWN_EXTENSIONS.has(ext.toLowerCase());
  8618. }
  8619. function escapeRegExp(str) {
  8620. return str.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
  8621. }
  8622. const dataSymbol = Symbol();
  8623. const siteDataRef = shallowRef(siteData);
  8624. function initData(route) {
  8625. const site = computed(() => resolveSiteDataByRoute(siteDataRef.value, route.data.relativePath));
  8626. const appearance = site.value.appearance;
  8627. const isDark = appearance === "force-dark" ? ref(true) : appearance ? useDark({
  8628. storageKey: APPEARANCE_KEY,
  8629. initialValue: () => typeof appearance === "string" ? appearance : "auto",
  8630. ...typeof appearance === "object" ? appearance : {}
  8631. }) : ref(false);
  8632. const hashRef = ref(inBrowser ? location.hash : "");
  8633. if (inBrowser) {
  8634. window.addEventListener("hashchange", () => {
  8635. hashRef.value = location.hash;
  8636. });
  8637. }
  8638. watch(() => route.data, () => {
  8639. hashRef.value = inBrowser ? location.hash : "";
  8640. });
  8641. return {
  8642. site,
  8643. theme: computed(() => site.value.themeConfig),
  8644. page: computed(() => route.data),
  8645. frontmatter: computed(() => route.data.frontmatter),
  8646. params: computed(() => route.data.params),
  8647. lang: computed(() => site.value.lang),
  8648. dir: computed(() => route.data.frontmatter.dir || site.value.dir),
  8649. localeIndex: computed(() => site.value.localeIndex || "root"),
  8650. title: computed(() => createTitle(site.value, route.data)),
  8651. description: computed(() => route.data.description || site.value.description),
  8652. isDark,
  8653. hash: computed(() => hashRef.value)
  8654. };
  8655. }
  8656. function useData() {
  8657. const data = inject(dataSymbol);
  8658. if (!data) {
  8659. throw new Error("vitepress data not properly injected in app");
  8660. }
  8661. return data;
  8662. }
  8663. function joinPath(base, path) {
  8664. return `${base}${path}`.replace(/\/+/g, "/");
  8665. }
  8666. function withBase(path) {
  8667. return EXTERNAL_URL_RE.test(path) || !path.startsWith("/") ? path : joinPath(siteDataRef.value.base, path);
  8668. }
  8669. function pathToFile(path) {
  8670. let pagePath = path.replace(/\.html$/, "");
  8671. pagePath = decodeURIComponent(pagePath);
  8672. pagePath = pagePath.replace(/\/$/, "/index");
  8673. {
  8674. if (inBrowser) {
  8675. const base = "/";
  8676. pagePath = sanitizeFileName(pagePath.slice(base.length).replace(/\//g, "_") || "index") + ".md";
  8677. let pageHash = __VP_HASH_MAP__[pagePath.toLowerCase()];
  8678. if (!pageHash) {
  8679. pagePath = pagePath.endsWith("_index.md") ? pagePath.slice(0, -9) + ".md" : pagePath.slice(0, -3) + "_index.md";
  8680. pageHash = __VP_HASH_MAP__[pagePath.toLowerCase()];
  8681. }
  8682. if (!pageHash)
  8683. return null;
  8684. pagePath = `${base}${"assets"}/${pagePath}.${pageHash}.js`;
  8685. } else {
  8686. pagePath = `./${sanitizeFileName(pagePath.slice(1).replace(/\//g, "_"))}.md.js`;
  8687. }
  8688. }
  8689. return pagePath;
  8690. }
  8691. let contentUpdatedCallbacks = [];
  8692. function onContentUpdated(fn) {
  8693. contentUpdatedCallbacks.push(fn);
  8694. onUnmounted(() => {
  8695. contentUpdatedCallbacks = contentUpdatedCallbacks.filter((f) => f !== fn);
  8696. });
  8697. }
  8698. function getScrollOffset() {
  8699. let scrollOffset = siteDataRef.value.scrollOffset;
  8700. let offset = 0;
  8701. let padding = 24;
  8702. if (typeof scrollOffset === "object" && "padding" in scrollOffset) {
  8703. padding = scrollOffset.padding;
  8704. scrollOffset = scrollOffset.selector;
  8705. }
  8706. if (typeof scrollOffset === "number") {
  8707. offset = scrollOffset;
  8708. } else if (typeof scrollOffset === "string") {
  8709. offset = tryOffsetSelector(scrollOffset, padding);
  8710. } else if (Array.isArray(scrollOffset)) {
  8711. for (const selector of scrollOffset) {
  8712. const res = tryOffsetSelector(selector, padding);
  8713. if (res) {
  8714. offset = res;
  8715. break;
  8716. }
  8717. }
  8718. }
  8719. return offset;
  8720. }
  8721. function tryOffsetSelector(selector, padding) {
  8722. const el = document.querySelector(selector);
  8723. if (!el)
  8724. return 0;
  8725. const bot = el.getBoundingClientRect().bottom;
  8726. if (bot < 0)
  8727. return 0;
  8728. return bot + padding;
  8729. }
  8730. const RouterSymbol = Symbol();
  8731. const fakeHost = "http://a.com";
  8732. const getDefaultRoute = () => ({
  8733. path: "/",
  8734. component: null,
  8735. data: notFoundPageData
  8736. });
  8737. function createRouter(loadPageModule, fallbackComponent) {
  8738. const route = reactive(getDefaultRoute());
  8739. const router = {
  8740. route,
  8741. go
  8742. };
  8743. async function go(href = inBrowser ? location.href : "/") {
  8744. var _a, _b;
  8745. href = normalizeHref(href);
  8746. if (await ((_a = router.onBeforeRouteChange) == null ? void 0 : _a.call(router, href)) === false)
  8747. return;
  8748. if (inBrowser && href !== normalizeHref(location.href)) {
  8749. history.replaceState({ scrollPosition: window.scrollY }, "");
  8750. history.pushState({}, "", href);
  8751. }
  8752. await loadPage(href);
  8753. await ((_b = router.onAfterRouteChanged) == null ? void 0 : _b.call(router, href));
  8754. }
  8755. let latestPendingPath = null;
  8756. async function loadPage(href, scrollPosition = 0, isRetry = false) {
  8757. var _a;
  8758. if (await ((_a = router.onBeforePageLoad) == null ? void 0 : _a.call(router, href)) === false)
  8759. return;
  8760. const targetLoc = new URL(href, fakeHost);
  8761. const pendingPath = latestPendingPath = targetLoc.pathname;
  8762. try {
  8763. let page = await loadPageModule(pendingPath);
  8764. if (!page) {
  8765. throw new Error(`Page not found: ${pendingPath}`);
  8766. }
  8767. if (latestPendingPath === pendingPath) {
  8768. latestPendingPath = null;
  8769. const { default: comp, __pageData } = page;
  8770. if (!comp) {
  8771. throw new Error(`Invalid route component: ${comp}`);
  8772. }
  8773. route.path = inBrowser ? pendingPath : withBase(pendingPath);
  8774. route.component = markRaw(comp);
  8775. route.data = true ? markRaw(__pageData) : readonly(__pageData);
  8776. if (inBrowser) {
  8777. nextTick(() => {
  8778. let actualPathname = siteDataRef.value.base + __pageData.relativePath.replace(/(?:(^|\/)index)?\.md$/, "$1");
  8779. if (!siteDataRef.value.cleanUrls && !actualPathname.endsWith("/")) {
  8780. actualPathname += ".html";
  8781. }
  8782. if (actualPathname !== targetLoc.pathname) {
  8783. targetLoc.pathname = actualPathname;
  8784. href = actualPathname + targetLoc.search + targetLoc.hash;
  8785. history.replaceState({}, "", href);
  8786. }
  8787. if (targetLoc.hash && !scrollPosition) {
  8788. let target = null;
  8789. try {
  8790. target = document.getElementById(decodeURIComponent(targetLoc.hash).slice(1));
  8791. } catch (e) {
  8792. console.warn(e);
  8793. }
  8794. if (target) {
  8795. scrollTo$1(target, targetLoc.hash);
  8796. return;
  8797. }
  8798. }
  8799. window.scrollTo(0, scrollPosition);
  8800. });
  8801. }
  8802. }
  8803. } catch (err) {
  8804. if (!/fetch|Page not found/.test(err.message) && !/^\/404(\.html|\/)?$/.test(href)) {
  8805. console.error(err);
  8806. }
  8807. if (!isRetry) {
  8808. try {
  8809. const res = await fetch(siteDataRef.value.base + "hashmap.json");
  8810. window.__VP_HASH_MAP__ = await res.json();
  8811. await loadPage(href, scrollPosition, true);
  8812. return;
  8813. } catch (e) {
  8814. }
  8815. }
  8816. if (latestPendingPath === pendingPath) {
  8817. latestPendingPath = null;
  8818. route.path = inBrowser ? pendingPath : withBase(pendingPath);
  8819. route.component = fallbackComponent ? markRaw(fallbackComponent) : null;
  8820. route.data = notFoundPageData;
  8821. }
  8822. }
  8823. }
  8824. if (inBrowser) {
  8825. if (history.state === null) {
  8826. history.replaceState({}, "");
  8827. }
  8828. window.addEventListener("click", (e) => {
  8829. const button = e.target.closest("button");
  8830. if (button)
  8831. return;
  8832. const link2 = e.target.closest("a");
  8833. if (link2 && !link2.closest(".vp-raw") && (link2 instanceof SVGElement || !link2.download)) {
  8834. const { target } = link2;
  8835. const { href, origin, pathname, hash, search } = new URL(link2.href instanceof SVGAnimatedString ? link2.href.animVal : link2.href, link2.baseURI);
  8836. const currentUrl = new URL(location.href);
  8837. if (!e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey && !target && origin === currentUrl.origin && treatAsHtml(pathname)) {
  8838. e.preventDefault();
  8839. if (pathname === currentUrl.pathname && search === currentUrl.search) {
  8840. if (hash !== currentUrl.hash) {
  8841. history.pushState({}, "", href);
  8842. window.dispatchEvent(new HashChangeEvent("hashchange", {
  8843. oldURL: currentUrl.href,
  8844. newURL: href
  8845. }));
  8846. }
  8847. if (hash) {
  8848. scrollTo$1(link2, hash, link2.classList.contains("header-anchor"));
  8849. } else {
  8850. window.scrollTo(0, 0);
  8851. }
  8852. } else {
  8853. go(href);
  8854. }
  8855. }
  8856. }
  8857. }, { capture: true });
  8858. window.addEventListener("popstate", async (e) => {
  8859. var _a;
  8860. if (e.state === null) {
  8861. return;
  8862. }
  8863. await loadPage(normalizeHref(location.href), e.state && e.state.scrollPosition || 0);
  8864. (_a = router.onAfterRouteChanged) == null ? void 0 : _a.call(router, location.href);
  8865. });
  8866. window.addEventListener("hashchange", (e) => {
  8867. e.preventDefault();
  8868. });
  8869. }
  8870. return router;
  8871. }
  8872. function useRouter() {
  8873. const router = inject(RouterSymbol);
  8874. if (!router) {
  8875. throw new Error("useRouter() is called without provider.");
  8876. }
  8877. return router;
  8878. }
  8879. function useRoute() {
  8880. return useRouter().route;
  8881. }
  8882. function scrollTo$1(el, hash, smooth = false) {
  8883. let target = null;
  8884. try {
  8885. target = el.classList.contains("header-anchor") ? el : document.getElementById(decodeURIComponent(hash).slice(1));
  8886. } catch (e) {
  8887. console.warn(e);
  8888. }
  8889. if (target) {
  8890. let scrollToTarget = function() {
  8891. if (!smooth || Math.abs(targetTop - window.scrollY) > window.innerHeight)
  8892. window.scrollTo(0, targetTop);
  8893. else
  8894. window.scrollTo({ left: 0, top: targetTop, behavior: "smooth" });
  8895. };
  8896. const targetPadding = parseInt(window.getComputedStyle(target).paddingTop, 10);
  8897. const targetTop = window.scrollY + target.getBoundingClientRect().top - getScrollOffset() + targetPadding;
  8898. requestAnimationFrame(scrollToTarget);
  8899. }
  8900. }
  8901. function normalizeHref(href) {
  8902. const url = new URL(href, fakeHost);
  8903. url.pathname = url.pathname.replace(/(^|\/)index(\.html)?$/, "$1");
  8904. if (siteDataRef.value.cleanUrls)
  8905. url.pathname = url.pathname.replace(/\.html$/, "");
  8906. else if (!url.pathname.endsWith("/") && !url.pathname.endsWith(".html"))
  8907. url.pathname += ".html";
  8908. return url.pathname + url.search + url.hash;
  8909. }
  8910. const runCbs = () => contentUpdatedCallbacks.forEach((fn) => fn());
  8911. const Content = /* @__PURE__ */ defineComponent({
  8912. name: "VitePressContent",
  8913. props: {
  8914. as: { type: [Object, String], default: "div" }
  8915. },
  8916. setup(props) {
  8917. const route = useRoute();
  8918. const { site } = useData();
  8919. return () => h(props.as, site.value.contentProps ?? { style: { position: "relative" } }, [
  8920. route.component ? h(route.component, {
  8921. onVnodeMounted: runCbs,
  8922. onVnodeUpdated: runCbs,
  8923. onVnodeUnmounted: runCbs
  8924. }) : "404 Page Not Found"
  8925. ]);
  8926. }
  8927. });
  8928. const ClientOnly = /* @__PURE__ */ defineComponent({
  8929. setup(_, { slots }) {
  8930. const show = ref(false);
  8931. onMounted(() => {
  8932. show.value = true;
  8933. });
  8934. return () => show.value && slots.default ? slots.default() : null;
  8935. }
  8936. });
  8937. function useCodeGroups() {
  8938. if (inBrowser) {
  8939. window.addEventListener("click", (e) => {
  8940. var _a;
  8941. const el = e.target;
  8942. if (el.matches(".vp-code-group input")) {
  8943. const group = (_a = el.parentElement) == null ? void 0 : _a.parentElement;
  8944. if (!group)
  8945. return;
  8946. const i = Array.from(group.querySelectorAll("input")).indexOf(el);
  8947. if (i < 0)
  8948. return;
  8949. const blocks = group.querySelector(".blocks");
  8950. if (!blocks)
  8951. return;
  8952. const current = Array.from(blocks.children).find((child) => child.classList.contains("active"));
  8953. if (!current)
  8954. return;
  8955. const next = blocks.children[i];
  8956. if (!next || current === next)
  8957. return;
  8958. current.classList.remove("active");
  8959. next.classList.add("active");
  8960. const label = group == null ? void 0 : group.querySelector(`label[for="${el.id}"]`);
  8961. label == null ? void 0 : label.scrollIntoView({ block: "nearest" });
  8962. }
  8963. });
  8964. }
  8965. }
  8966. function useCopyCode() {
  8967. if (inBrowser) {
  8968. const timeoutIdMap = /* @__PURE__ */ new WeakMap();
  8969. window.addEventListener("click", (e) => {
  8970. var _a;
  8971. const el = e.target;
  8972. if (el.matches('div[class*="language-"] > button.copy')) {
  8973. const parent = el.parentElement;
  8974. const sibling = (_a = el.nextElementSibling) == null ? void 0 : _a.nextElementSibling;
  8975. if (!parent || !sibling) {
  8976. return;
  8977. }
  8978. const isShell = /language-(shellscript|shell|bash|sh|zsh)/.test(parent.className);
  8979. const ignoredNodes = [".vp-copy-ignore", ".diff.remove"];
  8980. const clone = sibling.cloneNode(true);
  8981. clone.querySelectorAll(ignoredNodes.join(",")).forEach((node) => node.remove());
  8982. let text = clone.textContent || "";
  8983. if (isShell) {
  8984. text = text.replace(/^ *(\$|>) /gm, "").trim();
  8985. }
  8986. copyToClipboard(text).then(() => {
  8987. el.classList.add("copied");
  8988. clearTimeout(timeoutIdMap.get(el));
  8989. const timeoutId = setTimeout(() => {
  8990. el.classList.remove("copied");
  8991. el.blur();
  8992. timeoutIdMap.delete(el);
  8993. }, 2e3);
  8994. timeoutIdMap.set(el, timeoutId);
  8995. });
  8996. }
  8997. });
  8998. }
  8999. }
  9000. async function copyToClipboard(text) {
  9001. try {
  9002. return navigator.clipboard.writeText(text);
  9003. } catch {
  9004. const element = document.createElement("textarea");
  9005. const previouslyFocusedElement = document.activeElement;
  9006. element.value = text;
  9007. element.setAttribute("readonly", "");
  9008. element.style.contain = "strict";
  9009. element.style.position = "absolute";
  9010. element.style.left = "-9999px";
  9011. element.style.fontSize = "12pt";
  9012. const selection = document.getSelection();
  9013. const originalRange = selection ? selection.rangeCount > 0 && selection.getRangeAt(0) : null;
  9014. document.body.appendChild(element);
  9015. element.select();
  9016. element.selectionStart = 0;
  9017. element.selectionEnd = text.length;
  9018. document.execCommand("copy");
  9019. document.body.removeChild(element);
  9020. if (originalRange) {
  9021. selection.removeAllRanges();
  9022. selection.addRange(originalRange);
  9023. }
  9024. if (previouslyFocusedElement) {
  9025. previouslyFocusedElement.focus();
  9026. }
  9027. }
  9028. }
  9029. function useUpdateHead(route, siteDataByRouteRef) {
  9030. let isFirstUpdate = true;
  9031. let managedHeadElements = [];
  9032. const updateHeadTags = (newTags) => {
  9033. if (isFirstUpdate) {
  9034. isFirstUpdate = false;
  9035. newTags.forEach((tag) => {
  9036. const headEl = createHeadElement(tag);
  9037. for (const el of document.head.children) {
  9038. if (el.isEqualNode(headEl)) {
  9039. managedHeadElements.push(el);
  9040. return;
  9041. }
  9042. }
  9043. });
  9044. return;
  9045. }
  9046. const newElements = newTags.map(createHeadElement);
  9047. managedHeadElements.forEach((oldEl, oldIndex) => {
  9048. const matchedIndex = newElements.findIndex((newEl) => newEl == null ? void 0 : newEl.isEqualNode(oldEl ?? null));
  9049. if (matchedIndex !== -1) {
  9050. delete newElements[matchedIndex];
  9051. } else {
  9052. oldEl == null ? void 0 : oldEl.remove();
  9053. delete managedHeadElements[oldIndex];
  9054. }
  9055. });
  9056. newElements.forEach((el) => el && document.head.appendChild(el));
  9057. managedHeadElements = [...managedHeadElements, ...newElements].filter(Boolean);
  9058. };
  9059. watchEffect(() => {
  9060. const pageData = route.data;
  9061. const siteData2 = siteDataByRouteRef.value;
  9062. const pageDescription = pageData && pageData.description;
  9063. const frontmatterHead = pageData && pageData.frontmatter.head || [];
  9064. const title = createTitle(siteData2, pageData);
  9065. if (title !== document.title) {
  9066. document.title = title;
  9067. }
  9068. const description = pageDescription || siteData2.description;
  9069. let metaDescriptionElement = document.querySelector(`meta[name=description]`);
  9070. if (metaDescriptionElement) {
  9071. if (metaDescriptionElement.getAttribute("content") !== description) {
  9072. metaDescriptionElement.setAttribute("content", description);
  9073. }
  9074. } else {
  9075. createHeadElement(["meta", { name: "description", content: description }]);
  9076. }
  9077. updateHeadTags(mergeHead(siteData2.head, filterOutHeadDescription(frontmatterHead)));
  9078. });
  9079. }
  9080. function createHeadElement([tag, attrs, innerHTML]) {
  9081. const el = document.createElement(tag);
  9082. for (const key in attrs) {
  9083. el.setAttribute(key, attrs[key]);
  9084. }
  9085. if (innerHTML) {
  9086. el.innerHTML = innerHTML;
  9087. }
  9088. if (tag === "script" && !attrs.async) {
  9089. el.async = false;
  9090. }
  9091. return el;
  9092. }
  9093. function isMetaDescription(headConfig) {
  9094. return headConfig[0] === "meta" && headConfig[1] && headConfig[1].name === "description";
  9095. }
  9096. function filterOutHeadDescription(head) {
  9097. return head.filter((h2) => !isMetaDescription(h2));
  9098. }
  9099. const hasFetched = /* @__PURE__ */ new Set();
  9100. const createLink = () => document.createElement("link");
  9101. const viaDOM = (url) => {
  9102. const link2 = createLink();
  9103. link2.rel = `prefetch`;
  9104. link2.href = url;
  9105. document.head.appendChild(link2);
  9106. };
  9107. const viaXHR = (url) => {
  9108. const req = new XMLHttpRequest();
  9109. req.open("GET", url, req.withCredentials = true);
  9110. req.send();
  9111. };
  9112. let link;
  9113. const doFetch = inBrowser && (link = createLink()) && link.relList && link.relList.supports && link.relList.supports("prefetch") ? viaDOM : viaXHR;
  9114. function usePrefetch() {
  9115. if (!inBrowser) {
  9116. return;
  9117. }
  9118. if (!window.IntersectionObserver) {
  9119. return;
  9120. }
  9121. let conn;
  9122. if ((conn = navigator.connection) && (conn.saveData || /2g/.test(conn.effectiveType))) {
  9123. return;
  9124. }
  9125. const rIC = window.requestIdleCallback || setTimeout;
  9126. let observer = null;
  9127. const observeLinks = () => {
  9128. if (observer) {
  9129. observer.disconnect();
  9130. }
  9131. observer = new IntersectionObserver((entries) => {
  9132. entries.forEach((entry) => {
  9133. if (entry.isIntersecting) {
  9134. const link2 = entry.target;
  9135. observer.unobserve(link2);
  9136. const { pathname } = link2;
  9137. if (!hasFetched.has(pathname)) {
  9138. hasFetched.add(pathname);
  9139. const pageChunkPath = pathToFile(pathname);
  9140. if (pageChunkPath)
  9141. doFetch(pageChunkPath);
  9142. }
  9143. }
  9144. });
  9145. });
  9146. rIC(() => {
  9147. document.querySelectorAll("#app a").forEach((link2) => {
  9148. const { hostname, pathname } = new URL(link2.href instanceof SVGAnimatedString ? link2.href.animVal : link2.href, link2.baseURI);
  9149. const extMatch = pathname.match(/\.\w+$/);
  9150. if (extMatch && extMatch[0] !== ".html") {
  9151. return;
  9152. }
  9153. if (
  9154. // only prefetch same tab navigation, since a new tab will load
  9155. // the lean js chunk instead.
  9156. link2.target !== "_blank" && // only prefetch inbound links
  9157. hostname === location.hostname
  9158. ) {
  9159. if (pathname !== location.pathname) {
  9160. observer.observe(link2);
  9161. } else {
  9162. hasFetched.add(pathname);
  9163. }
  9164. }
  9165. });
  9166. });
  9167. };
  9168. onMounted(observeLinks);
  9169. const route = useRoute();
  9170. watch(() => route.path, observeLinks);
  9171. onUnmounted(() => {
  9172. observer && observer.disconnect();
  9173. });
  9174. }
  9175. export {
  9176. provide as $,
  9177. watchPostEffect as A,
  9178. onUpdated as B,
  9179. getScrollOffset as C,
  9180. resolveComponent as D,
  9181. renderList as E,
  9182. Fragment as F,
  9183. shallowRef as G,
  9184. onContentUpdated as H,
  9185. createVNode as I,
  9186. resolveDynamicComponent as J,
  9187. EXTERNAL_URL_RE as K,
  9188. useRoute as L,
  9189. mergeProps as M,
  9190. inject as N,
  9191. useWindowSize as O,
  9192. normalizeStyle as P,
  9193. onClickOutside as Q,
  9194. onKeyStroke as R,
  9195. nextTick as S,
  9196. Transition as T,
  9197. useWindowScroll as U,
  9198. inBrowser as V,
  9199. readonly as W,
  9200. defineAsyncComponent as X,
  9201. __vitePreload as Y,
  9202. useScrollLock as Z,
  9203. _export_sfc as _,
  9204. createTextVNode as a,
  9205. toHandlers as a0,
  9206. withKeys as a1,
  9207. withModifiers as a2,
  9208. useSlots as a3,
  9209. reactive as a4,
  9210. toRef$1 as a5,
  9211. useRouter as a6,
  9212. onBeforeMount as a7,
  9213. createStaticVNode as a8,
  9214. useUpdateHead as a9,
  9215. createApp as aA,
  9216. escapeRegExp as aB,
  9217. RouterSymbol as aa,
  9218. initData as ab,
  9219. dataSymbol as ac,
  9220. Content as ad,
  9221. ClientOnly as ae,
  9222. siteDataRef as af,
  9223. createSSRApp as ag,
  9224. createRouter as ah,
  9225. pathToFile as ai,
  9226. usePrefetch as aj,
  9227. useCopyCode as ak,
  9228. useCodeGroups as al,
  9229. h as am,
  9230. unrefElement as an,
  9231. tryOnScopeDispose as ao,
  9232. computedAsync as ap,
  9233. useSessionStorage as aq,
  9234. useLocalStorage as ar,
  9235. watchDebounced as as,
  9236. useEventListener as at,
  9237. onBeforeUnmount as au,
  9238. withDirectives as av,
  9239. vModelText as aw,
  9240. isRef as ax,
  9241. Teleport as ay,
  9242. markRaw as az,
  9243. createBlock as b,
  9244. createElementBlock as c,
  9245. defineComponent as d,
  9246. createCommentVNode as e,
  9247. treatAsHtml as f,
  9248. withBase as g,
  9249. computed as h,
  9250. isExternal as i,
  9251. ref as j,
  9252. onMounted as k,
  9253. createBaseVNode as l,
  9254. unref as m,
  9255. normalizeClass as n,
  9256. openBlock as o,
  9257. pushScopeId as p,
  9258. popScopeId as q,
  9259. renderSlot as r,
  9260. isActive as s,
  9261. toDisplayString as t,
  9262. useData as u,
  9263. useMediaQuery as v,
  9264. withCtx as w,
  9265. watch as x,
  9266. watchEffect as y,
  9267. onUnmounted as z
  9268. };