runtime-core.esm-bundler.js 265 KB

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