backend.js 462 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392
  1. /******/ (function(modules) { // webpackBootstrap
  2. /******/ // The module cache
  3. /******/ var installedModules = {};
  4. /******/
  5. /******/ // The require function
  6. /******/ function __webpack_require__(moduleId) {
  7. /******/
  8. /******/ // Check if module is in cache
  9. /******/ if(installedModules[moduleId]) {
  10. /******/ return installedModules[moduleId].exports;
  11. /******/ }
  12. /******/ // Create a new module (and put it into the cache)
  13. /******/ var module = installedModules[moduleId] = {
  14. /******/ i: moduleId,
  15. /******/ l: false,
  16. /******/ exports: {}
  17. /******/ };
  18. /******/
  19. /******/ // Execute the module function
  20. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  21. /******/
  22. /******/ // Flag the module as loaded
  23. /******/ module.l = true;
  24. /******/
  25. /******/ // Return the exports of the module
  26. /******/ return module.exports;
  27. /******/ }
  28. /******/
  29. /******/
  30. /******/ // expose the modules object (__webpack_modules__)
  31. /******/ __webpack_require__.m = modules;
  32. /******/
  33. /******/ // expose the module cache
  34. /******/ __webpack_require__.c = installedModules;
  35. /******/
  36. /******/ // define getter function for harmony exports
  37. /******/ __webpack_require__.d = function(exports, name, getter) {
  38. /******/ if(!__webpack_require__.o(exports, name)) {
  39. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  40. /******/ }
  41. /******/ };
  42. /******/
  43. /******/ // define __esModule on exports
  44. /******/ __webpack_require__.r = function(exports) {
  45. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  46. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  47. /******/ }
  48. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  49. /******/ };
  50. /******/
  51. /******/ // create a fake namespace object
  52. /******/ // mode & 1: value is a module id, require it
  53. /******/ // mode & 2: merge all properties of value into the ns
  54. /******/ // mode & 4: return value when already ns object
  55. /******/ // mode & 8|1: behave like require
  56. /******/ __webpack_require__.t = function(value, mode) {
  57. /******/ if(mode & 1) value = __webpack_require__(value);
  58. /******/ if(mode & 8) return value;
  59. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  60. /******/ var ns = Object.create(null);
  61. /******/ __webpack_require__.r(ns);
  62. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  63. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  64. /******/ return ns;
  65. /******/ };
  66. /******/
  67. /******/ // getDefaultExport function for compatibility with non-harmony modules
  68. /******/ __webpack_require__.n = function(module) {
  69. /******/ var getter = module && module.__esModule ?
  70. /******/ function getDefault() { return module['default']; } :
  71. /******/ function getModuleExports() { return module; };
  72. /******/ __webpack_require__.d(getter, 'a', getter);
  73. /******/ return getter;
  74. /******/ };
  75. /******/
  76. /******/ // Object.prototype.hasOwnProperty.call
  77. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  78. /******/
  79. /******/ // __webpack_public_path__
  80. /******/ __webpack_require__.p = "";
  81. /******/
  82. /******/
  83. /******/ // Load entry module and return exports
  84. /******/ return __webpack_require__(__webpack_require__.s = 160);
  85. /******/ })
  86. /************************************************************************/
  87. /******/ ({
  88. /***/ 0:
  89. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90. "use strict";
  91. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return classify; });
  92. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return camelize; });
  93. /* unused harmony export kebabize */
  94. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return getComponentDisplayName; });
  95. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return inDoc; });
  96. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return UNDEFINED; });
  97. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return INFINITY; });
  98. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return NEGATIVE_INFINITY; });
  99. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return NAN; });
  100. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return SPECIAL_TOKENS; });
  101. /* unused harmony export MAX_STRING_SIZE */
  102. /* unused harmony export MAX_ARRAY_SIZE */
  103. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return specialTokenToString; });
  104. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return stringify; });
  105. /* unused harmony export getCustomMapDetails */
  106. /* unused harmony export reviveMap */
  107. /* unused harmony export getCustomSetDetails */
  108. /* unused harmony export reviveSet */
  109. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return getComponentName; });
  110. /* unused harmony export getCustomComponentDefinitionDetails */
  111. /* unused harmony export getCustomFunctionDetails */
  112. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return getCustomRefDetails; });
  113. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return parse; });
  114. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return isPlainObject; });
  115. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return searchDeepInObject; });
  116. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "w", function() { return sortByKey; });
  117. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return set; });
  118. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return get; });
  119. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return has; });
  120. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return scrollIntoView; });
  121. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return focusInput; });
  122. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return openInEditor; });
  123. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return escape; });
  124. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return copyToClipboard; });
  125. /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22);
  126. /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
  127. /* harmony import */ var _transfer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15);
  128. /* harmony import */ var src_backend__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(14);
  129. /* harmony import */ var src_backend_vuex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12);
  130. /* harmony import */ var src_backend_router__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13);
  131. /* harmony import */ var src_shared_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4);
  132. /* harmony import */ var _devtools_env__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2);
  133. function cached (fn) {
  134. var cache = Object.create(null)
  135. return function cachedFn (str) {
  136. var hit = cache[str]
  137. return hit || (cache[str] = fn(str))
  138. }
  139. }
  140. var classifyRE = /(?:^|[-_/])(\w)/g
  141. var classify = cached((str) => {
  142. return str && str.replace(classifyRE, toUpper)
  143. })
  144. var camelizeRE = /-(\w)/g
  145. var camelize = cached((str) => {
  146. return str.replace(camelizeRE, toUpper)
  147. })
  148. var kebabizeRE = /([a-z0-9])([A-Z])/g
  149. var kebabize = cached((str) => {
  150. return str && str
  151. .replace(kebabizeRE, (_, lowerCaseCharacter, upperCaseLetter) => {
  152. return `${lowerCaseCharacter}-${upperCaseLetter}`
  153. })
  154. .toLowerCase()
  155. })
  156. function toUpper (_, c) {
  157. return c ? c.toUpperCase() : ''
  158. }
  159. function getComponentDisplayName (originalName, style = 'class') {
  160. switch (style) {
  161. case 'class':
  162. return classify(originalName)
  163. case 'kebab':
  164. return kebabize(originalName)
  165. case 'original':
  166. default:
  167. return originalName
  168. }
  169. }
  170. function inDoc (node) {
  171. if (!node) { return false }
  172. var doc = node.ownerDocument.documentElement
  173. var parent = node.parentNode
  174. return doc === node ||
  175. doc === parent ||
  176. !!(parent && parent.nodeType === 1 && (doc.contains(parent)))
  177. }
  178. /**
  179. * Stringify/parse data using CircularJSON.
  180. */
  181. var UNDEFINED = '__vue_devtool_undefined__'
  182. var INFINITY = '__vue_devtool_infinity__'
  183. var NEGATIVE_INFINITY = '__vue_devtool_negative_infinity__'
  184. var NAN = '__vue_devtool_nan__'
  185. var SPECIAL_TOKENS = {
  186. 'true': true,
  187. 'false': false,
  188. 'undefined': UNDEFINED,
  189. 'null': null,
  190. '-Infinity': NEGATIVE_INFINITY,
  191. 'Infinity': INFINITY,
  192. 'NaN': NAN
  193. }
  194. var MAX_STRING_SIZE = 10000
  195. var MAX_ARRAY_SIZE = 5000
  196. function specialTokenToString (value) {
  197. if (value === null) {
  198. return 'null'
  199. } else if (value === UNDEFINED) {
  200. return 'undefined'
  201. } else if (value === NAN) {
  202. return 'NaN'
  203. } else if (value === INFINITY) {
  204. return 'Infinity'
  205. } else if (value === NEGATIVE_INFINITY) {
  206. return '-Infinity'
  207. }
  208. return false
  209. }
  210. /**
  211. * Needed to prevent stack overflow
  212. * while replacing complex objects
  213. * like components because we create
  214. * new objects with the CustomValue API
  215. * (.i.e `{ _custom: { ... } }`)
  216. */
  217. class EncodeCache {
  218. constructor () {
  219. this.map = new Map()
  220. }
  221. /**
  222. * Returns a result unique to each input data
  223. * @param {*} data Input data
  224. * @param {*} factory Function used to create the unique result
  225. */
  226. cache (data, factory) {
  227. var cached = this.map.get(data)
  228. if (cached) {
  229. return cached
  230. } else {
  231. var result = factory(data)
  232. this.map.set(data, result)
  233. return result
  234. }
  235. }
  236. clear () {
  237. this.map.clear()
  238. }
  239. }
  240. var encodeCache = new EncodeCache()
  241. function stringify (data) {
  242. // Create a fresh cache for each serialization
  243. encodeCache.clear()
  244. return _transfer__WEBPACK_IMPORTED_MODULE_1__[/* stringify */ "b"](data, replacer)
  245. }
  246. function replacer (key) {
  247. var val = this[key]
  248. var type = typeof val
  249. if (Array.isArray(val)) {
  250. var l = val.length
  251. if (l > MAX_ARRAY_SIZE) {
  252. return {
  253. _isArray: true,
  254. length: l,
  255. items: val.slice(0, MAX_ARRAY_SIZE)
  256. }
  257. }
  258. return val
  259. } else if (typeof val === 'string') {
  260. if (val.length > MAX_STRING_SIZE) {
  261. return val.substr(0, MAX_STRING_SIZE) + `... (${(val.length)} total length)`
  262. } else {
  263. return val
  264. }
  265. } else if (type === 'undefined') {
  266. return UNDEFINED
  267. } else if (val === Infinity) {
  268. return INFINITY
  269. } else if (val === -Infinity) {
  270. return NEGATIVE_INFINITY
  271. } else if (type === 'function') {
  272. return getCustomFunctionDetails(val)
  273. } else if (type === 'symbol') {
  274. return `[native Symbol ${Symbol.prototype.toString.call(val)}]`
  275. } else if (val !== null && type === 'object') {
  276. var proto = Object.prototype.toString.call(val)
  277. if (proto === '[object Map]') {
  278. return encodeCache.cache(val, () => getCustomMapDetails(val))
  279. } else if (proto === '[object Set]') {
  280. return encodeCache.cache(val, () => getCustomSetDetails(val))
  281. } else if (proto === '[object RegExp]') {
  282. // special handling of native type
  283. return `[native RegExp ${RegExp.prototype.toString.call(val)}]`
  284. } else if (proto === '[object Date]') {
  285. return `[native Date ${Date.prototype.toString.call(val)}]`
  286. } else if (val.state && val._vm) {
  287. return encodeCache.cache(val, () => Object(src_backend_vuex__WEBPACK_IMPORTED_MODULE_3__[/* getCustomStoreDetails */ "a"])(val))
  288. } else if (val.constructor && val.constructor.name === 'VueRouter') {
  289. return encodeCache.cache(val, () => Object(src_backend_router__WEBPACK_IMPORTED_MODULE_4__[/* getCustomRouterDetails */ "a"])(val))
  290. } else if (val._isVue) {
  291. return encodeCache.cache(val, () => Object(src_backend__WEBPACK_IMPORTED_MODULE_2__[/* getCustomInstanceDetails */ "a"])(val))
  292. } else if (typeof val.render === 'function') {
  293. return encodeCache.cache(val, () => getCustomComponentDefinitionDetails(val))
  294. } else if (val.constructor && val.constructor.name === 'VNode') {
  295. return `[native VNode <${val.tag}>]`
  296. }
  297. } else if (Number.isNaN(val)) {
  298. return NAN
  299. }
  300. return sanitize(val)
  301. }
  302. function getCustomMapDetails (val) {
  303. var list = []
  304. val.forEach(
  305. (value, key) => list.push({
  306. key,
  307. value
  308. })
  309. )
  310. return {
  311. _custom: {
  312. type: 'map',
  313. display: 'Map',
  314. value: list,
  315. readOnly: true,
  316. fields: {
  317. abstract: true
  318. }
  319. }
  320. }
  321. }
  322. function reviveMap (val) {
  323. var result = new Map()
  324. var list = val._custom.value
  325. for (var i = 0; i < list.length; i++) {
  326. var { key, value } = list[i]
  327. result.set(key, reviver(null, value))
  328. }
  329. return result
  330. }
  331. function getCustomSetDetails (val) {
  332. var list = Array.from(val)
  333. return {
  334. _custom: {
  335. type: 'set',
  336. display: `Set[${list.length}]`,
  337. value: list,
  338. readOnly: true
  339. }
  340. }
  341. }
  342. function reviveSet (val) {
  343. var result = new Set()
  344. var list = val._custom.value
  345. for (var i = 0; i < list.length; i++) {
  346. var value = list[i]
  347. result.add(reviver(null, value))
  348. }
  349. return result
  350. }
  351. // Use a custom basename functions instead of the shimed version
  352. // because it doesn't work on Windows
  353. function basename (filename, ext) {
  354. return path__WEBPACK_IMPORTED_MODULE_0___default.a.basename(
  355. filename.replace(/^[a-zA-Z]:/, '').replace(/\\/g, '/'),
  356. ext
  357. )
  358. }
  359. function getComponentName (options) {
  360. var name = options.name || options._componentTag
  361. if (name) {
  362. return name
  363. }
  364. var file = options.__file // injected by vue-loader
  365. if (file) {
  366. return classify(basename(file, '.vue'))
  367. }
  368. }
  369. function getCustomComponentDefinitionDetails (def) {
  370. var display = getComponentName(def)
  371. if (display) {
  372. if (def.name && def.__file) {
  373. display += ` <span>(${def.__file})</span>`
  374. }
  375. } else {
  376. display = '<i>Unknown Component</i>'
  377. }
  378. return {
  379. _custom: Object.assign({}, {type: 'component-definition',
  380. display,
  381. tooltip: 'Component definition'},
  382. def.__file ? {
  383. file: def.__file
  384. } : {})
  385. }
  386. }
  387. function getCustomFunctionDetails (func) {
  388. var string = ''
  389. var matches = null
  390. try {
  391. string = Function.prototype.toString.call(func)
  392. matches = String.prototype.match.call(string, /\([\s\S]*?\)/)
  393. } catch (e) {
  394. // Func is probably a Proxy, which can break Function.prototype.toString()
  395. }
  396. // Trim any excess whitespace from the argument string
  397. var match = matches && matches[0]
  398. var args = typeof match === 'string'
  399. ? `(${match.substr(1, match.length - 2).split(',').map(a => a.trim()).join(', ')})` : '(?)'
  400. var name = typeof func.name === 'string' ? func.name : ''
  401. return {
  402. _custom: {
  403. type: 'function',
  404. display: `<span>ƒ</span> ${escape(name)}${args}`
  405. }
  406. }
  407. }
  408. function getCustomRefDetails (instance, key, ref) {
  409. var value
  410. if (Array.isArray(ref)) {
  411. value = ref.map((r) => getCustomRefDetails(instance, key, r)).map(data => data.value)
  412. } else {
  413. var name
  414. if (ref._isVue) {
  415. name = getComponentName(ref.$options)
  416. } else {
  417. name = ref.tagName.toLowerCase()
  418. }
  419. value = {
  420. _custom: {
  421. display: `&lt;${name}` +
  422. (ref.id ? ` <span class="attr-title">id</span>="${ref.id}"` : '') +
  423. (ref.className ? ` <span class="attr-title">class</span>="${ref.className}"` : '') + '&gt;',
  424. uid: instance.__VUE_DEVTOOLS_UID__,
  425. type: 'reference'
  426. }
  427. }
  428. }
  429. return {
  430. type: '$refs',
  431. key: key,
  432. value,
  433. editable: false
  434. }
  435. }
  436. function parse (data, revive) {
  437. return revive
  438. ? _transfer__WEBPACK_IMPORTED_MODULE_1__[/* parse */ "a"](data, reviver)
  439. : _transfer__WEBPACK_IMPORTED_MODULE_1__[/* parse */ "a"](data)
  440. }
  441. var specialTypeRE = /^\[native (\w+) (.*)\]$/
  442. var symbolRE = /^\[native Symbol Symbol\((.*)\)\]$/
  443. function reviver (key, val) {
  444. if (val === UNDEFINED) {
  445. return undefined
  446. } else if (val === INFINITY) {
  447. return Infinity
  448. } else if (val === NEGATIVE_INFINITY) {
  449. return -Infinity
  450. } else if (val === NAN) {
  451. return NaN
  452. } else if (val && val._custom) {
  453. if (val._custom.type === 'component') {
  454. return src_backend__WEBPACK_IMPORTED_MODULE_2__[/* instanceMap */ "d"].get(val._custom.id)
  455. } else if (val._custom.type === 'map') {
  456. return reviveMap(val)
  457. } else if (val._custom.type === 'set') {
  458. return reviveSet(val)
  459. }
  460. } else if (symbolRE.test(val)) {
  461. var [, string] = symbolRE.exec(val)
  462. return Symbol.for(string)
  463. } else if (specialTypeRE.test(val)) {
  464. var [, type, string$1] = specialTypeRE.exec(val)
  465. return new window[type](string$1)
  466. } else {
  467. return val
  468. }
  469. }
  470. /**
  471. * Sanitize data to be posted to the other side.
  472. * Since the message posted is sent with structured clone,
  473. * we need to filter out any types that might cause an error.
  474. *
  475. * @param {*} data
  476. * @return {*}
  477. */
  478. function sanitize (data) {
  479. if (
  480. !isPrimitive(data) &&
  481. !Array.isArray(data) &&
  482. !isPlainObject(data)
  483. ) {
  484. // handle types that will probably cause issues in
  485. // the structured clone
  486. return Object.prototype.toString.call(data)
  487. } else {
  488. return data
  489. }
  490. }
  491. function isPlainObject (obj) {
  492. return Object.prototype.toString.call(obj) === '[object Object]'
  493. }
  494. function isPrimitive (data) {
  495. if (data == null) {
  496. return true
  497. }
  498. var type = typeof data
  499. return (
  500. type === 'string' ||
  501. type === 'number' ||
  502. type === 'boolean'
  503. )
  504. }
  505. /**
  506. * Searches a key or value in the object, with a maximum deepness
  507. * @param {*} obj Search target
  508. * @param {string} searchTerm Search string
  509. * @returns {boolean} Search match
  510. */
  511. function searchDeepInObject (obj, searchTerm) {
  512. var seen = new Map()
  513. var result = internalSearchObject(obj, searchTerm.toLowerCase(), seen, 0)
  514. seen.clear()
  515. return result
  516. }
  517. var SEARCH_MAX_DEPTH = 10
  518. /**
  519. * Executes a search on each field of the provided object
  520. * @param {*} obj Search target
  521. * @param {string} searchTerm Search string
  522. * @param {Map<any,boolean>} seen Map containing the search result to prevent stack overflow by walking on the same object multiple times
  523. * @param {number} depth Deep search depth level, which is capped to prevent performance issues
  524. * @returns {boolean} Search match
  525. */
  526. function internalSearchObject (obj, searchTerm, seen, depth) {
  527. if (depth > SEARCH_MAX_DEPTH) {
  528. return false
  529. }
  530. var match = false
  531. var keys = Object.keys(obj)
  532. var key, value
  533. for (var i = 0; i < keys.length; i++) {
  534. key = keys[i]
  535. value = obj[key]
  536. match = internalSearchCheck(searchTerm, key, value, seen, depth + 1)
  537. if (match) {
  538. break
  539. }
  540. }
  541. return match
  542. }
  543. /**
  544. * Executes a search on each value of the provided array
  545. * @param {*} array Search target
  546. * @param {string} searchTerm Search string
  547. * @param {Map<any,boolean>} seen Map containing the search result to prevent stack overflow by walking on the same object multiple times
  548. * @param {number} depth Deep search depth level, which is capped to prevent performance issues
  549. * @returns {boolean} Search match
  550. */
  551. function internalSearchArray (array, searchTerm, seen, depth) {
  552. if (depth > SEARCH_MAX_DEPTH) {
  553. return false
  554. }
  555. var match = false
  556. var value
  557. for (var i = 0; i < array.length; i++) {
  558. value = array[i]
  559. match = internalSearchCheck(searchTerm, null, value, seen, depth + 1)
  560. if (match) {
  561. break
  562. }
  563. }
  564. return match
  565. }
  566. /**
  567. * Checks if the provided field matches the search terms
  568. * @param {string} searchTerm Search string
  569. * @param {string} key Field key (null if from array)
  570. * @param {*} value Field value
  571. * @param {Map<any,boolean>} seen Map containing the search result to prevent stack overflow by walking on the same object multiple times
  572. * @param {number} depth Deep search depth level, which is capped to prevent performance issues
  573. * @returns {boolean} Search match
  574. */
  575. function internalSearchCheck (searchTerm, key, value, seen, depth) {
  576. var match = false
  577. var result
  578. if (key === '_custom') {
  579. key = value.display
  580. value = value.value
  581. }
  582. (result = specialTokenToString(value)) && (value = result)
  583. if (key && compare(key, searchTerm)) {
  584. match = true
  585. seen.set(value, true)
  586. } else if (seen.has(value)) {
  587. match = seen.get(value)
  588. } else if (Array.isArray(value)) {
  589. seen.set(value, null)
  590. match = internalSearchArray(value, searchTerm, seen, depth)
  591. seen.set(value, match)
  592. } else if (isPlainObject(value)) {
  593. seen.set(value, null)
  594. match = internalSearchObject(value, searchTerm, seen, depth)
  595. seen.set(value, match)
  596. } else if (compare(value, searchTerm)) {
  597. match = true
  598. seen.set(value, true)
  599. }
  600. return match
  601. }
  602. /**
  603. * Compares two values
  604. * @param {*} value Mixed type value that will be cast to string
  605. * @param {string} searchTerm Search string
  606. * @returns {boolean} Search match
  607. */
  608. function compare (value, searchTerm) {
  609. return ('' + value).toLowerCase().indexOf(searchTerm) !== -1
  610. }
  611. function sortByKey (state) {
  612. return state && state.slice().sort((a, b) => {
  613. if (a.key < b.key) { return -1 }
  614. if (a.key > b.key) { return 1 }
  615. return 0
  616. })
  617. }
  618. function set (object, path, value, cb = null) {
  619. var sections = Array.isArray(path) ? path : path.split('.')
  620. while (sections.length > 1) {
  621. object = object[sections.shift()]
  622. }
  623. var field = sections[0]
  624. if (cb) {
  625. cb(object, field, value)
  626. } else {
  627. object[field] = value
  628. }
  629. }
  630. function get (object, path) {
  631. var sections = Array.isArray(path) ? path : path.split('.')
  632. for (var i = 0; i < sections.length; i++) {
  633. object = object[sections[i]]
  634. if (!object) {
  635. return undefined
  636. }
  637. }
  638. return object
  639. }
  640. function has (object, path, parent = false) {
  641. if (typeof object === 'undefined') {
  642. return false
  643. }
  644. var sections = Array.isArray(path) ? path : path.split('.')
  645. var size = !parent ? 1 : 2
  646. while (object && sections.length > size) {
  647. object = object[sections.shift()]
  648. }
  649. return object != null && object.hasOwnProperty(sections[0])
  650. }
  651. function scrollIntoView (scrollParent, el, center = true) {
  652. var parentTop = scrollParent.scrollTop
  653. var parentHeight = scrollParent.offsetHeight
  654. var elBounds = el.getBoundingClientRect()
  655. var parentBounds = scrollParent.getBoundingClientRect()
  656. var top = elBounds.top - parentBounds.top + scrollParent.scrollTop
  657. var height = el.offsetHeight
  658. if (center) {
  659. scrollParent.scrollTop = top + (height - parentHeight) / 2
  660. } else if (top < parentTop) {
  661. scrollParent.scrollTop = top
  662. } else if (top + height > parentTop + parentHeight) {
  663. scrollParent.scrollTop = top - parentHeight + height
  664. }
  665. }
  666. function focusInput (el) {
  667. el.focus()
  668. el.setSelectionRange(0, el.value.length)
  669. }
  670. function openInEditor (file) {
  671. // Console display
  672. var fileName = file.replace(/\\/g, '\\\\')
  673. var src = `fetch('${src_shared_data__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"].openInEditorHost}__open-in-editor?file=${encodeURI(file)}').then(response => {
  674. if (response.ok) {
  675. console.log('File ${fileName} opened in editor')
  676. } else {
  677. const msg = 'Opening component ${fileName} failed'
  678. const target = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {}
  679. if (target.__VUE_DEVTOOLS_TOAST__) {
  680. target.__VUE_DEVTOOLS_TOAST__(msg, 'error')
  681. } else {
  682. console.log('%c' + msg, 'color:red')
  683. }
  684. console.log('Check the setup of your project, see https://github.com/vuejs/vue-devtools/blob/master/docs/open-in-editor.md')
  685. }
  686. })`
  687. if (_devtools_env__WEBPACK_IMPORTED_MODULE_6__[/* isChrome */ "c"]) {
  688. chrome.devtools.inspectedWindow.eval(src)
  689. } else {
  690. // eslint-disable-next-line no-eval
  691. eval(src)
  692. }
  693. }
  694. var ESC = {
  695. '<': '&lt;',
  696. '>': '&gt;',
  697. '"': '&quot;',
  698. '&': '&amp;'
  699. }
  700. function escape (s) {
  701. return s.replace(/[<>"&]/g, escapeChar)
  702. }
  703. function escapeChar (a) {
  704. return ESC[a] || a
  705. }
  706. function copyToClipboard (state) {
  707. if (typeof document === 'undefined') { return }
  708. var dummyTextArea = document.createElement('textarea')
  709. dummyTextArea.textContent = stringify(state)
  710. document.body.appendChild(dummyTextArea)
  711. dummyTextArea.select()
  712. document.execCommand('copy')
  713. document.body.removeChild(dummyTextArea)
  714. }
  715. /***/ }),
  716. /***/ 10:
  717. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  718. "use strict";
  719. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return init; });
  720. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return get; });
  721. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return set; });
  722. /* unused harmony export remove */
  723. /* unused harmony export clear */
  724. // If we can, we use the browser extension API to store data
  725. // it's async though, so we synchronize changes from an intermediate
  726. // storageData object
  727. var useStorage = typeof chrome !== 'undefined' && typeof chrome.storage !== 'undefined'
  728. var storageData = null
  729. function init () {
  730. return new Promise((resolve) => {
  731. if (useStorage) {
  732. chrome.storage.local.get(null, result => {
  733. storageData = result
  734. resolve()
  735. })
  736. } else {
  737. storageData = {}
  738. resolve()
  739. }
  740. })
  741. }
  742. function get (key, defaultValue = null) {
  743. checkStorage()
  744. if (useStorage) {
  745. return getDefaultValue(storageData[key], defaultValue)
  746. } else {
  747. try {
  748. return getDefaultValue(JSON.parse(localStorage.getItem(key)), defaultValue)
  749. } catch (e) {}
  750. }
  751. }
  752. function set (key, val) {
  753. checkStorage()
  754. if (useStorage) {
  755. storageData[key] = val
  756. chrome.storage.local.set({ [key]: val })
  757. } else {
  758. try {
  759. localStorage.setItem(key, JSON.stringify(val))
  760. } catch (e) {}
  761. }
  762. }
  763. function remove (key) {
  764. checkStorage()
  765. if (useStorage) {
  766. delete storageData[key]
  767. chrome.storage.local.remove([key])
  768. } else {
  769. try {
  770. localStorage.removeItem(key)
  771. } catch (e) {}
  772. }
  773. }
  774. function clear () {
  775. checkStorage()
  776. if (useStorage) {
  777. storageData = {}
  778. chrome.storage.local.clear()
  779. } else {
  780. try {
  781. localStorage.clear()
  782. } catch (e) {}
  783. }
  784. }
  785. function checkStorage () {
  786. if (!storageData) {
  787. throw new Error(`Storage wasn't initialized with 'init()'`)
  788. }
  789. }
  790. function getDefaultValue (value, defaultValue) {
  791. if (value == null) {
  792. return defaultValue
  793. }
  794. return value
  795. }
  796. /***/ }),
  797. /***/ 12:
  798. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  799. "use strict";
  800. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return initVuexBackend; });
  801. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getCustomStoreDetails; });
  802. /* harmony import */ var src_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
  803. /* harmony import */ var src_shared_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
  804. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5);
  805. /* harmony import */ var _clone__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6);
  806. var isProd = "production" === 'production'
  807. class VuexBackend {
  808. constructor (hook, bridge, isLegacy) {
  809. bridge.send('vuex:init')
  810. this.hook = hook
  811. this.bridge = bridge
  812. this.isLegacy = isLegacy
  813. this.store = hook.store
  814. // Flush info from hook
  815. // (for example, modules registered before backend was created)
  816. this.earlyModules = hook.flushStoreModules()
  817. /** Initial store state */
  818. this.initialState = this.hook.initialState
  819. /** Internal store vm for mutation replaying */
  820. this.snapshotsVm = null
  821. /** Initial snapshot */
  822. this.baseStateSnapshot = null
  823. /** Snapshot cache */
  824. this.stateSnapshotCache = null
  825. /** Mutation history */
  826. this.mutations = null
  827. /** Last replayed state */
  828. this.lastState = null
  829. /** Currently registered dynamic modules */
  830. this.registeredModules = {}
  831. /** All dynamic modules ever registered, useful for mutation replaying */
  832. this.allTimeModules = {}
  833. /** Legacy base state */
  834. this.legacyBaseSnapshot = null
  835. // First-time snapshot VM creation
  836. this.resetSnapshotsVm()
  837. // Initial setup
  838. this.reset()
  839. // Override dynamic module handling in vuex
  840. if (this.store.registerModule) {
  841. this.origRegisterModule = this.store.registerModule.bind(this.store)
  842. this.store.registerModule = (path, module, options) => {
  843. this.addModule(path, module, options)
  844. this.origRegisterModule(path, module, options)
  845. if (!isProd) { console.log('register module', path) }
  846. }
  847. this.origUnregisterModule = this.store.unregisterModule.bind(this.store)
  848. this.store.unregisterModule = (path) => {
  849. this.removeModule(path)
  850. this.origUnregisterModule(path)
  851. if (!isProd) { console.log('unregister module', path) }
  852. }
  853. } else {
  854. this.origRegisterModule = this.origUnregisterModule = () => {}
  855. }
  856. // Register modules that were added before backend was created
  857. this.earlyModules.forEach((ref) => {
  858. var path = ref.path;
  859. var module = ref.module;
  860. var options = ref.options;
  861. var moduleInfo = this.addModule(path, module, options)
  862. moduleInfo.early = true
  863. })
  864. // deal with multiple backend injections
  865. hook.off('vuex:mutation')
  866. // application -> devtool
  867. hook.on('vuex:mutation', this.onMutation.bind(this))
  868. // devtool -> application
  869. bridge.on('vuex:travel-to-state', this.onTravelToState.bind(this))
  870. bridge.on('vuex:commit-all', this.onCommitAll.bind(this))
  871. bridge.on('vuex:revert-all', this.onRevertAll.bind(this))
  872. bridge.on('vuex:commit', this.onCommit.bind(this))
  873. bridge.on('vuex:revert', this.onRevert.bind(this))
  874. bridge.on('vuex:import-state', this.onImportState.bind(this))
  875. bridge.on('vuex:inspect-state', this.onInspectState.bind(this))
  876. bridge.on('vuex:edit-state', this.onEditState.bind(this))
  877. }
  878. /**
  879. * Register a mutation record
  880. */
  881. onMutation (ref) {
  882. var type = ref.type;
  883. var payload = ref.payload;
  884. if (!src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].recordVuex) { return }
  885. this.addMutation(type, payload)
  886. }
  887. /**
  888. * Time-travel to the state of a specific mutation (by index)
  889. */
  890. onTravelToState (ref) {
  891. var index = ref.index;
  892. var apply = ref.apply;
  893. var snapshot = this.replayMutations(index)
  894. var state = Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(this.lastState)
  895. this.bridge.send('vuex:inspected-state', {
  896. index,
  897. snapshot
  898. })
  899. if (apply) {
  900. this.ensureRegisteredModules(this.mutations[index])
  901. this.hook.emit('vuex:travel-to-state', state)
  902. }
  903. }
  904. onCommitAll () {
  905. this.reset(this.lastState)
  906. }
  907. onRevertAll () {
  908. this.reset()
  909. }
  910. /**
  911. * Reset the base state to a specific mutation (by index)
  912. *
  913. * ⚠️ State should be time-traveled to before executing this
  914. */
  915. onCommit (index) {
  916. if (src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].vuexNewBackend) {
  917. this.baseStateSnapshot = this.lastState
  918. } else {
  919. this.legacyBaseSnapshot = this.mutations[index].snapshot
  920. }
  921. this.resetSnapshotCache()
  922. this.mutations = this.mutations.slice(index + 1)
  923. this.mutations.forEach((mutation, index) => {
  924. mutation.index = index
  925. })
  926. }
  927. /**
  928. * Removes mutations after a specific mutation (by index)
  929. *
  930. * ⚠️ State should be time-traveled to before executing this
  931. */
  932. onRevert (index) {
  933. this.resetSnapshotCache()
  934. this.ensureRegisteredModules(this.mutations[index - 1])
  935. this.mutations = this.mutations.slice(0, index)
  936. }
  937. /**
  938. * Parse and time-travel to a state
  939. */
  940. onImportState (state) {
  941. var parsed = Object(src_util__WEBPACK_IMPORTED_MODULE_0__[/* parse */ "s"])(state, true)
  942. this.initialState = parsed
  943. this.hook.emit('vuex:travel-to-state', parsed)
  944. this.reset()
  945. this.bridge.send('vuex:init')
  946. this.onInspectState(-1)
  947. }
  948. /**
  949. * If the index is -1, sends the base state.
  950. * Else replays the mutations up to the <index> mutation.
  951. */
  952. onInspectState (index) {
  953. var snapshot = this.replayMutations(index)
  954. this.bridge.send('vuex:inspected-state', {
  955. index,
  956. snapshot
  957. })
  958. }
  959. onEditState (ref) {
  960. var index = ref.index;
  961. var value = ref.value;
  962. var path = ref.path;
  963. var parsedValue
  964. if (value) {
  965. parsedValue = Object(src_util__WEBPACK_IMPORTED_MODULE_0__[/* parse */ "s"])(value, true)
  966. }
  967. this.store._committing = true
  968. Object(src_util__WEBPACK_IMPORTED_MODULE_0__[/* set */ "v"])(this.store.state, path, parsedValue)
  969. this.store._committing = false
  970. this.bridge.send('vuex:inspected-state', {
  971. index,
  972. snapshot: this.getStoreSnapshot()
  973. })
  974. this.cacheStateSnapshot(index, true)
  975. }
  976. /**
  977. * Should be called when store structure changes,
  978. * for example when a dynamic module is registered
  979. */
  980. resetSnapshotsVm (state) {
  981. this.snapshotsVm = new vue__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"]({
  982. data: {
  983. $$state: state || {}
  984. },
  985. computed: this.store._vm.$options.computed
  986. })
  987. }
  988. /**
  989. * Reset vuex backend
  990. */
  991. reset (stateSnapshot = null) {
  992. if (src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].vuexNewBackend) {
  993. this.baseStateSnapshot = stateSnapshot || Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(this.initialState)
  994. } else {
  995. this.legacyBaseSnapshot = this.stringifyStore()
  996. }
  997. this.mutations = []
  998. this.resetSnapshotCache()
  999. }
  1000. resetSnapshotCache () {
  1001. this.stateSnapshotCache = [
  1002. {
  1003. index: -1,
  1004. state: this.baseStateSnapshot,
  1005. permanent: true
  1006. }
  1007. ]
  1008. }
  1009. /**
  1010. * Handle adding a dynamic store module
  1011. */
  1012. addModule (path, module, options) {
  1013. if (typeof path === 'string') { path = [path] }
  1014. var state
  1015. if (options && options.preserveState) {
  1016. state = Object(src_util__WEBPACK_IMPORTED_MODULE_0__[/* get */ "k"])(this.store.state, path)
  1017. }
  1018. if (!state) {
  1019. state = typeof module.state === 'function' ? module.state() : module.state
  1020. }
  1021. if (!state) {
  1022. state = {}
  1023. }
  1024. var fakeModule = Object.assign({}, module)
  1025. if (src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].vuexNewBackend) {
  1026. // Ensure all children state are cloned
  1027. var replaceNestedStates = (nestedModule) => {
  1028. if (nestedModule.modules) {
  1029. Object.keys(nestedModule.modules).forEach(key => {
  1030. var child = nestedModule.modules[key]
  1031. var state = {}
  1032. if (child.state) {
  1033. state = typeof child.state === 'function' ? child.state() : child.state
  1034. }
  1035. child.state = Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(state)
  1036. replaceNestedStates(child)
  1037. })
  1038. }
  1039. }
  1040. replaceNestedStates(fakeModule)
  1041. }
  1042. var key = path.join('/')
  1043. var moduleInfo = this.registeredModules[key] = this.allTimeModules[key] = {
  1044. path,
  1045. module: fakeModule,
  1046. options: Object.assign({}, options,
  1047. {preserveState: false}),
  1048. state: src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].vuexNewBackend ? Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(state) : null
  1049. }
  1050. if (src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].recordVuex) {
  1051. this.addMutation(`Register module: ${key}`, {
  1052. path,
  1053. module,
  1054. options
  1055. }, {
  1056. registerModule: true
  1057. })
  1058. }
  1059. return moduleInfo
  1060. }
  1061. /**
  1062. * Handle removing a dynamic store module
  1063. */
  1064. removeModule (path) {
  1065. if (typeof path === 'string') { path = [path] }
  1066. delete this.registeredModules[path.join('/')]
  1067. if (src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].recordVuex) {
  1068. this.addMutation(`Unregister module: ${path.join('/')}`, {
  1069. path
  1070. }, {
  1071. unregisterModule: true
  1072. })
  1073. }
  1074. }
  1075. /**
  1076. * Make sure all (and only) the dynamic modules present at the moment of a mutation
  1077. * are correctly registered in the store
  1078. */
  1079. ensureRegisteredModules (mutation) {
  1080. if (mutation) {
  1081. mutation.registeredModules.forEach(m => {
  1082. if (!Object.keys(this.registeredModules).sort((a, b) => a.length - b.length).includes(m)) {
  1083. var data = this.allTimeModules[m]
  1084. if (data) {
  1085. var { path, module, options, state } = data
  1086. this.origRegisterModule(path, Object.assign({}, module,
  1087. {state: Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(state)}), options)
  1088. this.registeredModules[path.join('/')] = data
  1089. }
  1090. }
  1091. })
  1092. Object.keys(this.registeredModules).sort((a, b) => b.length - a.length).forEach(m => {
  1093. if (!mutation.registeredModules.includes(m)) {
  1094. this.origUnregisterModule(m.split('/'))
  1095. delete this.registeredModules[m]
  1096. }
  1097. })
  1098. this.resetSnapshotsVm(this.store.state)
  1099. }
  1100. }
  1101. /**
  1102. * Check if the store as a specific dynamic module
  1103. */
  1104. hasModule (path) {
  1105. return !!this.store._modules.get(path)
  1106. }
  1107. stringifyStore () {
  1108. return Object(src_util__WEBPACK_IMPORTED_MODULE_0__[/* stringify */ "y"])({
  1109. state: this.store.state,
  1110. getters: this.store.getters || {}
  1111. })
  1112. }
  1113. /**
  1114. * Handle a new mutation commited to the store
  1115. */
  1116. addMutation (type, payload, options = {}) {
  1117. var index = this.mutations.length
  1118. if (!src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].vuexNewBackend) {
  1119. options.snapshot = this.stringifyStore()
  1120. }
  1121. this.mutations.push(Object.assign({}, {type,
  1122. payload: src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].vuexNewBackend ? Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(payload) : null,
  1123. index,
  1124. handlers: this.store._mutations[type],
  1125. registeredModules: Object.keys(this.registeredModules)},
  1126. options))
  1127. this.bridge.send('vuex:mutation', {
  1128. mutation: {
  1129. type: type,
  1130. payload: Object(src_util__WEBPACK_IMPORTED_MODULE_0__[/* stringify */ "y"])(payload),
  1131. index
  1132. },
  1133. timestamp: Date.now(),
  1134. options
  1135. })
  1136. }
  1137. /**
  1138. * Replays mutations from the base state up to a specific index
  1139. * to re-create what the vuex state should be at this point
  1140. */
  1141. replayMutations (index) {
  1142. if (!src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].vuexNewBackend) {
  1143. var snapshot = index === -1 ? this.legacyBaseSnapshot : this.mutations[index].snapshot
  1144. this.lastState = Object(src_util__WEBPACK_IMPORTED_MODULE_0__[/* parse */ "s"])(snapshot, true).state
  1145. return snapshot
  1146. }
  1147. var originalVm = this.store._vm
  1148. var originalState = Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(this.store.state)
  1149. this.store._vm = this.snapshotsVm
  1150. var tempRemovedModules = []
  1151. var tempAddedModules = []
  1152. // If base state, we need to remove all dynamic registered modules
  1153. // to prevent errors because their state is missing
  1154. if (index === -1) {
  1155. tempRemovedModules = Object.keys(this.registeredModules)
  1156. tempRemovedModules.filter(m => this.hasModule(m.split('/'))).sort((a, b) => b.length - a.length).forEach(m => {
  1157. this.origUnregisterModule(m.split('/'))
  1158. if (!isProd) { console.log('before replay unregister', m) }
  1159. })
  1160. }
  1161. // Get most recent snapshot for target index
  1162. // for faster replay
  1163. var stateSnapshot
  1164. for (var i = 0; i < this.stateSnapshotCache.length; i++) {
  1165. var s = this.stateSnapshotCache[i]
  1166. if (s.index > index) {
  1167. break
  1168. } else {
  1169. stateSnapshot = s
  1170. }
  1171. }
  1172. var resultState
  1173. // Snapshot was already replayed
  1174. if (stateSnapshot.index === index) {
  1175. resultState = stateSnapshot.state
  1176. var state = Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(stateSnapshot.state)
  1177. this.resetSnapshotsVm(state)
  1178. this.store.replaceState(state)
  1179. } else {
  1180. // Update state when using fake vm to properly temporarily remove modules
  1181. this.resetSnapshotsVm(originalState)
  1182. this.store.replaceState(originalState)
  1183. // Temporarily remove modules if they where not present during first mutation being replayed
  1184. var startMutation = this.mutations[stateSnapshot.index]
  1185. if (startMutation) {
  1186. tempRemovedModules = Object.keys(this.registeredModules).filter(m => !startMutation.registeredModules.includes(m))
  1187. } else {
  1188. tempRemovedModules = Object.keys(this.registeredModules)
  1189. }
  1190. tempRemovedModules.filter(m => this.hasModule(m.split('/'))).sort((a, b) => b.length - a.length).forEach(m => {
  1191. this.origUnregisterModule(m.split('/'))
  1192. if (!isProd) { console.log('before replay unregister', m) }
  1193. })
  1194. var state$1 = Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(stateSnapshot.state)
  1195. this.resetSnapshotsVm(state$1)
  1196. this.store.replaceState(state$1)
  1197. src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].snapshotLoading = true
  1198. // Replay mutations
  1199. for (var i$1 = stateSnapshot.index + 1; i$1 <= index; i$1++) {
  1200. var mutation = this.mutations[i$1]
  1201. if (mutation.registerModule) {
  1202. var key = mutation.payload.path.join('/')
  1203. var moduleInfo = this.allTimeModules[key]
  1204. tempAddedModules.push(key)
  1205. this.origRegisterModule(moduleInfo.path, Object.assign({}, moduleInfo.module,
  1206. {state: Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(moduleInfo.state)}), moduleInfo.options)
  1207. this.resetSnapshotsVm(this.store.state)
  1208. if (!isProd) { console.log('replay register module', moduleInfo) }
  1209. } else if (mutation.unregisterModule && this.hasModule(mutation.payload.path)) {
  1210. var path = mutation.payload.path
  1211. var index$1 = tempAddedModules.indexOf(path.join('/'))
  1212. if (index$1 !== -1) { tempAddedModules.splice(index$1, 1) }
  1213. this.origUnregisterModule(path)
  1214. this.resetSnapshotsVm(this.store.state)
  1215. if (!isProd) { console.log('replay unregister module', path) }
  1216. } else if (mutation.handlers) {
  1217. this.store._committing = true
  1218. try {
  1219. var payload = mutation.payload
  1220. if (this.isLegacy && !Array.isArray(payload)) {
  1221. payload = [payload]
  1222. }
  1223. if (Array.isArray(mutation.handlers)) {
  1224. if (this.isLegacy) {
  1225. mutation.handlers.forEach(handler => handler(this.store.state, ...payload))
  1226. } else {
  1227. mutation.handlers.forEach(handler => handler(payload))
  1228. }
  1229. } else {
  1230. if (this.isLegacy) {
  1231. mutation.handlers(this.store.state, ...payload)
  1232. } else {
  1233. mutation.handlers(payload)
  1234. }
  1235. }
  1236. } catch (e) {
  1237. throw e
  1238. }
  1239. this.store._committing = false
  1240. }
  1241. // Optimization: periodically cache snapshots
  1242. if (i$1 === index || (i$1 % src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].cacheVuexSnapshotsEvery === 0)) {
  1243. this.cacheStateSnapshot(i$1)
  1244. }
  1245. }
  1246. // Send final state after replay
  1247. resultState = Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(this.store.state)
  1248. if (!isProd) { console.log(`replayed ${index - stateSnapshot.index} mutation(s)`) }
  1249. }
  1250. this.lastState = resultState
  1251. var result = this.stringifyStore()
  1252. // Restore user state
  1253. tempAddedModules.sort((a, b) => b.length - a.length).forEach(m => {
  1254. this.origUnregisterModule(m.split('/'))
  1255. if (!isProd) { console.log('after replay unregister', m) }
  1256. })
  1257. tempRemovedModules.sort((a, b) => a.length - b.length).forEach(m => {
  1258. var { path, module, options, state } = this.registeredModules[m]
  1259. this.origRegisterModule(path, Object.assign({}, module,
  1260. {state: Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(state)}), options)
  1261. if (!isProd) { console.log('after replay register', m) }
  1262. })
  1263. this.store._vm = originalVm
  1264. return result
  1265. }
  1266. cacheStateSnapshot (index, permanent = false) {
  1267. this.removeCachedStateSnapshot(index)
  1268. this.stateSnapshotCache.push({
  1269. index,
  1270. state: Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(this.store.state),
  1271. permanent
  1272. })
  1273. if (!isProd) { console.log('cached snapshot', index) }
  1274. // Delete old cached snapshots
  1275. if (this.stateSnapshotCache.filter(s => !s.permanent).length > src_shared_data__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].cacheVuexSnapshotsLimit) {
  1276. var i = this.stateSnapshotCache.findIndex(s => !s.permanent)
  1277. if (i !== -1) {
  1278. if (!isProd) { console.log('clean cached snapshot', this.stateSnapshotCache[i].index) }
  1279. this.stateSnapshotCache.splice(i, 1)
  1280. }
  1281. }
  1282. }
  1283. removeCachedStateSnapshot (index) {
  1284. var i = this.stateSnapshotCache.findIndex(s => s.idex === index)
  1285. if (i !== -1) { this.stateSnapshotCache.splice(i, 1) }
  1286. }
  1287. /**
  1288. * Get the serialized state and getters from the store
  1289. */
  1290. getStoreSnapshot (stateSnapshot = null) {
  1291. var originalVm
  1292. if (stateSnapshot) {
  1293. originalVm = this.store._vm
  1294. this.store._vm = this.snapshotsVm
  1295. this.store.replaceState(Object(_clone__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(stateSnapshot))
  1296. }
  1297. var result = Object(src_util__WEBPACK_IMPORTED_MODULE_0__[/* stringify */ "y"])({
  1298. state: this.store.state,
  1299. getters: this.store.getters || {}
  1300. })
  1301. if (stateSnapshot) {
  1302. // Restore user state
  1303. this.store._vm = originalVm
  1304. }
  1305. return result
  1306. }
  1307. }
  1308. function initVuexBackend (hook, bridge, isLegacy) {
  1309. // eslint-disable-next-line no-new
  1310. new VuexBackend(hook, bridge, isLegacy)
  1311. }
  1312. function getCustomStoreDetails (store) {
  1313. return {
  1314. _custom: {
  1315. type: 'store',
  1316. display: 'Store',
  1317. value: {
  1318. state: store.state,
  1319. getters: store.getters
  1320. },
  1321. fields: {
  1322. abstract: true
  1323. }
  1324. }
  1325. }
  1326. }
  1327. /***/ }),
  1328. /***/ 13:
  1329. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1330. "use strict";
  1331. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return initRouterBackend; });
  1332. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getCustomRouterDetails; });
  1333. /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
  1334. function initRouterBackend (Vue, bridge, rootInstances) {
  1335. var recording = true
  1336. var getSnapshot = () => {
  1337. var routeChanges = []
  1338. rootInstances.forEach(instance => {
  1339. var router = instance._router
  1340. if (router && router.options && router.options.routes) {
  1341. routeChanges.push(...router.options.routes)
  1342. }
  1343. })
  1344. return Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* stringify */ "y"])({
  1345. routeChanges
  1346. })
  1347. }
  1348. bridge.send('routes:init', getSnapshot())
  1349. bridge.on('router:toggle-recording', enabled => {
  1350. recording = enabled
  1351. })
  1352. rootInstances.forEach(instance => {
  1353. var router = instance._router
  1354. if (router) {
  1355. router.afterEach((to, from) => {
  1356. if (!recording) { return }
  1357. bridge.send('router:changed', Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* stringify */ "y"])({
  1358. to,
  1359. from,
  1360. timestamp: Date.now()
  1361. }))
  1362. })
  1363. bridge.send('router:init', Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* stringify */ "y"])({
  1364. mode: router.mode,
  1365. current: {
  1366. from: router.history.current,
  1367. to: router.history.current,
  1368. timestamp: Date.now()
  1369. }
  1370. }))
  1371. if (router.matcher && router.matcher.addRoutes) {
  1372. var addRoutes = router.matcher.addRoutes
  1373. router.matcher.addRoutes = function (routes) {
  1374. routes.forEach((item) => {
  1375. bridge.send('routes:changed', Object(_util__WEBPACK_IMPORTED_MODULE_0__[/* stringify */ "y"])(item))
  1376. })
  1377. addRoutes.call(this, routes)
  1378. }
  1379. }
  1380. }
  1381. })
  1382. }
  1383. function getCustomRouterDetails (router) {
  1384. return {
  1385. _custom: {
  1386. type: 'router',
  1387. display: 'VueRouter',
  1388. value: {
  1389. options: router.options,
  1390. currentRoute: router.currentRoute
  1391. },
  1392. fields: {
  1393. abstract: true
  1394. }
  1395. }
  1396. }
  1397. }
  1398. /***/ }),
  1399. /***/ 14:
  1400. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1401. "use strict";
  1402. // EXPORTS
  1403. __webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ backend_instanceMap; });
  1404. __webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ initBackend; });
  1405. __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ getCustomInstanceDetails; });
  1406. __webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ getInstanceName; });
  1407. // UNUSED EXPORTS: functionalVnodeMap, findInstanceOrVnode, reduceStateList, toast, inspectInstance
  1408. // EXTERNAL MODULE: D:/devtools-5.1.1/src/util.js
  1409. var util = __webpack_require__(0);
  1410. // EXTERNAL MODULE: D:/devtools-5.1.1/src/shared-data.js
  1411. var shared_data = __webpack_require__(4);
  1412. // EXTERNAL MODULE: D:/devtools-5.1.1/src/devtools/env.js
  1413. var env = __webpack_require__(2);
  1414. // CONCATENATED MODULE: D:/devtools-5.1.1/src/backend/highlighter.js
  1415. var overlay
  1416. var overlayContent
  1417. function init () {
  1418. if (overlay || !env["b" /* isBrowser */]) { return }
  1419. overlay = document.createElement('div')
  1420. overlay.style.backgroundColor = 'rgba(104, 182, 255, 0.35)'
  1421. overlay.style.position = 'fixed'
  1422. overlay.style.zIndex = '99999999999999'
  1423. overlay.style.pointerEvents = 'none'
  1424. overlay.style.display = 'flex'
  1425. overlay.style.alignItems = 'center'
  1426. overlay.style.justifyContent = 'center'
  1427. overlay.style.borderRadius = '3px'
  1428. overlayContent = document.createElement('div')
  1429. overlayContent.style.backgroundColor = 'rgba(104, 182, 255, 0.9)'
  1430. overlayContent.style.fontFamily = 'monospace'
  1431. overlayContent.style.fontSize = '11px'
  1432. overlayContent.style.padding = '2px 3px'
  1433. overlayContent.style.borderRadius = '3px'
  1434. overlayContent.style.color = 'white'
  1435. overlay.appendChild(overlayContent)
  1436. }
  1437. /**
  1438. * Highlight an instance.
  1439. *
  1440. * @param {Vue} instance
  1441. */
  1442. function highlight (instance) {
  1443. if (!instance) { return }
  1444. var rect = getInstanceOrVnodeRect(instance)
  1445. if (!env["b" /* isBrowser */]) {
  1446. // TODO: Highlight rect area.
  1447. return
  1448. }
  1449. init()
  1450. if (rect) {
  1451. var content = []
  1452. var name = instance.fnContext ? Object(util["m" /* getComponentName */])(instance.fnOptions) : getInstanceName(instance)
  1453. name = Object(util["l" /* getComponentDisplayName */])(name, shared_data["a" /* default */].componentNameStyle)
  1454. if (name) {
  1455. var pre = document.createElement('span')
  1456. pre.style.opacity = '0.6'
  1457. pre.innerText = '<'
  1458. var text = document.createTextNode(name)
  1459. var post = document.createElement('span')
  1460. post.style.opacity = '0.6'
  1461. post.innerText = '>'
  1462. content.push(pre, text, post)
  1463. }
  1464. showOverlay(rect, content)
  1465. }
  1466. }
  1467. /**
  1468. * Remove highlight overlay.
  1469. */
  1470. function unHighlight () {
  1471. if (overlay && overlay.parentNode) {
  1472. document.body.removeChild(overlay)
  1473. }
  1474. }
  1475. /**
  1476. * Get the client rect for an instance.
  1477. *
  1478. * @param {Vue|Vnode} instance
  1479. * @return {Object}
  1480. */
  1481. function getInstanceOrVnodeRect (instance) {
  1482. var el = instance.$el || instance.elm
  1483. if (!env["b" /* isBrowser */]) {
  1484. // TODO: Find position from instance or a vnode (for functional components).
  1485. return
  1486. }
  1487. if (!Object(util["p" /* inDoc */])(el)) {
  1488. return
  1489. }
  1490. if (instance._isFragment) {
  1491. return getFragmentRect(instance)
  1492. } else if (el.nodeType === 1) {
  1493. return el.getBoundingClientRect()
  1494. }
  1495. }
  1496. /**
  1497. * Highlight a fragment instance.
  1498. * Loop over its node range and determine its bounding box.
  1499. *
  1500. * @param {Vue} instance
  1501. * @return {Object}
  1502. */
  1503. function getFragmentRect (ref) {
  1504. var _fragmentStart = ref._fragmentStart;
  1505. var _fragmentEnd = ref._fragmentEnd;
  1506. var top, bottom, left, right
  1507. highlighter_util().mapNodeRange(_fragmentStart, _fragmentEnd, function (node) {
  1508. var rect
  1509. if (node.nodeType === 1 || node.getBoundingClientRect) {
  1510. rect = node.getBoundingClientRect()
  1511. } else if (node.nodeType === 3 && node.data.trim()) {
  1512. rect = getTextRect(node)
  1513. }
  1514. if (rect) {
  1515. if (!top || rect.top < top) {
  1516. top = rect.top
  1517. }
  1518. if (!bottom || rect.bottom > bottom) {
  1519. bottom = rect.bottom
  1520. }
  1521. if (!left || rect.left < left) {
  1522. left = rect.left
  1523. }
  1524. if (!right || rect.right > right) {
  1525. right = rect.right
  1526. }
  1527. }
  1528. })
  1529. return {
  1530. top,
  1531. left,
  1532. width: right - left,
  1533. height: bottom - top
  1534. }
  1535. }
  1536. var range
  1537. /**
  1538. * Get the bounding rect for a text node using a Range.
  1539. *
  1540. * @param {Text} node
  1541. * @return {Rect}
  1542. */
  1543. function getTextRect (node) {
  1544. if (!env["b" /* isBrowser */]) { return }
  1545. if (!range) { range = document.createRange() }
  1546. range.selectNode(node)
  1547. return range.getBoundingClientRect()
  1548. }
  1549. /**
  1550. * Display the overlay with given rect.
  1551. *
  1552. * @param {Rect}
  1553. */
  1554. function showOverlay (ref, content = []) {
  1555. var width = ref.width; if ( width === void 0 ) width = 0;
  1556. var height = ref.height; if ( height === void 0 ) height = 0;
  1557. var top = ref.top; if ( top === void 0 ) top = 0;
  1558. var left = ref.left; if ( left === void 0 ) left = 0;
  1559. if (!env["b" /* isBrowser */]) { return }
  1560. overlay.style.width = ~~width + 'px'
  1561. overlay.style.height = ~~height + 'px'
  1562. overlay.style.top = ~~top + 'px'
  1563. overlay.style.left = ~~left + 'px'
  1564. overlayContent.innerHTML = ''
  1565. content.forEach(child => overlayContent.appendChild(child))
  1566. document.body.appendChild(overlay)
  1567. }
  1568. /**
  1569. * Get Vue's util
  1570. */
  1571. function highlighter_util () {
  1572. return env["f" /* target */].__VUE_DEVTOOLS_GLOBAL_HOOK__.Vue.util
  1573. }
  1574. // EXTERNAL MODULE: D:/devtools-5.1.1/src/backend/vuex.js
  1575. var vuex = __webpack_require__(12);
  1576. // CONCATENATED MODULE: D:/devtools-5.1.1/src/backend/events.js
  1577. var internalRE = /^(?:pre-)?hook:/
  1578. function initEventsBackend (Vue, bridge) {
  1579. var recording = true
  1580. bridge.send('events:reset')
  1581. bridge.on('events:toggle-recording', enabled => {
  1582. recording = enabled
  1583. })
  1584. function logEvent (vm, type, eventName, payload) {
  1585. // The string check is important for compat with 1.x where the first
  1586. // argument may be an object instead of a string.
  1587. // this also ensures the event is only logged for direct $emit (source)
  1588. // instead of by $dispatch/$broadcast
  1589. if (typeof eventName === 'string' && !internalRE.test(eventName)) {
  1590. bridge.send('event:triggered', Object(util["y" /* stringify */])({
  1591. eventName,
  1592. type,
  1593. payload,
  1594. instanceId: vm._uid,
  1595. instanceName: getInstanceName(vm._self || vm),
  1596. timestamp: Date.now()
  1597. }))
  1598. }
  1599. }
  1600. function wrap (method) {
  1601. var original = Vue.prototype[method]
  1602. if (original) {
  1603. Vue.prototype[method] = function (...args) {
  1604. var res = original.apply(this, args)
  1605. if (recording) {
  1606. logEvent(this, method, args[0], args.slice(1))
  1607. }
  1608. return res
  1609. }
  1610. }
  1611. }
  1612. wrap('$emit')
  1613. wrap('$broadcast')
  1614. wrap('$dispatch')
  1615. }
  1616. // EXTERNAL MODULE: D:/devtools-5.1.1/src/backend/router.js
  1617. var router = __webpack_require__(13);
  1618. // CONCATENATED MODULE: D:/devtools-5.1.1/src/backend/perf.js
  1619. var COMPONENT_HOOKS = [
  1620. 'beforeCreate',
  1621. 'created',
  1622. 'beforeMount',
  1623. 'mounted',
  1624. 'beforeUpdate',
  1625. 'updated',
  1626. 'beforeDestroyed',
  1627. 'destroyed'
  1628. ]
  1629. var RENDER_HOOKS = {
  1630. beforeMount: { after: 'mountRender' },
  1631. mounted: { before: 'mountRender' },
  1632. beforeUpdate: { after: 'updateRender' },
  1633. updated: { before: 'updateRender' }
  1634. }
  1635. var perf_frames = 0
  1636. var frameTime
  1637. var secondsTimer
  1638. var perf_bridge
  1639. var componentMetrics
  1640. function initPerfBackend (Vue, _bridge, instanceMap) {
  1641. perf_bridge = _bridge
  1642. // Global mixin
  1643. Vue.mixin({
  1644. beforeCreate () {
  1645. applyHooks(this)
  1646. }
  1647. })
  1648. // Apply to existing components
  1649. instanceMap.forEach(applyHooks)
  1650. Object(shared_data["d" /* watch */])('recordPerf', value => {
  1651. if (value) {
  1652. startRecording()
  1653. } else {
  1654. stopRecording()
  1655. }
  1656. })
  1657. }
  1658. function startRecording () {
  1659. perf_frames = 0
  1660. frameTime = performance.now()
  1661. secondsTimer = setInterval(frameInterval, 500)
  1662. componentMetrics = {}
  1663. requestAnimationFrame(perf_frame)
  1664. }
  1665. function stopRecording () {
  1666. clearInterval(secondsTimer)
  1667. }
  1668. function perf_frame () {
  1669. perf_frames++
  1670. if (shared_data["a" /* default */].recordPerf) {
  1671. requestAnimationFrame(perf_frame)
  1672. }
  1673. }
  1674. function frameInterval () {
  1675. var metric = {
  1676. type: 'fps',
  1677. time: Date.now(),
  1678. start: frameTime,
  1679. end: frameTime = performance.now()
  1680. }
  1681. metric.value = Math.round(perf_frames / (metric.end - metric.start) * 1000)
  1682. perf_frames = 0
  1683. perf_bridge.send('perf:add-metric', metric)
  1684. }
  1685. function applyHooks (vm) {
  1686. if (vm.$options.$_devtoolsPerfHooks) { return }
  1687. vm.$options.$_devtoolsPerfHooks = true
  1688. var renderMetrics = {}
  1689. COMPONENT_HOOKS.forEach(hook => {
  1690. var renderHook = RENDER_HOOKS[hook]
  1691. var handler = function () {
  1692. if (shared_data["a" /* default */].recordPerf) {
  1693. // Before
  1694. var time = performance.now()
  1695. if (renderHook && renderHook.before) {
  1696. // Render hook ends before one hook
  1697. var metric = renderMetrics[renderHook.before]
  1698. if (metric) {
  1699. metric.end = time
  1700. addComponentMetric(vm.$options, renderHook.before, metric.start, metric.end)
  1701. }
  1702. }
  1703. // After
  1704. this.$once(`hook:${hook}`, () => {
  1705. var newTime = performance.now()
  1706. addComponentMetric(vm.$options, hook, time, newTime)
  1707. if (renderHook && renderHook.after) {
  1708. // Render hook starts after one hook
  1709. renderMetrics[renderHook.after] = {
  1710. start: newTime,
  1711. end: 0
  1712. }
  1713. }
  1714. })
  1715. }
  1716. }
  1717. var currentValue = vm.$options[hook]
  1718. if (Array.isArray(currentValue)) {
  1719. vm.$options[hook] = [handler, ...currentValue]
  1720. } else if (typeof currentValue === 'function') {
  1721. vm.$options[hook] = [handler, currentValue]
  1722. } else {
  1723. vm.$options[hook] = [handler]
  1724. }
  1725. })
  1726. }
  1727. function addComponentMetric (options, type, start, end) {
  1728. var duration = end - start
  1729. var name = Object(util["m" /* getComponentName */])(options)
  1730. var metric = componentMetrics[name] = componentMetrics[name] || {
  1731. id: name,
  1732. hooks: {},
  1733. totalTime: 0
  1734. }
  1735. var hook = metric.hooks[type] = metric.hooks[type] || {
  1736. count: 0,
  1737. totalTime: 0
  1738. }
  1739. hook.count++
  1740. hook.totalTime += duration
  1741. metric.totalTime += duration
  1742. perf_bridge.send('perf:upsert-metric', { type: 'componentRender', data: metric })
  1743. }
  1744. // CONCATENATED MODULE: D:/devtools-5.1.1/src/backend/utils.js
  1745. function findRelatedComponent (el) {
  1746. while (!el.__vue__ && el.parentElement) {
  1747. el = el.parentElement
  1748. }
  1749. return el.__vue__
  1750. }
  1751. // CONCATENATED MODULE: D:/devtools-5.1.1/src/backend/component-selector.js
  1752. class component_selector_ComponentSelector {
  1753. constructor (bridge, instanceMap) {
  1754. var self = this
  1755. self.bridge = bridge
  1756. self.instanceMap = instanceMap
  1757. self.bindMethods()
  1758. bridge.on('start-component-selector', self.startSelecting)
  1759. bridge.on('stop-component-selector', self.stopSelecting)
  1760. }
  1761. /**
  1762. * Adds event listeners for mouseover and mouseup
  1763. */
  1764. startSelecting () {
  1765. if (!env["b" /* isBrowser */]) { return }
  1766. window.addEventListener('mouseover', this.elementMouseOver, true)
  1767. window.addEventListener('click', this.elementClicked, true)
  1768. window.addEventListener('mouseout', this.cancelEvent, true)
  1769. window.addEventListener('mouseenter', this.cancelEvent, true)
  1770. window.addEventListener('mouseleave', this.cancelEvent, true)
  1771. window.addEventListener('mousedown', this.cancelEvent, true)
  1772. window.addEventListener('mouseup', this.cancelEvent, true)
  1773. }
  1774. /**
  1775. * Removes event listeners
  1776. */
  1777. stopSelecting () {
  1778. if (!env["b" /* isBrowser */]) { return }
  1779. window.removeEventListener('mouseover', this.elementMouseOver, true)
  1780. window.removeEventListener('click', this.elementClicked, true)
  1781. window.removeEventListener('mouseout', this.cancelEvent, true)
  1782. window.removeEventListener('mouseenter', this.cancelEvent, true)
  1783. window.removeEventListener('mouseleave', this.cancelEvent, true)
  1784. window.removeEventListener('mousedown', this.cancelEvent, true)
  1785. window.removeEventListener('mouseup', this.cancelEvent, true)
  1786. unHighlight()
  1787. }
  1788. /**
  1789. * Highlights a component on element mouse over
  1790. * @param {MouseEvent} e
  1791. */
  1792. elementMouseOver (e) {
  1793. this.cancelEvent(e)
  1794. var el = e.target
  1795. if (el) {
  1796. this.selectedInstance = findRelatedComponent(el)
  1797. }
  1798. unHighlight()
  1799. if (this.selectedInstance) {
  1800. highlight(this.selectedInstance)
  1801. }
  1802. }
  1803. /**
  1804. * Selects an instance in the component view
  1805. * @param {MouseEvent} e
  1806. */
  1807. elementClicked (e) {
  1808. this.cancelEvent(e)
  1809. if (this.selectedInstance) {
  1810. this.bridge.send('inspect-instance', this.selectedInstance.__VUE_DEVTOOLS_UID__)
  1811. } else {
  1812. this.bridge.send('stop-component-selector')
  1813. }
  1814. this.stopSelecting()
  1815. }
  1816. /**
  1817. * Cancel a mouse event
  1818. * @param {MouseEvent} e
  1819. */
  1820. cancelEvent (e) {
  1821. e.stopImmediatePropagation()
  1822. e.preventDefault()
  1823. }
  1824. /**
  1825. * Bind class methods to the class scope to avoid rebind for event listeners
  1826. */
  1827. bindMethods () {
  1828. this.startSelecting = this.startSelecting.bind(this)
  1829. this.stopSelecting = this.stopSelecting.bind(this)
  1830. this.elementMouseOver = this.elementMouseOver.bind(this)
  1831. this.elementClicked = this.elementClicked.bind(this)
  1832. }
  1833. }
  1834. // EXTERNAL MODULE: D:/devtools-5.1.1/src/storage.js
  1835. var storage = __webpack_require__(10);
  1836. // CONCATENATED MODULE: D:/devtools-5.1.1/src/backend/index.js
  1837. // This is the backend that is injected into the page that a Vue app lives in
  1838. // when the Vue Devtools panel is activated.
  1839. // hook should have been injected before this executes.
  1840. var backend_hook = env["f" /* target */].__VUE_DEVTOOLS_GLOBAL_HOOK__
  1841. var rootInstances = []
  1842. var propModes = ['default', 'sync', 'once']
  1843. var backend_instanceMap = env["f" /* target */].__VUE_DEVTOOLS_INSTANCE_MAP__ = new Map()
  1844. var functionalVnodeMap = env["f" /* target */].__VUE_DEVTOOLS_FUNCTIONAL_VNODE_MAP__ = new Map()
  1845. var consoleBoundInstances = Array(5)
  1846. var currentInspectedId
  1847. var backend_bridge
  1848. var filter = ''
  1849. var captureCount = 0
  1850. var isLegacy = false
  1851. var rootUID = 0
  1852. var functionalIds = new Map()
  1853. // Dedupe instances
  1854. // Some instances may be both on a component and on a child abstract/functional component
  1855. var captureIds = new Map()
  1856. function initBackend (_bridge) {
  1857. backend_bridge = _bridge
  1858. if (backend_hook.Vue) {
  1859. isLegacy = backend_hook.Vue.version && backend_hook.Vue.version.split('.')[0] === '1'
  1860. connect(backend_hook.Vue)
  1861. } else {
  1862. backend_hook.once('init', connect)
  1863. }
  1864. initRightClick()
  1865. }
  1866. function connect (Vue) {
  1867. Object(storage["b" /* init */])().then(() => {
  1868. Object(shared_data["c" /* init */])({
  1869. bridge: backend_bridge,
  1870. Vue
  1871. })
  1872. backend_hook.currentTab = 'components'
  1873. backend_bridge.on('switch-tab', tab => {
  1874. backend_hook.currentTab = tab
  1875. if (tab === 'components') {
  1876. flush()
  1877. }
  1878. })
  1879. // the backend may get injected to the same page multiple times
  1880. // if the user closes and reopens the devtools.
  1881. // make sure there's only one flush listener.
  1882. backend_hook.off('flush')
  1883. backend_hook.on('flush', () => {
  1884. if (backend_hook.currentTab === 'components') {
  1885. flush()
  1886. }
  1887. })
  1888. backend_bridge.on('select-instance', id => {
  1889. currentInspectedId = id
  1890. var instance = findInstanceOrVnode(id)
  1891. if (!instance) { return }
  1892. if (!/:functional:/.test(id)) { bindToConsole(instance) }
  1893. flush()
  1894. backend_bridge.send('instance-selected')
  1895. })
  1896. backend_bridge.on('scroll-to-instance', id => {
  1897. var instance = findInstanceOrVnode(id)
  1898. if (instance) {
  1899. scrollIntoView(instance)
  1900. highlight(instance)
  1901. }
  1902. })
  1903. backend_bridge.on('filter-instances', _filter => {
  1904. filter = _filter.toLowerCase()
  1905. flush()
  1906. })
  1907. backend_bridge.on('refresh', scan)
  1908. backend_bridge.on('enter-instance', id => {
  1909. var instance = findInstanceOrVnode(id)
  1910. if (instance) { highlight(instance) }
  1911. })
  1912. backend_bridge.on('leave-instance', unHighlight)
  1913. // eslint-disable-next-line no-new
  1914. new component_selector_ComponentSelector(backend_bridge, backend_instanceMap)
  1915. // Get the instance id that is targeted by context menu
  1916. backend_bridge.on('get-context-menu-target', () => {
  1917. var instance = env["f" /* target */].__VUE_DEVTOOLS_CONTEXT_MENU_TARGET__
  1918. env["f" /* target */].__VUE_DEVTOOLS_CONTEXT_MENU_TARGET__ = null
  1919. env["f" /* target */].__VUE_DEVTOOLS_CONTEXT_MENU_HAS_TARGET__ = false
  1920. if (instance) {
  1921. var id = instance.__VUE_DEVTOOLS_UID__
  1922. if (id) {
  1923. return backend_bridge.send('inspect-instance', id)
  1924. }
  1925. }
  1926. toast('No Vue component was found', 'warn')
  1927. })
  1928. backend_bridge.on('set-instance-data', args => {
  1929. setStateValue(args)
  1930. flush()
  1931. })
  1932. // vuex
  1933. if (backend_hook.store) {
  1934. Object(vuex["b" /* initVuexBackend */])(backend_hook, backend_bridge, backend_hook.store.commit === undefined)
  1935. } else {
  1936. backend_hook.once('vuex:init', store => {
  1937. Object(vuex["b" /* initVuexBackend */])(backend_hook, backend_bridge, store.commit === undefined)
  1938. })
  1939. }
  1940. backend_hook.once('router:init', () => {
  1941. Object(router["b" /* initRouterBackend */])(backend_hook.Vue, backend_bridge, rootInstances)
  1942. })
  1943. // events
  1944. initEventsBackend(Vue, backend_bridge)
  1945. env["f" /* target */].__VUE_DEVTOOLS_INSPECT__ = inspectInstance
  1946. // User project devtools config
  1947. if (env["f" /* target */].hasOwnProperty('VUE_DEVTOOLS_CONFIG')) {
  1948. var config = env["f" /* target */].VUE_DEVTOOLS_CONFIG
  1949. // Open in editor
  1950. if (config.hasOwnProperty('openInEditorHost')) {
  1951. shared_data["a" /* default */].openInEditorHost = config.openInEditorHost
  1952. }
  1953. }
  1954. backend_bridge.log('backend ready.')
  1955. backend_bridge.send('ready', Vue.version)
  1956. backend_bridge.on('log-detected-vue', () => {
  1957. console.log(
  1958. `%c vue-devtools %c Detected Vue v${Vue.version} %c`,
  1959. 'background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff',
  1960. 'background:#41b883 ; padding: 1px; border-radius: 0 3px 3px 0; color: #fff',
  1961. 'background:transparent'
  1962. )
  1963. })
  1964. setTimeout(() => {
  1965. scan()
  1966. // perf
  1967. initPerfBackend(Vue, backend_bridge, backend_instanceMap)
  1968. }, 0)
  1969. })
  1970. }
  1971. function findInstanceOrVnode (id) {
  1972. if (/:functional:/.test(id)) {
  1973. var [refId] = id.split(':functional:')
  1974. var map = functionalVnodeMap.get(refId)
  1975. return map && map[id]
  1976. }
  1977. return backend_instanceMap.get(id)
  1978. }
  1979. /**
  1980. * Scan the page for root level Vue instances.
  1981. */
  1982. function scan () {
  1983. rootInstances.length = 0
  1984. var inFragment = false
  1985. var currentFragment = null
  1986. function processInstance (instance) {
  1987. if (instance) {
  1988. if (rootInstances.indexOf(instance.$root) === -1) {
  1989. instance = instance.$root
  1990. }
  1991. if (instance._isFragment) {
  1992. inFragment = true
  1993. currentFragment = instance
  1994. }
  1995. // respect Vue.config.devtools option
  1996. var baseVue = instance.constructor
  1997. while (baseVue.super) {
  1998. baseVue = baseVue.super
  1999. }
  2000. if (baseVue.config && baseVue.config.devtools) {
  2001. // give a unique id to root instance so we can
  2002. // 'namespace' its children
  2003. if (typeof instance.__VUE_DEVTOOLS_ROOT_UID__ === 'undefined') {
  2004. instance.__VUE_DEVTOOLS_ROOT_UID__ = ++rootUID
  2005. }
  2006. rootInstances.push(instance)
  2007. }
  2008. return true
  2009. }
  2010. }
  2011. if (env["b" /* isBrowser */]) {
  2012. walk(document, function (node) {
  2013. if (inFragment) {
  2014. if (node === currentFragment._fragmentEnd) {
  2015. inFragment = false
  2016. currentFragment = null
  2017. }
  2018. return true
  2019. }
  2020. var instance = node.__vue__
  2021. return processInstance(instance)
  2022. })
  2023. } else {
  2024. if (Array.isArray(env["f" /* target */].__VUE_ROOT_INSTANCES__)) {
  2025. env["f" /* target */].__VUE_ROOT_INSTANCES__.map(processInstance)
  2026. }
  2027. }
  2028. backend_hook.emit('router:init')
  2029. flush()
  2030. }
  2031. /**
  2032. * DOM walk helper
  2033. *
  2034. * @param {NodeList} nodes
  2035. * @param {Function} fn
  2036. */
  2037. function walk (node, fn) {
  2038. if (node.childNodes) {
  2039. for (var i = 0, l = node.childNodes.length; i < l; i++) {
  2040. var child = node.childNodes[i]
  2041. var stop = fn(child)
  2042. if (!stop) {
  2043. walk(child, fn)
  2044. }
  2045. }
  2046. }
  2047. // also walk shadow DOM
  2048. if (node.shadowRoot) {
  2049. walk(node.shadowRoot, fn)
  2050. }
  2051. }
  2052. /**
  2053. * Called on every Vue.js batcher flush cycle.
  2054. * Capture current component tree structure and the state
  2055. * of the current inspected instance (if present) and
  2056. * send it to the devtools.
  2057. */
  2058. function flush () {
  2059. var start
  2060. functionalIds.clear()
  2061. captureIds.clear()
  2062. if (false) {}
  2063. var payload = Object(util["y" /* stringify */])({
  2064. inspectedInstance: getInstanceDetails(currentInspectedId),
  2065. instances: findQualifiedChildrenFromList(rootInstances)
  2066. })
  2067. if (false) {}
  2068. backend_bridge.send('flush', payload)
  2069. }
  2070. /**
  2071. * Iterate through an array of instances and flatten it into
  2072. * an array of qualified instances. This is a depth-first
  2073. * traversal - e.g. if an instance is not matched, we will
  2074. * recursively go deeper until a qualified child is found.
  2075. *
  2076. * @param {Array} instances
  2077. * @return {Array}
  2078. */
  2079. function findQualifiedChildrenFromList (instances) {
  2080. instances = instances
  2081. .filter(child => !child._isBeingDestroyed)
  2082. return !filter
  2083. ? instances.map(capture)
  2084. : Array.prototype.concat.apply([], instances.map(findQualifiedChildren))
  2085. }
  2086. /**
  2087. * Find qualified children from a single instance.
  2088. * If the instance itself is qualified, just return itself.
  2089. * This is ok because [].concat works in both cases.
  2090. *
  2091. * @param {Vue|Vnode} instance
  2092. * @return {Vue|Array}
  2093. */
  2094. function findQualifiedChildren (instance) {
  2095. return isQualified(instance)
  2096. ? capture(instance)
  2097. : findQualifiedChildrenFromList(instance.$children).concat(
  2098. instance._vnode && instance._vnode.children
  2099. // Find functional components in recursively in non-functional vnodes.
  2100. ? flatten(instance._vnode.children.filter(child => !child.componentInstance).map(captureChild))
  2101. // Filter qualified children.
  2102. .filter(instance => isQualified(instance))
  2103. : []
  2104. )
  2105. }
  2106. /**
  2107. * Check if an instance is qualified.
  2108. *
  2109. * @param {Vue|Vnode} instance
  2110. * @return {Boolean}
  2111. */
  2112. function isQualified (instance) {
  2113. var name = Object(util["g" /* classify */])(instance.name || getInstanceName(instance)).toLowerCase()
  2114. return name.indexOf(filter) > -1
  2115. }
  2116. function flatten (items) {
  2117. return items.reduce((acc, item) => {
  2118. if (item instanceof Array) { acc.push(...flatten(item)) }
  2119. else if (item) { acc.push(item) }
  2120. return acc
  2121. }, [])
  2122. }
  2123. function captureChild (child) {
  2124. if (child.fnContext && !child.componentInstance) {
  2125. return capture(child)
  2126. } else if (child.componentInstance) {
  2127. if (!child.componentInstance._isBeingDestroyed) { return capture(child.componentInstance) }
  2128. } else if (child.children) {
  2129. return flatten(child.children.map(captureChild))
  2130. }
  2131. }
  2132. /**
  2133. * Capture the meta information of an instance. (recursive)
  2134. *
  2135. * @param {Vue} instance
  2136. * @return {Object}
  2137. */
  2138. function capture (instance, index, list) {
  2139. if (false) {}
  2140. if (instance.$options && instance.$options.abstract && instance._vnode && instance._vnode.componentInstance) {
  2141. instance = instance._vnode.componentInstance
  2142. }
  2143. // Functional component.
  2144. if (instance.fnContext && !instance.componentInstance) {
  2145. var contextUid = instance.fnContext.__VUE_DEVTOOLS_UID__
  2146. var id = functionalIds.get(contextUid)
  2147. if (id == null) {
  2148. id = 0
  2149. } else {
  2150. id++
  2151. }
  2152. functionalIds.set(contextUid, id)
  2153. var functionalId = contextUid + ':functional:' + id
  2154. markFunctional(functionalId, instance)
  2155. return {
  2156. id: functionalId,
  2157. functional: true,
  2158. name: getInstanceName(instance),
  2159. renderKey: getRenderKey(instance.key),
  2160. children: (instance.children ? instance.children.map(
  2161. child => child.fnContext
  2162. ? captureChild(child)
  2163. : child.componentInstance
  2164. ? capture(child.componentInstance)
  2165. : undefined
  2166. )
  2167. // router-view has both fnContext and componentInstance on vnode.
  2168. : instance.componentInstance ? [capture(instance.componentInstance)] : []).filter(Boolean),
  2169. inactive: false,
  2170. isFragment: false // TODO: Check what is it for.
  2171. }
  2172. }
  2173. // instance._uid is not reliable in devtools as there
  2174. // may be 2 roots with same _uid which causes unexpected
  2175. // behaviour
  2176. instance.__VUE_DEVTOOLS_UID__ = getUniqueId(instance)
  2177. // Dedupe
  2178. if (captureIds.has(instance.__VUE_DEVTOOLS_UID__)) {
  2179. return
  2180. } else {
  2181. captureIds.set(instance.__VUE_DEVTOOLS_UID__, undefined)
  2182. }
  2183. mark(instance)
  2184. var name = getInstanceName(instance)
  2185. var ret = {
  2186. uid: instance._uid,
  2187. id: instance.__VUE_DEVTOOLS_UID__,
  2188. name,
  2189. renderKey: getRenderKey(instance.$vnode ? instance.$vnode['key'] : null),
  2190. inactive: !!instance._inactive,
  2191. isFragment: !!instance._isFragment,
  2192. children: instance.$children
  2193. .filter(child => !child._isBeingDestroyed)
  2194. .map(capture)
  2195. .filter(Boolean)
  2196. }
  2197. if (instance._vnode && instance._vnode.children) {
  2198. ret.children = ret.children.concat(
  2199. flatten(instance._vnode.children.map(captureChild))
  2200. .filter(Boolean)
  2201. )
  2202. }
  2203. // record screen position to ensure correct ordering
  2204. if ((!list || list.length > 1) && !instance._inactive) {
  2205. var rect = getInstanceOrVnodeRect(instance)
  2206. ret.top = rect ? rect.top : Infinity
  2207. } else {
  2208. ret.top = Infinity
  2209. }
  2210. // check if instance is available in console
  2211. var consoleId = consoleBoundInstances.indexOf(instance.__VUE_DEVTOOLS_UID__)
  2212. ret.consoleId = consoleId > -1 ? '$vm' + consoleId : null
  2213. // check router view
  2214. var isRouterView2 = instance.$vnode && instance.$vnode.data.routerView
  2215. if (instance._routerView || isRouterView2) {
  2216. ret.isRouterView = true
  2217. if (!instance._inactive && instance.$route) {
  2218. var matched = instance.$route.matched
  2219. var depth = isRouterView2
  2220. ? instance.$vnode.data.routerViewDepth
  2221. : instance._routerView.depth
  2222. ret.matchedRouteSegment =
  2223. matched &&
  2224. matched[depth] &&
  2225. (isRouterView2 ? matched[depth].path : matched[depth].handler.path)
  2226. }
  2227. }
  2228. return ret
  2229. }
  2230. /**
  2231. * Mark an instance as captured and store it in the instance map.
  2232. *
  2233. * @param {Vue} instance
  2234. */
  2235. function mark (instance) {
  2236. if (!backend_instanceMap.has(instance.__VUE_DEVTOOLS_UID__)) {
  2237. backend_instanceMap.set(instance.__VUE_DEVTOOLS_UID__, instance)
  2238. instance.$on('hook:beforeDestroy', function () {
  2239. backend_instanceMap.delete(instance.__VUE_DEVTOOLS_UID__)
  2240. })
  2241. }
  2242. }
  2243. function markFunctional (id, vnode) {
  2244. var refId = vnode.fnContext.__VUE_DEVTOOLS_UID__
  2245. if (!functionalVnodeMap.has(refId)) {
  2246. functionalVnodeMap.set(refId, {})
  2247. vnode.fnContext.$on('hook:beforeDestroy', function () {
  2248. functionalVnodeMap.delete(refId)
  2249. })
  2250. }
  2251. functionalVnodeMap.get(refId)[id] = vnode
  2252. }
  2253. /**
  2254. * Get the detailed information of an inspected instance.
  2255. *
  2256. * @param {Number} id
  2257. */
  2258. function getInstanceDetails (id) {
  2259. var instance = backend_instanceMap.get(id)
  2260. if (!instance) {
  2261. var vnode = findInstanceOrVnode(id)
  2262. if (!vnode) { return {} }
  2263. var data = {
  2264. id,
  2265. name: Object(util["m" /* getComponentName */])(vnode.fnOptions),
  2266. file: vnode.fnOptions.__file || null,
  2267. state: processProps(Object.assign({}, {$options: vnode.fnOptions}, (vnode.devtoolsMeta && vnode.devtoolsMeta.renderContext.props))),
  2268. functional: true
  2269. }
  2270. return data
  2271. } else {
  2272. var data$1 = {
  2273. id: id,
  2274. name: getInstanceName(instance),
  2275. state: getInstanceState(instance)
  2276. }
  2277. var i
  2278. if ((i = instance.$vnode) && (i = i.componentOptions) && (i = i.Ctor) && (i = i.options)) {
  2279. data$1.file = i.__file || null
  2280. }
  2281. return data$1
  2282. }
  2283. }
  2284. function getInstanceState (instance) {
  2285. return processProps(instance).concat(
  2286. processState(instance),
  2287. processRefs(instance),
  2288. processComputed(instance),
  2289. processInjected(instance),
  2290. processRouteContext(instance),
  2291. processVuexGetters(instance),
  2292. processFirebaseBindings(instance),
  2293. processObservables(instance),
  2294. processAttrs(instance)
  2295. )
  2296. }
  2297. function getCustomInstanceDetails (instance) {
  2298. var state = getInstanceState(instance)
  2299. return {
  2300. _custom: {
  2301. type: 'component',
  2302. id: instance.__VUE_DEVTOOLS_UID__,
  2303. display: getInstanceName(instance),
  2304. tooltip: 'Component instance',
  2305. value: reduceStateList(state),
  2306. fields: {
  2307. abstract: true
  2308. }
  2309. }
  2310. }
  2311. }
  2312. function reduceStateList (list) {
  2313. if (!list.length) {
  2314. return undefined
  2315. }
  2316. return list.reduce((map, item) => {
  2317. var key = item.type || 'data'
  2318. var obj = map[key] = map[key] || {}
  2319. obj[item.key] = item.value
  2320. return map
  2321. }, {})
  2322. }
  2323. /**
  2324. * Get the appropriate display name for an instance.
  2325. *
  2326. * @param {Vue} instance
  2327. * @return {String}
  2328. */
  2329. function getInstanceName (instance) {
  2330. var name = Object(util["m" /* getComponentName */])(instance.$options || instance.fnOptions || {})
  2331. if (name) { return name }
  2332. return instance.$root === instance
  2333. ? 'Root'
  2334. : 'Anonymous Component'
  2335. }
  2336. /**
  2337. * Process the props of an instance.
  2338. * Make sure return a plain object because window.postMessage()
  2339. * will throw an Error if the passed object contains Functions.
  2340. *
  2341. * @param {Vue} instance
  2342. * @return {Array}
  2343. */
  2344. function processProps (instance) {
  2345. var props
  2346. if (isLegacy && (props = instance._props)) {
  2347. // 1.x
  2348. return Object.keys(props).map(key => {
  2349. var prop = props[key]
  2350. var options = prop.options
  2351. return {
  2352. type: 'props',
  2353. key: prop.path,
  2354. value: instance[prop.path],
  2355. meta: options ? {
  2356. type: options.type ? getPropType(options.type) : 'any',
  2357. required: !!options.required,
  2358. mode: propModes[prop.mode]
  2359. } : {}
  2360. }
  2361. })
  2362. } else if ((props = instance.$options.props)) {
  2363. // 2.0
  2364. var propsData = []
  2365. for (var key in props) {
  2366. var prop = props[key]
  2367. key = Object(util["f" /* camelize */])(key)
  2368. propsData.push({
  2369. type: 'props',
  2370. key,
  2371. value: instance[key],
  2372. meta: prop ? {
  2373. type: prop.type ? getPropType(prop.type) : 'any',
  2374. required: !!prop.required
  2375. } : {
  2376. type: 'invalid'
  2377. },
  2378. editable: shared_data["a" /* default */].editableProps
  2379. })
  2380. }
  2381. return propsData
  2382. } else {
  2383. return []
  2384. }
  2385. }
  2386. function processAttrs (instance) {
  2387. return Object.entries(instance.$attrs || {}).map((ref) => {
  2388. var key = ref[0];
  2389. var value = ref[1];
  2390. return {
  2391. type: '$attrs',
  2392. key,
  2393. value
  2394. }
  2395. })
  2396. }
  2397. /**
  2398. * Convert prop type constructor to string.
  2399. *
  2400. * @param {Function} fn
  2401. */
  2402. var fnTypeRE = /^(?:function|class) (\w+)/
  2403. function getPropType (type) {
  2404. var match = type.toString().match(fnTypeRE)
  2405. return typeof type === 'function'
  2406. ? (match && match[1]) || 'any'
  2407. : 'any'
  2408. }
  2409. /**
  2410. * Process state, filtering out props and "clean" the result
  2411. * with a JSON dance. This removes functions which can cause
  2412. * errors during structured clone used by window.postMessage.
  2413. *
  2414. * @param {Vue} instance
  2415. * @return {Array}
  2416. */
  2417. function processState (instance) {
  2418. var props = isLegacy
  2419. ? instance._props
  2420. : instance.$options.props
  2421. var getters =
  2422. instance.$options.vuex &&
  2423. instance.$options.vuex.getters
  2424. return Object.keys(instance._data)
  2425. .filter(key => (
  2426. !(props && key in props) &&
  2427. !(getters && key in getters)
  2428. ))
  2429. .map(key => ({
  2430. key,
  2431. value: instance._data[key],
  2432. editable: true
  2433. }))
  2434. }
  2435. /**
  2436. * Process refs
  2437. *
  2438. * @param {Vue} instance
  2439. * @return {Array}
  2440. */
  2441. function processRefs (instance) {
  2442. return Object.keys(instance.$refs)
  2443. .filter(key => instance.$refs[key])
  2444. .map(key => Object(util["n" /* getCustomRefDetails */])(instance, key, instance.$refs[key]))
  2445. }
  2446. /**
  2447. * Process the computed properties of an instance.
  2448. *
  2449. * @param {Vue} instance
  2450. * @return {Array}
  2451. */
  2452. function processComputed (instance) {
  2453. var computed = []
  2454. var defs = instance.$options.computed || {}
  2455. // use for...in here because if 'computed' is not defined
  2456. // on component, computed properties will be placed in prototype
  2457. // and Object.keys does not include
  2458. // properties from object's prototype
  2459. for (var key in defs) {
  2460. var def = defs[key]
  2461. var type = typeof def === 'function' && def.vuex
  2462. ? 'vuex bindings'
  2463. : 'computed'
  2464. // use try ... catch here because some computed properties may
  2465. // throw error during its evaluation
  2466. var computedProp = null
  2467. try {
  2468. computedProp = {
  2469. type,
  2470. key,
  2471. value: instance[key]
  2472. }
  2473. } catch (e) {
  2474. computedProp = {
  2475. type,
  2476. key,
  2477. value: '(error during evaluation)'
  2478. }
  2479. }
  2480. computed.push(computedProp)
  2481. }
  2482. return computed
  2483. }
  2484. /**
  2485. * Process Vuex getters.
  2486. *
  2487. * @param {Vue} instance
  2488. * @return {Array}
  2489. */
  2490. function processInjected (instance) {
  2491. var injected = instance.$options.inject
  2492. if (injected) {
  2493. return Object.keys(injected).map(key => {
  2494. return {
  2495. key,
  2496. type: 'injected',
  2497. value: instance[key]
  2498. }
  2499. })
  2500. } else {
  2501. return []
  2502. }
  2503. }
  2504. /**
  2505. * Process possible vue-router $route context
  2506. *
  2507. * @param {Vue} instance
  2508. * @return {Array}
  2509. */
  2510. function processRouteContext (instance) {
  2511. try {
  2512. var route = instance.$route
  2513. if (route) {
  2514. var { path, query, params } = route
  2515. var value = { path, query, params }
  2516. if (route.fullPath) { value.fullPath = route.fullPath }
  2517. if (route.hash) { value.hash = route.hash }
  2518. if (route.name) { value.name = route.name }
  2519. if (route.meta) { value.meta = route.meta }
  2520. return [{
  2521. key: '$route',
  2522. value: {
  2523. _custom: {
  2524. type: 'router',
  2525. abstract: true,
  2526. value
  2527. }
  2528. }
  2529. }]
  2530. }
  2531. } catch (e) {
  2532. // Invalid $router
  2533. }
  2534. return []
  2535. }
  2536. /**
  2537. * Process Vuex getters.
  2538. *
  2539. * @param {Vue} instance
  2540. * @return {Array}
  2541. */
  2542. function processVuexGetters (instance) {
  2543. var getters =
  2544. instance.$options.vuex &&
  2545. instance.$options.vuex.getters
  2546. if (getters) {
  2547. return Object.keys(getters).map(key => {
  2548. return {
  2549. type: 'vuex getters',
  2550. key,
  2551. value: instance[key]
  2552. }
  2553. })
  2554. } else {
  2555. return []
  2556. }
  2557. }
  2558. /**
  2559. * Process Firebase bindings.
  2560. *
  2561. * @param {Vue} instance
  2562. * @return {Array}
  2563. */
  2564. function processFirebaseBindings (instance) {
  2565. var refs = instance.$firebaseRefs
  2566. if (refs) {
  2567. return Object.keys(refs).map(key => {
  2568. return {
  2569. type: 'firebase bindings',
  2570. key,
  2571. value: instance[key]
  2572. }
  2573. })
  2574. } else {
  2575. return []
  2576. }
  2577. }
  2578. /**
  2579. * Process vue-rx observable bindings.
  2580. *
  2581. * @param {Vue} instance
  2582. * @return {Array}
  2583. */
  2584. function processObservables (instance) {
  2585. var obs = instance.$observables
  2586. if (obs) {
  2587. return Object.keys(obs).map(key => {
  2588. return {
  2589. type: 'observables',
  2590. key,
  2591. value: instance[key]
  2592. }
  2593. })
  2594. } else {
  2595. return []
  2596. }
  2597. }
  2598. /**
  2599. * Sroll a node into view.
  2600. *
  2601. * @param {Vue} instance
  2602. */
  2603. function scrollIntoView (instance) {
  2604. var rect = getInstanceOrVnodeRect(instance)
  2605. if (rect) {
  2606. // TODO: Handle this for non-browser environments.
  2607. window.scrollBy(0, rect.top + (rect.height - window.innerHeight) / 2)
  2608. }
  2609. }
  2610. /**
  2611. * Binds given instance in console as $vm0.
  2612. * For compatibility reasons it also binds it as $vm.
  2613. *
  2614. * @param {Vue} instance
  2615. */
  2616. function bindToConsole (instance) {
  2617. if (!instance) { return }
  2618. if (!env["b" /* isBrowser */]) { return }
  2619. var id = instance.__VUE_DEVTOOLS_UID__
  2620. var index = consoleBoundInstances.indexOf(id)
  2621. if (index > -1) {
  2622. consoleBoundInstances.splice(index, 1)
  2623. } else {
  2624. consoleBoundInstances.pop()
  2625. }
  2626. consoleBoundInstances.unshift(id)
  2627. for (var i = 0; i < 5; i++) {
  2628. window['$vm' + i] = backend_instanceMap.get(consoleBoundInstances[i])
  2629. }
  2630. window.$vm = instance
  2631. }
  2632. /**
  2633. * Returns a devtools unique id for instance.
  2634. * @param {Vue} instance
  2635. */
  2636. function getUniqueId (instance) {
  2637. var rootVueId = instance.$root.__VUE_DEVTOOLS_ROOT_UID__
  2638. return `${rootVueId}:${instance._uid}`
  2639. }
  2640. function getRenderKey (value) {
  2641. if (value == null) { return }
  2642. var type = typeof value
  2643. if (type === 'number') {
  2644. return value
  2645. } else if (type === 'string') {
  2646. return `'${value}'`
  2647. } else if (Array.isArray(value)) {
  2648. return 'Array'
  2649. } else {
  2650. return 'Object'
  2651. }
  2652. }
  2653. /**
  2654. * Display a toast message.
  2655. * @param {any} message HTML content
  2656. */
  2657. function toast (message, type = 'normal') {
  2658. var fn = env["f" /* target */].__VUE_DEVTOOLS_TOAST__
  2659. fn && fn(message, type)
  2660. }
  2661. function inspectInstance (instance) {
  2662. var id = instance.__VUE_DEVTOOLS_UID__
  2663. id && backend_bridge.send('inspect-instance', id)
  2664. }
  2665. function setStateValue (ref) {
  2666. var id = ref.id;
  2667. var path = ref.path;
  2668. var value = ref.value;
  2669. var newKey = ref.newKey;
  2670. var remove = ref.remove;
  2671. var instance = backend_instanceMap.get(id)
  2672. if (instance) {
  2673. try {
  2674. var parsedValue
  2675. if (value) {
  2676. parsedValue = Object(util["s" /* parse */])(value, true)
  2677. }
  2678. var api = isLegacy ? {
  2679. $set: backend_hook.Vue.set,
  2680. $delete: backend_hook.Vue.delete
  2681. } : instance
  2682. var data = Object(util["o" /* has */])(instance._props, path, newKey)
  2683. ? instance._props
  2684. : instance._data
  2685. Object(util["v" /* set */])(data, path, parsedValue, (obj, field, value) => {
  2686. (remove || newKey) && api.$delete(obj, field)
  2687. !remove && api.$set(obj, newKey || field, value)
  2688. })
  2689. } catch (e) {
  2690. console.error(e)
  2691. }
  2692. }
  2693. }
  2694. function initRightClick () {
  2695. if (!env["b" /* isBrowser */]) { return }
  2696. // Start recording context menu when Vue is detected
  2697. // event if Vue devtools are not loaded yet
  2698. document.addEventListener('contextmenu', event => {
  2699. var el = event.target
  2700. if (el) {
  2701. // Search for parent that "is" a component instance
  2702. var instance = findRelatedComponent(el)
  2703. if (instance) {
  2704. window.__VUE_DEVTOOLS_CONTEXT_MENU_HAS_TARGET__ = true
  2705. window.__VUE_DEVTOOLS_CONTEXT_MENU_TARGET__ = instance
  2706. return
  2707. }
  2708. }
  2709. window.__VUE_DEVTOOLS_CONTEXT_MENU_HAS_TARGET__ = null
  2710. window.__VUE_DEVTOOLS_CONTEXT_MENU_TARGET__ = null
  2711. })
  2712. }
  2713. /***/ }),
  2714. /***/ 15:
  2715. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2716. "use strict";
  2717. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return stringify; });
  2718. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return parse; });
  2719. /* unused harmony export stringifyStrict */
  2720. var MAX_SERIALIZED_SIZE = 512 * 1024 // 1MB
  2721. function encode (data, replacer, list, seen) {
  2722. var stored, key, value, i, l
  2723. var seenIndex = seen.get(data)
  2724. if (seenIndex != null) {
  2725. return seenIndex
  2726. }
  2727. var index = list.length
  2728. var proto = Object.prototype.toString.call(data)
  2729. if (proto === '[object Object]') {
  2730. stored = {}
  2731. seen.set(data, index)
  2732. list.push(stored)
  2733. var keys = Object.keys(data)
  2734. for (i = 0, l = keys.length; i < l; i++) {
  2735. key = keys[i]
  2736. value = data[key]
  2737. if (replacer) { value = replacer.call(data, key, value) }
  2738. stored[key] = encode(value, replacer, list, seen)
  2739. }
  2740. } else if (proto === '[object Array]') {
  2741. stored = []
  2742. seen.set(data, index)
  2743. list.push(stored)
  2744. for (i = 0, l = data.length; i < l; i++) {
  2745. value = data[i]
  2746. if (replacer) { value = replacer.call(data, i, value) }
  2747. stored[i] = encode(value, replacer, list, seen)
  2748. }
  2749. } else {
  2750. list.push(data)
  2751. }
  2752. return index
  2753. }
  2754. function decode (list, reviver) {
  2755. var i = list.length
  2756. var j, k, data, key, value, proto
  2757. while (i--) {
  2758. data = list[i]
  2759. proto = Object.prototype.toString.call(data)
  2760. if (proto === '[object Object]') {
  2761. var keys = Object.keys(data)
  2762. for (j = 0, k = keys.length; j < k; j++) {
  2763. key = keys[j]
  2764. value = list[data[key]]
  2765. if (reviver) { value = reviver.call(data, key, value) }
  2766. data[key] = value
  2767. }
  2768. } else if (proto === '[object Array]') {
  2769. for (j = 0, k = data.length; j < k; j++) {
  2770. value = list[data[j]]
  2771. if (reviver) { value = reviver.call(data, j, value) }
  2772. data[j] = value
  2773. }
  2774. }
  2775. }
  2776. }
  2777. function stringify (data, replacer, space) {
  2778. var result
  2779. try {
  2780. result = arguments.length === 1
  2781. ? JSON.stringify(data)
  2782. : JSON.stringify(data, replacer, space)
  2783. } catch (e) {
  2784. result = stringifyStrict(data, replacer, space)
  2785. }
  2786. if (result.length > MAX_SERIALIZED_SIZE) {
  2787. var chunkCount = Math.ceil(result.length / MAX_SERIALIZED_SIZE)
  2788. var chunks = []
  2789. for (var i = 0; i < chunkCount; i++) {
  2790. chunks.push(result.slice(i * MAX_SERIALIZED_SIZE, (i + 1) * MAX_SERIALIZED_SIZE))
  2791. }
  2792. return chunks
  2793. }
  2794. return result
  2795. }
  2796. function parse (data, reviver) {
  2797. if (Array.isArray(data)) {
  2798. data = data.join('')
  2799. }
  2800. var hasCircular = /^\s/.test(data)
  2801. if (!hasCircular) {
  2802. return arguments.length === 1
  2803. ? JSON.parse(data)
  2804. : JSON.parse(data, reviver)
  2805. } else {
  2806. var list = JSON.parse(data)
  2807. decode(list, reviver)
  2808. return list[0]
  2809. }
  2810. }
  2811. function stringifyStrict (data, replacer, space) {
  2812. var list = []
  2813. encode(data, replacer, list, new Map())
  2814. return space
  2815. ? ' ' + JSON.stringify(list, null, space)
  2816. : ' ' + JSON.stringify(list)
  2817. }
  2818. /***/ }),
  2819. /***/ 160:
  2820. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2821. "use strict";
  2822. __webpack_require__.r(__webpack_exports__);
  2823. /* harmony import */ var src_backend__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
  2824. /* harmony import */ var src_bridge__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23);
  2825. // this is injected to the app page when the panel is activated.
  2826. window.addEventListener('message', handshake)
  2827. function handshake (e) {
  2828. if (e.data.source === 'vue-devtools-proxy' && e.data.payload === 'init') {
  2829. window.removeEventListener('message', handshake)
  2830. var listeners = []
  2831. var bridge = new src_bridge__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"]({
  2832. listen (fn) {
  2833. var listener = evt => {
  2834. if (evt.data.source === 'vue-devtools-proxy' && evt.data.payload) {
  2835. fn(evt.data.payload)
  2836. }
  2837. }
  2838. window.addEventListener('message', listener)
  2839. listeners.push(listener)
  2840. },
  2841. send (data) {
  2842. window.postMessage({
  2843. source: 'vue-devtools-backend',
  2844. payload: data
  2845. }, '*')
  2846. }
  2847. })
  2848. bridge.on('shutdown', () => {
  2849. listeners.forEach(l => {
  2850. window.removeEventListener('message', l)
  2851. })
  2852. listeners = []
  2853. })
  2854. Object(src_backend__WEBPACK_IMPORTED_MODULE_0__[/* initBackend */ "c"])(bridge)
  2855. }
  2856. }
  2857. /***/ }),
  2858. /***/ 17:
  2859. /***/ (function(module, exports, __webpack_require__) {
  2860. "use strict";
  2861. /* WEBPACK VAR INJECTION */(function(global) {/*!
  2862. * The buffer module from node.js, for the browser.
  2863. *
  2864. * @author Feross Aboukhadijeh <http://feross.org>
  2865. * @license MIT
  2866. */
  2867. /* eslint-disable no-proto */
  2868. var base64 = __webpack_require__(18)
  2869. var ieee754 = __webpack_require__(19)
  2870. var isArray = __webpack_require__(20)
  2871. exports.Buffer = Buffer
  2872. exports.SlowBuffer = SlowBuffer
  2873. exports.INSPECT_MAX_BYTES = 50
  2874. /**
  2875. * If `Buffer.TYPED_ARRAY_SUPPORT`:
  2876. * === true Use Uint8Array implementation (fastest)
  2877. * === false Use Object implementation (most compatible, even IE6)
  2878. *
  2879. * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
  2880. * Opera 11.6+, iOS 4.2+.
  2881. *
  2882. * Due to various browser bugs, sometimes the Object implementation will be used even
  2883. * when the browser supports typed arrays.
  2884. *
  2885. * Note:
  2886. *
  2887. * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
  2888. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
  2889. *
  2890. * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
  2891. *
  2892. * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
  2893. * incorrect length in some situations.
  2894. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
  2895. * get the Object implementation, which is slower but behaves correctly.
  2896. */
  2897. Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  2898. ? global.TYPED_ARRAY_SUPPORT
  2899. : typedArraySupport()
  2900. /*
  2901. * Export kMaxLength after typed array support is determined.
  2902. */
  2903. exports.kMaxLength = kMaxLength()
  2904. function typedArraySupport () {
  2905. try {
  2906. var arr = new Uint8Array(1)
  2907. arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
  2908. return arr.foo() === 42 && // typed array instances can be augmented
  2909. typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
  2910. arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
  2911. } catch (e) {
  2912. return false
  2913. }
  2914. }
  2915. function kMaxLength () {
  2916. return Buffer.TYPED_ARRAY_SUPPORT
  2917. ? 0x7fffffff
  2918. : 0x3fffffff
  2919. }
  2920. function createBuffer (that, length) {
  2921. if (kMaxLength() < length) {
  2922. throw new RangeError('Invalid typed array length')
  2923. }
  2924. if (Buffer.TYPED_ARRAY_SUPPORT) {
  2925. // Return an augmented `Uint8Array` instance, for best performance
  2926. that = new Uint8Array(length)
  2927. that.__proto__ = Buffer.prototype
  2928. } else {
  2929. // Fallback: Return an object instance of the Buffer class
  2930. if (that === null) {
  2931. that = new Buffer(length)
  2932. }
  2933. that.length = length
  2934. }
  2935. return that
  2936. }
  2937. /**
  2938. * The Buffer constructor returns instances of `Uint8Array` that have their
  2939. * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
  2940. * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
  2941. * and the `Uint8Array` methods. Square bracket notation works as expected -- it
  2942. * returns a single octet.
  2943. *
  2944. * The `Uint8Array` prototype remains unmodified.
  2945. */
  2946. function Buffer (arg, encodingOrOffset, length) {
  2947. if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
  2948. return new Buffer(arg, encodingOrOffset, length)
  2949. }
  2950. // Common case.
  2951. if (typeof arg === 'number') {
  2952. if (typeof encodingOrOffset === 'string') {
  2953. throw new Error(
  2954. 'If encoding is specified then the first argument must be a string'
  2955. )
  2956. }
  2957. return allocUnsafe(this, arg)
  2958. }
  2959. return from(this, arg, encodingOrOffset, length)
  2960. }
  2961. Buffer.poolSize = 8192 // not used by this implementation
  2962. // TODO: Legacy, not needed anymore. Remove in next major version.
  2963. Buffer._augment = function (arr) {
  2964. arr.__proto__ = Buffer.prototype
  2965. return arr
  2966. }
  2967. function from (that, value, encodingOrOffset, length) {
  2968. if (typeof value === 'number') {
  2969. throw new TypeError('"value" argument must not be a number')
  2970. }
  2971. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  2972. return fromArrayBuffer(that, value, encodingOrOffset, length)
  2973. }
  2974. if (typeof value === 'string') {
  2975. return fromString(that, value, encodingOrOffset)
  2976. }
  2977. return fromObject(that, value)
  2978. }
  2979. /**
  2980. * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
  2981. * if value is a number.
  2982. * Buffer.from(str[, encoding])
  2983. * Buffer.from(array)
  2984. * Buffer.from(buffer)
  2985. * Buffer.from(arrayBuffer[, byteOffset[, length]])
  2986. **/
  2987. Buffer.from = function (value, encodingOrOffset, length) {
  2988. return from(null, value, encodingOrOffset, length)
  2989. }
  2990. if (Buffer.TYPED_ARRAY_SUPPORT) {
  2991. Buffer.prototype.__proto__ = Uint8Array.prototype
  2992. Buffer.__proto__ = Uint8Array
  2993. if (typeof Symbol !== 'undefined' && Symbol.species &&
  2994. Buffer[Symbol.species] === Buffer) {
  2995. // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
  2996. Object.defineProperty(Buffer, Symbol.species, {
  2997. value: null,
  2998. configurable: true
  2999. })
  3000. }
  3001. }
  3002. function assertSize (size) {
  3003. if (typeof size !== 'number') {
  3004. throw new TypeError('"size" argument must be a number')
  3005. } else if (size < 0) {
  3006. throw new RangeError('"size" argument must not be negative')
  3007. }
  3008. }
  3009. function alloc (that, size, fill, encoding) {
  3010. assertSize(size)
  3011. if (size <= 0) {
  3012. return createBuffer(that, size)
  3013. }
  3014. if (fill !== undefined) {
  3015. // Only pay attention to encoding if it's a string. This
  3016. // prevents accidentally sending in a number that would
  3017. // be interpretted as a start offset.
  3018. return typeof encoding === 'string'
  3019. ? createBuffer(that, size).fill(fill, encoding)
  3020. : createBuffer(that, size).fill(fill)
  3021. }
  3022. return createBuffer(that, size)
  3023. }
  3024. /**
  3025. * Creates a new filled Buffer instance.
  3026. * alloc(size[, fill[, encoding]])
  3027. **/
  3028. Buffer.alloc = function (size, fill, encoding) {
  3029. return alloc(null, size, fill, encoding)
  3030. }
  3031. function allocUnsafe (that, size) {
  3032. assertSize(size)
  3033. that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
  3034. if (!Buffer.TYPED_ARRAY_SUPPORT) {
  3035. for (var i = 0; i < size; ++i) {
  3036. that[i] = 0
  3037. }
  3038. }
  3039. return that
  3040. }
  3041. /**
  3042. * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
  3043. * */
  3044. Buffer.allocUnsafe = function (size) {
  3045. return allocUnsafe(null, size)
  3046. }
  3047. /**
  3048. * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
  3049. */
  3050. Buffer.allocUnsafeSlow = function (size) {
  3051. return allocUnsafe(null, size)
  3052. }
  3053. function fromString (that, string, encoding) {
  3054. if (typeof encoding !== 'string' || encoding === '') {
  3055. encoding = 'utf8'
  3056. }
  3057. if (!Buffer.isEncoding(encoding)) {
  3058. throw new TypeError('"encoding" must be a valid string encoding')
  3059. }
  3060. var length = byteLength(string, encoding) | 0
  3061. that = createBuffer(that, length)
  3062. var actual = that.write(string, encoding)
  3063. if (actual !== length) {
  3064. // Writing a hex string, for example, that contains invalid characters will
  3065. // cause everything after the first invalid character to be ignored. (e.g.
  3066. // 'abxxcd' will be treated as 'ab')
  3067. that = that.slice(0, actual)
  3068. }
  3069. return that
  3070. }
  3071. function fromArrayLike (that, array) {
  3072. var length = array.length < 0 ? 0 : checked(array.length) | 0
  3073. that = createBuffer(that, length)
  3074. for (var i = 0; i < length; i += 1) {
  3075. that[i] = array[i] & 255
  3076. }
  3077. return that
  3078. }
  3079. function fromArrayBuffer (that, array, byteOffset, length) {
  3080. array.byteLength // this throws if `array` is not a valid ArrayBuffer
  3081. if (byteOffset < 0 || array.byteLength < byteOffset) {
  3082. throw new RangeError('\'offset\' is out of bounds')
  3083. }
  3084. if (array.byteLength < byteOffset + (length || 0)) {
  3085. throw new RangeError('\'length\' is out of bounds')
  3086. }
  3087. if (byteOffset === undefined && length === undefined) {
  3088. array = new Uint8Array(array)
  3089. } else if (length === undefined) {
  3090. array = new Uint8Array(array, byteOffset)
  3091. } else {
  3092. array = new Uint8Array(array, byteOffset, length)
  3093. }
  3094. if (Buffer.TYPED_ARRAY_SUPPORT) {
  3095. // Return an augmented `Uint8Array` instance, for best performance
  3096. that = array
  3097. that.__proto__ = Buffer.prototype
  3098. } else {
  3099. // Fallback: Return an object instance of the Buffer class
  3100. that = fromArrayLike(that, array)
  3101. }
  3102. return that
  3103. }
  3104. function fromObject (that, obj) {
  3105. if (Buffer.isBuffer(obj)) {
  3106. var len = checked(obj.length) | 0
  3107. that = createBuffer(that, len)
  3108. if (that.length === 0) {
  3109. return that
  3110. }
  3111. obj.copy(that, 0, 0, len)
  3112. return that
  3113. }
  3114. if (obj) {
  3115. if ((typeof ArrayBuffer !== 'undefined' &&
  3116. obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
  3117. if (typeof obj.length !== 'number' || isnan(obj.length)) {
  3118. return createBuffer(that, 0)
  3119. }
  3120. return fromArrayLike(that, obj)
  3121. }
  3122. if (obj.type === 'Buffer' && isArray(obj.data)) {
  3123. return fromArrayLike(that, obj.data)
  3124. }
  3125. }
  3126. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  3127. }
  3128. function checked (length) {
  3129. // Note: cannot use `length < kMaxLength()` here because that fails when
  3130. // length is NaN (which is otherwise coerced to zero.)
  3131. if (length >= kMaxLength()) {
  3132. throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
  3133. 'size: 0x' + kMaxLength().toString(16) + ' bytes')
  3134. }
  3135. return length | 0
  3136. }
  3137. function SlowBuffer (length) {
  3138. if (+length != length) { // eslint-disable-line eqeqeq
  3139. length = 0
  3140. }
  3141. return Buffer.alloc(+length)
  3142. }
  3143. Buffer.isBuffer = function isBuffer (b) {
  3144. return !!(b != null && b._isBuffer)
  3145. }
  3146. Buffer.compare = function compare (a, b) {
  3147. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  3148. throw new TypeError('Arguments must be Buffers')
  3149. }
  3150. if (a === b) return 0
  3151. var x = a.length
  3152. var y = b.length
  3153. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  3154. if (a[i] !== b[i]) {
  3155. x = a[i]
  3156. y = b[i]
  3157. break
  3158. }
  3159. }
  3160. if (x < y) return -1
  3161. if (y < x) return 1
  3162. return 0
  3163. }
  3164. Buffer.isEncoding = function isEncoding (encoding) {
  3165. switch (String(encoding).toLowerCase()) {
  3166. case 'hex':
  3167. case 'utf8':
  3168. case 'utf-8':
  3169. case 'ascii':
  3170. case 'latin1':
  3171. case 'binary':
  3172. case 'base64':
  3173. case 'ucs2':
  3174. case 'ucs-2':
  3175. case 'utf16le':
  3176. case 'utf-16le':
  3177. return true
  3178. default:
  3179. return false
  3180. }
  3181. }
  3182. Buffer.concat = function concat (list, length) {
  3183. if (!isArray(list)) {
  3184. throw new TypeError('"list" argument must be an Array of Buffers')
  3185. }
  3186. if (list.length === 0) {
  3187. return Buffer.alloc(0)
  3188. }
  3189. var i
  3190. if (length === undefined) {
  3191. length = 0
  3192. for (i = 0; i < list.length; ++i) {
  3193. length += list[i].length
  3194. }
  3195. }
  3196. var buffer = Buffer.allocUnsafe(length)
  3197. var pos = 0
  3198. for (i = 0; i < list.length; ++i) {
  3199. var buf = list[i]
  3200. if (!Buffer.isBuffer(buf)) {
  3201. throw new TypeError('"list" argument must be an Array of Buffers')
  3202. }
  3203. buf.copy(buffer, pos)
  3204. pos += buf.length
  3205. }
  3206. return buffer
  3207. }
  3208. function byteLength (string, encoding) {
  3209. if (Buffer.isBuffer(string)) {
  3210. return string.length
  3211. }
  3212. if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
  3213. (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
  3214. return string.byteLength
  3215. }
  3216. if (typeof string !== 'string') {
  3217. string = '' + string
  3218. }
  3219. var len = string.length
  3220. if (len === 0) return 0
  3221. // Use a for loop to avoid recursion
  3222. var loweredCase = false
  3223. for (;;) {
  3224. switch (encoding) {
  3225. case 'ascii':
  3226. case 'latin1':
  3227. case 'binary':
  3228. return len
  3229. case 'utf8':
  3230. case 'utf-8':
  3231. case undefined:
  3232. return utf8ToBytes(string).length
  3233. case 'ucs2':
  3234. case 'ucs-2':
  3235. case 'utf16le':
  3236. case 'utf-16le':
  3237. return len * 2
  3238. case 'hex':
  3239. return len >>> 1
  3240. case 'base64':
  3241. return base64ToBytes(string).length
  3242. default:
  3243. if (loweredCase) return utf8ToBytes(string).length // assume utf8
  3244. encoding = ('' + encoding).toLowerCase()
  3245. loweredCase = true
  3246. }
  3247. }
  3248. }
  3249. Buffer.byteLength = byteLength
  3250. function slowToString (encoding, start, end) {
  3251. var loweredCase = false
  3252. // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  3253. // property of a typed array.
  3254. // This behaves neither like String nor Uint8Array in that we set start/end
  3255. // to their upper/lower bounds if the value passed is out of range.
  3256. // undefined is handled specially as per ECMA-262 6th Edition,
  3257. // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  3258. if (start === undefined || start < 0) {
  3259. start = 0
  3260. }
  3261. // Return early if start > this.length. Done here to prevent potential uint32
  3262. // coercion fail below.
  3263. if (start > this.length) {
  3264. return ''
  3265. }
  3266. if (end === undefined || end > this.length) {
  3267. end = this.length
  3268. }
  3269. if (end <= 0) {
  3270. return ''
  3271. }
  3272. // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  3273. end >>>= 0
  3274. start >>>= 0
  3275. if (end <= start) {
  3276. return ''
  3277. }
  3278. if (!encoding) encoding = 'utf8'
  3279. while (true) {
  3280. switch (encoding) {
  3281. case 'hex':
  3282. return hexSlice(this, start, end)
  3283. case 'utf8':
  3284. case 'utf-8':
  3285. return utf8Slice(this, start, end)
  3286. case 'ascii':
  3287. return asciiSlice(this, start, end)
  3288. case 'latin1':
  3289. case 'binary':
  3290. return latin1Slice(this, start, end)
  3291. case 'base64':
  3292. return base64Slice(this, start, end)
  3293. case 'ucs2':
  3294. case 'ucs-2':
  3295. case 'utf16le':
  3296. case 'utf-16le':
  3297. return utf16leSlice(this, start, end)
  3298. default:
  3299. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  3300. encoding = (encoding + '').toLowerCase()
  3301. loweredCase = true
  3302. }
  3303. }
  3304. }
  3305. // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  3306. // Buffer instances.
  3307. Buffer.prototype._isBuffer = true
  3308. function swap (b, n, m) {
  3309. var i = b[n]
  3310. b[n] = b[m]
  3311. b[m] = i
  3312. }
  3313. Buffer.prototype.swap16 = function swap16 () {
  3314. var len = this.length
  3315. if (len % 2 !== 0) {
  3316. throw new RangeError('Buffer size must be a multiple of 16-bits')
  3317. }
  3318. for (var i = 0; i < len; i += 2) {
  3319. swap(this, i, i + 1)
  3320. }
  3321. return this
  3322. }
  3323. Buffer.prototype.swap32 = function swap32 () {
  3324. var len = this.length
  3325. if (len % 4 !== 0) {
  3326. throw new RangeError('Buffer size must be a multiple of 32-bits')
  3327. }
  3328. for (var i = 0; i < len; i += 4) {
  3329. swap(this, i, i + 3)
  3330. swap(this, i + 1, i + 2)
  3331. }
  3332. return this
  3333. }
  3334. Buffer.prototype.swap64 = function swap64 () {
  3335. var len = this.length
  3336. if (len % 8 !== 0) {
  3337. throw new RangeError('Buffer size must be a multiple of 64-bits')
  3338. }
  3339. for (var i = 0; i < len; i += 8) {
  3340. swap(this, i, i + 7)
  3341. swap(this, i + 1, i + 6)
  3342. swap(this, i + 2, i + 5)
  3343. swap(this, i + 3, i + 4)
  3344. }
  3345. return this
  3346. }
  3347. Buffer.prototype.toString = function toString () {
  3348. var length = this.length | 0
  3349. if (length === 0) return ''
  3350. if (arguments.length === 0) return utf8Slice(this, 0, length)
  3351. return slowToString.apply(this, arguments)
  3352. }
  3353. Buffer.prototype.equals = function equals (b) {
  3354. if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  3355. if (this === b) return true
  3356. return Buffer.compare(this, b) === 0
  3357. }
  3358. Buffer.prototype.inspect = function inspect () {
  3359. var str = ''
  3360. var max = exports.INSPECT_MAX_BYTES
  3361. if (this.length > 0) {
  3362. str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
  3363. if (this.length > max) str += ' ... '
  3364. }
  3365. return '<Buffer ' + str + '>'
  3366. }
  3367. Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  3368. if (!Buffer.isBuffer(target)) {
  3369. throw new TypeError('Argument must be a Buffer')
  3370. }
  3371. if (start === undefined) {
  3372. start = 0
  3373. }
  3374. if (end === undefined) {
  3375. end = target ? target.length : 0
  3376. }
  3377. if (thisStart === undefined) {
  3378. thisStart = 0
  3379. }
  3380. if (thisEnd === undefined) {
  3381. thisEnd = this.length
  3382. }
  3383. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  3384. throw new RangeError('out of range index')
  3385. }
  3386. if (thisStart >= thisEnd && start >= end) {
  3387. return 0
  3388. }
  3389. if (thisStart >= thisEnd) {
  3390. return -1
  3391. }
  3392. if (start >= end) {
  3393. return 1
  3394. }
  3395. start >>>= 0
  3396. end >>>= 0
  3397. thisStart >>>= 0
  3398. thisEnd >>>= 0
  3399. if (this === target) return 0
  3400. var x = thisEnd - thisStart
  3401. var y = end - start
  3402. var len = Math.min(x, y)
  3403. var thisCopy = this.slice(thisStart, thisEnd)
  3404. var targetCopy = target.slice(start, end)
  3405. for (var i = 0; i < len; ++i) {
  3406. if (thisCopy[i] !== targetCopy[i]) {
  3407. x = thisCopy[i]
  3408. y = targetCopy[i]
  3409. break
  3410. }
  3411. }
  3412. if (x < y) return -1
  3413. if (y < x) return 1
  3414. return 0
  3415. }
  3416. // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  3417. // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  3418. //
  3419. // Arguments:
  3420. // - buffer - a Buffer to search
  3421. // - val - a string, Buffer, or number
  3422. // - byteOffset - an index into `buffer`; will be clamped to an int32
  3423. // - encoding - an optional encoding, relevant is val is a string
  3424. // - dir - true for indexOf, false for lastIndexOf
  3425. function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  3426. // Empty buffer means no match
  3427. if (buffer.length === 0) return -1
  3428. // Normalize byteOffset
  3429. if (typeof byteOffset === 'string') {
  3430. encoding = byteOffset
  3431. byteOffset = 0
  3432. } else if (byteOffset > 0x7fffffff) {
  3433. byteOffset = 0x7fffffff
  3434. } else if (byteOffset < -0x80000000) {
  3435. byteOffset = -0x80000000
  3436. }
  3437. byteOffset = +byteOffset // Coerce to Number.
  3438. if (isNaN(byteOffset)) {
  3439. // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
  3440. byteOffset = dir ? 0 : (buffer.length - 1)
  3441. }
  3442. // Normalize byteOffset: negative offsets start from the end of the buffer
  3443. if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  3444. if (byteOffset >= buffer.length) {
  3445. if (dir) return -1
  3446. else byteOffset = buffer.length - 1
  3447. } else if (byteOffset < 0) {
  3448. if (dir) byteOffset = 0
  3449. else return -1
  3450. }
  3451. // Normalize val
  3452. if (typeof val === 'string') {
  3453. val = Buffer.from(val, encoding)
  3454. }
  3455. // Finally, search either indexOf (if dir is true) or lastIndexOf
  3456. if (Buffer.isBuffer(val)) {
  3457. // Special case: looking for empty string/buffer always fails
  3458. if (val.length === 0) {
  3459. return -1
  3460. }
  3461. return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  3462. } else if (typeof val === 'number') {
  3463. val = val & 0xFF // Search for a byte value [0-255]
  3464. if (Buffer.TYPED_ARRAY_SUPPORT &&
  3465. typeof Uint8Array.prototype.indexOf === 'function') {
  3466. if (dir) {
  3467. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
  3468. } else {
  3469. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
  3470. }
  3471. }
  3472. return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  3473. }
  3474. throw new TypeError('val must be string, number or Buffer')
  3475. }
  3476. function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  3477. var indexSize = 1
  3478. var arrLength = arr.length
  3479. var valLength = val.length
  3480. if (encoding !== undefined) {
  3481. encoding = String(encoding).toLowerCase()
  3482. if (encoding === 'ucs2' || encoding === 'ucs-2' ||
  3483. encoding === 'utf16le' || encoding === 'utf-16le') {
  3484. if (arr.length < 2 || val.length < 2) {
  3485. return -1
  3486. }
  3487. indexSize = 2
  3488. arrLength /= 2
  3489. valLength /= 2
  3490. byteOffset /= 2
  3491. }
  3492. }
  3493. function read (buf, i) {
  3494. if (indexSize === 1) {
  3495. return buf[i]
  3496. } else {
  3497. return buf.readUInt16BE(i * indexSize)
  3498. }
  3499. }
  3500. var i
  3501. if (dir) {
  3502. var foundIndex = -1
  3503. for (i = byteOffset; i < arrLength; i++) {
  3504. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  3505. if (foundIndex === -1) foundIndex = i
  3506. if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
  3507. } else {
  3508. if (foundIndex !== -1) i -= i - foundIndex
  3509. foundIndex = -1
  3510. }
  3511. }
  3512. } else {
  3513. if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
  3514. for (i = byteOffset; i >= 0; i--) {
  3515. var found = true
  3516. for (var j = 0; j < valLength; j++) {
  3517. if (read(arr, i + j) !== read(val, j)) {
  3518. found = false
  3519. break
  3520. }
  3521. }
  3522. if (found) return i
  3523. }
  3524. }
  3525. return -1
  3526. }
  3527. Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  3528. return this.indexOf(val, byteOffset, encoding) !== -1
  3529. }
  3530. Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  3531. return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  3532. }
  3533. Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  3534. return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  3535. }
  3536. function hexWrite (buf, string, offset, length) {
  3537. offset = Number(offset) || 0
  3538. var remaining = buf.length - offset
  3539. if (!length) {
  3540. length = remaining
  3541. } else {
  3542. length = Number(length)
  3543. if (length > remaining) {
  3544. length = remaining
  3545. }
  3546. }
  3547. // must be an even number of digits
  3548. var strLen = string.length
  3549. if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
  3550. if (length > strLen / 2) {
  3551. length = strLen / 2
  3552. }
  3553. for (var i = 0; i < length; ++i) {
  3554. var parsed = parseInt(string.substr(i * 2, 2), 16)
  3555. if (isNaN(parsed)) return i
  3556. buf[offset + i] = parsed
  3557. }
  3558. return i
  3559. }
  3560. function utf8Write (buf, string, offset, length) {
  3561. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  3562. }
  3563. function asciiWrite (buf, string, offset, length) {
  3564. return blitBuffer(asciiToBytes(string), buf, offset, length)
  3565. }
  3566. function latin1Write (buf, string, offset, length) {
  3567. return asciiWrite(buf, string, offset, length)
  3568. }
  3569. function base64Write (buf, string, offset, length) {
  3570. return blitBuffer(base64ToBytes(string), buf, offset, length)
  3571. }
  3572. function ucs2Write (buf, string, offset, length) {
  3573. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  3574. }
  3575. Buffer.prototype.write = function write (string, offset, length, encoding) {
  3576. // Buffer#write(string)
  3577. if (offset === undefined) {
  3578. encoding = 'utf8'
  3579. length = this.length
  3580. offset = 0
  3581. // Buffer#write(string, encoding)
  3582. } else if (length === undefined && typeof offset === 'string') {
  3583. encoding = offset
  3584. length = this.length
  3585. offset = 0
  3586. // Buffer#write(string, offset[, length][, encoding])
  3587. } else if (isFinite(offset)) {
  3588. offset = offset | 0
  3589. if (isFinite(length)) {
  3590. length = length | 0
  3591. if (encoding === undefined) encoding = 'utf8'
  3592. } else {
  3593. encoding = length
  3594. length = undefined
  3595. }
  3596. // legacy write(string, encoding, offset, length) - remove in v0.13
  3597. } else {
  3598. throw new Error(
  3599. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  3600. )
  3601. }
  3602. var remaining = this.length - offset
  3603. if (length === undefined || length > remaining) length = remaining
  3604. if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
  3605. throw new RangeError('Attempt to write outside buffer bounds')
  3606. }
  3607. if (!encoding) encoding = 'utf8'
  3608. var loweredCase = false
  3609. for (;;) {
  3610. switch (encoding) {
  3611. case 'hex':
  3612. return hexWrite(this, string, offset, length)
  3613. case 'utf8':
  3614. case 'utf-8':
  3615. return utf8Write(this, string, offset, length)
  3616. case 'ascii':
  3617. return asciiWrite(this, string, offset, length)
  3618. case 'latin1':
  3619. case 'binary':
  3620. return latin1Write(this, string, offset, length)
  3621. case 'base64':
  3622. // Warning: maxLength not taken into account in base64Write
  3623. return base64Write(this, string, offset, length)
  3624. case 'ucs2':
  3625. case 'ucs-2':
  3626. case 'utf16le':
  3627. case 'utf-16le':
  3628. return ucs2Write(this, string, offset, length)
  3629. default:
  3630. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  3631. encoding = ('' + encoding).toLowerCase()
  3632. loweredCase = true
  3633. }
  3634. }
  3635. }
  3636. Buffer.prototype.toJSON = function toJSON () {
  3637. return {
  3638. type: 'Buffer',
  3639. data: Array.prototype.slice.call(this._arr || this, 0)
  3640. }
  3641. }
  3642. function base64Slice (buf, start, end) {
  3643. if (start === 0 && end === buf.length) {
  3644. return base64.fromByteArray(buf)
  3645. } else {
  3646. return base64.fromByteArray(buf.slice(start, end))
  3647. }
  3648. }
  3649. function utf8Slice (buf, start, end) {
  3650. end = Math.min(buf.length, end)
  3651. var res = []
  3652. var i = start
  3653. while (i < end) {
  3654. var firstByte = buf[i]
  3655. var codePoint = null
  3656. var bytesPerSequence = (firstByte > 0xEF) ? 4
  3657. : (firstByte > 0xDF) ? 3
  3658. : (firstByte > 0xBF) ? 2
  3659. : 1
  3660. if (i + bytesPerSequence <= end) {
  3661. var secondByte, thirdByte, fourthByte, tempCodePoint
  3662. switch (bytesPerSequence) {
  3663. case 1:
  3664. if (firstByte < 0x80) {
  3665. codePoint = firstByte
  3666. }
  3667. break
  3668. case 2:
  3669. secondByte = buf[i + 1]
  3670. if ((secondByte & 0xC0) === 0x80) {
  3671. tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
  3672. if (tempCodePoint > 0x7F) {
  3673. codePoint = tempCodePoint
  3674. }
  3675. }
  3676. break
  3677. case 3:
  3678. secondByte = buf[i + 1]
  3679. thirdByte = buf[i + 2]
  3680. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
  3681. tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
  3682. if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
  3683. codePoint = tempCodePoint
  3684. }
  3685. }
  3686. break
  3687. case 4:
  3688. secondByte = buf[i + 1]
  3689. thirdByte = buf[i + 2]
  3690. fourthByte = buf[i + 3]
  3691. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
  3692. tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
  3693. if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
  3694. codePoint = tempCodePoint
  3695. }
  3696. }
  3697. }
  3698. }
  3699. if (codePoint === null) {
  3700. // we did not generate a valid codePoint so insert a
  3701. // replacement char (U+FFFD) and advance only 1 byte
  3702. codePoint = 0xFFFD
  3703. bytesPerSequence = 1
  3704. } else if (codePoint > 0xFFFF) {
  3705. // encode to utf16 (surrogate pair dance)
  3706. codePoint -= 0x10000
  3707. res.push(codePoint >>> 10 & 0x3FF | 0xD800)
  3708. codePoint = 0xDC00 | codePoint & 0x3FF
  3709. }
  3710. res.push(codePoint)
  3711. i += bytesPerSequence
  3712. }
  3713. return decodeCodePointsArray(res)
  3714. }
  3715. // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  3716. // the lowest limit is Chrome, with 0x10000 args.
  3717. // We go 1 magnitude less, for safety
  3718. var MAX_ARGUMENTS_LENGTH = 0x1000
  3719. function decodeCodePointsArray (codePoints) {
  3720. var len = codePoints.length
  3721. if (len <= MAX_ARGUMENTS_LENGTH) {
  3722. return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  3723. }
  3724. // Decode in chunks to avoid "call stack size exceeded".
  3725. var res = ''
  3726. var i = 0
  3727. while (i < len) {
  3728. res += String.fromCharCode.apply(
  3729. String,
  3730. codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
  3731. )
  3732. }
  3733. return res
  3734. }
  3735. function asciiSlice (buf, start, end) {
  3736. var ret = ''
  3737. end = Math.min(buf.length, end)
  3738. for (var i = start; i < end; ++i) {
  3739. ret += String.fromCharCode(buf[i] & 0x7F)
  3740. }
  3741. return ret
  3742. }
  3743. function latin1Slice (buf, start, end) {
  3744. var ret = ''
  3745. end = Math.min(buf.length, end)
  3746. for (var i = start; i < end; ++i) {
  3747. ret += String.fromCharCode(buf[i])
  3748. }
  3749. return ret
  3750. }
  3751. function hexSlice (buf, start, end) {
  3752. var len = buf.length
  3753. if (!start || start < 0) start = 0
  3754. if (!end || end < 0 || end > len) end = len
  3755. var out = ''
  3756. for (var i = start; i < end; ++i) {
  3757. out += toHex(buf[i])
  3758. }
  3759. return out
  3760. }
  3761. function utf16leSlice (buf, start, end) {
  3762. var bytes = buf.slice(start, end)
  3763. var res = ''
  3764. for (var i = 0; i < bytes.length; i += 2) {
  3765. res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  3766. }
  3767. return res
  3768. }
  3769. Buffer.prototype.slice = function slice (start, end) {
  3770. var len = this.length
  3771. start = ~~start
  3772. end = end === undefined ? len : ~~end
  3773. if (start < 0) {
  3774. start += len
  3775. if (start < 0) start = 0
  3776. } else if (start > len) {
  3777. start = len
  3778. }
  3779. if (end < 0) {
  3780. end += len
  3781. if (end < 0) end = 0
  3782. } else if (end > len) {
  3783. end = len
  3784. }
  3785. if (end < start) end = start
  3786. var newBuf
  3787. if (Buffer.TYPED_ARRAY_SUPPORT) {
  3788. newBuf = this.subarray(start, end)
  3789. newBuf.__proto__ = Buffer.prototype
  3790. } else {
  3791. var sliceLen = end - start
  3792. newBuf = new Buffer(sliceLen, undefined)
  3793. for (var i = 0; i < sliceLen; ++i) {
  3794. newBuf[i] = this[i + start]
  3795. }
  3796. }
  3797. return newBuf
  3798. }
  3799. /*
  3800. * Need to make sure that buffer isn't trying to write out of bounds.
  3801. */
  3802. function checkOffset (offset, ext, length) {
  3803. if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  3804. if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  3805. }
  3806. Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  3807. offset = offset | 0
  3808. byteLength = byteLength | 0
  3809. if (!noAssert) checkOffset(offset, byteLength, this.length)
  3810. var val = this[offset]
  3811. var mul = 1
  3812. var i = 0
  3813. while (++i < byteLength && (mul *= 0x100)) {
  3814. val += this[offset + i] * mul
  3815. }
  3816. return val
  3817. }
  3818. Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  3819. offset = offset | 0
  3820. byteLength = byteLength | 0
  3821. if (!noAssert) {
  3822. checkOffset(offset, byteLength, this.length)
  3823. }
  3824. var val = this[offset + --byteLength]
  3825. var mul = 1
  3826. while (byteLength > 0 && (mul *= 0x100)) {
  3827. val += this[offset + --byteLength] * mul
  3828. }
  3829. return val
  3830. }
  3831. Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  3832. if (!noAssert) checkOffset(offset, 1, this.length)
  3833. return this[offset]
  3834. }
  3835. Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  3836. if (!noAssert) checkOffset(offset, 2, this.length)
  3837. return this[offset] | (this[offset + 1] << 8)
  3838. }
  3839. Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  3840. if (!noAssert) checkOffset(offset, 2, this.length)
  3841. return (this[offset] << 8) | this[offset + 1]
  3842. }
  3843. Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  3844. if (!noAssert) checkOffset(offset, 4, this.length)
  3845. return ((this[offset]) |
  3846. (this[offset + 1] << 8) |
  3847. (this[offset + 2] << 16)) +
  3848. (this[offset + 3] * 0x1000000)
  3849. }
  3850. Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  3851. if (!noAssert) checkOffset(offset, 4, this.length)
  3852. return (this[offset] * 0x1000000) +
  3853. ((this[offset + 1] << 16) |
  3854. (this[offset + 2] << 8) |
  3855. this[offset + 3])
  3856. }
  3857. Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  3858. offset = offset | 0
  3859. byteLength = byteLength | 0
  3860. if (!noAssert) checkOffset(offset, byteLength, this.length)
  3861. var val = this[offset]
  3862. var mul = 1
  3863. var i = 0
  3864. while (++i < byteLength && (mul *= 0x100)) {
  3865. val += this[offset + i] * mul
  3866. }
  3867. mul *= 0x80
  3868. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  3869. return val
  3870. }
  3871. Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  3872. offset = offset | 0
  3873. byteLength = byteLength | 0
  3874. if (!noAssert) checkOffset(offset, byteLength, this.length)
  3875. var i = byteLength
  3876. var mul = 1
  3877. var val = this[offset + --i]
  3878. while (i > 0 && (mul *= 0x100)) {
  3879. val += this[offset + --i] * mul
  3880. }
  3881. mul *= 0x80
  3882. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  3883. return val
  3884. }
  3885. Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  3886. if (!noAssert) checkOffset(offset, 1, this.length)
  3887. if (!(this[offset] & 0x80)) return (this[offset])
  3888. return ((0xff - this[offset] + 1) * -1)
  3889. }
  3890. Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  3891. if (!noAssert) checkOffset(offset, 2, this.length)
  3892. var val = this[offset] | (this[offset + 1] << 8)
  3893. return (val & 0x8000) ? val | 0xFFFF0000 : val
  3894. }
  3895. Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  3896. if (!noAssert) checkOffset(offset, 2, this.length)
  3897. var val = this[offset + 1] | (this[offset] << 8)
  3898. return (val & 0x8000) ? val | 0xFFFF0000 : val
  3899. }
  3900. Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  3901. if (!noAssert) checkOffset(offset, 4, this.length)
  3902. return (this[offset]) |
  3903. (this[offset + 1] << 8) |
  3904. (this[offset + 2] << 16) |
  3905. (this[offset + 3] << 24)
  3906. }
  3907. Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  3908. if (!noAssert) checkOffset(offset, 4, this.length)
  3909. return (this[offset] << 24) |
  3910. (this[offset + 1] << 16) |
  3911. (this[offset + 2] << 8) |
  3912. (this[offset + 3])
  3913. }
  3914. Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  3915. if (!noAssert) checkOffset(offset, 4, this.length)
  3916. return ieee754.read(this, offset, true, 23, 4)
  3917. }
  3918. Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  3919. if (!noAssert) checkOffset(offset, 4, this.length)
  3920. return ieee754.read(this, offset, false, 23, 4)
  3921. }
  3922. Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  3923. if (!noAssert) checkOffset(offset, 8, this.length)
  3924. return ieee754.read(this, offset, true, 52, 8)
  3925. }
  3926. Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  3927. if (!noAssert) checkOffset(offset, 8, this.length)
  3928. return ieee754.read(this, offset, false, 52, 8)
  3929. }
  3930. function checkInt (buf, value, offset, ext, max, min) {
  3931. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  3932. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  3933. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  3934. }
  3935. Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  3936. value = +value
  3937. offset = offset | 0
  3938. byteLength = byteLength | 0
  3939. if (!noAssert) {
  3940. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  3941. checkInt(this, value, offset, byteLength, maxBytes, 0)
  3942. }
  3943. var mul = 1
  3944. var i = 0
  3945. this[offset] = value & 0xFF
  3946. while (++i < byteLength && (mul *= 0x100)) {
  3947. this[offset + i] = (value / mul) & 0xFF
  3948. }
  3949. return offset + byteLength
  3950. }
  3951. Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  3952. value = +value
  3953. offset = offset | 0
  3954. byteLength = byteLength | 0
  3955. if (!noAssert) {
  3956. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  3957. checkInt(this, value, offset, byteLength, maxBytes, 0)
  3958. }
  3959. var i = byteLength - 1
  3960. var mul = 1
  3961. this[offset + i] = value & 0xFF
  3962. while (--i >= 0 && (mul *= 0x100)) {
  3963. this[offset + i] = (value / mul) & 0xFF
  3964. }
  3965. return offset + byteLength
  3966. }
  3967. Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  3968. value = +value
  3969. offset = offset | 0
  3970. if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  3971. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  3972. this[offset] = (value & 0xff)
  3973. return offset + 1
  3974. }
  3975. function objectWriteUInt16 (buf, value, offset, littleEndian) {
  3976. if (value < 0) value = 0xffff + value + 1
  3977. for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
  3978. buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
  3979. (littleEndian ? i : 1 - i) * 8
  3980. }
  3981. }
  3982. Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  3983. value = +value
  3984. offset = offset | 0
  3985. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  3986. if (Buffer.TYPED_ARRAY_SUPPORT) {
  3987. this[offset] = (value & 0xff)
  3988. this[offset + 1] = (value >>> 8)
  3989. } else {
  3990. objectWriteUInt16(this, value, offset, true)
  3991. }
  3992. return offset + 2
  3993. }
  3994. Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  3995. value = +value
  3996. offset = offset | 0
  3997. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  3998. if (Buffer.TYPED_ARRAY_SUPPORT) {
  3999. this[offset] = (value >>> 8)
  4000. this[offset + 1] = (value & 0xff)
  4001. } else {
  4002. objectWriteUInt16(this, value, offset, false)
  4003. }
  4004. return offset + 2
  4005. }
  4006. function objectWriteUInt32 (buf, value, offset, littleEndian) {
  4007. if (value < 0) value = 0xffffffff + value + 1
  4008. for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
  4009. buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
  4010. }
  4011. }
  4012. Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  4013. value = +value
  4014. offset = offset | 0
  4015. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  4016. if (Buffer.TYPED_ARRAY_SUPPORT) {
  4017. this[offset + 3] = (value >>> 24)
  4018. this[offset + 2] = (value >>> 16)
  4019. this[offset + 1] = (value >>> 8)
  4020. this[offset] = (value & 0xff)
  4021. } else {
  4022. objectWriteUInt32(this, value, offset, true)
  4023. }
  4024. return offset + 4
  4025. }
  4026. Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  4027. value = +value
  4028. offset = offset | 0
  4029. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  4030. if (Buffer.TYPED_ARRAY_SUPPORT) {
  4031. this[offset] = (value >>> 24)
  4032. this[offset + 1] = (value >>> 16)
  4033. this[offset + 2] = (value >>> 8)
  4034. this[offset + 3] = (value & 0xff)
  4035. } else {
  4036. objectWriteUInt32(this, value, offset, false)
  4037. }
  4038. return offset + 4
  4039. }
  4040. Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  4041. value = +value
  4042. offset = offset | 0
  4043. if (!noAssert) {
  4044. var limit = Math.pow(2, 8 * byteLength - 1)
  4045. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  4046. }
  4047. var i = 0
  4048. var mul = 1
  4049. var sub = 0
  4050. this[offset] = value & 0xFF
  4051. while (++i < byteLength && (mul *= 0x100)) {
  4052. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  4053. sub = 1
  4054. }
  4055. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  4056. }
  4057. return offset + byteLength
  4058. }
  4059. Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  4060. value = +value
  4061. offset = offset | 0
  4062. if (!noAssert) {
  4063. var limit = Math.pow(2, 8 * byteLength - 1)
  4064. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  4065. }
  4066. var i = byteLength - 1
  4067. var mul = 1
  4068. var sub = 0
  4069. this[offset + i] = value & 0xFF
  4070. while (--i >= 0 && (mul *= 0x100)) {
  4071. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  4072. sub = 1
  4073. }
  4074. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  4075. }
  4076. return offset + byteLength
  4077. }
  4078. Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  4079. value = +value
  4080. offset = offset | 0
  4081. if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  4082. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  4083. if (value < 0) value = 0xff + value + 1
  4084. this[offset] = (value & 0xff)
  4085. return offset + 1
  4086. }
  4087. Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  4088. value = +value
  4089. offset = offset | 0
  4090. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  4091. if (Buffer.TYPED_ARRAY_SUPPORT) {
  4092. this[offset] = (value & 0xff)
  4093. this[offset + 1] = (value >>> 8)
  4094. } else {
  4095. objectWriteUInt16(this, value, offset, true)
  4096. }
  4097. return offset + 2
  4098. }
  4099. Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  4100. value = +value
  4101. offset = offset | 0
  4102. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  4103. if (Buffer.TYPED_ARRAY_SUPPORT) {
  4104. this[offset] = (value >>> 8)
  4105. this[offset + 1] = (value & 0xff)
  4106. } else {
  4107. objectWriteUInt16(this, value, offset, false)
  4108. }
  4109. return offset + 2
  4110. }
  4111. Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  4112. value = +value
  4113. offset = offset | 0
  4114. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  4115. if (Buffer.TYPED_ARRAY_SUPPORT) {
  4116. this[offset] = (value & 0xff)
  4117. this[offset + 1] = (value >>> 8)
  4118. this[offset + 2] = (value >>> 16)
  4119. this[offset + 3] = (value >>> 24)
  4120. } else {
  4121. objectWriteUInt32(this, value, offset, true)
  4122. }
  4123. return offset + 4
  4124. }
  4125. Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  4126. value = +value
  4127. offset = offset | 0
  4128. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  4129. if (value < 0) value = 0xffffffff + value + 1
  4130. if (Buffer.TYPED_ARRAY_SUPPORT) {
  4131. this[offset] = (value >>> 24)
  4132. this[offset + 1] = (value >>> 16)
  4133. this[offset + 2] = (value >>> 8)
  4134. this[offset + 3] = (value & 0xff)
  4135. } else {
  4136. objectWriteUInt32(this, value, offset, false)
  4137. }
  4138. return offset + 4
  4139. }
  4140. function checkIEEE754 (buf, value, offset, ext, max, min) {
  4141. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  4142. if (offset < 0) throw new RangeError('Index out of range')
  4143. }
  4144. function writeFloat (buf, value, offset, littleEndian, noAssert) {
  4145. if (!noAssert) {
  4146. checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  4147. }
  4148. ieee754.write(buf, value, offset, littleEndian, 23, 4)
  4149. return offset + 4
  4150. }
  4151. Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  4152. return writeFloat(this, value, offset, true, noAssert)
  4153. }
  4154. Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  4155. return writeFloat(this, value, offset, false, noAssert)
  4156. }
  4157. function writeDouble (buf, value, offset, littleEndian, noAssert) {
  4158. if (!noAssert) {
  4159. checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  4160. }
  4161. ieee754.write(buf, value, offset, littleEndian, 52, 8)
  4162. return offset + 8
  4163. }
  4164. Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  4165. return writeDouble(this, value, offset, true, noAssert)
  4166. }
  4167. Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  4168. return writeDouble(this, value, offset, false, noAssert)
  4169. }
  4170. // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  4171. Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  4172. if (!start) start = 0
  4173. if (!end && end !== 0) end = this.length
  4174. if (targetStart >= target.length) targetStart = target.length
  4175. if (!targetStart) targetStart = 0
  4176. if (end > 0 && end < start) end = start
  4177. // Copy 0 bytes; we're done
  4178. if (end === start) return 0
  4179. if (target.length === 0 || this.length === 0) return 0
  4180. // Fatal error conditions
  4181. if (targetStart < 0) {
  4182. throw new RangeError('targetStart out of bounds')
  4183. }
  4184. if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  4185. if (end < 0) throw new RangeError('sourceEnd out of bounds')
  4186. // Are we oob?
  4187. if (end > this.length) end = this.length
  4188. if (target.length - targetStart < end - start) {
  4189. end = target.length - targetStart + start
  4190. }
  4191. var len = end - start
  4192. var i
  4193. if (this === target && start < targetStart && targetStart < end) {
  4194. // descending copy from end
  4195. for (i = len - 1; i >= 0; --i) {
  4196. target[i + targetStart] = this[i + start]
  4197. }
  4198. } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
  4199. // ascending copy from start
  4200. for (i = 0; i < len; ++i) {
  4201. target[i + targetStart] = this[i + start]
  4202. }
  4203. } else {
  4204. Uint8Array.prototype.set.call(
  4205. target,
  4206. this.subarray(start, start + len),
  4207. targetStart
  4208. )
  4209. }
  4210. return len
  4211. }
  4212. // Usage:
  4213. // buffer.fill(number[, offset[, end]])
  4214. // buffer.fill(buffer[, offset[, end]])
  4215. // buffer.fill(string[, offset[, end]][, encoding])
  4216. Buffer.prototype.fill = function fill (val, start, end, encoding) {
  4217. // Handle string cases:
  4218. if (typeof val === 'string') {
  4219. if (typeof start === 'string') {
  4220. encoding = start
  4221. start = 0
  4222. end = this.length
  4223. } else if (typeof end === 'string') {
  4224. encoding = end
  4225. end = this.length
  4226. }
  4227. if (val.length === 1) {
  4228. var code = val.charCodeAt(0)
  4229. if (code < 256) {
  4230. val = code
  4231. }
  4232. }
  4233. if (encoding !== undefined && typeof encoding !== 'string') {
  4234. throw new TypeError('encoding must be a string')
  4235. }
  4236. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  4237. throw new TypeError('Unknown encoding: ' + encoding)
  4238. }
  4239. } else if (typeof val === 'number') {
  4240. val = val & 255
  4241. }
  4242. // Invalid ranges are not set to a default, so can range check early.
  4243. if (start < 0 || this.length < start || this.length < end) {
  4244. throw new RangeError('Out of range index')
  4245. }
  4246. if (end <= start) {
  4247. return this
  4248. }
  4249. start = start >>> 0
  4250. end = end === undefined ? this.length : end >>> 0
  4251. if (!val) val = 0
  4252. var i
  4253. if (typeof val === 'number') {
  4254. for (i = start; i < end; ++i) {
  4255. this[i] = val
  4256. }
  4257. } else {
  4258. var bytes = Buffer.isBuffer(val)
  4259. ? val
  4260. : utf8ToBytes(new Buffer(val, encoding).toString())
  4261. var len = bytes.length
  4262. for (i = 0; i < end - start; ++i) {
  4263. this[i + start] = bytes[i % len]
  4264. }
  4265. }
  4266. return this
  4267. }
  4268. // HELPER FUNCTIONS
  4269. // ================
  4270. var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
  4271. function base64clean (str) {
  4272. // Node strips out invalid characters like \n and \t from the string, base64-js does not
  4273. str = stringtrim(str).replace(INVALID_BASE64_RE, '')
  4274. // Node converts strings with length < 2 to ''
  4275. if (str.length < 2) return ''
  4276. // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  4277. while (str.length % 4 !== 0) {
  4278. str = str + '='
  4279. }
  4280. return str
  4281. }
  4282. function stringtrim (str) {
  4283. if (str.trim) return str.trim()
  4284. return str.replace(/^\s+|\s+$/g, '')
  4285. }
  4286. function toHex (n) {
  4287. if (n < 16) return '0' + n.toString(16)
  4288. return n.toString(16)
  4289. }
  4290. function utf8ToBytes (string, units) {
  4291. units = units || Infinity
  4292. var codePoint
  4293. var length = string.length
  4294. var leadSurrogate = null
  4295. var bytes = []
  4296. for (var i = 0; i < length; ++i) {
  4297. codePoint = string.charCodeAt(i)
  4298. // is surrogate component
  4299. if (codePoint > 0xD7FF && codePoint < 0xE000) {
  4300. // last char was a lead
  4301. if (!leadSurrogate) {
  4302. // no lead yet
  4303. if (codePoint > 0xDBFF) {
  4304. // unexpected trail
  4305. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  4306. continue
  4307. } else if (i + 1 === length) {
  4308. // unpaired lead
  4309. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  4310. continue
  4311. }
  4312. // valid lead
  4313. leadSurrogate = codePoint
  4314. continue
  4315. }
  4316. // 2 leads in a row
  4317. if (codePoint < 0xDC00) {
  4318. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  4319. leadSurrogate = codePoint
  4320. continue
  4321. }
  4322. // valid surrogate pair
  4323. codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
  4324. } else if (leadSurrogate) {
  4325. // valid bmp char, but last char was a lead
  4326. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  4327. }
  4328. leadSurrogate = null
  4329. // encode utf8
  4330. if (codePoint < 0x80) {
  4331. if ((units -= 1) < 0) break
  4332. bytes.push(codePoint)
  4333. } else if (codePoint < 0x800) {
  4334. if ((units -= 2) < 0) break
  4335. bytes.push(
  4336. codePoint >> 0x6 | 0xC0,
  4337. codePoint & 0x3F | 0x80
  4338. )
  4339. } else if (codePoint < 0x10000) {
  4340. if ((units -= 3) < 0) break
  4341. bytes.push(
  4342. codePoint >> 0xC | 0xE0,
  4343. codePoint >> 0x6 & 0x3F | 0x80,
  4344. codePoint & 0x3F | 0x80
  4345. )
  4346. } else if (codePoint < 0x110000) {
  4347. if ((units -= 4) < 0) break
  4348. bytes.push(
  4349. codePoint >> 0x12 | 0xF0,
  4350. codePoint >> 0xC & 0x3F | 0x80,
  4351. codePoint >> 0x6 & 0x3F | 0x80,
  4352. codePoint & 0x3F | 0x80
  4353. )
  4354. } else {
  4355. throw new Error('Invalid code point')
  4356. }
  4357. }
  4358. return bytes
  4359. }
  4360. function asciiToBytes (str) {
  4361. var byteArray = []
  4362. for (var i = 0; i < str.length; ++i) {
  4363. // Node's code seems to be doing this and not & 0x7F..
  4364. byteArray.push(str.charCodeAt(i) & 0xFF)
  4365. }
  4366. return byteArray
  4367. }
  4368. function utf16leToBytes (str, units) {
  4369. var c, hi, lo
  4370. var byteArray = []
  4371. for (var i = 0; i < str.length; ++i) {
  4372. if ((units -= 2) < 0) break
  4373. c = str.charCodeAt(i)
  4374. hi = c >> 8
  4375. lo = c % 256
  4376. byteArray.push(lo)
  4377. byteArray.push(hi)
  4378. }
  4379. return byteArray
  4380. }
  4381. function base64ToBytes (str) {
  4382. return base64.toByteArray(base64clean(str))
  4383. }
  4384. function blitBuffer (src, dst, offset, length) {
  4385. for (var i = 0; i < length; ++i) {
  4386. if ((i + offset >= dst.length) || (i >= src.length)) break
  4387. dst[i + offset] = src[i]
  4388. }
  4389. return i
  4390. }
  4391. function isnan (val) {
  4392. return val !== val // eslint-disable-line no-self-compare
  4393. }
  4394. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(9)))
  4395. /***/ }),
  4396. /***/ 18:
  4397. /***/ (function(module, exports, __webpack_require__) {
  4398. "use strict";
  4399. exports.byteLength = byteLength
  4400. exports.toByteArray = toByteArray
  4401. exports.fromByteArray = fromByteArray
  4402. var lookup = []
  4403. var revLookup = []
  4404. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  4405. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  4406. for (var i = 0, len = code.length; i < len; ++i) {
  4407. lookup[i] = code[i]
  4408. revLookup[code.charCodeAt(i)] = i
  4409. }
  4410. // Support decoding URL-safe base64 strings, as Node.js does.
  4411. // See: https://en.wikipedia.org/wiki/Base64#URL_applications
  4412. revLookup['-'.charCodeAt(0)] = 62
  4413. revLookup['_'.charCodeAt(0)] = 63
  4414. function getLens (b64) {
  4415. var len = b64.length
  4416. if (len % 4 > 0) {
  4417. throw new Error('Invalid string. Length must be a multiple of 4')
  4418. }
  4419. // Trim off extra bytes after placeholder bytes are found
  4420. // See: https://github.com/beatgammit/base64-js/issues/42
  4421. var validLen = b64.indexOf('=')
  4422. if (validLen === -1) validLen = len
  4423. var placeHoldersLen = validLen === len
  4424. ? 0
  4425. : 4 - (validLen % 4)
  4426. return [validLen, placeHoldersLen]
  4427. }
  4428. // base64 is 4/3 + up to two characters of the original data
  4429. function byteLength (b64) {
  4430. var lens = getLens(b64)
  4431. var validLen = lens[0]
  4432. var placeHoldersLen = lens[1]
  4433. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  4434. }
  4435. function _byteLength (b64, validLen, placeHoldersLen) {
  4436. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  4437. }
  4438. function toByteArray (b64) {
  4439. var tmp
  4440. var lens = getLens(b64)
  4441. var validLen = lens[0]
  4442. var placeHoldersLen = lens[1]
  4443. var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
  4444. var curByte = 0
  4445. // if there are placeholders, only get up to the last complete 4 chars
  4446. var len = placeHoldersLen > 0
  4447. ? validLen - 4
  4448. : validLen
  4449. var i
  4450. for (i = 0; i < len; i += 4) {
  4451. tmp =
  4452. (revLookup[b64.charCodeAt(i)] << 18) |
  4453. (revLookup[b64.charCodeAt(i + 1)] << 12) |
  4454. (revLookup[b64.charCodeAt(i + 2)] << 6) |
  4455. revLookup[b64.charCodeAt(i + 3)]
  4456. arr[curByte++] = (tmp >> 16) & 0xFF
  4457. arr[curByte++] = (tmp >> 8) & 0xFF
  4458. arr[curByte++] = tmp & 0xFF
  4459. }
  4460. if (placeHoldersLen === 2) {
  4461. tmp =
  4462. (revLookup[b64.charCodeAt(i)] << 2) |
  4463. (revLookup[b64.charCodeAt(i + 1)] >> 4)
  4464. arr[curByte++] = tmp & 0xFF
  4465. }
  4466. if (placeHoldersLen === 1) {
  4467. tmp =
  4468. (revLookup[b64.charCodeAt(i)] << 10) |
  4469. (revLookup[b64.charCodeAt(i + 1)] << 4) |
  4470. (revLookup[b64.charCodeAt(i + 2)] >> 2)
  4471. arr[curByte++] = (tmp >> 8) & 0xFF
  4472. arr[curByte++] = tmp & 0xFF
  4473. }
  4474. return arr
  4475. }
  4476. function tripletToBase64 (num) {
  4477. return lookup[num >> 18 & 0x3F] +
  4478. lookup[num >> 12 & 0x3F] +
  4479. lookup[num >> 6 & 0x3F] +
  4480. lookup[num & 0x3F]
  4481. }
  4482. function encodeChunk (uint8, start, end) {
  4483. var tmp
  4484. var output = []
  4485. for (var i = start; i < end; i += 3) {
  4486. tmp =
  4487. ((uint8[i] << 16) & 0xFF0000) +
  4488. ((uint8[i + 1] << 8) & 0xFF00) +
  4489. (uint8[i + 2] & 0xFF)
  4490. output.push(tripletToBase64(tmp))
  4491. }
  4492. return output.join('')
  4493. }
  4494. function fromByteArray (uint8) {
  4495. var tmp
  4496. var len = uint8.length
  4497. var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  4498. var parts = []
  4499. var maxChunkLength = 16383 // must be multiple of 3
  4500. // go through the array every three bytes, we'll deal with trailing stuff later
  4501. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  4502. parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
  4503. }
  4504. // pad the end with zeros, but make sure to not forget the extra bytes
  4505. if (extraBytes === 1) {
  4506. tmp = uint8[len - 1]
  4507. parts.push(
  4508. lookup[tmp >> 2] +
  4509. lookup[(tmp << 4) & 0x3F] +
  4510. '=='
  4511. )
  4512. } else if (extraBytes === 2) {
  4513. tmp = (uint8[len - 2] << 8) + uint8[len - 1]
  4514. parts.push(
  4515. lookup[tmp >> 10] +
  4516. lookup[(tmp >> 4) & 0x3F] +
  4517. lookup[(tmp << 2) & 0x3F] +
  4518. '='
  4519. )
  4520. }
  4521. return parts.join('')
  4522. }
  4523. /***/ }),
  4524. /***/ 19:
  4525. /***/ (function(module, exports) {
  4526. /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
  4527. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  4528. var e, m
  4529. var eLen = (nBytes * 8) - mLen - 1
  4530. var eMax = (1 << eLen) - 1
  4531. var eBias = eMax >> 1
  4532. var nBits = -7
  4533. var i = isLE ? (nBytes - 1) : 0
  4534. var d = isLE ? -1 : 1
  4535. var s = buffer[offset + i]
  4536. i += d
  4537. e = s & ((1 << (-nBits)) - 1)
  4538. s >>= (-nBits)
  4539. nBits += eLen
  4540. for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  4541. m = e & ((1 << (-nBits)) - 1)
  4542. e >>= (-nBits)
  4543. nBits += mLen
  4544. for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  4545. if (e === 0) {
  4546. e = 1 - eBias
  4547. } else if (e === eMax) {
  4548. return m ? NaN : ((s ? -1 : 1) * Infinity)
  4549. } else {
  4550. m = m + Math.pow(2, mLen)
  4551. e = e - eBias
  4552. }
  4553. return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  4554. }
  4555. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  4556. var e, m, c
  4557. var eLen = (nBytes * 8) - mLen - 1
  4558. var eMax = (1 << eLen) - 1
  4559. var eBias = eMax >> 1
  4560. var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  4561. var i = isLE ? 0 : (nBytes - 1)
  4562. var d = isLE ? 1 : -1
  4563. var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
  4564. value = Math.abs(value)
  4565. if (isNaN(value) || value === Infinity) {
  4566. m = isNaN(value) ? 1 : 0
  4567. e = eMax
  4568. } else {
  4569. e = Math.floor(Math.log(value) / Math.LN2)
  4570. if (value * (c = Math.pow(2, -e)) < 1) {
  4571. e--
  4572. c *= 2
  4573. }
  4574. if (e + eBias >= 1) {
  4575. value += rt / c
  4576. } else {
  4577. value += rt * Math.pow(2, 1 - eBias)
  4578. }
  4579. if (value * c >= 2) {
  4580. e++
  4581. c /= 2
  4582. }
  4583. if (e + eBias >= eMax) {
  4584. m = 0
  4585. e = eMax
  4586. } else if (e + eBias >= 1) {
  4587. m = ((value * c) - 1) * Math.pow(2, mLen)
  4588. e = e + eBias
  4589. } else {
  4590. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
  4591. e = 0
  4592. }
  4593. }
  4594. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  4595. e = (e << mLen) | m
  4596. eLen += mLen
  4597. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  4598. buffer[offset + i - d] |= s * 128
  4599. }
  4600. /***/ }),
  4601. /***/ 2:
  4602. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4603. "use strict";
  4604. /* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isBrowser; });
  4605. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return target; });
  4606. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return isChrome; });
  4607. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isFirefox; });
  4608. /* unused harmony export isWindows */
  4609. /* unused harmony export isMac */
  4610. /* unused harmony export isLinux */
  4611. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return keys; });
  4612. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return initEnv; });
  4613. var isBrowser = typeof navigator !== 'undefined'
  4614. var target = isBrowser
  4615. ? window
  4616. : typeof global !== 'undefined'
  4617. ? global
  4618. : {}
  4619. var isChrome = typeof chrome !== 'undefined' && !!chrome.devtools
  4620. var isFirefox = isBrowser && navigator.userAgent.indexOf('Firefox') > -1
  4621. var isWindows = isBrowser && navigator.platform.indexOf('Win') === 0
  4622. var isMac = isBrowser && navigator.platform === 'MacIntel'
  4623. var isLinux = isBrowser && navigator.platform.indexOf('Linux') === 0
  4624. var keys = {
  4625. ctrl: isMac ? '&#8984;' : 'Ctrl',
  4626. shift: 'Shift',
  4627. alt: isMac ? '&#8997;' : 'Alt',
  4628. del: 'Del',
  4629. enter: 'Enter',
  4630. esc: 'Esc'
  4631. }
  4632. function initEnv (Vue) {
  4633. if (Vue.prototype.hasOwnProperty('$isChrome')) { return }
  4634. Object.defineProperties(Vue.prototype, {
  4635. '$isChrome': { get: () => isChrome },
  4636. '$isFirefox': { get: () => isFirefox },
  4637. '$isWindows': { get: () => isWindows },
  4638. '$isMac': { get: () => isMac },
  4639. '$isLinux': { get: () => isLinux },
  4640. '$keys': { get: () => keys }
  4641. })
  4642. if (isWindows) { document.body.classList.add('platform-windows') }
  4643. if (isMac) { document.body.classList.add('platform-mac') }
  4644. if (isLinux) { document.body.classList.add('platform-linux') }
  4645. }
  4646. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(9)))
  4647. /***/ }),
  4648. /***/ 20:
  4649. /***/ (function(module, exports) {
  4650. var toString = {}.toString;
  4651. module.exports = Array.isArray || function (arr) {
  4652. return toString.call(arr) == '[object Array]';
  4653. };
  4654. /***/ }),
  4655. /***/ 21:
  4656. /***/ (function(module, exports) {
  4657. // shim for using process in browser
  4658. var process = module.exports = {};
  4659. // cached from whatever global is present so that test runners that stub it
  4660. // don't break things. But we need to wrap it in a try catch in case it is
  4661. // wrapped in strict mode code which doesn't define any globals. It's inside a
  4662. // function because try/catches deoptimize in certain engines.
  4663. var cachedSetTimeout;
  4664. var cachedClearTimeout;
  4665. function defaultSetTimout() {
  4666. throw new Error('setTimeout has not been defined');
  4667. }
  4668. function defaultClearTimeout () {
  4669. throw new Error('clearTimeout has not been defined');
  4670. }
  4671. (function () {
  4672. try {
  4673. if (typeof setTimeout === 'function') {
  4674. cachedSetTimeout = setTimeout;
  4675. } else {
  4676. cachedSetTimeout = defaultSetTimout;
  4677. }
  4678. } catch (e) {
  4679. cachedSetTimeout = defaultSetTimout;
  4680. }
  4681. try {
  4682. if (typeof clearTimeout === 'function') {
  4683. cachedClearTimeout = clearTimeout;
  4684. } else {
  4685. cachedClearTimeout = defaultClearTimeout;
  4686. }
  4687. } catch (e) {
  4688. cachedClearTimeout = defaultClearTimeout;
  4689. }
  4690. } ())
  4691. function runTimeout(fun) {
  4692. if (cachedSetTimeout === setTimeout) {
  4693. //normal enviroments in sane situations
  4694. return setTimeout(fun, 0);
  4695. }
  4696. // if setTimeout wasn't available but was latter defined
  4697. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  4698. cachedSetTimeout = setTimeout;
  4699. return setTimeout(fun, 0);
  4700. }
  4701. try {
  4702. // when when somebody has screwed with setTimeout but no I.E. maddness
  4703. return cachedSetTimeout(fun, 0);
  4704. } catch(e){
  4705. try {
  4706. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  4707. return cachedSetTimeout.call(null, fun, 0);
  4708. } catch(e){
  4709. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  4710. return cachedSetTimeout.call(this, fun, 0);
  4711. }
  4712. }
  4713. }
  4714. function runClearTimeout(marker) {
  4715. if (cachedClearTimeout === clearTimeout) {
  4716. //normal enviroments in sane situations
  4717. return clearTimeout(marker);
  4718. }
  4719. // if clearTimeout wasn't available but was latter defined
  4720. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  4721. cachedClearTimeout = clearTimeout;
  4722. return clearTimeout(marker);
  4723. }
  4724. try {
  4725. // when when somebody has screwed with setTimeout but no I.E. maddness
  4726. return cachedClearTimeout(marker);
  4727. } catch (e){
  4728. try {
  4729. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  4730. return cachedClearTimeout.call(null, marker);
  4731. } catch (e){
  4732. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  4733. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  4734. return cachedClearTimeout.call(this, marker);
  4735. }
  4736. }
  4737. }
  4738. var queue = [];
  4739. var draining = false;
  4740. var currentQueue;
  4741. var queueIndex = -1;
  4742. function cleanUpNextTick() {
  4743. if (!draining || !currentQueue) {
  4744. return;
  4745. }
  4746. draining = false;
  4747. if (currentQueue.length) {
  4748. queue = currentQueue.concat(queue);
  4749. } else {
  4750. queueIndex = -1;
  4751. }
  4752. if (queue.length) {
  4753. drainQueue();
  4754. }
  4755. }
  4756. function drainQueue() {
  4757. if (draining) {
  4758. return;
  4759. }
  4760. var timeout = runTimeout(cleanUpNextTick);
  4761. draining = true;
  4762. var len = queue.length;
  4763. while(len) {
  4764. currentQueue = queue;
  4765. queue = [];
  4766. while (++queueIndex < len) {
  4767. if (currentQueue) {
  4768. currentQueue[queueIndex].run();
  4769. }
  4770. }
  4771. queueIndex = -1;
  4772. len = queue.length;
  4773. }
  4774. currentQueue = null;
  4775. draining = false;
  4776. runClearTimeout(timeout);
  4777. }
  4778. process.nextTick = function (fun) {
  4779. var args = new Array(arguments.length - 1);
  4780. if (arguments.length > 1) {
  4781. for (var i = 1; i < arguments.length; i++) {
  4782. args[i - 1] = arguments[i];
  4783. }
  4784. }
  4785. queue.push(new Item(fun, args));
  4786. if (queue.length === 1 && !draining) {
  4787. runTimeout(drainQueue);
  4788. }
  4789. };
  4790. // v8 likes predictible objects
  4791. function Item(fun, array) {
  4792. this.fun = fun;
  4793. this.array = array;
  4794. }
  4795. Item.prototype.run = function () {
  4796. this.fun.apply(null, this.array);
  4797. };
  4798. process.title = 'browser';
  4799. process.browser = true;
  4800. process.env = {};
  4801. process.argv = [];
  4802. process.version = ''; // empty string to avoid regexp issues
  4803. process.versions = {};
  4804. function noop() {}
  4805. process.on = noop;
  4806. process.addListener = noop;
  4807. process.once = noop;
  4808. process.off = noop;
  4809. process.removeListener = noop;
  4810. process.removeAllListeners = noop;
  4811. process.emit = noop;
  4812. process.prependListener = noop;
  4813. process.prependOnceListener = noop;
  4814. process.listeners = function (name) { return [] }
  4815. process.binding = function (name) {
  4816. throw new Error('process.binding is not supported');
  4817. };
  4818. process.cwd = function () { return '/' };
  4819. process.chdir = function (dir) {
  4820. throw new Error('process.chdir is not supported');
  4821. };
  4822. process.umask = function() { return 0; };
  4823. /***/ }),
  4824. /***/ 22:
  4825. /***/ (function(module, exports, __webpack_require__) {
  4826. /* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
  4827. // backported and transplited with Babel, with backwards-compat fixes
  4828. // Copyright Joyent, Inc. and other Node contributors.
  4829. //
  4830. // Permission is hereby granted, free of charge, to any person obtaining a
  4831. // copy of this software and associated documentation files (the
  4832. // "Software"), to deal in the Software without restriction, including
  4833. // without limitation the rights to use, copy, modify, merge, publish,
  4834. // distribute, sublicense, and/or sell copies of the Software, and to permit
  4835. // persons to whom the Software is furnished to do so, subject to the
  4836. // following conditions:
  4837. //
  4838. // The above copyright notice and this permission notice shall be included
  4839. // in all copies or substantial portions of the Software.
  4840. //
  4841. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  4842. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  4843. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  4844. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  4845. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  4846. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  4847. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  4848. // resolves . and .. elements in a path array with directory names there
  4849. // must be no slashes, empty elements, or device names (c:\) in the array
  4850. // (so also no leading and trailing slashes - it does not distinguish
  4851. // relative and absolute paths)
  4852. function normalizeArray(parts, allowAboveRoot) {
  4853. // if the path tries to go above the root, `up` ends up > 0
  4854. var up = 0;
  4855. for (var i = parts.length - 1; i >= 0; i--) {
  4856. var last = parts[i];
  4857. if (last === '.') {
  4858. parts.splice(i, 1);
  4859. } else if (last === '..') {
  4860. parts.splice(i, 1);
  4861. up++;
  4862. } else if (up) {
  4863. parts.splice(i, 1);
  4864. up--;
  4865. }
  4866. }
  4867. // if the path is allowed to go above the root, restore leading ..s
  4868. if (allowAboveRoot) {
  4869. for (; up--; up) {
  4870. parts.unshift('..');
  4871. }
  4872. }
  4873. return parts;
  4874. }
  4875. // path.resolve([from ...], to)
  4876. // posix version
  4877. exports.resolve = function() {
  4878. var resolvedPath = '',
  4879. resolvedAbsolute = false;
  4880. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  4881. var path = (i >= 0) ? arguments[i] : process.cwd();
  4882. // Skip empty and invalid entries
  4883. if (typeof path !== 'string') {
  4884. throw new TypeError('Arguments to path.resolve must be strings');
  4885. } else if (!path) {
  4886. continue;
  4887. }
  4888. resolvedPath = path + '/' + resolvedPath;
  4889. resolvedAbsolute = path.charAt(0) === '/';
  4890. }
  4891. // At this point the path should be resolved to a full absolute path, but
  4892. // handle relative paths to be safe (might happen when process.cwd() fails)
  4893. // Normalize the path
  4894. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  4895. return !!p;
  4896. }), !resolvedAbsolute).join('/');
  4897. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  4898. };
  4899. // path.normalize(path)
  4900. // posix version
  4901. exports.normalize = function(path) {
  4902. var isAbsolute = exports.isAbsolute(path),
  4903. trailingSlash = substr(path, -1) === '/';
  4904. // Normalize the path
  4905. path = normalizeArray(filter(path.split('/'), function(p) {
  4906. return !!p;
  4907. }), !isAbsolute).join('/');
  4908. if (!path && !isAbsolute) {
  4909. path = '.';
  4910. }
  4911. if (path && trailingSlash) {
  4912. path += '/';
  4913. }
  4914. return (isAbsolute ? '/' : '') + path;
  4915. };
  4916. // posix version
  4917. exports.isAbsolute = function(path) {
  4918. return path.charAt(0) === '/';
  4919. };
  4920. // posix version
  4921. exports.join = function() {
  4922. var paths = Array.prototype.slice.call(arguments, 0);
  4923. return exports.normalize(filter(paths, function(p, index) {
  4924. if (typeof p !== 'string') {
  4925. throw new TypeError('Arguments to path.join must be strings');
  4926. }
  4927. return p;
  4928. }).join('/'));
  4929. };
  4930. // path.relative(from, to)
  4931. // posix version
  4932. exports.relative = function(from, to) {
  4933. from = exports.resolve(from).substr(1);
  4934. to = exports.resolve(to).substr(1);
  4935. function trim(arr) {
  4936. var start = 0;
  4937. for (; start < arr.length; start++) {
  4938. if (arr[start] !== '') break;
  4939. }
  4940. var end = arr.length - 1;
  4941. for (; end >= 0; end--) {
  4942. if (arr[end] !== '') break;
  4943. }
  4944. if (start > end) return [];
  4945. return arr.slice(start, end - start + 1);
  4946. }
  4947. var fromParts = trim(from.split('/'));
  4948. var toParts = trim(to.split('/'));
  4949. var length = Math.min(fromParts.length, toParts.length);
  4950. var samePartsLength = length;
  4951. for (var i = 0; i < length; i++) {
  4952. if (fromParts[i] !== toParts[i]) {
  4953. samePartsLength = i;
  4954. break;
  4955. }
  4956. }
  4957. var outputParts = [];
  4958. for (var i = samePartsLength; i < fromParts.length; i++) {
  4959. outputParts.push('..');
  4960. }
  4961. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  4962. return outputParts.join('/');
  4963. };
  4964. exports.sep = '/';
  4965. exports.delimiter = ':';
  4966. exports.dirname = function (path) {
  4967. if (typeof path !== 'string') path = path + '';
  4968. if (path.length === 0) return '.';
  4969. var code = path.charCodeAt(0);
  4970. var hasRoot = code === 47 /*/*/;
  4971. var end = -1;
  4972. var matchedSlash = true;
  4973. for (var i = path.length - 1; i >= 1; --i) {
  4974. code = path.charCodeAt(i);
  4975. if (code === 47 /*/*/) {
  4976. if (!matchedSlash) {
  4977. end = i;
  4978. break;
  4979. }
  4980. } else {
  4981. // We saw the first non-path separator
  4982. matchedSlash = false;
  4983. }
  4984. }
  4985. if (end === -1) return hasRoot ? '/' : '.';
  4986. if (hasRoot && end === 1) {
  4987. // return '//';
  4988. // Backwards-compat fix:
  4989. return '/';
  4990. }
  4991. return path.slice(0, end);
  4992. };
  4993. function basename(path) {
  4994. if (typeof path !== 'string') path = path + '';
  4995. var start = 0;
  4996. var end = -1;
  4997. var matchedSlash = true;
  4998. var i;
  4999. for (i = path.length - 1; i >= 0; --i) {
  5000. if (path.charCodeAt(i) === 47 /*/*/) {
  5001. // If we reached a path separator that was not part of a set of path
  5002. // separators at the end of the string, stop now
  5003. if (!matchedSlash) {
  5004. start = i + 1;
  5005. break;
  5006. }
  5007. } else if (end === -1) {
  5008. // We saw the first non-path separator, mark this as the end of our
  5009. // path component
  5010. matchedSlash = false;
  5011. end = i + 1;
  5012. }
  5013. }
  5014. if (end === -1) return '';
  5015. return path.slice(start, end);
  5016. }
  5017. // Uses a mixed approach for backwards-compatibility, as ext behavior changed
  5018. // in new Node.js versions, so only basename() above is backported here
  5019. exports.basename = function (path, ext) {
  5020. var f = basename(path);
  5021. if (ext && f.substr(-1 * ext.length) === ext) {
  5022. f = f.substr(0, f.length - ext.length);
  5023. }
  5024. return f;
  5025. };
  5026. exports.extname = function (path) {
  5027. if (typeof path !== 'string') path = path + '';
  5028. var startDot = -1;
  5029. var startPart = 0;
  5030. var end = -1;
  5031. var matchedSlash = true;
  5032. // Track the state of characters (if any) we see before our first dot and
  5033. // after any path separator we find
  5034. var preDotState = 0;
  5035. for (var i = path.length - 1; i >= 0; --i) {
  5036. var code = path.charCodeAt(i);
  5037. if (code === 47 /*/*/) {
  5038. // If we reached a path separator that was not part of a set of path
  5039. // separators at the end of the string, stop now
  5040. if (!matchedSlash) {
  5041. startPart = i + 1;
  5042. break;
  5043. }
  5044. continue;
  5045. }
  5046. if (end === -1) {
  5047. // We saw the first non-path separator, mark this as the end of our
  5048. // extension
  5049. matchedSlash = false;
  5050. end = i + 1;
  5051. }
  5052. if (code === 46 /*.*/) {
  5053. // If this is our first dot, mark it as the start of our extension
  5054. if (startDot === -1)
  5055. startDot = i;
  5056. else if (preDotState !== 1)
  5057. preDotState = 1;
  5058. } else if (startDot !== -1) {
  5059. // We saw a non-dot and non-path separator before our dot, so we should
  5060. // have a good chance at having a non-empty extension
  5061. preDotState = -1;
  5062. }
  5063. }
  5064. if (startDot === -1 || end === -1 ||
  5065. // We saw a non-dot character immediately before the dot
  5066. preDotState === 0 ||
  5067. // The (right-most) trimmed path component is exactly '..'
  5068. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  5069. return '';
  5070. }
  5071. return path.slice(startDot, end);
  5072. };
  5073. function filter (xs, f) {
  5074. if (xs.filter) return xs.filter(f);
  5075. var res = [];
  5076. for (var i = 0; i < xs.length; i++) {
  5077. if (f(xs[i], i, xs)) res.push(xs[i]);
  5078. }
  5079. return res;
  5080. }
  5081. // String.prototype.substr - negative index don't work in IE8
  5082. var substr = 'ab'.substr(-1) === 'b'
  5083. ? function (str, start, len) { return str.substr(start, len) }
  5084. : function (str, start, len) {
  5085. if (start < 0) start = str.length + start;
  5086. return str.substr(start, len);
  5087. }
  5088. ;
  5089. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(21)))
  5090. /***/ }),
  5091. /***/ 23:
  5092. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5093. "use strict";
  5094. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Bridge; });
  5095. /* harmony import */ var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24);
  5096. /* harmony import */ var events__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_0__);
  5097. var BATCH_DURATION = 100
  5098. class Bridge extends events__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"] {
  5099. constructor (wall) {
  5100. super()
  5101. this.setMaxListeners(Infinity)
  5102. this.wall = wall
  5103. wall.listen(messages => {
  5104. if (Array.isArray(messages)) {
  5105. messages.forEach(message => this._emit(message))
  5106. } else {
  5107. this._emit(messages)
  5108. }
  5109. })
  5110. this._batchingQueue = []
  5111. this._sendingQueue = []
  5112. this._receivingQueue = []
  5113. this._sending = false
  5114. this._time = null
  5115. }
  5116. /**
  5117. * Send an event.
  5118. *
  5119. * @param {String} event
  5120. * @param {*} payload
  5121. */
  5122. send (event, payload) {
  5123. if (Array.isArray(payload)) {
  5124. var lastIndex = payload.length - 1
  5125. payload.forEach((chunk, index) => {
  5126. this._send({
  5127. event,
  5128. _chunk: chunk,
  5129. last: index === lastIndex
  5130. })
  5131. })
  5132. this._flush()
  5133. } else if (this._time === null) {
  5134. this._send([{ event, payload }])
  5135. this._time = Date.now()
  5136. } else {
  5137. this._batchingQueue.push({
  5138. event,
  5139. payload
  5140. })
  5141. var now = Date.now()
  5142. if (now - this._time > BATCH_DURATION) {
  5143. this._flush()
  5144. } else {
  5145. this._timer = setTimeout(() => this._flush(), BATCH_DURATION)
  5146. }
  5147. }
  5148. }
  5149. /**
  5150. * Log a message to the devtools background page.
  5151. *
  5152. * @param {String} message
  5153. */
  5154. log (message) {
  5155. this.send('log', message)
  5156. }
  5157. _flush () {
  5158. if (this._batchingQueue.length) { this._send(this._batchingQueue) }
  5159. clearTimeout(this._timer)
  5160. this._batchingQueue = []
  5161. this._time = null
  5162. }
  5163. _emit (message) {
  5164. if (typeof message === 'string') {
  5165. this.emit(message)
  5166. } else if (message._chunk) {
  5167. this._receivingQueue.push(message._chunk)
  5168. if (message.last) {
  5169. this.emit(message.event, this._receivingQueue)
  5170. this._receivingQueue = []
  5171. }
  5172. } else {
  5173. this.emit(message.event, message.payload)
  5174. }
  5175. }
  5176. _send (messages) {
  5177. this._sendingQueue.push(messages)
  5178. this._nextSend()
  5179. }
  5180. _nextSend () {
  5181. if (!this._sendingQueue.length || this._sending) { return }
  5182. this._sending = true
  5183. var messages = this._sendingQueue.shift()
  5184. try {
  5185. this.wall.send(messages)
  5186. } catch (err) {
  5187. if (err.message === 'Message length exceeded maximum allowed length.') {
  5188. this._sendingQueue.splice(0, 0, messages.map(message => [message]))
  5189. }
  5190. }
  5191. this._sending = false
  5192. requestAnimationFrame(() => this._nextSend())
  5193. }
  5194. }
  5195. /***/ }),
  5196. /***/ 24:
  5197. /***/ (function(module, exports, __webpack_require__) {
  5198. "use strict";
  5199. // Copyright Joyent, Inc. and other Node contributors.
  5200. //
  5201. // Permission is hereby granted, free of charge, to any person obtaining a
  5202. // copy of this software and associated documentation files (the
  5203. // "Software"), to deal in the Software without restriction, including
  5204. // without limitation the rights to use, copy, modify, merge, publish,
  5205. // distribute, sublicense, and/or sell copies of the Software, and to permit
  5206. // persons to whom the Software is furnished to do so, subject to the
  5207. // following conditions:
  5208. //
  5209. // The above copyright notice and this permission notice shall be included
  5210. // in all copies or substantial portions of the Software.
  5211. //
  5212. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  5213. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  5214. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  5215. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  5216. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  5217. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  5218. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  5219. var R = typeof Reflect === 'object' ? Reflect : null
  5220. var ReflectApply = R && typeof R.apply === 'function'
  5221. ? R.apply
  5222. : function ReflectApply(target, receiver, args) {
  5223. return Function.prototype.apply.call(target, receiver, args);
  5224. }
  5225. var ReflectOwnKeys
  5226. if (R && typeof R.ownKeys === 'function') {
  5227. ReflectOwnKeys = R.ownKeys
  5228. } else if (Object.getOwnPropertySymbols) {
  5229. ReflectOwnKeys = function ReflectOwnKeys(target) {
  5230. return Object.getOwnPropertyNames(target)
  5231. .concat(Object.getOwnPropertySymbols(target));
  5232. };
  5233. } else {
  5234. ReflectOwnKeys = function ReflectOwnKeys(target) {
  5235. return Object.getOwnPropertyNames(target);
  5236. };
  5237. }
  5238. function ProcessEmitWarning(warning) {
  5239. if (console && console.warn) console.warn(warning);
  5240. }
  5241. var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
  5242. return value !== value;
  5243. }
  5244. function EventEmitter() {
  5245. EventEmitter.init.call(this);
  5246. }
  5247. module.exports = EventEmitter;
  5248. module.exports.once = once;
  5249. // Backwards-compat with node 0.10.x
  5250. EventEmitter.EventEmitter = EventEmitter;
  5251. EventEmitter.prototype._events = undefined;
  5252. EventEmitter.prototype._eventsCount = 0;
  5253. EventEmitter.prototype._maxListeners = undefined;
  5254. // By default EventEmitters will print a warning if more than 10 listeners are
  5255. // added to it. This is a useful default which helps finding memory leaks.
  5256. var defaultMaxListeners = 10;
  5257. function checkListener(listener) {
  5258. if (typeof listener !== 'function') {
  5259. throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
  5260. }
  5261. }
  5262. Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
  5263. enumerable: true,
  5264. get: function() {
  5265. return defaultMaxListeners;
  5266. },
  5267. set: function(arg) {
  5268. if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
  5269. throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
  5270. }
  5271. defaultMaxListeners = arg;
  5272. }
  5273. });
  5274. EventEmitter.init = function() {
  5275. if (this._events === undefined ||
  5276. this._events === Object.getPrototypeOf(this)._events) {
  5277. this._events = Object.create(null);
  5278. this._eventsCount = 0;
  5279. }
  5280. this._maxListeners = this._maxListeners || undefined;
  5281. };
  5282. // Obviously not all Emitters should be limited to 10. This function allows
  5283. // that to be increased. Set to zero for unlimited.
  5284. EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
  5285. if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
  5286. throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
  5287. }
  5288. this._maxListeners = n;
  5289. return this;
  5290. };
  5291. function _getMaxListeners(that) {
  5292. if (that._maxListeners === undefined)
  5293. return EventEmitter.defaultMaxListeners;
  5294. return that._maxListeners;
  5295. }
  5296. EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
  5297. return _getMaxListeners(this);
  5298. };
  5299. EventEmitter.prototype.emit = function emit(type) {
  5300. var args = [];
  5301. for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
  5302. var doError = (type === 'error');
  5303. var events = this._events;
  5304. if (events !== undefined)
  5305. doError = (doError && events.error === undefined);
  5306. else if (!doError)
  5307. return false;
  5308. // If there is no 'error' event listener then throw.
  5309. if (doError) {
  5310. var er;
  5311. if (args.length > 0)
  5312. er = args[0];
  5313. if (er instanceof Error) {
  5314. // Note: The comments on the `throw` lines are intentional, they show
  5315. // up in Node's output if this results in an unhandled exception.
  5316. throw er; // Unhandled 'error' event
  5317. }
  5318. // At least give some kind of context to the user
  5319. var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
  5320. err.context = er;
  5321. throw err; // Unhandled 'error' event
  5322. }
  5323. var handler = events[type];
  5324. if (handler === undefined)
  5325. return false;
  5326. if (typeof handler === 'function') {
  5327. ReflectApply(handler, this, args);
  5328. } else {
  5329. var len = handler.length;
  5330. var listeners = arrayClone(handler, len);
  5331. for (var i = 0; i < len; ++i)
  5332. ReflectApply(listeners[i], this, args);
  5333. }
  5334. return true;
  5335. };
  5336. function _addListener(target, type, listener, prepend) {
  5337. var m;
  5338. var events;
  5339. var existing;
  5340. checkListener(listener);
  5341. events = target._events;
  5342. if (events === undefined) {
  5343. events = target._events = Object.create(null);
  5344. target._eventsCount = 0;
  5345. } else {
  5346. // To avoid recursion in the case that type === "newListener"! Before
  5347. // adding it to the listeners, first emit "newListener".
  5348. if (events.newListener !== undefined) {
  5349. target.emit('newListener', type,
  5350. listener.listener ? listener.listener : listener);
  5351. // Re-assign `events` because a newListener handler could have caused the
  5352. // this._events to be assigned to a new object
  5353. events = target._events;
  5354. }
  5355. existing = events[type];
  5356. }
  5357. if (existing === undefined) {
  5358. // Optimize the case of one listener. Don't need the extra array object.
  5359. existing = events[type] = listener;
  5360. ++target._eventsCount;
  5361. } else {
  5362. if (typeof existing === 'function') {
  5363. // Adding the second element, need to change to array.
  5364. existing = events[type] =
  5365. prepend ? [listener, existing] : [existing, listener];
  5366. // If we've already got an array, just append.
  5367. } else if (prepend) {
  5368. existing.unshift(listener);
  5369. } else {
  5370. existing.push(listener);
  5371. }
  5372. // Check for listener leak
  5373. m = _getMaxListeners(target);
  5374. if (m > 0 && existing.length > m && !existing.warned) {
  5375. existing.warned = true;
  5376. // No error code for this since it is a Warning
  5377. // eslint-disable-next-line no-restricted-syntax
  5378. var w = new Error('Possible EventEmitter memory leak detected. ' +
  5379. existing.length + ' ' + String(type) + ' listeners ' +
  5380. 'added. Use emitter.setMaxListeners() to ' +
  5381. 'increase limit');
  5382. w.name = 'MaxListenersExceededWarning';
  5383. w.emitter = target;
  5384. w.type = type;
  5385. w.count = existing.length;
  5386. ProcessEmitWarning(w);
  5387. }
  5388. }
  5389. return target;
  5390. }
  5391. EventEmitter.prototype.addListener = function addListener(type, listener) {
  5392. return _addListener(this, type, listener, false);
  5393. };
  5394. EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  5395. EventEmitter.prototype.prependListener =
  5396. function prependListener(type, listener) {
  5397. return _addListener(this, type, listener, true);
  5398. };
  5399. function onceWrapper() {
  5400. if (!this.fired) {
  5401. this.target.removeListener(this.type, this.wrapFn);
  5402. this.fired = true;
  5403. if (arguments.length === 0)
  5404. return this.listener.call(this.target);
  5405. return this.listener.apply(this.target, arguments);
  5406. }
  5407. }
  5408. function _onceWrap(target, type, listener) {
  5409. var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
  5410. var wrapped = onceWrapper.bind(state);
  5411. wrapped.listener = listener;
  5412. state.wrapFn = wrapped;
  5413. return wrapped;
  5414. }
  5415. EventEmitter.prototype.once = function once(type, listener) {
  5416. checkListener(listener);
  5417. this.on(type, _onceWrap(this, type, listener));
  5418. return this;
  5419. };
  5420. EventEmitter.prototype.prependOnceListener =
  5421. function prependOnceListener(type, listener) {
  5422. checkListener(listener);
  5423. this.prependListener(type, _onceWrap(this, type, listener));
  5424. return this;
  5425. };
  5426. // Emits a 'removeListener' event if and only if the listener was removed.
  5427. EventEmitter.prototype.removeListener =
  5428. function removeListener(type, listener) {
  5429. var list, events, position, i, originalListener;
  5430. checkListener(listener);
  5431. events = this._events;
  5432. if (events === undefined)
  5433. return this;
  5434. list = events[type];
  5435. if (list === undefined)
  5436. return this;
  5437. if (list === listener || list.listener === listener) {
  5438. if (--this._eventsCount === 0)
  5439. this._events = Object.create(null);
  5440. else {
  5441. delete events[type];
  5442. if (events.removeListener)
  5443. this.emit('removeListener', type, list.listener || listener);
  5444. }
  5445. } else if (typeof list !== 'function') {
  5446. position = -1;
  5447. for (i = list.length - 1; i >= 0; i--) {
  5448. if (list[i] === listener || list[i].listener === listener) {
  5449. originalListener = list[i].listener;
  5450. position = i;
  5451. break;
  5452. }
  5453. }
  5454. if (position < 0)
  5455. return this;
  5456. if (position === 0)
  5457. list.shift();
  5458. else {
  5459. spliceOne(list, position);
  5460. }
  5461. if (list.length === 1)
  5462. events[type] = list[0];
  5463. if (events.removeListener !== undefined)
  5464. this.emit('removeListener', type, originalListener || listener);
  5465. }
  5466. return this;
  5467. };
  5468. EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
  5469. EventEmitter.prototype.removeAllListeners =
  5470. function removeAllListeners(type) {
  5471. var listeners, events, i;
  5472. events = this._events;
  5473. if (events === undefined)
  5474. return this;
  5475. // not listening for removeListener, no need to emit
  5476. if (events.removeListener === undefined) {
  5477. if (arguments.length === 0) {
  5478. this._events = Object.create(null);
  5479. this._eventsCount = 0;
  5480. } else if (events[type] !== undefined) {
  5481. if (--this._eventsCount === 0)
  5482. this._events = Object.create(null);
  5483. else
  5484. delete events[type];
  5485. }
  5486. return this;
  5487. }
  5488. // emit removeListener for all listeners on all events
  5489. if (arguments.length === 0) {
  5490. var keys = Object.keys(events);
  5491. var key;
  5492. for (i = 0; i < keys.length; ++i) {
  5493. key = keys[i];
  5494. if (key === 'removeListener') continue;
  5495. this.removeAllListeners(key);
  5496. }
  5497. this.removeAllListeners('removeListener');
  5498. this._events = Object.create(null);
  5499. this._eventsCount = 0;
  5500. return this;
  5501. }
  5502. listeners = events[type];
  5503. if (typeof listeners === 'function') {
  5504. this.removeListener(type, listeners);
  5505. } else if (listeners !== undefined) {
  5506. // LIFO order
  5507. for (i = listeners.length - 1; i >= 0; i--) {
  5508. this.removeListener(type, listeners[i]);
  5509. }
  5510. }
  5511. return this;
  5512. };
  5513. function _listeners(target, type, unwrap) {
  5514. var events = target._events;
  5515. if (events === undefined)
  5516. return [];
  5517. var evlistener = events[type];
  5518. if (evlistener === undefined)
  5519. return [];
  5520. if (typeof evlistener === 'function')
  5521. return unwrap ? [evlistener.listener || evlistener] : [evlistener];
  5522. return unwrap ?
  5523. unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
  5524. }
  5525. EventEmitter.prototype.listeners = function listeners(type) {
  5526. return _listeners(this, type, true);
  5527. };
  5528. EventEmitter.prototype.rawListeners = function rawListeners(type) {
  5529. return _listeners(this, type, false);
  5530. };
  5531. EventEmitter.listenerCount = function(emitter, type) {
  5532. if (typeof emitter.listenerCount === 'function') {
  5533. return emitter.listenerCount(type);
  5534. } else {
  5535. return listenerCount.call(emitter, type);
  5536. }
  5537. };
  5538. EventEmitter.prototype.listenerCount = listenerCount;
  5539. function listenerCount(type) {
  5540. var events = this._events;
  5541. if (events !== undefined) {
  5542. var evlistener = events[type];
  5543. if (typeof evlistener === 'function') {
  5544. return 1;
  5545. } else if (evlistener !== undefined) {
  5546. return evlistener.length;
  5547. }
  5548. }
  5549. return 0;
  5550. }
  5551. EventEmitter.prototype.eventNames = function eventNames() {
  5552. return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
  5553. };
  5554. function arrayClone(arr, n) {
  5555. var copy = new Array(n);
  5556. for (var i = 0; i < n; ++i)
  5557. copy[i] = arr[i];
  5558. return copy;
  5559. }
  5560. function spliceOne(list, index) {
  5561. for (; index + 1 < list.length; index++)
  5562. list[index] = list[index + 1];
  5563. list.pop();
  5564. }
  5565. function unwrapListeners(arr) {
  5566. var ret = new Array(arr.length);
  5567. for (var i = 0; i < ret.length; ++i) {
  5568. ret[i] = arr[i].listener || arr[i];
  5569. }
  5570. return ret;
  5571. }
  5572. function once(emitter, name) {
  5573. return new Promise(function (resolve, reject) {
  5574. function errorListener(err) {
  5575. emitter.removeListener(name, resolver);
  5576. reject(err);
  5577. }
  5578. function resolver() {
  5579. if (typeof emitter.removeListener === 'function') {
  5580. emitter.removeListener('error', errorListener);
  5581. }
  5582. resolve([].slice.call(arguments));
  5583. };
  5584. eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
  5585. if (name !== 'error') {
  5586. addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
  5587. }
  5588. });
  5589. }
  5590. function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
  5591. if (typeof emitter.on === 'function') {
  5592. eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
  5593. }
  5594. }
  5595. function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
  5596. if (typeof emitter.on === 'function') {
  5597. if (flags.once) {
  5598. emitter.once(name, listener);
  5599. } else {
  5600. emitter.on(name, listener);
  5601. }
  5602. } else if (typeof emitter.addEventListener === 'function') {
  5603. // EventTarget does not have `error` event semantics like Node
  5604. // EventEmitters, we do not listen for `error` events here.
  5605. emitter.addEventListener(name, function wrapListener(arg) {
  5606. // IE does not have builtin `{ once: true }` support so we
  5607. // have to do it manually.
  5608. if (flags.once) {
  5609. emitter.removeEventListener(name, wrapListener);
  5610. }
  5611. listener(arg);
  5612. });
  5613. } else {
  5614. throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
  5615. }
  5616. }
  5617. /***/ }),
  5618. /***/ 35:
  5619. /***/ (function(module, exports, __webpack_require__) {
  5620. /* WEBPACK VAR INJECTION */(function(global) {var scope = (typeof global !== "undefined" && global) ||
  5621. (typeof self !== "undefined" && self) ||
  5622. window;
  5623. var apply = Function.prototype.apply;
  5624. // DOM APIs, for completeness
  5625. exports.setTimeout = function() {
  5626. return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);
  5627. };
  5628. exports.setInterval = function() {
  5629. return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);
  5630. };
  5631. exports.clearTimeout =
  5632. exports.clearInterval = function(timeout) {
  5633. if (timeout) {
  5634. timeout.close();
  5635. }
  5636. };
  5637. function Timeout(id, clearFn) {
  5638. this._id = id;
  5639. this._clearFn = clearFn;
  5640. }
  5641. Timeout.prototype.unref = Timeout.prototype.ref = function() {};
  5642. Timeout.prototype.close = function() {
  5643. this._clearFn.call(scope, this._id);
  5644. };
  5645. // Does not start the time, just sets up the members needed.
  5646. exports.enroll = function(item, msecs) {
  5647. clearTimeout(item._idleTimeoutId);
  5648. item._idleTimeout = msecs;
  5649. };
  5650. exports.unenroll = function(item) {
  5651. clearTimeout(item._idleTimeoutId);
  5652. item._idleTimeout = -1;
  5653. };
  5654. exports._unrefActive = exports.active = function(item) {
  5655. clearTimeout(item._idleTimeoutId);
  5656. var msecs = item._idleTimeout;
  5657. if (msecs >= 0) {
  5658. item._idleTimeoutId = setTimeout(function onTimeout() {
  5659. if (item._onTimeout)
  5660. item._onTimeout();
  5661. }, msecs);
  5662. }
  5663. };
  5664. // setimmediate attaches itself to the global object
  5665. __webpack_require__(36);
  5666. // On some exotic environments, it's not clear which object `setimmediate` was
  5667. // able to install onto. Search each possibility in the same order as the
  5668. // `setimmediate` library.
  5669. exports.setImmediate = (typeof self !== "undefined" && self.setImmediate) ||
  5670. (typeof global !== "undefined" && global.setImmediate) ||
  5671. (this && this.setImmediate);
  5672. exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) ||
  5673. (typeof global !== "undefined" && global.clearImmediate) ||
  5674. (this && this.clearImmediate);
  5675. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(9)))
  5676. /***/ }),
  5677. /***/ 36:
  5678. /***/ (function(module, exports, __webpack_require__) {
  5679. /* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
  5680. "use strict";
  5681. if (global.setImmediate) {
  5682. return;
  5683. }
  5684. var nextHandle = 1; // Spec says greater than zero
  5685. var tasksByHandle = {};
  5686. var currentlyRunningATask = false;
  5687. var doc = global.document;
  5688. var registerImmediate;
  5689. function setImmediate(callback) {
  5690. // Callback can either be a function or a string
  5691. if (typeof callback !== "function") {
  5692. callback = new Function("" + callback);
  5693. }
  5694. // Copy function arguments
  5695. var args = new Array(arguments.length - 1);
  5696. for (var i = 0; i < args.length; i++) {
  5697. args[i] = arguments[i + 1];
  5698. }
  5699. // Store and register the task
  5700. var task = { callback: callback, args: args };
  5701. tasksByHandle[nextHandle] = task;
  5702. registerImmediate(nextHandle);
  5703. return nextHandle++;
  5704. }
  5705. function clearImmediate(handle) {
  5706. delete tasksByHandle[handle];
  5707. }
  5708. function run(task) {
  5709. var callback = task.callback;
  5710. var args = task.args;
  5711. switch (args.length) {
  5712. case 0:
  5713. callback();
  5714. break;
  5715. case 1:
  5716. callback(args[0]);
  5717. break;
  5718. case 2:
  5719. callback(args[0], args[1]);
  5720. break;
  5721. case 3:
  5722. callback(args[0], args[1], args[2]);
  5723. break;
  5724. default:
  5725. callback.apply(undefined, args);
  5726. break;
  5727. }
  5728. }
  5729. function runIfPresent(handle) {
  5730. // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
  5731. // So if we're currently running a task, we'll need to delay this invocation.
  5732. if (currentlyRunningATask) {
  5733. // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
  5734. // "too much recursion" error.
  5735. setTimeout(runIfPresent, 0, handle);
  5736. } else {
  5737. var task = tasksByHandle[handle];
  5738. if (task) {
  5739. currentlyRunningATask = true;
  5740. try {
  5741. run(task);
  5742. } finally {
  5743. clearImmediate(handle);
  5744. currentlyRunningATask = false;
  5745. }
  5746. }
  5747. }
  5748. }
  5749. function installNextTickImplementation() {
  5750. registerImmediate = function(handle) {
  5751. process.nextTick(function () { runIfPresent(handle); });
  5752. };
  5753. }
  5754. function canUsePostMessage() {
  5755. // The test against `importScripts` prevents this implementation from being installed inside a web worker,
  5756. // where `global.postMessage` means something completely different and can't be used for this purpose.
  5757. if (global.postMessage && !global.importScripts) {
  5758. var postMessageIsAsynchronous = true;
  5759. var oldOnMessage = global.onmessage;
  5760. global.onmessage = function() {
  5761. postMessageIsAsynchronous = false;
  5762. };
  5763. global.postMessage("", "*");
  5764. global.onmessage = oldOnMessage;
  5765. return postMessageIsAsynchronous;
  5766. }
  5767. }
  5768. function installPostMessageImplementation() {
  5769. // Installs an event handler on `global` for the `message` event: see
  5770. // * https://developer.mozilla.org/en/DOM/window.postMessage
  5771. // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
  5772. var messagePrefix = "setImmediate$" + Math.random() + "$";
  5773. var onGlobalMessage = function(event) {
  5774. if (event.source === global &&
  5775. typeof event.data === "string" &&
  5776. event.data.indexOf(messagePrefix) === 0) {
  5777. runIfPresent(+event.data.slice(messagePrefix.length));
  5778. }
  5779. };
  5780. if (global.addEventListener) {
  5781. global.addEventListener("message", onGlobalMessage, false);
  5782. } else {
  5783. global.attachEvent("onmessage", onGlobalMessage);
  5784. }
  5785. registerImmediate = function(handle) {
  5786. global.postMessage(messagePrefix + handle, "*");
  5787. };
  5788. }
  5789. function installMessageChannelImplementation() {
  5790. var channel = new MessageChannel();
  5791. channel.port1.onmessage = function(event) {
  5792. var handle = event.data;
  5793. runIfPresent(handle);
  5794. };
  5795. registerImmediate = function(handle) {
  5796. channel.port2.postMessage(handle);
  5797. };
  5798. }
  5799. function installReadyStateChangeImplementation() {
  5800. var html = doc.documentElement;
  5801. registerImmediate = function(handle) {
  5802. // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
  5803. // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
  5804. var script = doc.createElement("script");
  5805. script.onreadystatechange = function () {
  5806. runIfPresent(handle);
  5807. script.onreadystatechange = null;
  5808. html.removeChild(script);
  5809. script = null;
  5810. };
  5811. html.appendChild(script);
  5812. };
  5813. }
  5814. function installSetTimeoutImplementation() {
  5815. registerImmediate = function(handle) {
  5816. setTimeout(runIfPresent, 0, handle);
  5817. };
  5818. }
  5819. // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
  5820. var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
  5821. attachTo = attachTo && attachTo.setTimeout ? attachTo : global;
  5822. // Don't get fooled by e.g. browserify environments.
  5823. if ({}.toString.call(global.process) === "[object process]") {
  5824. // For Node.js before 0.9
  5825. installNextTickImplementation();
  5826. } else if (canUsePostMessage()) {
  5827. // For non-IE10 modern browsers
  5828. installPostMessageImplementation();
  5829. } else if (global.MessageChannel) {
  5830. // For web workers, where supported
  5831. installMessageChannelImplementation();
  5832. } else if (doc && "onreadystatechange" in doc.createElement("script")) {
  5833. // For IE 6–8
  5834. installReadyStateChangeImplementation();
  5835. } else {
  5836. // For older browsers
  5837. installSetTimeoutImplementation();
  5838. }
  5839. attachTo.setImmediate = setImmediate;
  5840. attachTo.clearImmediate = clearImmediate;
  5841. }(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));
  5842. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(9), __webpack_require__(21)))
  5843. /***/ }),
  5844. /***/ 4:
  5845. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5846. "use strict";
  5847. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return init; });
  5848. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return destroy; });
  5849. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return watch; });
  5850. /* harmony import */ var _storage__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10);
  5851. // Initial state
  5852. var internalSharedData = {
  5853. openInEditorHost: '/',
  5854. componentNameStyle: 'class',
  5855. theme: 'auto',
  5856. displayDensity: 'low',
  5857. timeFormat: 'default',
  5858. recordVuex: true,
  5859. cacheVuexSnapshotsEvery: 50,
  5860. cacheVuexSnapshotsLimit: 10,
  5861. snapshotLoading: false,
  5862. recordPerf: false,
  5863. editableProps: false,
  5864. logDetected: true,
  5865. vuexNewBackend: false,
  5866. vuexAutoload: false
  5867. }
  5868. var persisted = [
  5869. 'componentNameStyle',
  5870. 'theme',
  5871. 'displayDensity',
  5872. 'recordVuex',
  5873. 'editableProps',
  5874. 'logDetected',
  5875. 'vuexNewBackend',
  5876. 'vuexAutoload',
  5877. 'timeFormat'
  5878. ]
  5879. // ---- INTERNALS ---- //
  5880. var Vue
  5881. var bridge
  5882. // List of fields to persist to storage (disabled if 'false')
  5883. // This should be unique to each shared data client to prevent conflicts
  5884. var persist = false
  5885. // For reactivity, we wrap the data in a Vue instance
  5886. var vm
  5887. function init (params) {
  5888. // Mandatory params
  5889. bridge = params.bridge
  5890. Vue = params.Vue
  5891. persist = !!params.persist
  5892. // Load persisted fields
  5893. persisted.forEach(key => {
  5894. var value = _storage__WEBPACK_IMPORTED_MODULE_0__[/* get */ "a"](`shared-data:${key}`)
  5895. if (value !== null) {
  5896. internalSharedData[key] = value
  5897. // Send to other shared data clients
  5898. if (persist) {
  5899. sendValue(key, value)
  5900. }
  5901. }
  5902. })
  5903. // Wrapper Vue instance
  5904. vm = new Vue({
  5905. data: internalSharedData
  5906. })
  5907. // Update value from other shared data clients
  5908. bridge.on('shared-data:set', (ref) => {
  5909. var key = ref.key;
  5910. var value = ref.value;
  5911. setValue(key, value)
  5912. })
  5913. }
  5914. function destroy () {
  5915. bridge.removeAllListeners('shared-data:set')
  5916. vm.$destroy()
  5917. }
  5918. function setValue (key, value) {
  5919. // Storage
  5920. if (persist && persisted.includes(key)) {
  5921. _storage__WEBPACK_IMPORTED_MODULE_0__[/* set */ "c"](`shared-data:${key}`, value)
  5922. }
  5923. vm[key] = value
  5924. // Validate Proxy set trap
  5925. return true
  5926. }
  5927. function sendValue (key, value) {
  5928. bridge && bridge.send('shared-data:set', {
  5929. key,
  5930. value
  5931. })
  5932. }
  5933. function watch (...args) {
  5934. vm.$watch(...args)
  5935. }
  5936. var proxy = {}
  5937. Object.keys(internalSharedData).forEach(key => {
  5938. Object.defineProperty(proxy, key, {
  5939. configurable: false,
  5940. get: () => vm && vm.$data[key],
  5941. set: (value) => {
  5942. sendValue(key, value)
  5943. setValue(key, value)
  5944. }
  5945. })
  5946. })
  5947. /* harmony default export */ __webpack_exports__["a"] = (proxy);
  5948. /***/ }),
  5949. /***/ 5:
  5950. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5951. "use strict";
  5952. /* WEBPACK VAR INJECTION */(function(global, setImmediate) {/* unused harmony export EffectScope */
  5953. /* unused harmony export computed */
  5954. /* unused harmony export customRef */
  5955. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Vue; });
  5956. /* unused harmony export defineAsyncComponent */
  5957. /* unused harmony export defineComponent */
  5958. /* unused harmony export del */
  5959. /* unused harmony export effectScope */
  5960. /* unused harmony export getCurrentInstance */
  5961. /* unused harmony export getCurrentScope */
  5962. /* unused harmony export h */
  5963. /* unused harmony export inject */
  5964. /* unused harmony export isProxy */
  5965. /* unused harmony export isReactive */
  5966. /* unused harmony export isReadonly */
  5967. /* unused harmony export isRef */
  5968. /* unused harmony export isShallow */
  5969. /* unused harmony export markRaw */
  5970. /* unused harmony export mergeDefaults */
  5971. /* unused harmony export nextTick */
  5972. /* unused harmony export onActivated */
  5973. /* unused harmony export onBeforeMount */
  5974. /* unused harmony export onBeforeUnmount */
  5975. /* unused harmony export onBeforeUpdate */
  5976. /* unused harmony export onDeactivated */
  5977. /* unused harmony export onErrorCaptured */
  5978. /* unused harmony export onMounted */
  5979. /* unused harmony export onRenderTracked */
  5980. /* unused harmony export onRenderTriggered */
  5981. /* unused harmony export onScopeDispose */
  5982. /* unused harmony export onServerPrefetch */
  5983. /* unused harmony export onUnmounted */
  5984. /* unused harmony export onUpdated */
  5985. /* unused harmony export provide */
  5986. /* unused harmony export proxyRefs */
  5987. /* unused harmony export reactive */
  5988. /* unused harmony export readonly */
  5989. /* unused harmony export ref */
  5990. /* unused harmony export set */
  5991. /* unused harmony export shallowReactive */
  5992. /* unused harmony export shallowReadonly */
  5993. /* unused harmony export shallowRef */
  5994. /* unused harmony export toRaw */
  5995. /* unused harmony export toRef */
  5996. /* unused harmony export toRefs */
  5997. /* unused harmony export triggerRef */
  5998. /* unused harmony export unref */
  5999. /* unused harmony export useAttrs */
  6000. /* unused harmony export useCssModule */
  6001. /* unused harmony export useCssVars */
  6002. /* unused harmony export useListeners */
  6003. /* unused harmony export useSlots */
  6004. /* unused harmony export version */
  6005. /* unused harmony export watch */
  6006. /* unused harmony export watchEffect */
  6007. /* unused harmony export watchPostEffect */
  6008. /* unused harmony export watchSyncEffect */
  6009. /*!
  6010. * Vue.js v2.7.16
  6011. * (c) 2014-2023 Evan You
  6012. * Released under the MIT License.
  6013. */
  6014. var emptyObject = Object.freeze({});
  6015. var isArray = Array.isArray;
  6016. // These helpers produce better VM code in JS engines due to their
  6017. // explicitness and function inlining.
  6018. function isUndef(v) {
  6019. return v === undefined || v === null;
  6020. }
  6021. function isDef(v) {
  6022. return v !== undefined && v !== null;
  6023. }
  6024. function isTrue(v) {
  6025. return v === true;
  6026. }
  6027. function isFalse(v) {
  6028. return v === false;
  6029. }
  6030. /**
  6031. * Check if value is primitive.
  6032. */
  6033. function isPrimitive(value) {
  6034. return (typeof value === 'string' ||
  6035. typeof value === 'number' ||
  6036. // $flow-disable-line
  6037. typeof value === 'symbol' ||
  6038. typeof value === 'boolean');
  6039. }
  6040. function isFunction(value) {
  6041. return typeof value === 'function';
  6042. }
  6043. /**
  6044. * Quick object check - this is primarily used to tell
  6045. * objects from primitive values when we know the value
  6046. * is a JSON-compliant type.
  6047. */
  6048. function isObject(obj) {
  6049. return obj !== null && typeof obj === 'object';
  6050. }
  6051. /**
  6052. * Get the raw type string of a value, e.g., [object Object].
  6053. */
  6054. var _toString = Object.prototype.toString;
  6055. function toRawType(value) {
  6056. return _toString.call(value).slice(8, -1);
  6057. }
  6058. /**
  6059. * Strict object type check. Only returns true
  6060. * for plain JavaScript objects.
  6061. */
  6062. function isPlainObject(obj) {
  6063. return _toString.call(obj) === '[object Object]';
  6064. }
  6065. function isRegExp(v) {
  6066. return _toString.call(v) === '[object RegExp]';
  6067. }
  6068. /**
  6069. * Check if val is a valid array index.
  6070. */
  6071. function isValidArrayIndex(val) {
  6072. var n = parseFloat(String(val));
  6073. return n >= 0 && Math.floor(n) === n && isFinite(val);
  6074. }
  6075. function isPromise(val) {
  6076. return (isDef(val) &&
  6077. typeof val.then === 'function' &&
  6078. typeof val.catch === 'function');
  6079. }
  6080. /**
  6081. * Convert a value to a string that is actually rendered.
  6082. */
  6083. function toString(val) {
  6084. return val == null
  6085. ? ''
  6086. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  6087. ? JSON.stringify(val, replacer, 2)
  6088. : String(val);
  6089. }
  6090. function replacer(_key, val) {
  6091. // avoid circular deps from v3
  6092. if (val && val.__v_isRef) {
  6093. return val.value;
  6094. }
  6095. return val;
  6096. }
  6097. /**
  6098. * Convert an input value to a number for persistence.
  6099. * If the conversion fails, return original string.
  6100. */
  6101. function toNumber(val) {
  6102. var n = parseFloat(val);
  6103. return isNaN(n) ? val : n;
  6104. }
  6105. /**
  6106. * Make a map and return a function for checking if a key
  6107. * is in that map.
  6108. */
  6109. function makeMap(str, expectsLowerCase) {
  6110. var map = Object.create(null);
  6111. var list = str.split(',');
  6112. for (var i = 0; i < list.length; i++) {
  6113. map[list[i]] = true;
  6114. }
  6115. return expectsLowerCase ? function (val) { return map[val.toLowerCase()]; } : function (val) { return map[val]; };
  6116. }
  6117. /**
  6118. * Check if a tag is a built-in tag.
  6119. */
  6120. var isBuiltInTag = makeMap('slot,component', true);
  6121. /**
  6122. * Check if an attribute is a reserved attribute.
  6123. */
  6124. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  6125. /**
  6126. * Remove an item from an array.
  6127. */
  6128. function remove$2(arr, item) {
  6129. var len = arr.length;
  6130. if (len) {
  6131. // fast path for the only / last item
  6132. if (item === arr[len - 1]) {
  6133. arr.length = len - 1;
  6134. return;
  6135. }
  6136. var index = arr.indexOf(item);
  6137. if (index > -1) {
  6138. return arr.splice(index, 1);
  6139. }
  6140. }
  6141. }
  6142. /**
  6143. * Check whether an object has the property.
  6144. */
  6145. var hasOwnProperty = Object.prototype.hasOwnProperty;
  6146. function hasOwn(obj, key) {
  6147. return hasOwnProperty.call(obj, key);
  6148. }
  6149. /**
  6150. * Create a cached version of a pure function.
  6151. */
  6152. function cached(fn) {
  6153. var cache = Object.create(null);
  6154. return function cachedFn(str) {
  6155. var hit = cache[str];
  6156. return hit || (cache[str] = fn(str));
  6157. };
  6158. }
  6159. /**
  6160. * Camelize a hyphen-delimited string.
  6161. */
  6162. var camelizeRE = /-(\w)/g;
  6163. var camelize = cached(function (str) {
  6164. return str.replace(camelizeRE, function (_, c) { return (c ? c.toUpperCase() : ''); });
  6165. });
  6166. /**
  6167. * Capitalize a string.
  6168. */
  6169. var capitalize = cached(function (str) {
  6170. return str.charAt(0).toUpperCase() + str.slice(1);
  6171. });
  6172. /**
  6173. * Hyphenate a camelCase string.
  6174. */
  6175. var hyphenateRE = /\B([A-Z])/g;
  6176. var hyphenate = cached(function (str) {
  6177. return str.replace(hyphenateRE, '-$1').toLowerCase();
  6178. });
  6179. /**
  6180. * Simple bind polyfill for environments that do not support it,
  6181. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  6182. * since native bind is now performant enough in most browsers.
  6183. * But removing it would mean breaking code that was able to run in
  6184. * PhantomJS 1.x, so this must be kept for backward compatibility.
  6185. */
  6186. /* istanbul ignore next */
  6187. function polyfillBind(fn, ctx) {
  6188. function boundFn(a) {
  6189. var l = arguments.length;
  6190. return l
  6191. ? l > 1
  6192. ? fn.apply(ctx, arguments)
  6193. : fn.call(ctx, a)
  6194. : fn.call(ctx);
  6195. }
  6196. boundFn._length = fn.length;
  6197. return boundFn;
  6198. }
  6199. function nativeBind(fn, ctx) {
  6200. return fn.bind(ctx);
  6201. }
  6202. // @ts-expect-error bind cannot be `undefined`
  6203. var bind = Function.prototype.bind ? nativeBind : polyfillBind;
  6204. /**
  6205. * Convert an Array-like object to a real Array.
  6206. */
  6207. function toArray(list, start) {
  6208. start = start || 0;
  6209. var i = list.length - start;
  6210. var ret = new Array(i);
  6211. while (i--) {
  6212. ret[i] = list[i + start];
  6213. }
  6214. return ret;
  6215. }
  6216. /**
  6217. * Mix properties into target object.
  6218. */
  6219. function extend(to, _from) {
  6220. for (var key in _from) {
  6221. to[key] = _from[key];
  6222. }
  6223. return to;
  6224. }
  6225. /**
  6226. * Merge an Array of Objects into a single Object.
  6227. */
  6228. function toObject(arr) {
  6229. var res = {};
  6230. for (var i = 0; i < arr.length; i++) {
  6231. if (arr[i]) {
  6232. extend(res, arr[i]);
  6233. }
  6234. }
  6235. return res;
  6236. }
  6237. /* eslint-disable no-unused-vars */
  6238. /**
  6239. * Perform no operation.
  6240. * Stubbing args to make Flow happy without leaving useless transpiled code
  6241. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  6242. */
  6243. function noop(a, b, c) { }
  6244. /**
  6245. * Always return false.
  6246. */
  6247. var no = function (a, b, c) { return false; };
  6248. /* eslint-enable no-unused-vars */
  6249. /**
  6250. * Return the same value.
  6251. */
  6252. var identity = function (_) { return _; };
  6253. /**
  6254. * Check if two values are loosely equal - that is,
  6255. * if they are plain objects, do they have the same shape?
  6256. */
  6257. function looseEqual(a, b) {
  6258. if (a === b)
  6259. return true;
  6260. var isObjectA = isObject(a);
  6261. var isObjectB = isObject(b);
  6262. if (isObjectA && isObjectB) {
  6263. try {
  6264. var isArrayA = Array.isArray(a);
  6265. var isArrayB = Array.isArray(b);
  6266. if (isArrayA && isArrayB) {
  6267. return (a.length === b.length &&
  6268. a.every(function (e, i) {
  6269. return looseEqual(e, b[i]);
  6270. }));
  6271. }
  6272. else if (a instanceof Date && b instanceof Date) {
  6273. return a.getTime() === b.getTime();
  6274. }
  6275. else if (!isArrayA && !isArrayB) {
  6276. var keysA = Object.keys(a);
  6277. var keysB = Object.keys(b);
  6278. return (keysA.length === keysB.length &&
  6279. keysA.every(function (key) {
  6280. return looseEqual(a[key], b[key]);
  6281. }));
  6282. }
  6283. else {
  6284. /* istanbul ignore next */
  6285. return false;
  6286. }
  6287. }
  6288. catch (e) {
  6289. /* istanbul ignore next */
  6290. return false;
  6291. }
  6292. }
  6293. else if (!isObjectA && !isObjectB) {
  6294. return String(a) === String(b);
  6295. }
  6296. else {
  6297. return false;
  6298. }
  6299. }
  6300. /**
  6301. * Return the first index at which a loosely equal value can be
  6302. * found in the array (if value is a plain object, the array must
  6303. * contain an object of the same shape), or -1 if it is not present.
  6304. */
  6305. function looseIndexOf(arr, val) {
  6306. for (var i = 0; i < arr.length; i++) {
  6307. if (looseEqual(arr[i], val))
  6308. return i;
  6309. }
  6310. return -1;
  6311. }
  6312. /**
  6313. * Ensure a function is called only once.
  6314. */
  6315. function once(fn) {
  6316. var called = false;
  6317. return function () {
  6318. if (!called) {
  6319. called = true;
  6320. fn.apply(this, arguments);
  6321. }
  6322. };
  6323. }
  6324. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is#polyfill
  6325. function hasChanged(x, y) {
  6326. if (x === y) {
  6327. return x === 0 && 1 / x !== 1 / y;
  6328. }
  6329. else {
  6330. return x === x || y === y;
  6331. }
  6332. }
  6333. var SSR_ATTR = 'data-server-rendered';
  6334. var ASSET_TYPES = ['component', 'directive', 'filter'];
  6335. var LIFECYCLE_HOOKS = [
  6336. 'beforeCreate',
  6337. 'created',
  6338. 'beforeMount',
  6339. 'mounted',
  6340. 'beforeUpdate',
  6341. 'updated',
  6342. 'beforeDestroy',
  6343. 'destroyed',
  6344. 'activated',
  6345. 'deactivated',
  6346. 'errorCaptured',
  6347. 'serverPrefetch',
  6348. 'renderTracked',
  6349. 'renderTriggered'
  6350. ];
  6351. var config = {
  6352. /**
  6353. * Option merge strategies (used in core/util/options)
  6354. */
  6355. // $flow-disable-line
  6356. optionMergeStrategies: Object.create(null),
  6357. /**
  6358. * Whether to suppress warnings.
  6359. */
  6360. silent: false,
  6361. /**
  6362. * Show production mode tip message on boot?
  6363. */
  6364. productionTip: "production" !== 'production',
  6365. /**
  6366. * Whether to enable devtools
  6367. */
  6368. devtools: "production" !== 'production',
  6369. /**
  6370. * Whether to record perf
  6371. */
  6372. performance: false,
  6373. /**
  6374. * Error handler for watcher errors
  6375. */
  6376. errorHandler: null,
  6377. /**
  6378. * Warn handler for watcher warns
  6379. */
  6380. warnHandler: null,
  6381. /**
  6382. * Ignore certain custom elements
  6383. */
  6384. ignoredElements: [],
  6385. /**
  6386. * Custom user key aliases for v-on
  6387. */
  6388. // $flow-disable-line
  6389. keyCodes: Object.create(null),
  6390. /**
  6391. * Check if a tag is reserved so that it cannot be registered as a
  6392. * component. This is platform-dependent and may be overwritten.
  6393. */
  6394. isReservedTag: no,
  6395. /**
  6396. * Check if an attribute is reserved so that it cannot be used as a component
  6397. * prop. This is platform-dependent and may be overwritten.
  6398. */
  6399. isReservedAttr: no,
  6400. /**
  6401. * Check if a tag is an unknown element.
  6402. * Platform-dependent.
  6403. */
  6404. isUnknownElement: no,
  6405. /**
  6406. * Get the namespace of an element
  6407. */
  6408. getTagNamespace: noop,
  6409. /**
  6410. * Parse the real tag name for the specific platform.
  6411. */
  6412. parsePlatformTagName: identity,
  6413. /**
  6414. * Check if an attribute must be bound using property, e.g. value
  6415. * Platform-dependent.
  6416. */
  6417. mustUseProp: no,
  6418. /**
  6419. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  6420. * This will significantly reduce performance if set to false.
  6421. */
  6422. async: true,
  6423. /**
  6424. * Exposed for legacy reasons
  6425. */
  6426. _lifecycleHooks: LIFECYCLE_HOOKS
  6427. };
  6428. /**
  6429. * unicode letters used for parsing html tags, component names and property paths.
  6430. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  6431. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  6432. */
  6433. var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
  6434. /**
  6435. * Check if a string starts with $ or _
  6436. */
  6437. function isReserved(str) {
  6438. var c = (str + '').charCodeAt(0);
  6439. return c === 0x24 || c === 0x5f;
  6440. }
  6441. /**
  6442. * Define a property.
  6443. */
  6444. function def(obj, key, val, enumerable) {
  6445. Object.defineProperty(obj, key, {
  6446. value: val,
  6447. enumerable: !!enumerable,
  6448. writable: true,
  6449. configurable: true
  6450. });
  6451. }
  6452. /**
  6453. * Parse simple path.
  6454. */
  6455. var bailRE = new RegExp("[^".concat(unicodeRegExp.source, ".$_\\d]"));
  6456. function parsePath(path) {
  6457. if (bailRE.test(path)) {
  6458. return;
  6459. }
  6460. var segments = path.split('.');
  6461. return function (obj) {
  6462. for (var i = 0; i < segments.length; i++) {
  6463. if (!obj)
  6464. return;
  6465. obj = obj[segments[i]];
  6466. }
  6467. return obj;
  6468. };
  6469. }
  6470. // can we use __proto__?
  6471. var hasProto = '__proto__' in {};
  6472. // Browser environment sniffing
  6473. var inBrowser = typeof window !== 'undefined';
  6474. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  6475. var isIE = UA && /msie|trident/.test(UA);
  6476. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  6477. var isEdge = UA && UA.indexOf('edge/') > 0;
  6478. UA && UA.indexOf('android') > 0;
  6479. var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
  6480. UA && /chrome\/\d+/.test(UA) && !isEdge;
  6481. UA && /phantomjs/.test(UA);
  6482. var isFF = UA && UA.match(/firefox\/(\d+)/);
  6483. // Firefox has a "watch" function on Object.prototype...
  6484. // @ts-expect-error firebox support
  6485. var nativeWatch = {}.watch;
  6486. var supportsPassive = false;
  6487. if (inBrowser) {
  6488. try {
  6489. var opts = {};
  6490. Object.defineProperty(opts, 'passive', {
  6491. get: function () {
  6492. /* istanbul ignore next */
  6493. supportsPassive = true;
  6494. }
  6495. }); // https://github.com/facebook/flow/issues/285
  6496. window.addEventListener('test-passive', null, opts);
  6497. }
  6498. catch (e) { }
  6499. }
  6500. // this needs to be lazy-evaled because vue may be required before
  6501. // vue-server-renderer can set VUE_ENV
  6502. var _isServer;
  6503. var isServerRendering = function () {
  6504. if (_isServer === undefined) {
  6505. /* istanbul ignore if */
  6506. if (!inBrowser && typeof global !== 'undefined') {
  6507. // detect presence of vue-server-renderer and avoid
  6508. // Webpack shimming the process
  6509. _isServer =
  6510. global['process'] && global['process'].env.VUE_ENV === 'server';
  6511. }
  6512. else {
  6513. _isServer = false;
  6514. }
  6515. }
  6516. return _isServer;
  6517. };
  6518. // detect devtools
  6519. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  6520. /* istanbul ignore next */
  6521. function isNative(Ctor) {
  6522. return typeof Ctor === 'function' && /native code/.test(Ctor.toString());
  6523. }
  6524. var hasSymbol = typeof Symbol !== 'undefined' &&
  6525. isNative(Symbol) &&
  6526. typeof Reflect !== 'undefined' &&
  6527. isNative(Reflect.ownKeys);
  6528. var _Set; // $flow-disable-line
  6529. /* istanbul ignore if */ if (typeof Set !== 'undefined' && isNative(Set)) {
  6530. // use native Set when available.
  6531. _Set = Set;
  6532. }
  6533. else {
  6534. // a non-standard Set polyfill that only works with primitive keys.
  6535. _Set = /** @class */ (function () {
  6536. function Set() {
  6537. this.set = Object.create(null);
  6538. }
  6539. Set.prototype.has = function (key) {
  6540. return this.set[key] === true;
  6541. };
  6542. Set.prototype.add = function (key) {
  6543. this.set[key] = true;
  6544. };
  6545. Set.prototype.clear = function () {
  6546. this.set = Object.create(null);
  6547. };
  6548. return Set;
  6549. }());
  6550. }
  6551. var currentInstance = null;
  6552. /**
  6553. * This is exposed for compatibility with v3 (e.g. some functions in VueUse
  6554. * relies on it). Do not use this internally, just use `currentInstance`.
  6555. *
  6556. * @internal this function needs manual type declaration because it relies
  6557. * on previously manually authored types from Vue 2
  6558. */
  6559. function getCurrentInstance() {
  6560. return currentInstance && { proxy: currentInstance };
  6561. }
  6562. /**
  6563. * @internal
  6564. */
  6565. function setCurrentInstance(vm) {
  6566. if (vm === void 0) { vm = null; }
  6567. if (!vm)
  6568. currentInstance && currentInstance._scope.off();
  6569. currentInstance = vm;
  6570. vm && vm._scope.on();
  6571. }
  6572. /**
  6573. * @internal
  6574. */
  6575. var VNode = /** @class */ (function () {
  6576. function VNode(tag, data, children, text, elm, context, componentOptions, asyncFactory) {
  6577. this.tag = tag;
  6578. this.data = data;
  6579. this.children = children;
  6580. this.text = text;
  6581. this.elm = elm;
  6582. this.ns = undefined;
  6583. this.context = context;
  6584. this.fnContext = undefined;
  6585. this.fnOptions = undefined;
  6586. this.fnScopeId = undefined;
  6587. this.key = data && data.key;
  6588. this.componentOptions = componentOptions;
  6589. this.componentInstance = undefined;
  6590. this.parent = undefined;
  6591. this.raw = false;
  6592. this.isStatic = false;
  6593. this.isRootInsert = true;
  6594. this.isComment = false;
  6595. this.isCloned = false;
  6596. this.isOnce = false;
  6597. this.asyncFactory = asyncFactory;
  6598. this.asyncMeta = undefined;
  6599. this.isAsyncPlaceholder = false;
  6600. }
  6601. Object.defineProperty(VNode.prototype, "child", {
  6602. // DEPRECATED: alias for componentInstance for backwards compat.
  6603. /* istanbul ignore next */
  6604. get: function () {
  6605. return this.componentInstance;
  6606. },
  6607. enumerable: false,
  6608. configurable: true
  6609. });
  6610. return VNode;
  6611. }());
  6612. var createEmptyVNode = function (text) {
  6613. if (text === void 0) { text = ''; }
  6614. var node = new VNode();
  6615. node.text = text;
  6616. node.isComment = true;
  6617. return node;
  6618. };
  6619. function createTextVNode(val) {
  6620. return new VNode(undefined, undefined, undefined, String(val));
  6621. }
  6622. // optimized shallow clone
  6623. // used for static nodes and slot nodes because they may be reused across
  6624. // multiple renders, cloning them avoids errors when DOM manipulations rely
  6625. // on their elm reference.
  6626. function cloneVNode(vnode) {
  6627. var cloned = new VNode(vnode.tag, vnode.data,
  6628. // #7975
  6629. // clone children array to avoid mutating original in case of cloning
  6630. // a child.
  6631. vnode.children && vnode.children.slice(), vnode.text, vnode.elm, vnode.context, vnode.componentOptions, vnode.asyncFactory);
  6632. cloned.ns = vnode.ns;
  6633. cloned.isStatic = vnode.isStatic;
  6634. cloned.key = vnode.key;
  6635. cloned.isComment = vnode.isComment;
  6636. cloned.fnContext = vnode.fnContext;
  6637. cloned.fnOptions = vnode.fnOptions;
  6638. cloned.fnScopeId = vnode.fnScopeId;
  6639. cloned.asyncMeta = vnode.asyncMeta;
  6640. cloned.isCloned = true;
  6641. return cloned;
  6642. }
  6643. /******************************************************************************
  6644. Copyright (c) Microsoft Corporation.
  6645. Permission to use, copy, modify, and/or distribute this software for any
  6646. purpose with or without fee is hereby granted.
  6647. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  6648. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  6649. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  6650. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  6651. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  6652. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  6653. PERFORMANCE OF THIS SOFTWARE.
  6654. ***************************************************************************** */
  6655. var __assign = function() {
  6656. __assign = Object.assign || function __assign(t) {
  6657. for (var s, i = 1, n = arguments.length; i < n; i++) {
  6658. s = arguments[i];
  6659. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  6660. }
  6661. return t;
  6662. };
  6663. return __assign.apply(this, arguments);
  6664. };
  6665. typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
  6666. var e = new Error(message);
  6667. return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
  6668. };
  6669. var uid$2 = 0;
  6670. var pendingCleanupDeps = [];
  6671. var cleanupDeps = function () {
  6672. for (var i = 0; i < pendingCleanupDeps.length; i++) {
  6673. var dep = pendingCleanupDeps[i];
  6674. dep.subs = dep.subs.filter(function (s) { return s; });
  6675. dep._pending = false;
  6676. }
  6677. pendingCleanupDeps.length = 0;
  6678. };
  6679. /**
  6680. * A dep is an observable that can have multiple
  6681. * directives subscribing to it.
  6682. * @internal
  6683. */
  6684. var Dep = /** @class */ (function () {
  6685. function Dep() {
  6686. // pending subs cleanup
  6687. this._pending = false;
  6688. this.id = uid$2++;
  6689. this.subs = [];
  6690. }
  6691. Dep.prototype.addSub = function (sub) {
  6692. this.subs.push(sub);
  6693. };
  6694. Dep.prototype.removeSub = function (sub) {
  6695. // #12696 deps with massive amount of subscribers are extremely slow to
  6696. // clean up in Chromium
  6697. // to workaround this, we unset the sub for now, and clear them on
  6698. // next scheduler flush.
  6699. this.subs[this.subs.indexOf(sub)] = null;
  6700. if (!this._pending) {
  6701. this._pending = true;
  6702. pendingCleanupDeps.push(this);
  6703. }
  6704. };
  6705. Dep.prototype.depend = function (info) {
  6706. if (Dep.target) {
  6707. Dep.target.addDep(this);
  6708. if (false) {}
  6709. }
  6710. };
  6711. Dep.prototype.notify = function (info) {
  6712. // stabilize the subscriber list first
  6713. var subs = this.subs.filter(function (s) { return s; });
  6714. if (false) {}
  6715. for (var i = 0, l = subs.length; i < l; i++) {
  6716. var sub = subs[i];
  6717. if (false) {}
  6718. sub.update();
  6719. }
  6720. };
  6721. return Dep;
  6722. }());
  6723. // The current target watcher being evaluated.
  6724. // This is globally unique because only one watcher
  6725. // can be evaluated at a time.
  6726. Dep.target = null;
  6727. var targetStack = [];
  6728. function pushTarget(target) {
  6729. targetStack.push(target);
  6730. Dep.target = target;
  6731. }
  6732. function popTarget() {
  6733. targetStack.pop();
  6734. Dep.target = targetStack[targetStack.length - 1];
  6735. }
  6736. /*
  6737. * not type checking this file because flow doesn't play well with
  6738. * dynamically accessing methods on Array prototype
  6739. */
  6740. var arrayProto = Array.prototype;
  6741. var arrayMethods = Object.create(arrayProto);
  6742. var methodsToPatch = [
  6743. 'push',
  6744. 'pop',
  6745. 'shift',
  6746. 'unshift',
  6747. 'splice',
  6748. 'sort',
  6749. 'reverse'
  6750. ];
  6751. /**
  6752. * Intercept mutating methods and emit events
  6753. */
  6754. methodsToPatch.forEach(function (method) {
  6755. // cache original method
  6756. var original = arrayProto[method];
  6757. def(arrayMethods, method, function mutator() {
  6758. var args = [];
  6759. for (var _i = 0; _i < arguments.length; _i++) {
  6760. args[_i] = arguments[_i];
  6761. }
  6762. var result = original.apply(this, args);
  6763. var ob = this.__ob__;
  6764. var inserted;
  6765. switch (method) {
  6766. case 'push':
  6767. case 'unshift':
  6768. inserted = args;
  6769. break;
  6770. case 'splice':
  6771. inserted = args.slice(2);
  6772. break;
  6773. }
  6774. if (inserted)
  6775. ob.observeArray(inserted);
  6776. // notify change
  6777. if (false) {}
  6778. else {
  6779. ob.dep.notify();
  6780. }
  6781. return result;
  6782. });
  6783. });
  6784. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  6785. var NO_INITIAL_VALUE = {};
  6786. /**
  6787. * In some cases we may want to disable observation inside a component's
  6788. * update computation.
  6789. */
  6790. var shouldObserve = true;
  6791. function toggleObserving(value) {
  6792. shouldObserve = value;
  6793. }
  6794. // ssr mock dep
  6795. var mockDep = {
  6796. notify: noop,
  6797. depend: noop,
  6798. addSub: noop,
  6799. removeSub: noop
  6800. };
  6801. /**
  6802. * Observer class that is attached to each observed
  6803. * object. Once attached, the observer converts the target
  6804. * object's property keys into getter/setters that
  6805. * collect dependencies and dispatch updates.
  6806. */
  6807. var Observer = /** @class */ (function () {
  6808. function Observer(value, shallow, mock) {
  6809. if (shallow === void 0) { shallow = false; }
  6810. if (mock === void 0) { mock = false; }
  6811. this.value = value;
  6812. this.shallow = shallow;
  6813. this.mock = mock;
  6814. // this.value = value
  6815. this.dep = mock ? mockDep : new Dep();
  6816. this.vmCount = 0;
  6817. def(value, '__ob__', this);
  6818. if (isArray(value)) {
  6819. if (!mock) {
  6820. if (hasProto) {
  6821. value.__proto__ = arrayMethods;
  6822. /* eslint-enable no-proto */
  6823. }
  6824. else {
  6825. for (var i = 0, l = arrayKeys.length; i < l; i++) {
  6826. var key = arrayKeys[i];
  6827. def(value, key, arrayMethods[key]);
  6828. }
  6829. }
  6830. }
  6831. if (!shallow) {
  6832. this.observeArray(value);
  6833. }
  6834. }
  6835. else {
  6836. /**
  6837. * Walk through all properties and convert them into
  6838. * getter/setters. This method should only be called when
  6839. * value type is Object.
  6840. */
  6841. var keys = Object.keys(value);
  6842. for (var i = 0; i < keys.length; i++) {
  6843. var key = keys[i];
  6844. defineReactive(value, key, NO_INITIAL_VALUE, undefined, shallow, mock);
  6845. }
  6846. }
  6847. }
  6848. /**
  6849. * Observe a list of Array items.
  6850. */
  6851. Observer.prototype.observeArray = function (value) {
  6852. for (var i = 0, l = value.length; i < l; i++) {
  6853. observe(value[i], false, this.mock);
  6854. }
  6855. };
  6856. return Observer;
  6857. }());
  6858. // helpers
  6859. /**
  6860. * Attempt to create an observer instance for a value,
  6861. * returns the new observer if successfully observed,
  6862. * or the existing observer if the value already has one.
  6863. */
  6864. function observe(value, shallow, ssrMockReactivity) {
  6865. if (value && hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  6866. return value.__ob__;
  6867. }
  6868. if (shouldObserve &&
  6869. (ssrMockReactivity || !isServerRendering()) &&
  6870. (isArray(value) || isPlainObject(value)) &&
  6871. Object.isExtensible(value) &&
  6872. !value.__v_skip /* ReactiveFlags.SKIP */ &&
  6873. !isRef(value) &&
  6874. !(value instanceof VNode)) {
  6875. return new Observer(value, shallow, ssrMockReactivity);
  6876. }
  6877. }
  6878. /**
  6879. * Define a reactive property on an Object.
  6880. */
  6881. function defineReactive(obj, key, val, customSetter, shallow, mock, observeEvenIfShallow) {
  6882. if (observeEvenIfShallow === void 0) { observeEvenIfShallow = false; }
  6883. var dep = new Dep();
  6884. var property = Object.getOwnPropertyDescriptor(obj, key);
  6885. if (property && property.configurable === false) {
  6886. return;
  6887. }
  6888. // cater for pre-defined getter/setters
  6889. var getter = property && property.get;
  6890. var setter = property && property.set;
  6891. if ((!getter || setter) &&
  6892. (val === NO_INITIAL_VALUE || arguments.length === 2)) {
  6893. val = obj[key];
  6894. }
  6895. var childOb = shallow ? val && val.__ob__ : observe(val, false, mock);
  6896. Object.defineProperty(obj, key, {
  6897. enumerable: true,
  6898. configurable: true,
  6899. get: function reactiveGetter() {
  6900. var value = getter ? getter.call(obj) : val;
  6901. if (Dep.target) {
  6902. if (false) {}
  6903. else {
  6904. dep.depend();
  6905. }
  6906. if (childOb) {
  6907. childOb.dep.depend();
  6908. if (isArray(value)) {
  6909. dependArray(value);
  6910. }
  6911. }
  6912. }
  6913. return isRef(value) && !shallow ? value.value : value;
  6914. },
  6915. set: function reactiveSetter(newVal) {
  6916. var value = getter ? getter.call(obj) : val;
  6917. if (!hasChanged(value, newVal)) {
  6918. return;
  6919. }
  6920. if (false) {}
  6921. if (setter) {
  6922. setter.call(obj, newVal);
  6923. }
  6924. else if (getter) {
  6925. // #7981: for accessor properties without setter
  6926. return;
  6927. }
  6928. else if (!shallow && isRef(value) && !isRef(newVal)) {
  6929. value.value = newVal;
  6930. return;
  6931. }
  6932. else {
  6933. val = newVal;
  6934. }
  6935. childOb = shallow ? newVal && newVal.__ob__ : observe(newVal, false, mock);
  6936. if (false) {}
  6937. else {
  6938. dep.notify();
  6939. }
  6940. }
  6941. });
  6942. return dep;
  6943. }
  6944. function set(target, key, val) {
  6945. if (false) {}
  6946. if (isReadonly(target)) {
  6947. false && false;
  6948. return;
  6949. }
  6950. var ob = target.__ob__;
  6951. if (isArray(target) && isValidArrayIndex(key)) {
  6952. target.length = Math.max(target.length, key);
  6953. target.splice(key, 1, val);
  6954. // when mocking for SSR, array methods are not hijacked
  6955. if (ob && !ob.shallow && ob.mock) {
  6956. observe(val, false, true);
  6957. }
  6958. return val;
  6959. }
  6960. if (key in target && !(key in Object.prototype)) {
  6961. target[key] = val;
  6962. return val;
  6963. }
  6964. if (target._isVue || (ob && ob.vmCount)) {
  6965. false &&
  6966. false;
  6967. return val;
  6968. }
  6969. if (!ob) {
  6970. target[key] = val;
  6971. return val;
  6972. }
  6973. defineReactive(ob.value, key, val, undefined, ob.shallow, ob.mock);
  6974. if (false) {}
  6975. else {
  6976. ob.dep.notify();
  6977. }
  6978. return val;
  6979. }
  6980. function del(target, key) {
  6981. if (false) {}
  6982. if (isArray(target) && isValidArrayIndex(key)) {
  6983. target.splice(key, 1);
  6984. return;
  6985. }
  6986. var ob = target.__ob__;
  6987. if (target._isVue || (ob && ob.vmCount)) {
  6988. false &&
  6989. false;
  6990. return;
  6991. }
  6992. if (isReadonly(target)) {
  6993. false &&
  6994. false;
  6995. return;
  6996. }
  6997. if (!hasOwn(target, key)) {
  6998. return;
  6999. }
  7000. delete target[key];
  7001. if (!ob) {
  7002. return;
  7003. }
  7004. if (false) {}
  7005. else {
  7006. ob.dep.notify();
  7007. }
  7008. }
  7009. /**
  7010. * Collect dependencies on array elements when the array is touched, since
  7011. * we cannot intercept array element access like property getters.
  7012. */
  7013. function dependArray(value) {
  7014. for (var e = void 0, i = 0, l = value.length; i < l; i++) {
  7015. e = value[i];
  7016. if (e && e.__ob__) {
  7017. e.__ob__.dep.depend();
  7018. }
  7019. if (isArray(e)) {
  7020. dependArray(e);
  7021. }
  7022. }
  7023. }
  7024. function reactive(target) {
  7025. makeReactive(target, false);
  7026. return target;
  7027. }
  7028. /**
  7029. * Return a shallowly-reactive copy of the original object, where only the root
  7030. * level properties are reactive. It also does not auto-unwrap refs (even at the
  7031. * root level).
  7032. */
  7033. function shallowReactive(target) {
  7034. makeReactive(target, true);
  7035. def(target, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, true);
  7036. return target;
  7037. }
  7038. function makeReactive(target, shallow) {
  7039. // if trying to observe a readonly proxy, return the readonly version.
  7040. if (!isReadonly(target)) {
  7041. if (false) { var existingOb; }
  7042. var ob = observe(target, shallow, isServerRendering() /* ssr mock reactivity */);
  7043. if (false) {}
  7044. }
  7045. }
  7046. function isReactive(value) {
  7047. if (isReadonly(value)) {
  7048. return isReactive(value["__v_raw" /* ReactiveFlags.RAW */]);
  7049. }
  7050. return !!(value && value.__ob__);
  7051. }
  7052. function isShallow(value) {
  7053. return !!(value && value.__v_isShallow);
  7054. }
  7055. function isReadonly(value) {
  7056. return !!(value && value.__v_isReadonly);
  7057. }
  7058. function isProxy(value) {
  7059. return isReactive(value) || isReadonly(value);
  7060. }
  7061. function toRaw(observed) {
  7062. var raw = observed && observed["__v_raw" /* ReactiveFlags.RAW */];
  7063. return raw ? toRaw(raw) : observed;
  7064. }
  7065. function markRaw(value) {
  7066. // non-extensible objects won't be observed anyway
  7067. if (Object.isExtensible(value)) {
  7068. def(value, "__v_skip" /* ReactiveFlags.SKIP */, true);
  7069. }
  7070. return value;
  7071. }
  7072. /**
  7073. * @internal
  7074. */
  7075. function isCollectionType(value) {
  7076. var type = toRawType(value);
  7077. return (type === 'Map' || type === 'WeakMap' || type === 'Set' || type === 'WeakSet');
  7078. }
  7079. /**
  7080. * @internal
  7081. */
  7082. var RefFlag = "__v_isRef";
  7083. function isRef(r) {
  7084. return !!(r && r.__v_isRef === true);
  7085. }
  7086. function ref$1(value) {
  7087. return createRef(value, false);
  7088. }
  7089. function shallowRef(value) {
  7090. return createRef(value, true);
  7091. }
  7092. function createRef(rawValue, shallow) {
  7093. if (isRef(rawValue)) {
  7094. return rawValue;
  7095. }
  7096. var ref = {};
  7097. def(ref, RefFlag, true);
  7098. def(ref, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, shallow);
  7099. def(ref, 'dep', defineReactive(ref, 'value', rawValue, null, shallow, isServerRendering()));
  7100. return ref;
  7101. }
  7102. function triggerRef(ref) {
  7103. if (false) {}
  7104. if (false) {}
  7105. else {
  7106. ref.dep && ref.dep.notify();
  7107. }
  7108. }
  7109. function unref(ref) {
  7110. return isRef(ref) ? ref.value : ref;
  7111. }
  7112. function proxyRefs(objectWithRefs) {
  7113. if (isReactive(objectWithRefs)) {
  7114. return objectWithRefs;
  7115. }
  7116. var proxy = {};
  7117. var keys = Object.keys(objectWithRefs);
  7118. for (var i = 0; i < keys.length; i++) {
  7119. proxyWithRefUnwrap(proxy, objectWithRefs, keys[i]);
  7120. }
  7121. return proxy;
  7122. }
  7123. function proxyWithRefUnwrap(target, source, key) {
  7124. Object.defineProperty(target, key, {
  7125. enumerable: true,
  7126. configurable: true,
  7127. get: function () {
  7128. var val = source[key];
  7129. if (isRef(val)) {
  7130. return val.value;
  7131. }
  7132. else {
  7133. var ob = val && val.__ob__;
  7134. if (ob)
  7135. ob.dep.depend();
  7136. return val;
  7137. }
  7138. },
  7139. set: function (value) {
  7140. var oldValue = source[key];
  7141. if (isRef(oldValue) && !isRef(value)) {
  7142. oldValue.value = value;
  7143. }
  7144. else {
  7145. source[key] = value;
  7146. }
  7147. }
  7148. });
  7149. }
  7150. function customRef(factory) {
  7151. var dep = new Dep();
  7152. var _a = factory(function () {
  7153. if (false) {}
  7154. else {
  7155. dep.depend();
  7156. }
  7157. }, function () {
  7158. if (false) {}
  7159. else {
  7160. dep.notify();
  7161. }
  7162. }), get = _a.get, set = _a.set;
  7163. var ref = {
  7164. get value() {
  7165. return get();
  7166. },
  7167. set value(newVal) {
  7168. set(newVal);
  7169. }
  7170. };
  7171. def(ref, RefFlag, true);
  7172. return ref;
  7173. }
  7174. function toRefs(object) {
  7175. if (false) {}
  7176. var ret = isArray(object) ? new Array(object.length) : {};
  7177. for (var key in object) {
  7178. ret[key] = toRef(object, key);
  7179. }
  7180. return ret;
  7181. }
  7182. function toRef(object, key, defaultValue) {
  7183. var val = object[key];
  7184. if (isRef(val)) {
  7185. return val;
  7186. }
  7187. var ref = {
  7188. get value() {
  7189. var val = object[key];
  7190. return val === undefined ? defaultValue : val;
  7191. },
  7192. set value(newVal) {
  7193. object[key] = newVal;
  7194. }
  7195. };
  7196. def(ref, RefFlag, true);
  7197. return ref;
  7198. }
  7199. var rawToReadonlyFlag = "__v_rawToReadonly";
  7200. var rawToShallowReadonlyFlag = "__v_rawToShallowReadonly";
  7201. function readonly(target) {
  7202. return createReadonly(target, false);
  7203. }
  7204. function createReadonly(target, shallow) {
  7205. if (!isPlainObject(target)) {
  7206. if (false) {}
  7207. return target;
  7208. }
  7209. if (false) {}
  7210. // already a readonly object
  7211. if (isReadonly(target)) {
  7212. return target;
  7213. }
  7214. // already has a readonly proxy
  7215. var existingFlag = shallow ? rawToShallowReadonlyFlag : rawToReadonlyFlag;
  7216. var existingProxy = target[existingFlag];
  7217. if (existingProxy) {
  7218. return existingProxy;
  7219. }
  7220. var proxy = Object.create(Object.getPrototypeOf(target));
  7221. def(target, existingFlag, proxy);
  7222. def(proxy, "__v_isReadonly" /* ReactiveFlags.IS_READONLY */, true);
  7223. def(proxy, "__v_raw" /* ReactiveFlags.RAW */, target);
  7224. if (isRef(target)) {
  7225. def(proxy, RefFlag, true);
  7226. }
  7227. if (shallow || isShallow(target)) {
  7228. def(proxy, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, true);
  7229. }
  7230. var keys = Object.keys(target);
  7231. for (var i = 0; i < keys.length; i++) {
  7232. defineReadonlyProperty(proxy, target, keys[i], shallow);
  7233. }
  7234. return proxy;
  7235. }
  7236. function defineReadonlyProperty(proxy, target, key, shallow) {
  7237. Object.defineProperty(proxy, key, {
  7238. enumerable: true,
  7239. configurable: true,
  7240. get: function () {
  7241. var val = target[key];
  7242. return shallow || !isPlainObject(val) ? val : readonly(val);
  7243. },
  7244. set: function () {
  7245. false &&
  7246. false;
  7247. }
  7248. });
  7249. }
  7250. /**
  7251. * Returns a reactive-copy of the original object, where only the root level
  7252. * properties are readonly, and does NOT unwrap refs nor recursively convert
  7253. * returned properties.
  7254. * This is used for creating the props proxy object for stateful components.
  7255. */
  7256. function shallowReadonly(target) {
  7257. return createReadonly(target, true);
  7258. }
  7259. function computed(getterOrOptions, debugOptions) {
  7260. var getter;
  7261. var setter;
  7262. var onlyGetter = isFunction(getterOrOptions);
  7263. if (onlyGetter) {
  7264. getter = getterOrOptions;
  7265. setter = false
  7266. ? undefined
  7267. : noop;
  7268. }
  7269. else {
  7270. getter = getterOrOptions.get;
  7271. setter = getterOrOptions.set;
  7272. }
  7273. var watcher = isServerRendering()
  7274. ? null
  7275. : new Watcher(currentInstance, getter, noop, { lazy: true });
  7276. if (false) {}
  7277. var ref = {
  7278. // some libs rely on the presence effect for checking computed refs
  7279. // from normal refs, but the implementation doesn't matter
  7280. effect: watcher,
  7281. get value() {
  7282. if (watcher) {
  7283. if (watcher.dirty) {
  7284. watcher.evaluate();
  7285. }
  7286. if (Dep.target) {
  7287. if (false) {}
  7288. watcher.depend();
  7289. }
  7290. return watcher.value;
  7291. }
  7292. else {
  7293. return getter();
  7294. }
  7295. },
  7296. set value(newVal) {
  7297. setter(newVal);
  7298. }
  7299. };
  7300. def(ref, RefFlag, true);
  7301. def(ref, "__v_isReadonly" /* ReactiveFlags.IS_READONLY */, onlyGetter);
  7302. return ref;
  7303. }
  7304. var WATCHER = "watcher";
  7305. var WATCHER_CB = "".concat(WATCHER, " callback");
  7306. var WATCHER_GETTER = "".concat(WATCHER, " getter");
  7307. var WATCHER_CLEANUP = "".concat(WATCHER, " cleanup");
  7308. // Simple effect.
  7309. function watchEffect(effect, options) {
  7310. return doWatch(effect, null, options);
  7311. }
  7312. function watchPostEffect(effect, options) {
  7313. return doWatch(effect, null, ( false
  7314. ? undefined : { flush: 'post' }));
  7315. }
  7316. function watchSyncEffect(effect, options) {
  7317. return doWatch(effect, null, ( false
  7318. ? undefined : { flush: 'sync' }));
  7319. }
  7320. // initial value for watchers to trigger on undefined initial values
  7321. var INITIAL_WATCHER_VALUE = {};
  7322. // implementation
  7323. function watch(source, cb, options) {
  7324. if (false) {}
  7325. return doWatch(source, cb, options);
  7326. }
  7327. function doWatch(source, cb, _a) {
  7328. var _b = _a === void 0 ? emptyObject : _a, immediate = _b.immediate, deep = _b.deep, _c = _b.flush, flush = _c === void 0 ? 'pre' : _c, onTrack = _b.onTrack, onTrigger = _b.onTrigger;
  7329. if (false) {}
  7330. var warnInvalidSource = function (s) {
  7331. warn("Invalid watch source: ".concat(s, ". A watch source can only be a getter/effect ") +
  7332. "function, a ref, a reactive object, or an array of these types.");
  7333. };
  7334. var instance = currentInstance;
  7335. var call = function (fn, type, args) {
  7336. if (args === void 0) { args = null; }
  7337. var res = invokeWithErrorHandling(fn, null, args, instance, type);
  7338. if (deep && res && res.__ob__)
  7339. res.__ob__.dep.depend();
  7340. return res;
  7341. };
  7342. var getter;
  7343. var forceTrigger = false;
  7344. var isMultiSource = false;
  7345. if (isRef(source)) {
  7346. getter = function () { return source.value; };
  7347. forceTrigger = isShallow(source);
  7348. }
  7349. else if (isReactive(source)) {
  7350. getter = function () {
  7351. source.__ob__.dep.depend();
  7352. return source;
  7353. };
  7354. deep = true;
  7355. }
  7356. else if (isArray(source)) {
  7357. isMultiSource = true;
  7358. forceTrigger = source.some(function (s) { return isReactive(s) || isShallow(s); });
  7359. getter = function () {
  7360. return source.map(function (s) {
  7361. if (isRef(s)) {
  7362. return s.value;
  7363. }
  7364. else if (isReactive(s)) {
  7365. s.__ob__.dep.depend();
  7366. return traverse(s);
  7367. }
  7368. else if (isFunction(s)) {
  7369. return call(s, WATCHER_GETTER);
  7370. }
  7371. else {
  7372. false && false;
  7373. }
  7374. });
  7375. };
  7376. }
  7377. else if (isFunction(source)) {
  7378. if (cb) {
  7379. // getter with cb
  7380. getter = function () { return call(source, WATCHER_GETTER); };
  7381. }
  7382. else {
  7383. // no cb -> simple effect
  7384. getter = function () {
  7385. if (instance && instance._isDestroyed) {
  7386. return;
  7387. }
  7388. if (cleanup) {
  7389. cleanup();
  7390. }
  7391. return call(source, WATCHER, [onCleanup]);
  7392. };
  7393. }
  7394. }
  7395. else {
  7396. getter = noop;
  7397. false && false;
  7398. }
  7399. if (cb && deep) {
  7400. var baseGetter_1 = getter;
  7401. getter = function () { return traverse(baseGetter_1()); };
  7402. }
  7403. var cleanup;
  7404. var onCleanup = function (fn) {
  7405. cleanup = watcher.onStop = function () {
  7406. call(fn, WATCHER_CLEANUP);
  7407. };
  7408. };
  7409. // in SSR there is no need to setup an actual effect, and it should be noop
  7410. // unless it's eager
  7411. if (isServerRendering()) {
  7412. // we will also not call the invalidate callback (+ runner is not set up)
  7413. onCleanup = noop;
  7414. if (!cb) {
  7415. getter();
  7416. }
  7417. else if (immediate) {
  7418. call(cb, WATCHER_CB, [
  7419. getter(),
  7420. isMultiSource ? [] : undefined,
  7421. onCleanup
  7422. ]);
  7423. }
  7424. return noop;
  7425. }
  7426. var watcher = new Watcher(currentInstance, getter, noop, {
  7427. lazy: true
  7428. });
  7429. watcher.noRecurse = !cb;
  7430. var oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
  7431. // overwrite default run
  7432. watcher.run = function () {
  7433. if (!watcher.active) {
  7434. return;
  7435. }
  7436. if (cb) {
  7437. // watch(source, cb)
  7438. var newValue = watcher.get();
  7439. if (deep ||
  7440. forceTrigger ||
  7441. (isMultiSource
  7442. ? newValue.some(function (v, i) {
  7443. return hasChanged(v, oldValue[i]);
  7444. })
  7445. : hasChanged(newValue, oldValue))) {
  7446. // cleanup before running cb again
  7447. if (cleanup) {
  7448. cleanup();
  7449. }
  7450. call(cb, WATCHER_CB, [
  7451. newValue,
  7452. // pass undefined as the old value when it's changed for the first time
  7453. oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,
  7454. onCleanup
  7455. ]);
  7456. oldValue = newValue;
  7457. }
  7458. }
  7459. else {
  7460. // watchEffect
  7461. watcher.get();
  7462. }
  7463. };
  7464. if (flush === 'sync') {
  7465. watcher.update = watcher.run;
  7466. }
  7467. else if (flush === 'post') {
  7468. watcher.post = true;
  7469. watcher.update = function () { return queueWatcher(watcher); };
  7470. }
  7471. else {
  7472. // pre
  7473. watcher.update = function () {
  7474. if (instance && instance === currentInstance && !instance._isMounted) {
  7475. // pre-watcher triggered before
  7476. var buffer = instance._preWatchers || (instance._preWatchers = []);
  7477. if (buffer.indexOf(watcher) < 0)
  7478. buffer.push(watcher);
  7479. }
  7480. else {
  7481. queueWatcher(watcher);
  7482. }
  7483. };
  7484. }
  7485. if (false) {}
  7486. // initial run
  7487. if (cb) {
  7488. if (immediate) {
  7489. watcher.run();
  7490. }
  7491. else {
  7492. oldValue = watcher.get();
  7493. }
  7494. }
  7495. else if (flush === 'post' && instance) {
  7496. instance.$once('hook:mounted', function () { return watcher.get(); });
  7497. }
  7498. else {
  7499. watcher.get();
  7500. }
  7501. return function () {
  7502. watcher.teardown();
  7503. };
  7504. }
  7505. var activeEffectScope;
  7506. var EffectScope = /** @class */ (function () {
  7507. function EffectScope(detached) {
  7508. if (detached === void 0) { detached = false; }
  7509. this.detached = detached;
  7510. /**
  7511. * @internal
  7512. */
  7513. this.active = true;
  7514. /**
  7515. * @internal
  7516. */
  7517. this.effects = [];
  7518. /**
  7519. * @internal
  7520. */
  7521. this.cleanups = [];
  7522. this.parent = activeEffectScope;
  7523. if (!detached && activeEffectScope) {
  7524. this.index =
  7525. (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
  7526. }
  7527. }
  7528. EffectScope.prototype.run = function (fn) {
  7529. if (this.active) {
  7530. var currentEffectScope = activeEffectScope;
  7531. try {
  7532. activeEffectScope = this;
  7533. return fn();
  7534. }
  7535. finally {
  7536. activeEffectScope = currentEffectScope;
  7537. }
  7538. }
  7539. else if (false) {}
  7540. };
  7541. /**
  7542. * This should only be called on non-detached scopes
  7543. * @internal
  7544. */
  7545. EffectScope.prototype.on = function () {
  7546. activeEffectScope = this;
  7547. };
  7548. /**
  7549. * This should only be called on non-detached scopes
  7550. * @internal
  7551. */
  7552. EffectScope.prototype.off = function () {
  7553. activeEffectScope = this.parent;
  7554. };
  7555. EffectScope.prototype.stop = function (fromParent) {
  7556. if (this.active) {
  7557. var i = void 0, l = void 0;
  7558. for (i = 0, l = this.effects.length; i < l; i++) {
  7559. this.effects[i].teardown();
  7560. }
  7561. for (i = 0, l = this.cleanups.length; i < l; i++) {
  7562. this.cleanups[i]();
  7563. }
  7564. if (this.scopes) {
  7565. for (i = 0, l = this.scopes.length; i < l; i++) {
  7566. this.scopes[i].stop(true);
  7567. }
  7568. }
  7569. // nested scope, dereference from parent to avoid memory leaks
  7570. if (!this.detached && this.parent && !fromParent) {
  7571. // optimized O(1) removal
  7572. var last = this.parent.scopes.pop();
  7573. if (last && last !== this) {
  7574. this.parent.scopes[this.index] = last;
  7575. last.index = this.index;
  7576. }
  7577. }
  7578. this.parent = undefined;
  7579. this.active = false;
  7580. }
  7581. };
  7582. return EffectScope;
  7583. }());
  7584. function effectScope(detached) {
  7585. return new EffectScope(detached);
  7586. }
  7587. /**
  7588. * @internal
  7589. */
  7590. function recordEffectScope(effect, scope) {
  7591. if (scope === void 0) { scope = activeEffectScope; }
  7592. if (scope && scope.active) {
  7593. scope.effects.push(effect);
  7594. }
  7595. }
  7596. function getCurrentScope() {
  7597. return activeEffectScope;
  7598. }
  7599. function onScopeDispose(fn) {
  7600. if (activeEffectScope) {
  7601. activeEffectScope.cleanups.push(fn);
  7602. }
  7603. else if (false) {}
  7604. }
  7605. function provide(key, value) {
  7606. if (!currentInstance) {
  7607. if (false) {}
  7608. }
  7609. else {
  7610. // TS doesn't allow symbol as index type
  7611. resolveProvided(currentInstance)[key] = value;
  7612. }
  7613. }
  7614. function resolveProvided(vm) {
  7615. // by default an instance inherits its parent's provides object
  7616. // but when it needs to provide values of its own, it creates its
  7617. // own provides object using parent provides object as prototype.
  7618. // this way in `inject` we can simply look up injections from direct
  7619. // parent and let the prototype chain do the work.
  7620. var existing = vm._provided;
  7621. var parentProvides = vm.$parent && vm.$parent._provided;
  7622. if (parentProvides === existing) {
  7623. return (vm._provided = Object.create(parentProvides));
  7624. }
  7625. else {
  7626. return existing;
  7627. }
  7628. }
  7629. function inject(key, defaultValue, treatDefaultAsFactory) {
  7630. if (treatDefaultAsFactory === void 0) { treatDefaultAsFactory = false; }
  7631. // fallback to `currentRenderingInstance` so that this can be called in
  7632. // a functional component
  7633. var instance = currentInstance;
  7634. if (instance) {
  7635. // #2400
  7636. // to support `app.use` plugins,
  7637. // fallback to appContext's `provides` if the instance is at root
  7638. var provides = instance.$parent && instance.$parent._provided;
  7639. if (provides && key in provides) {
  7640. // TS doesn't allow symbol as index type
  7641. return provides[key];
  7642. }
  7643. else if (arguments.length > 1) {
  7644. return treatDefaultAsFactory && isFunction(defaultValue)
  7645. ? defaultValue.call(instance)
  7646. : defaultValue;
  7647. }
  7648. else if (false) {}
  7649. }
  7650. else if (false) {}
  7651. }
  7652. var normalizeEvent = cached(function (name) {
  7653. var passive = name.charAt(0) === '&';
  7654. name = passive ? name.slice(1) : name;
  7655. var once = name.charAt(0) === '~'; // Prefixed last, checked first
  7656. name = once ? name.slice(1) : name;
  7657. var capture = name.charAt(0) === '!';
  7658. name = capture ? name.slice(1) : name;
  7659. return {
  7660. name: name,
  7661. once: once,
  7662. capture: capture,
  7663. passive: passive
  7664. };
  7665. });
  7666. function createFnInvoker(fns, vm) {
  7667. function invoker() {
  7668. var fns = invoker.fns;
  7669. if (isArray(fns)) {
  7670. var cloned = fns.slice();
  7671. for (var i = 0; i < cloned.length; i++) {
  7672. invokeWithErrorHandling(cloned[i], null, arguments, vm, "v-on handler");
  7673. }
  7674. }
  7675. else {
  7676. // return handler return value for single handlers
  7677. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler");
  7678. }
  7679. }
  7680. invoker.fns = fns;
  7681. return invoker;
  7682. }
  7683. function updateListeners(on, oldOn, add, remove, createOnceHandler, vm) {
  7684. var name, cur, old, event;
  7685. for (name in on) {
  7686. cur = on[name];
  7687. old = oldOn[name];
  7688. event = normalizeEvent(name);
  7689. if (isUndef(cur)) {
  7690. false &&
  7691. false;
  7692. }
  7693. else if (isUndef(old)) {
  7694. if (isUndef(cur.fns)) {
  7695. cur = on[name] = createFnInvoker(cur, vm);
  7696. }
  7697. if (isTrue(event.once)) {
  7698. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  7699. }
  7700. add(event.name, cur, event.capture, event.passive, event.params);
  7701. }
  7702. else if (cur !== old) {
  7703. old.fns = cur;
  7704. on[name] = old;
  7705. }
  7706. }
  7707. for (name in oldOn) {
  7708. if (isUndef(on[name])) {
  7709. event = normalizeEvent(name);
  7710. remove(event.name, oldOn[name], event.capture);
  7711. }
  7712. }
  7713. }
  7714. function mergeVNodeHook(def, hookKey, hook) {
  7715. if (def instanceof VNode) {
  7716. def = def.data.hook || (def.data.hook = {});
  7717. }
  7718. var invoker;
  7719. var oldHook = def[hookKey];
  7720. function wrappedHook() {
  7721. hook.apply(this, arguments);
  7722. // important: remove merged hook to ensure it's called only once
  7723. // and prevent memory leak
  7724. remove$2(invoker.fns, wrappedHook);
  7725. }
  7726. if (isUndef(oldHook)) {
  7727. // no existing hook
  7728. invoker = createFnInvoker([wrappedHook]);
  7729. }
  7730. else {
  7731. /* istanbul ignore if */
  7732. if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
  7733. // already a merged invoker
  7734. invoker = oldHook;
  7735. invoker.fns.push(wrappedHook);
  7736. }
  7737. else {
  7738. // existing plain hook
  7739. invoker = createFnInvoker([oldHook, wrappedHook]);
  7740. }
  7741. }
  7742. invoker.merged = true;
  7743. def[hookKey] = invoker;
  7744. }
  7745. function extractPropsFromVNodeData(data, Ctor, tag) {
  7746. // we are only extracting raw values here.
  7747. // validation and default values are handled in the child
  7748. // component itself.
  7749. var propOptions = Ctor.options.props;
  7750. if (isUndef(propOptions)) {
  7751. return;
  7752. }
  7753. var res = {};
  7754. var attrs = data.attrs, props = data.props;
  7755. if (isDef(attrs) || isDef(props)) {
  7756. for (var key in propOptions) {
  7757. var altKey = hyphenate(key);
  7758. if (false) { var keyInLowerCase; }
  7759. checkProp(res, props, key, altKey, true) ||
  7760. checkProp(res, attrs, key, altKey, false);
  7761. }
  7762. }
  7763. return res;
  7764. }
  7765. function checkProp(res, hash, key, altKey, preserve) {
  7766. if (isDef(hash)) {
  7767. if (hasOwn(hash, key)) {
  7768. res[key] = hash[key];
  7769. if (!preserve) {
  7770. delete hash[key];
  7771. }
  7772. return true;
  7773. }
  7774. else if (hasOwn(hash, altKey)) {
  7775. res[key] = hash[altKey];
  7776. if (!preserve) {
  7777. delete hash[altKey];
  7778. }
  7779. return true;
  7780. }
  7781. }
  7782. return false;
  7783. }
  7784. // The template compiler attempts to minimize the need for normalization by
  7785. // statically analyzing the template at compile time.
  7786. //
  7787. // For plain HTML markup, normalization can be completely skipped because the
  7788. // generated render function is guaranteed to return Array<VNode>. There are
  7789. // two cases where extra normalization is needed:
  7790. // 1. When the children contains components - because a functional component
  7791. // may return an Array instead of a single root. In this case, just a simple
  7792. // normalization is needed - if any child is an Array, we flatten the whole
  7793. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  7794. // because functional components already normalize their own children.
  7795. function simpleNormalizeChildren(children) {
  7796. for (var i = 0; i < children.length; i++) {
  7797. if (isArray(children[i])) {
  7798. return Array.prototype.concat.apply([], children);
  7799. }
  7800. }
  7801. return children;
  7802. }
  7803. // 2. When the children contains constructs that always generated nested Arrays,
  7804. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  7805. // with hand-written render functions / JSX. In such cases a full normalization
  7806. // is needed to cater to all possible types of children values.
  7807. function normalizeChildren(children) {
  7808. return isPrimitive(children)
  7809. ? [createTextVNode(children)]
  7810. : isArray(children)
  7811. ? normalizeArrayChildren(children)
  7812. : undefined;
  7813. }
  7814. function isTextNode(node) {
  7815. return isDef(node) && isDef(node.text) && isFalse(node.isComment);
  7816. }
  7817. function normalizeArrayChildren(children, nestedIndex) {
  7818. var res = [];
  7819. var i, c, lastIndex, last;
  7820. for (i = 0; i < children.length; i++) {
  7821. c = children[i];
  7822. if (isUndef(c) || typeof c === 'boolean')
  7823. continue;
  7824. lastIndex = res.length - 1;
  7825. last = res[lastIndex];
  7826. // nested
  7827. if (isArray(c)) {
  7828. if (c.length > 0) {
  7829. c = normalizeArrayChildren(c, "".concat(nestedIndex || '', "_").concat(i));
  7830. // merge adjacent text nodes
  7831. if (isTextNode(c[0]) && isTextNode(last)) {
  7832. res[lastIndex] = createTextVNode(last.text + c[0].text);
  7833. c.shift();
  7834. }
  7835. res.push.apply(res, c);
  7836. }
  7837. }
  7838. else if (isPrimitive(c)) {
  7839. if (isTextNode(last)) {
  7840. // merge adjacent text nodes
  7841. // this is necessary for SSR hydration because text nodes are
  7842. // essentially merged when rendered to HTML strings
  7843. res[lastIndex] = createTextVNode(last.text + c);
  7844. }
  7845. else if (c !== '') {
  7846. // convert primitive to vnode
  7847. res.push(createTextVNode(c));
  7848. }
  7849. }
  7850. else {
  7851. if (isTextNode(c) && isTextNode(last)) {
  7852. // merge adjacent text nodes
  7853. res[lastIndex] = createTextVNode(last.text + c.text);
  7854. }
  7855. else {
  7856. // default key for nested array children (likely generated by v-for)
  7857. if (isTrue(children._isVList) &&
  7858. isDef(c.tag) &&
  7859. isUndef(c.key) &&
  7860. isDef(nestedIndex)) {
  7861. c.key = "__vlist".concat(nestedIndex, "_").concat(i, "__");
  7862. }
  7863. res.push(c);
  7864. }
  7865. }
  7866. }
  7867. return res;
  7868. }
  7869. /**
  7870. * Runtime helper for rendering v-for lists.
  7871. */
  7872. function renderList(val, render) {
  7873. var ret = null, i, l, keys, key;
  7874. if (isArray(val) || typeof val === 'string') {
  7875. ret = new Array(val.length);
  7876. for (i = 0, l = val.length; i < l; i++) {
  7877. ret[i] = render(val[i], i);
  7878. }
  7879. }
  7880. else if (typeof val === 'number') {
  7881. ret = new Array(val);
  7882. for (i = 0; i < val; i++) {
  7883. ret[i] = render(i + 1, i);
  7884. }
  7885. }
  7886. else if (isObject(val)) {
  7887. if (hasSymbol && val[Symbol.iterator]) {
  7888. ret = [];
  7889. var iterator = val[Symbol.iterator]();
  7890. var result = iterator.next();
  7891. while (!result.done) {
  7892. ret.push(render(result.value, ret.length));
  7893. result = iterator.next();
  7894. }
  7895. }
  7896. else {
  7897. keys = Object.keys(val);
  7898. ret = new Array(keys.length);
  7899. for (i = 0, l = keys.length; i < l; i++) {
  7900. key = keys[i];
  7901. ret[i] = render(val[key], key, i);
  7902. }
  7903. }
  7904. }
  7905. if (!isDef(ret)) {
  7906. ret = [];
  7907. }
  7908. ret._isVList = true;
  7909. return ret;
  7910. }
  7911. /**
  7912. * Runtime helper for rendering <slot>
  7913. */
  7914. function renderSlot(name, fallbackRender, props, bindObject) {
  7915. var scopedSlotFn = this.$scopedSlots[name];
  7916. var nodes;
  7917. if (scopedSlotFn) {
  7918. // scoped slot
  7919. props = props || {};
  7920. if (bindObject) {
  7921. if (false) {}
  7922. props = extend(extend({}, bindObject), props);
  7923. }
  7924. nodes =
  7925. scopedSlotFn(props) ||
  7926. (isFunction(fallbackRender) ? fallbackRender() : fallbackRender);
  7927. }
  7928. else {
  7929. nodes =
  7930. this.$slots[name] ||
  7931. (isFunction(fallbackRender) ? fallbackRender() : fallbackRender);
  7932. }
  7933. var target = props && props.slot;
  7934. if (target) {
  7935. return this.$createElement('template', { slot: target }, nodes);
  7936. }
  7937. else {
  7938. return nodes;
  7939. }
  7940. }
  7941. /**
  7942. * Runtime helper for resolving filters
  7943. */
  7944. function resolveFilter(id) {
  7945. return resolveAsset(this.$options, 'filters', id, true) || identity;
  7946. }
  7947. function isKeyNotMatch(expect, actual) {
  7948. if (isArray(expect)) {
  7949. return expect.indexOf(actual) === -1;
  7950. }
  7951. else {
  7952. return expect !== actual;
  7953. }
  7954. }
  7955. /**
  7956. * Runtime helper for checking keyCodes from config.
  7957. * exposed as Vue.prototype._k
  7958. * passing in eventKeyName as last argument separately for backwards compat
  7959. */
  7960. function checkKeyCodes(eventKeyCode, key, builtInKeyCode, eventKeyName, builtInKeyName) {
  7961. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  7962. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  7963. return isKeyNotMatch(builtInKeyName, eventKeyName);
  7964. }
  7965. else if (mappedKeyCode) {
  7966. return isKeyNotMatch(mappedKeyCode, eventKeyCode);
  7967. }
  7968. else if (eventKeyName) {
  7969. return hyphenate(eventKeyName) !== key;
  7970. }
  7971. return eventKeyCode === undefined;
  7972. }
  7973. /**
  7974. * Runtime helper for merging v-bind="object" into a VNode's data.
  7975. */
  7976. function bindObjectProps(data, tag, value, asProp, isSync) {
  7977. if (value) {
  7978. if (!isObject(value)) {
  7979. false &&
  7980. false;
  7981. }
  7982. else {
  7983. if (isArray(value)) {
  7984. value = toObject(value);
  7985. }
  7986. var hash = void 0;
  7987. var _loop_1 = function (key) {
  7988. if (key === 'class' || key === 'style' || isReservedAttribute(key)) {
  7989. hash = data;
  7990. }
  7991. else {
  7992. var type = data.attrs && data.attrs.type;
  7993. hash =
  7994. asProp || config.mustUseProp(tag, type, key)
  7995. ? data.domProps || (data.domProps = {})
  7996. : data.attrs || (data.attrs = {});
  7997. }
  7998. var camelizedKey = camelize(key);
  7999. var hyphenatedKey = hyphenate(key);
  8000. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  8001. hash[key] = value[key];
  8002. if (isSync) {
  8003. var on = data.on || (data.on = {});
  8004. on["update:".concat(key)] = function ($event) {
  8005. value[key] = $event;
  8006. };
  8007. }
  8008. }
  8009. };
  8010. for (var key in value) {
  8011. _loop_1(key);
  8012. }
  8013. }
  8014. }
  8015. return data;
  8016. }
  8017. /**
  8018. * Runtime helper for rendering static trees.
  8019. */
  8020. function renderStatic(index, isInFor) {
  8021. var cached = this._staticTrees || (this._staticTrees = []);
  8022. var tree = cached[index];
  8023. // if has already-rendered static tree and not inside v-for,
  8024. // we can reuse the same tree.
  8025. if (tree && !isInFor) {
  8026. return tree;
  8027. }
  8028. // otherwise, render a fresh tree.
  8029. tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, this._c, this // for render fns generated for functional component templates
  8030. );
  8031. markStatic(tree, "__static__".concat(index), false);
  8032. return tree;
  8033. }
  8034. /**
  8035. * Runtime helper for v-once.
  8036. * Effectively it means marking the node as static with a unique key.
  8037. */
  8038. function markOnce(tree, index, key) {
  8039. markStatic(tree, "__once__".concat(index).concat(key ? "_".concat(key) : ""), true);
  8040. return tree;
  8041. }
  8042. function markStatic(tree, key, isOnce) {
  8043. if (isArray(tree)) {
  8044. for (var i = 0; i < tree.length; i++) {
  8045. if (tree[i] && typeof tree[i] !== 'string') {
  8046. markStaticNode(tree[i], "".concat(key, "_").concat(i), isOnce);
  8047. }
  8048. }
  8049. }
  8050. else {
  8051. markStaticNode(tree, key, isOnce);
  8052. }
  8053. }
  8054. function markStaticNode(node, key, isOnce) {
  8055. node.isStatic = true;
  8056. node.key = key;
  8057. node.isOnce = isOnce;
  8058. }
  8059. function bindObjectListeners(data, value) {
  8060. if (value) {
  8061. if (!isPlainObject(value)) {
  8062. false && false;
  8063. }
  8064. else {
  8065. var on = (data.on = data.on ? extend({}, data.on) : {});
  8066. for (var key in value) {
  8067. var existing = on[key];
  8068. var ours = value[key];
  8069. on[key] = existing ? [].concat(existing, ours) : ours;
  8070. }
  8071. }
  8072. }
  8073. return data;
  8074. }
  8075. function resolveScopedSlots(fns, res,
  8076. // the following are added in 2.6
  8077. hasDynamicKeys, contentHashKey) {
  8078. res = res || { $stable: !hasDynamicKeys };
  8079. for (var i = 0; i < fns.length; i++) {
  8080. var slot = fns[i];
  8081. if (isArray(slot)) {
  8082. resolveScopedSlots(slot, res, hasDynamicKeys);
  8083. }
  8084. else if (slot) {
  8085. // marker for reverse proxying v-slot without scope on this.$slots
  8086. // @ts-expect-error
  8087. if (slot.proxy) {
  8088. // @ts-expect-error
  8089. slot.fn.proxy = true;
  8090. }
  8091. res[slot.key] = slot.fn;
  8092. }
  8093. }
  8094. if (contentHashKey) {
  8095. res.$key = contentHashKey;
  8096. }
  8097. return res;
  8098. }
  8099. // helper to process dynamic keys for dynamic arguments in v-bind and v-on.
  8100. function bindDynamicKeys(baseObj, values) {
  8101. for (var i = 0; i < values.length; i += 2) {
  8102. var key = values[i];
  8103. if (typeof key === 'string' && key) {
  8104. baseObj[values[i]] = values[i + 1];
  8105. }
  8106. else if (false) {}
  8107. }
  8108. return baseObj;
  8109. }
  8110. // helper to dynamically append modifier runtime markers to event names.
  8111. // ensure only append when value is already string, otherwise it will be cast
  8112. // to string and cause the type check to miss.
  8113. function prependModifier(value, symbol) {
  8114. return typeof value === 'string' ? symbol + value : value;
  8115. }
  8116. function installRenderHelpers(target) {
  8117. target._o = markOnce;
  8118. target._n = toNumber;
  8119. target._s = toString;
  8120. target._l = renderList;
  8121. target._t = renderSlot;
  8122. target._q = looseEqual;
  8123. target._i = looseIndexOf;
  8124. target._m = renderStatic;
  8125. target._f = resolveFilter;
  8126. target._k = checkKeyCodes;
  8127. target._b = bindObjectProps;
  8128. target._v = createTextVNode;
  8129. target._e = createEmptyVNode;
  8130. target._u = resolveScopedSlots;
  8131. target._g = bindObjectListeners;
  8132. target._d = bindDynamicKeys;
  8133. target._p = prependModifier;
  8134. }
  8135. /**
  8136. * Runtime helper for resolving raw children VNodes into a slot object.
  8137. */
  8138. function resolveSlots(children, context) {
  8139. if (!children || !children.length) {
  8140. return {};
  8141. }
  8142. var slots = {};
  8143. for (var i = 0, l = children.length; i < l; i++) {
  8144. var child = children[i];
  8145. var data = child.data;
  8146. // remove slot attribute if the node is resolved as a Vue slot node
  8147. if (data && data.attrs && data.attrs.slot) {
  8148. delete data.attrs.slot;
  8149. }
  8150. // named slots should only be respected if the vnode was rendered in the
  8151. // same context.
  8152. if ((child.context === context || child.fnContext === context) &&
  8153. data &&
  8154. data.slot != null) {
  8155. var name_1 = data.slot;
  8156. var slot = slots[name_1] || (slots[name_1] = []);
  8157. if (child.tag === 'template') {
  8158. slot.push.apply(slot, child.children || []);
  8159. }
  8160. else {
  8161. slot.push(child);
  8162. }
  8163. }
  8164. else {
  8165. (slots.default || (slots.default = [])).push(child);
  8166. }
  8167. }
  8168. // ignore slots that contains only whitespace
  8169. for (var name_2 in slots) {
  8170. if (slots[name_2].every(isWhitespace)) {
  8171. delete slots[name_2];
  8172. }
  8173. }
  8174. return slots;
  8175. }
  8176. function isWhitespace(node) {
  8177. return (node.isComment && !node.asyncFactory) || node.text === ' ';
  8178. }
  8179. function isAsyncPlaceholder(node) {
  8180. // @ts-expect-error not really boolean type
  8181. return node.isComment && node.asyncFactory;
  8182. }
  8183. function normalizeScopedSlots(ownerVm, scopedSlots, normalSlots, prevScopedSlots) {
  8184. var res;
  8185. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  8186. var isStable = scopedSlots ? !!scopedSlots.$stable : !hasNormalSlots;
  8187. var key = scopedSlots && scopedSlots.$key;
  8188. if (!scopedSlots) {
  8189. res = {};
  8190. }
  8191. else if (scopedSlots._normalized) {
  8192. // fast path 1: child component re-render only, parent did not change
  8193. return scopedSlots._normalized;
  8194. }
  8195. else if (isStable &&
  8196. prevScopedSlots &&
  8197. prevScopedSlots !== emptyObject &&
  8198. key === prevScopedSlots.$key &&
  8199. !hasNormalSlots &&
  8200. !prevScopedSlots.$hasNormal) {
  8201. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  8202. // only need to normalize once
  8203. return prevScopedSlots;
  8204. }
  8205. else {
  8206. res = {};
  8207. for (var key_1 in scopedSlots) {
  8208. if (scopedSlots[key_1] && key_1[0] !== '$') {
  8209. res[key_1] = normalizeScopedSlot(ownerVm, normalSlots, key_1, scopedSlots[key_1]);
  8210. }
  8211. }
  8212. }
  8213. // expose normal slots on scopedSlots
  8214. for (var key_2 in normalSlots) {
  8215. if (!(key_2 in res)) {
  8216. res[key_2] = proxyNormalSlot(normalSlots, key_2);
  8217. }
  8218. }
  8219. // avoriaz seems to mock a non-extensible $scopedSlots object
  8220. // and when that is passed down this would cause an error
  8221. if (scopedSlots && Object.isExtensible(scopedSlots)) {
  8222. scopedSlots._normalized = res;
  8223. }
  8224. def(res, '$stable', isStable);
  8225. def(res, '$key', key);
  8226. def(res, '$hasNormal', hasNormalSlots);
  8227. return res;
  8228. }
  8229. function normalizeScopedSlot(vm, normalSlots, key, fn) {
  8230. var normalized = function () {
  8231. var cur = currentInstance;
  8232. setCurrentInstance(vm);
  8233. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  8234. res =
  8235. res && typeof res === 'object' && !isArray(res)
  8236. ? [res] // single vnode
  8237. : normalizeChildren(res);
  8238. var vnode = res && res[0];
  8239. setCurrentInstance(cur);
  8240. return res &&
  8241. (!vnode ||
  8242. (res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode))) // #9658, #10391
  8243. ? undefined
  8244. : res;
  8245. };
  8246. // this is a slot using the new v-slot syntax without scope. although it is
  8247. // compiled as a scoped slot, render fn users would expect it to be present
  8248. // on this.$slots because the usage is semantically a normal slot.
  8249. if (fn.proxy) {
  8250. Object.defineProperty(normalSlots, key, {
  8251. get: normalized,
  8252. enumerable: true,
  8253. configurable: true
  8254. });
  8255. }
  8256. return normalized;
  8257. }
  8258. function proxyNormalSlot(slots, key) {
  8259. return function () { return slots[key]; };
  8260. }
  8261. function initSetup(vm) {
  8262. var options = vm.$options;
  8263. var setup = options.setup;
  8264. if (setup) {
  8265. var ctx = (vm._setupContext = createSetupContext(vm));
  8266. setCurrentInstance(vm);
  8267. pushTarget();
  8268. var setupResult = invokeWithErrorHandling(setup, null, [vm._props || shallowReactive({}), ctx], vm, "setup");
  8269. popTarget();
  8270. setCurrentInstance();
  8271. if (isFunction(setupResult)) {
  8272. // render function
  8273. // @ts-ignore
  8274. options.render = setupResult;
  8275. }
  8276. else if (isObject(setupResult)) {
  8277. // bindings
  8278. if (false) {}
  8279. vm._setupState = setupResult;
  8280. // __sfc indicates compiled bindings from <script setup>
  8281. if (!setupResult.__sfc) {
  8282. for (var key in setupResult) {
  8283. if (!isReserved(key)) {
  8284. proxyWithRefUnwrap(vm, setupResult, key);
  8285. }
  8286. else if (false) {}
  8287. }
  8288. }
  8289. else {
  8290. // exposed for compiled render fn
  8291. var proxy = (vm._setupProxy = {});
  8292. for (var key in setupResult) {
  8293. if (key !== '__sfc') {
  8294. proxyWithRefUnwrap(proxy, setupResult, key);
  8295. }
  8296. }
  8297. }
  8298. }
  8299. else if (false) {}
  8300. }
  8301. }
  8302. function createSetupContext(vm) {
  8303. var exposeCalled = false;
  8304. return {
  8305. get attrs() {
  8306. if (!vm._attrsProxy) {
  8307. var proxy = (vm._attrsProxy = {});
  8308. def(proxy, '_v_attr_proxy', true);
  8309. syncSetupProxy(proxy, vm.$attrs, emptyObject, vm, '$attrs');
  8310. }
  8311. return vm._attrsProxy;
  8312. },
  8313. get listeners() {
  8314. if (!vm._listenersProxy) {
  8315. var proxy = (vm._listenersProxy = {});
  8316. syncSetupProxy(proxy, vm.$listeners, emptyObject, vm, '$listeners');
  8317. }
  8318. return vm._listenersProxy;
  8319. },
  8320. get slots() {
  8321. return initSlotsProxy(vm);
  8322. },
  8323. emit: bind(vm.$emit, vm),
  8324. expose: function (exposed) {
  8325. if (false) {}
  8326. if (exposed) {
  8327. Object.keys(exposed).forEach(function (key) {
  8328. return proxyWithRefUnwrap(vm, exposed, key);
  8329. });
  8330. }
  8331. }
  8332. };
  8333. }
  8334. function syncSetupProxy(to, from, prev, instance, type) {
  8335. var changed = false;
  8336. for (var key in from) {
  8337. if (!(key in to)) {
  8338. changed = true;
  8339. defineProxyAttr(to, key, instance, type);
  8340. }
  8341. else if (from[key] !== prev[key]) {
  8342. changed = true;
  8343. }
  8344. }
  8345. for (var key in to) {
  8346. if (!(key in from)) {
  8347. changed = true;
  8348. delete to[key];
  8349. }
  8350. }
  8351. return changed;
  8352. }
  8353. function defineProxyAttr(proxy, key, instance, type) {
  8354. Object.defineProperty(proxy, key, {
  8355. enumerable: true,
  8356. configurable: true,
  8357. get: function () {
  8358. return instance[type][key];
  8359. }
  8360. });
  8361. }
  8362. function initSlotsProxy(vm) {
  8363. if (!vm._slotsProxy) {
  8364. syncSetupSlots((vm._slotsProxy = {}), vm.$scopedSlots);
  8365. }
  8366. return vm._slotsProxy;
  8367. }
  8368. function syncSetupSlots(to, from) {
  8369. for (var key in from) {
  8370. to[key] = from[key];
  8371. }
  8372. for (var key in to) {
  8373. if (!(key in from)) {
  8374. delete to[key];
  8375. }
  8376. }
  8377. }
  8378. /**
  8379. * @internal use manual type def because public setup context type relies on
  8380. * legacy VNode types
  8381. */
  8382. function useSlots() {
  8383. return getContext().slots;
  8384. }
  8385. /**
  8386. * @internal use manual type def because public setup context type relies on
  8387. * legacy VNode types
  8388. */
  8389. function useAttrs() {
  8390. return getContext().attrs;
  8391. }
  8392. /**
  8393. * Vue 2 only
  8394. * @internal use manual type def because public setup context type relies on
  8395. * legacy VNode types
  8396. */
  8397. function useListeners() {
  8398. return getContext().listeners;
  8399. }
  8400. function getContext() {
  8401. if (false) {}
  8402. var vm = currentInstance;
  8403. return vm._setupContext || (vm._setupContext = createSetupContext(vm));
  8404. }
  8405. /**
  8406. * Runtime helper for merging default declarations. Imported by compiled code
  8407. * only.
  8408. * @internal
  8409. */
  8410. function mergeDefaults(raw, defaults) {
  8411. var props = isArray(raw)
  8412. ? raw.reduce(function (normalized, p) { return ((normalized[p] = {}), normalized); }, {})
  8413. : raw;
  8414. for (var key in defaults) {
  8415. var opt = props[key];
  8416. if (opt) {
  8417. if (isArray(opt) || isFunction(opt)) {
  8418. props[key] = { type: opt, default: defaults[key] };
  8419. }
  8420. else {
  8421. opt.default = defaults[key];
  8422. }
  8423. }
  8424. else if (opt === null) {
  8425. props[key] = { default: defaults[key] };
  8426. }
  8427. else if (false) {}
  8428. }
  8429. return props;
  8430. }
  8431. function initRender(vm) {
  8432. vm._vnode = null; // the root of the child tree
  8433. vm._staticTrees = null; // v-once cached trees
  8434. var options = vm.$options;
  8435. var parentVnode = (vm.$vnode = options._parentVnode); // the placeholder node in parent tree
  8436. var renderContext = parentVnode && parentVnode.context;
  8437. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  8438. vm.$scopedSlots = parentVnode
  8439. ? normalizeScopedSlots(vm.$parent, parentVnode.data.scopedSlots, vm.$slots)
  8440. : emptyObject;
  8441. // bind the createElement fn to this instance
  8442. // so that we get proper render context inside it.
  8443. // args order: tag, data, children, normalizationType, alwaysNormalize
  8444. // internal version is used by render functions compiled from templates
  8445. // @ts-expect-error
  8446. vm._c = function (a, b, c, d) { return createElement$1(vm, a, b, c, d, false); };
  8447. // normalization is always applied for the public version, used in
  8448. // user-written render functions.
  8449. // @ts-expect-error
  8450. vm.$createElement = function (a, b, c, d) { return createElement$1(vm, a, b, c, d, true); };
  8451. // $attrs & $listeners are exposed for easier HOC creation.
  8452. // they need to be reactive so that HOCs using them are always updated
  8453. var parentData = parentVnode && parentVnode.data;
  8454. /* istanbul ignore else */
  8455. if (false) {}
  8456. else {
  8457. defineReactive(vm, '$attrs', (parentData && parentData.attrs) || emptyObject, null, true);
  8458. defineReactive(vm, '$listeners', options._parentListeners || emptyObject, null, true);
  8459. }
  8460. }
  8461. var currentRenderingInstance = null;
  8462. function renderMixin(Vue) {
  8463. // install runtime convenience helpers
  8464. installRenderHelpers(Vue.prototype);
  8465. Vue.prototype.$nextTick = function (fn) {
  8466. return nextTick(fn, this);
  8467. };
  8468. Vue.prototype._render = function () {
  8469. var vm = this;
  8470. var _a = vm.$options, render = _a.render, _parentVnode = _a._parentVnode;
  8471. if (_parentVnode && vm._isMounted) {
  8472. vm.$scopedSlots = normalizeScopedSlots(vm.$parent, _parentVnode.data.scopedSlots, vm.$slots, vm.$scopedSlots);
  8473. if (vm._slotsProxy) {
  8474. syncSetupSlots(vm._slotsProxy, vm.$scopedSlots);
  8475. }
  8476. }
  8477. // set parent vnode. this allows render functions to have access
  8478. // to the data on the placeholder node.
  8479. vm.$vnode = _parentVnode;
  8480. // render self
  8481. var prevInst = currentInstance;
  8482. var prevRenderInst = currentRenderingInstance;
  8483. var vnode;
  8484. try {
  8485. setCurrentInstance(vm);
  8486. currentRenderingInstance = vm;
  8487. vnode = render.call(vm._renderProxy, vm.$createElement);
  8488. }
  8489. catch (e) {
  8490. handleError(e, vm, "render");
  8491. // return error render result,
  8492. // or previous vnode to prevent render error causing blank component
  8493. /* istanbul ignore else */
  8494. if (false) {}
  8495. else {
  8496. vnode = vm._vnode;
  8497. }
  8498. }
  8499. finally {
  8500. currentRenderingInstance = prevRenderInst;
  8501. setCurrentInstance(prevInst);
  8502. }
  8503. // if the returned array contains only a single node, allow it
  8504. if (isArray(vnode) && vnode.length === 1) {
  8505. vnode = vnode[0];
  8506. }
  8507. // return empty vnode in case the render function errored out
  8508. if (!(vnode instanceof VNode)) {
  8509. if (false) {}
  8510. vnode = createEmptyVNode();
  8511. }
  8512. // set parent
  8513. vnode.parent = _parentVnode;
  8514. return vnode;
  8515. };
  8516. }
  8517. function ensureCtor(comp, base) {
  8518. if (comp.__esModule || (hasSymbol && comp[Symbol.toStringTag] === 'Module')) {
  8519. comp = comp.default;
  8520. }
  8521. return isObject(comp) ? base.extend(comp) : comp;
  8522. }
  8523. function createAsyncPlaceholder(factory, data, context, children, tag) {
  8524. var node = createEmptyVNode();
  8525. node.asyncFactory = factory;
  8526. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  8527. return node;
  8528. }
  8529. function resolveAsyncComponent(factory, baseCtor) {
  8530. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  8531. return factory.errorComp;
  8532. }
  8533. if (isDef(factory.resolved)) {
  8534. return factory.resolved;
  8535. }
  8536. var owner = currentRenderingInstance;
  8537. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  8538. // already pending
  8539. factory.owners.push(owner);
  8540. }
  8541. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  8542. return factory.loadingComp;
  8543. }
  8544. if (owner && !isDef(factory.owners)) {
  8545. var owners_1 = (factory.owners = [owner]);
  8546. var sync_1 = true;
  8547. var timerLoading_1 = null;
  8548. var timerTimeout_1 = null;
  8549. owner.$on('hook:destroyed', function () { return remove$2(owners_1, owner); });
  8550. var forceRender_1 = function (renderCompleted) {
  8551. for (var i = 0, l = owners_1.length; i < l; i++) {
  8552. owners_1[i].$forceUpdate();
  8553. }
  8554. if (renderCompleted) {
  8555. owners_1.length = 0;
  8556. if (timerLoading_1 !== null) {
  8557. clearTimeout(timerLoading_1);
  8558. timerLoading_1 = null;
  8559. }
  8560. if (timerTimeout_1 !== null) {
  8561. clearTimeout(timerTimeout_1);
  8562. timerTimeout_1 = null;
  8563. }
  8564. }
  8565. };
  8566. var resolve = once(function (res) {
  8567. // cache resolved
  8568. factory.resolved = ensureCtor(res, baseCtor);
  8569. // invoke callbacks only if this is not a synchronous resolve
  8570. // (async resolves are shimmed as synchronous during SSR)
  8571. if (!sync_1) {
  8572. forceRender_1(true);
  8573. }
  8574. else {
  8575. owners_1.length = 0;
  8576. }
  8577. });
  8578. var reject_1 = once(function (reason) {
  8579. false &&
  8580. false;
  8581. if (isDef(factory.errorComp)) {
  8582. factory.error = true;
  8583. forceRender_1(true);
  8584. }
  8585. });
  8586. var res_1 = factory(resolve, reject_1);
  8587. if (isObject(res_1)) {
  8588. if (isPromise(res_1)) {
  8589. // () => Promise
  8590. if (isUndef(factory.resolved)) {
  8591. res_1.then(resolve, reject_1);
  8592. }
  8593. }
  8594. else if (isPromise(res_1.component)) {
  8595. res_1.component.then(resolve, reject_1);
  8596. if (isDef(res_1.error)) {
  8597. factory.errorComp = ensureCtor(res_1.error, baseCtor);
  8598. }
  8599. if (isDef(res_1.loading)) {
  8600. factory.loadingComp = ensureCtor(res_1.loading, baseCtor);
  8601. if (res_1.delay === 0) {
  8602. factory.loading = true;
  8603. }
  8604. else {
  8605. // @ts-expect-error NodeJS timeout type
  8606. timerLoading_1 = setTimeout(function () {
  8607. timerLoading_1 = null;
  8608. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  8609. factory.loading = true;
  8610. forceRender_1(false);
  8611. }
  8612. }, res_1.delay || 200);
  8613. }
  8614. }
  8615. if (isDef(res_1.timeout)) {
  8616. // @ts-expect-error NodeJS timeout type
  8617. timerTimeout_1 = setTimeout(function () {
  8618. timerTimeout_1 = null;
  8619. if (isUndef(factory.resolved)) {
  8620. reject_1( false ? undefined : null);
  8621. }
  8622. }, res_1.timeout);
  8623. }
  8624. }
  8625. }
  8626. sync_1 = false;
  8627. // return in case resolved synchronously
  8628. return factory.loading ? factory.loadingComp : factory.resolved;
  8629. }
  8630. }
  8631. function getFirstComponentChild(children) {
  8632. if (isArray(children)) {
  8633. for (var i = 0; i < children.length; i++) {
  8634. var c = children[i];
  8635. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  8636. return c;
  8637. }
  8638. }
  8639. }
  8640. }
  8641. var SIMPLE_NORMALIZE = 1;
  8642. var ALWAYS_NORMALIZE = 2;
  8643. // wrapper function for providing a more flexible interface
  8644. // without getting yelled at by flow
  8645. function createElement$1(context, tag, data, children, normalizationType, alwaysNormalize) {
  8646. if (isArray(data) || isPrimitive(data)) {
  8647. normalizationType = children;
  8648. children = data;
  8649. data = undefined;
  8650. }
  8651. if (isTrue(alwaysNormalize)) {
  8652. normalizationType = ALWAYS_NORMALIZE;
  8653. }
  8654. return _createElement(context, tag, data, children, normalizationType);
  8655. }
  8656. function _createElement(context, tag, data, children, normalizationType) {
  8657. if (isDef(data) && isDef(data.__ob__)) {
  8658. false &&
  8659. false;
  8660. return createEmptyVNode();
  8661. }
  8662. // object syntax in v-bind
  8663. if (isDef(data) && isDef(data.is)) {
  8664. tag = data.is;
  8665. }
  8666. if (!tag) {
  8667. // in case of component :is set to falsy value
  8668. return createEmptyVNode();
  8669. }
  8670. // warn against non-primitive key
  8671. if (false) {}
  8672. // support single function children as default scoped slot
  8673. if (isArray(children) && isFunction(children[0])) {
  8674. data = data || {};
  8675. data.scopedSlots = { default: children[0] };
  8676. children.length = 0;
  8677. }
  8678. if (normalizationType === ALWAYS_NORMALIZE) {
  8679. children = normalizeChildren(children);
  8680. }
  8681. else if (normalizationType === SIMPLE_NORMALIZE) {
  8682. children = simpleNormalizeChildren(children);
  8683. }
  8684. var vnode, ns;
  8685. if (typeof tag === 'string') {
  8686. var Ctor = void 0;
  8687. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  8688. if (config.isReservedTag(tag)) {
  8689. // platform built-in elements
  8690. if (false) {}
  8691. vnode = new VNode(config.parsePlatformTagName(tag), data, children, undefined, undefined, context);
  8692. }
  8693. else if ((!data || !data.pre) &&
  8694. isDef((Ctor = resolveAsset(context.$options, 'components', tag)))) {
  8695. // component
  8696. vnode = createComponent(Ctor, data, context, children, tag);
  8697. }
  8698. else {
  8699. // unknown or unlisted namespaced elements
  8700. // check at runtime because it may get assigned a namespace when its
  8701. // parent normalizes children
  8702. vnode = new VNode(tag, data, children, undefined, undefined, context);
  8703. }
  8704. }
  8705. else {
  8706. // direct component options / constructor
  8707. vnode = createComponent(tag, data, context, children);
  8708. }
  8709. if (isArray(vnode)) {
  8710. return vnode;
  8711. }
  8712. else if (isDef(vnode)) {
  8713. if (isDef(ns))
  8714. applyNS(vnode, ns);
  8715. if (isDef(data))
  8716. registerDeepBindings(data);
  8717. return vnode;
  8718. }
  8719. else {
  8720. return createEmptyVNode();
  8721. }
  8722. }
  8723. function applyNS(vnode, ns, force) {
  8724. vnode.ns = ns;
  8725. if (vnode.tag === 'foreignObject') {
  8726. // use default namespace inside foreignObject
  8727. ns = undefined;
  8728. force = true;
  8729. }
  8730. if (isDef(vnode.children)) {
  8731. for (var i = 0, l = vnode.children.length; i < l; i++) {
  8732. var child = vnode.children[i];
  8733. if (isDef(child.tag) &&
  8734. (isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  8735. applyNS(child, ns, force);
  8736. }
  8737. }
  8738. }
  8739. }
  8740. // ref #5318
  8741. // necessary to ensure parent re-render when deep bindings like :style and
  8742. // :class are used on slot nodes
  8743. function registerDeepBindings(data) {
  8744. if (isObject(data.style)) {
  8745. traverse(data.style);
  8746. }
  8747. if (isObject(data.class)) {
  8748. traverse(data.class);
  8749. }
  8750. }
  8751. /**
  8752. * @internal this function needs manual public type declaration because it relies
  8753. * on previously manually authored types from Vue 2
  8754. */
  8755. function h(type, props, children) {
  8756. if (!currentInstance) {
  8757. false &&
  8758. false;
  8759. }
  8760. return createElement$1(currentInstance, type, props, children, 2, true);
  8761. }
  8762. function handleError(err, vm, info) {
  8763. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  8764. // See: https://github.com/vuejs/vuex/issues/1505
  8765. pushTarget();
  8766. try {
  8767. if (vm) {
  8768. var cur = vm;
  8769. while ((cur = cur.$parent)) {
  8770. var hooks = cur.$options.errorCaptured;
  8771. if (hooks) {
  8772. for (var i = 0; i < hooks.length; i++) {
  8773. try {
  8774. var capture = hooks[i].call(cur, err, vm, info) === false;
  8775. if (capture)
  8776. return;
  8777. }
  8778. catch (e) {
  8779. globalHandleError(e, cur, 'errorCaptured hook');
  8780. }
  8781. }
  8782. }
  8783. }
  8784. }
  8785. globalHandleError(err, vm, info);
  8786. }
  8787. finally {
  8788. popTarget();
  8789. }
  8790. }
  8791. function invokeWithErrorHandling(handler, context, args, vm, info) {
  8792. var res;
  8793. try {
  8794. res = args ? handler.apply(context, args) : handler.call(context);
  8795. if (res && !res._isVue && isPromise(res) && !res._handled) {
  8796. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  8797. res._handled = true;
  8798. }
  8799. }
  8800. catch (e) {
  8801. handleError(e, vm, info);
  8802. }
  8803. return res;
  8804. }
  8805. function globalHandleError(err, vm, info) {
  8806. if (config.errorHandler) {
  8807. try {
  8808. return config.errorHandler.call(null, err, vm, info);
  8809. }
  8810. catch (e) {
  8811. // if the user intentionally throws the original error in the handler,
  8812. // do not log it twice
  8813. if (e !== err) {
  8814. logError(e, null, 'config.errorHandler');
  8815. }
  8816. }
  8817. }
  8818. logError(err, vm, info);
  8819. }
  8820. function logError(err, vm, info) {
  8821. if (false) {}
  8822. /* istanbul ignore else */
  8823. if (inBrowser && typeof console !== 'undefined') {
  8824. console.error(err);
  8825. }
  8826. else {
  8827. throw err;
  8828. }
  8829. }
  8830. /* globals MutationObserver */
  8831. var isUsingMicroTask = false;
  8832. var callbacks = [];
  8833. var pending = false;
  8834. function flushCallbacks() {
  8835. pending = false;
  8836. var copies = callbacks.slice(0);
  8837. callbacks.length = 0;
  8838. for (var i = 0; i < copies.length; i++) {
  8839. copies[i]();
  8840. }
  8841. }
  8842. // Here we have async deferring wrappers using microtasks.
  8843. // In 2.5 we used (macro) tasks (in combination with microtasks).
  8844. // However, it has subtle problems when state is changed right before repaint
  8845. // (e.g. #6813, out-in transitions).
  8846. // Also, using (macro) tasks in event handler would cause some weird behaviors
  8847. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  8848. // So we now use microtasks everywhere, again.
  8849. // A major drawback of this tradeoff is that there are some scenarios
  8850. // where microtasks have too high a priority and fire in between supposedly
  8851. // sequential events (e.g. #4521, #6690, which have workarounds)
  8852. // or even between bubbling of the same event (#6566).
  8853. var timerFunc;
  8854. // The nextTick behavior leverages the microtask queue, which can be accessed
  8855. // via either native Promise.then or MutationObserver.
  8856. // MutationObserver has wider support, however it is seriously bugged in
  8857. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  8858. // completely stops working after triggering a few times... so, if native
  8859. // Promise is available, we will use it:
  8860. /* istanbul ignore next, $flow-disable-line */
  8861. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  8862. var p_1 = Promise.resolve();
  8863. timerFunc = function () {
  8864. p_1.then(flushCallbacks);
  8865. // In problematic UIWebViews, Promise.then doesn't completely break, but
  8866. // it can get stuck in a weird state where callbacks are pushed into the
  8867. // microtask queue but the queue isn't being flushed, until the browser
  8868. // needs to do some other work, e.g. handle a timer. Therefore we can
  8869. // "force" the microtask queue to be flushed by adding an empty timer.
  8870. if (isIOS)
  8871. setTimeout(noop);
  8872. };
  8873. isUsingMicroTask = true;
  8874. }
  8875. else if (!isIE &&
  8876. typeof MutationObserver !== 'undefined' &&
  8877. (isNative(MutationObserver) ||
  8878. // PhantomJS and iOS 7.x
  8879. MutationObserver.toString() === '[object MutationObserverConstructor]')) {
  8880. // Use MutationObserver where native Promise is not available,
  8881. // e.g. PhantomJS, iOS7, Android 4.4
  8882. // (#6466 MutationObserver is unreliable in IE11)
  8883. var counter_1 = 1;
  8884. var observer = new MutationObserver(flushCallbacks);
  8885. var textNode_1 = document.createTextNode(String(counter_1));
  8886. observer.observe(textNode_1, {
  8887. characterData: true
  8888. });
  8889. timerFunc = function () {
  8890. counter_1 = (counter_1 + 1) % 2;
  8891. textNode_1.data = String(counter_1);
  8892. };
  8893. isUsingMicroTask = true;
  8894. }
  8895. else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  8896. // Fallback to setImmediate.
  8897. // Technically it leverages the (macro) task queue,
  8898. // but it is still a better choice than setTimeout.
  8899. timerFunc = function () {
  8900. setImmediate(flushCallbacks);
  8901. };
  8902. }
  8903. else {
  8904. // Fallback to setTimeout.
  8905. timerFunc = function () {
  8906. setTimeout(flushCallbacks, 0);
  8907. };
  8908. }
  8909. /**
  8910. * @internal
  8911. */
  8912. function nextTick(cb, ctx) {
  8913. var _resolve;
  8914. callbacks.push(function () {
  8915. if (cb) {
  8916. try {
  8917. cb.call(ctx);
  8918. }
  8919. catch (e) {
  8920. handleError(e, ctx, 'nextTick');
  8921. }
  8922. }
  8923. else if (_resolve) {
  8924. _resolve(ctx);
  8925. }
  8926. });
  8927. if (!pending) {
  8928. pending = true;
  8929. timerFunc();
  8930. }
  8931. // $flow-disable-line
  8932. if (!cb && typeof Promise !== 'undefined') {
  8933. return new Promise(function (resolve) {
  8934. _resolve = resolve;
  8935. });
  8936. }
  8937. }
  8938. function useCssModule(name) {
  8939. if (name === void 0) { name = '$style'; }
  8940. /* istanbul ignore else */
  8941. {
  8942. if (!currentInstance) {
  8943. false && false;
  8944. return emptyObject;
  8945. }
  8946. var mod = currentInstance[name];
  8947. if (!mod) {
  8948. false &&
  8949. false;
  8950. return emptyObject;
  8951. }
  8952. return mod;
  8953. }
  8954. }
  8955. /**
  8956. * Runtime helper for SFC's CSS variable injection feature.
  8957. * @private
  8958. */
  8959. function useCssVars(getter) {
  8960. if (!inBrowser && !false)
  8961. return;
  8962. var instance = currentInstance;
  8963. if (!instance) {
  8964. false &&
  8965. false;
  8966. return;
  8967. }
  8968. watchPostEffect(function () {
  8969. var el = instance.$el;
  8970. var vars = getter(instance, instance._setupProxy);
  8971. if (el && el.nodeType === 1) {
  8972. var style = el.style;
  8973. for (var key in vars) {
  8974. style.setProperty("--".concat(key), vars[key]);
  8975. }
  8976. }
  8977. });
  8978. }
  8979. /**
  8980. * v3-compatible async component API.
  8981. * @internal the type is manually declared in <root>/types/v3-define-async-component.d.ts
  8982. * because it relies on existing manual types
  8983. */
  8984. function defineAsyncComponent(source) {
  8985. if (isFunction(source)) {
  8986. source = { loader: source };
  8987. }
  8988. var loader = source.loader, loadingComponent = source.loadingComponent, errorComponent = source.errorComponent, _a = source.delay, delay = _a === void 0 ? 200 : _a, timeout = source.timeout, // undefined = never times out
  8989. _b = source.suspensible, // undefined = never times out
  8990. suspensible = _b === void 0 ? false : _b, // in Vue 3 default is true
  8991. userOnError = source.onError;
  8992. if (false) {}
  8993. var pendingRequest = null;
  8994. var retries = 0;
  8995. var retry = function () {
  8996. retries++;
  8997. pendingRequest = null;
  8998. return load();
  8999. };
  9000. var load = function () {
  9001. var thisRequest;
  9002. return (pendingRequest ||
  9003. (thisRequest = pendingRequest =
  9004. loader()
  9005. .catch(function (err) {
  9006. err = err instanceof Error ? err : new Error(String(err));
  9007. if (userOnError) {
  9008. return new Promise(function (resolve, reject) {
  9009. var userRetry = function () { return resolve(retry()); };
  9010. var userFail = function () { return reject(err); };
  9011. userOnError(err, userRetry, userFail, retries + 1);
  9012. });
  9013. }
  9014. else {
  9015. throw err;
  9016. }
  9017. })
  9018. .then(function (comp) {
  9019. if (thisRequest !== pendingRequest && pendingRequest) {
  9020. return pendingRequest;
  9021. }
  9022. if (false) {}
  9023. // interop module default
  9024. if (comp &&
  9025. (comp.__esModule || comp[Symbol.toStringTag] === 'Module')) {
  9026. comp = comp.default;
  9027. }
  9028. if (false) {}
  9029. return comp;
  9030. })));
  9031. };
  9032. return function () {
  9033. var component = load();
  9034. return {
  9035. component: component,
  9036. delay: delay,
  9037. timeout: timeout,
  9038. error: errorComponent,
  9039. loading: loadingComponent
  9040. };
  9041. };
  9042. }
  9043. function createLifeCycle(hookName) {
  9044. return function (fn, target) {
  9045. if (target === void 0) { target = currentInstance; }
  9046. if (!target) {
  9047. false &&
  9048. false;
  9049. return;
  9050. }
  9051. return injectHook(target, hookName, fn);
  9052. };
  9053. }
  9054. function formatName(name) {
  9055. if (name === 'beforeDestroy') {
  9056. name = 'beforeUnmount';
  9057. }
  9058. else if (name === 'destroyed') {
  9059. name = 'unmounted';
  9060. }
  9061. return "on".concat(name[0].toUpperCase() + name.slice(1));
  9062. }
  9063. function injectHook(instance, hookName, fn) {
  9064. var options = instance.$options;
  9065. options[hookName] = mergeLifecycleHook(options[hookName], fn);
  9066. }
  9067. var onBeforeMount = createLifeCycle('beforeMount');
  9068. var onMounted = createLifeCycle('mounted');
  9069. var onBeforeUpdate = createLifeCycle('beforeUpdate');
  9070. var onUpdated = createLifeCycle('updated');
  9071. var onBeforeUnmount = createLifeCycle('beforeDestroy');
  9072. var onUnmounted = createLifeCycle('destroyed');
  9073. var onActivated = createLifeCycle('activated');
  9074. var onDeactivated = createLifeCycle('deactivated');
  9075. var onServerPrefetch = createLifeCycle('serverPrefetch');
  9076. var onRenderTracked = createLifeCycle('renderTracked');
  9077. var onRenderTriggered = createLifeCycle('renderTriggered');
  9078. var injectErrorCapturedHook = createLifeCycle('errorCaptured');
  9079. function onErrorCaptured(hook, target) {
  9080. if (target === void 0) { target = currentInstance; }
  9081. injectErrorCapturedHook(hook, target);
  9082. }
  9083. /**
  9084. * Note: also update dist/vue.runtime.mjs when adding new exports to this file.
  9085. */
  9086. var version = '2.7.16';
  9087. /**
  9088. * @internal type is manually declared in <root>/types/v3-define-component.d.ts
  9089. */
  9090. function defineComponent(options) {
  9091. return options;
  9092. }
  9093. var seenObjects = new _Set();
  9094. /**
  9095. * Recursively traverse an object to evoke all converted
  9096. * getters, so that every nested property inside the object
  9097. * is collected as a "deep" dependency.
  9098. */
  9099. function traverse(val) {
  9100. _traverse(val, seenObjects);
  9101. seenObjects.clear();
  9102. return val;
  9103. }
  9104. function _traverse(val, seen) {
  9105. var i, keys;
  9106. var isA = isArray(val);
  9107. if ((!isA && !isObject(val)) ||
  9108. val.__v_skip /* ReactiveFlags.SKIP */ ||
  9109. Object.isFrozen(val) ||
  9110. val instanceof VNode) {
  9111. return;
  9112. }
  9113. if (val.__ob__) {
  9114. var depId = val.__ob__.dep.id;
  9115. if (seen.has(depId)) {
  9116. return;
  9117. }
  9118. seen.add(depId);
  9119. }
  9120. if (isA) {
  9121. i = val.length;
  9122. while (i--)
  9123. _traverse(val[i], seen);
  9124. }
  9125. else if (isRef(val)) {
  9126. _traverse(val.value, seen);
  9127. }
  9128. else {
  9129. keys = Object.keys(val);
  9130. i = keys.length;
  9131. while (i--)
  9132. _traverse(val[keys[i]], seen);
  9133. }
  9134. }
  9135. var uid$1 = 0;
  9136. /**
  9137. * A watcher parses an expression, collects dependencies,
  9138. * and fires callback when the expression value changes.
  9139. * This is used for both the $watch() api and directives.
  9140. * @internal
  9141. */
  9142. var Watcher = /** @class */ (function () {
  9143. function Watcher(vm, expOrFn, cb, options, isRenderWatcher) {
  9144. recordEffectScope(this,
  9145. // if the active effect scope is manually created (not a component scope),
  9146. // prioritize it
  9147. activeEffectScope && !activeEffectScope._vm
  9148. ? activeEffectScope
  9149. : vm
  9150. ? vm._scope
  9151. : undefined);
  9152. if ((this.vm = vm) && isRenderWatcher) {
  9153. vm._watcher = this;
  9154. }
  9155. // options
  9156. if (options) {
  9157. this.deep = !!options.deep;
  9158. this.user = !!options.user;
  9159. this.lazy = !!options.lazy;
  9160. this.sync = !!options.sync;
  9161. this.before = options.before;
  9162. if (false) {}
  9163. }
  9164. else {
  9165. this.deep = this.user = this.lazy = this.sync = false;
  9166. }
  9167. this.cb = cb;
  9168. this.id = ++uid$1; // uid for batching
  9169. this.active = true;
  9170. this.post = false;
  9171. this.dirty = this.lazy; // for lazy watchers
  9172. this.deps = [];
  9173. this.newDeps = [];
  9174. this.depIds = new _Set();
  9175. this.newDepIds = new _Set();
  9176. this.expression = false ? undefined : '';
  9177. // parse expression for getter
  9178. if (isFunction(expOrFn)) {
  9179. this.getter = expOrFn;
  9180. }
  9181. else {
  9182. this.getter = parsePath(expOrFn);
  9183. if (!this.getter) {
  9184. this.getter = noop;
  9185. false &&
  9186. false;
  9187. }
  9188. }
  9189. this.value = this.lazy ? undefined : this.get();
  9190. }
  9191. /**
  9192. * Evaluate the getter, and re-collect dependencies.
  9193. */
  9194. Watcher.prototype.get = function () {
  9195. pushTarget(this);
  9196. var value;
  9197. var vm = this.vm;
  9198. try {
  9199. value = this.getter.call(vm, vm);
  9200. }
  9201. catch (e) {
  9202. if (this.user) {
  9203. handleError(e, vm, "getter for watcher \"".concat(this.expression, "\""));
  9204. }
  9205. else {
  9206. throw e;
  9207. }
  9208. }
  9209. finally {
  9210. // "touch" every property so they are all tracked as
  9211. // dependencies for deep watching
  9212. if (this.deep) {
  9213. traverse(value);
  9214. }
  9215. popTarget();
  9216. this.cleanupDeps();
  9217. }
  9218. return value;
  9219. };
  9220. /**
  9221. * Add a dependency to this directive.
  9222. */
  9223. Watcher.prototype.addDep = function (dep) {
  9224. var id = dep.id;
  9225. if (!this.newDepIds.has(id)) {
  9226. this.newDepIds.add(id);
  9227. this.newDeps.push(dep);
  9228. if (!this.depIds.has(id)) {
  9229. dep.addSub(this);
  9230. }
  9231. }
  9232. };
  9233. /**
  9234. * Clean up for dependency collection.
  9235. */
  9236. Watcher.prototype.cleanupDeps = function () {
  9237. var i = this.deps.length;
  9238. while (i--) {
  9239. var dep = this.deps[i];
  9240. if (!this.newDepIds.has(dep.id)) {
  9241. dep.removeSub(this);
  9242. }
  9243. }
  9244. var tmp = this.depIds;
  9245. this.depIds = this.newDepIds;
  9246. this.newDepIds = tmp;
  9247. this.newDepIds.clear();
  9248. tmp = this.deps;
  9249. this.deps = this.newDeps;
  9250. this.newDeps = tmp;
  9251. this.newDeps.length = 0;
  9252. };
  9253. /**
  9254. * Subscriber interface.
  9255. * Will be called when a dependency changes.
  9256. */
  9257. Watcher.prototype.update = function () {
  9258. /* istanbul ignore else */
  9259. if (this.lazy) {
  9260. this.dirty = true;
  9261. }
  9262. else if (this.sync) {
  9263. this.run();
  9264. }
  9265. else {
  9266. queueWatcher(this);
  9267. }
  9268. };
  9269. /**
  9270. * Scheduler job interface.
  9271. * Will be called by the scheduler.
  9272. */
  9273. Watcher.prototype.run = function () {
  9274. if (this.active) {
  9275. var value = this.get();
  9276. if (value !== this.value ||
  9277. // Deep watchers and watchers on Object/Arrays should fire even
  9278. // when the value is the same, because the value may
  9279. // have mutated.
  9280. isObject(value) ||
  9281. this.deep) {
  9282. // set new value
  9283. var oldValue = this.value;
  9284. this.value = value;
  9285. if (this.user) {
  9286. var info = "callback for watcher \"".concat(this.expression, "\"");
  9287. invokeWithErrorHandling(this.cb, this.vm, [value, oldValue], this.vm, info);
  9288. }
  9289. else {
  9290. this.cb.call(this.vm, value, oldValue);
  9291. }
  9292. }
  9293. }
  9294. };
  9295. /**
  9296. * Evaluate the value of the watcher.
  9297. * This only gets called for lazy watchers.
  9298. */
  9299. Watcher.prototype.evaluate = function () {
  9300. this.value = this.get();
  9301. this.dirty = false;
  9302. };
  9303. /**
  9304. * Depend on all deps collected by this watcher.
  9305. */
  9306. Watcher.prototype.depend = function () {
  9307. var i = this.deps.length;
  9308. while (i--) {
  9309. this.deps[i].depend();
  9310. }
  9311. };
  9312. /**
  9313. * Remove self from all dependencies' subscriber list.
  9314. */
  9315. Watcher.prototype.teardown = function () {
  9316. if (this.vm && !this.vm._isBeingDestroyed) {
  9317. remove$2(this.vm._scope.effects, this);
  9318. }
  9319. if (this.active) {
  9320. var i = this.deps.length;
  9321. while (i--) {
  9322. this.deps[i].removeSub(this);
  9323. }
  9324. this.active = false;
  9325. if (this.onStop) {
  9326. this.onStop();
  9327. }
  9328. }
  9329. };
  9330. return Watcher;
  9331. }());
  9332. var mark;
  9333. var measure;
  9334. if (false) { var perf_1; }
  9335. function initEvents(vm) {
  9336. vm._events = Object.create(null);
  9337. vm._hasHookEvent = false;
  9338. // init parent attached events
  9339. var listeners = vm.$options._parentListeners;
  9340. if (listeners) {
  9341. updateComponentListeners(vm, listeners);
  9342. }
  9343. }
  9344. var target$1;
  9345. function add$1(event, fn) {
  9346. target$1.$on(event, fn);
  9347. }
  9348. function remove$1(event, fn) {
  9349. target$1.$off(event, fn);
  9350. }
  9351. function createOnceHandler$1(event, fn) {
  9352. var _target = target$1;
  9353. return function onceHandler() {
  9354. var res = fn.apply(null, arguments);
  9355. if (res !== null) {
  9356. _target.$off(event, onceHandler);
  9357. }
  9358. };
  9359. }
  9360. function updateComponentListeners(vm, listeners, oldListeners) {
  9361. target$1 = vm;
  9362. updateListeners(listeners, oldListeners || {}, add$1, remove$1, createOnceHandler$1, vm);
  9363. target$1 = undefined;
  9364. }
  9365. function eventsMixin(Vue) {
  9366. var hookRE = /^hook:/;
  9367. Vue.prototype.$on = function (event, fn) {
  9368. var vm = this;
  9369. if (isArray(event)) {
  9370. for (var i = 0, l = event.length; i < l; i++) {
  9371. vm.$on(event[i], fn);
  9372. }
  9373. }
  9374. else {
  9375. (vm._events[event] || (vm._events[event] = [])).push(fn);
  9376. // optimize hook:event cost by using a boolean flag marked at registration
  9377. // instead of a hash lookup
  9378. if (hookRE.test(event)) {
  9379. vm._hasHookEvent = true;
  9380. }
  9381. }
  9382. return vm;
  9383. };
  9384. Vue.prototype.$once = function (event, fn) {
  9385. var vm = this;
  9386. function on() {
  9387. vm.$off(event, on);
  9388. fn.apply(vm, arguments);
  9389. }
  9390. on.fn = fn;
  9391. vm.$on(event, on);
  9392. return vm;
  9393. };
  9394. Vue.prototype.$off = function (event, fn) {
  9395. var vm = this;
  9396. // all
  9397. if (!arguments.length) {
  9398. vm._events = Object.create(null);
  9399. return vm;
  9400. }
  9401. // array of events
  9402. if (isArray(event)) {
  9403. for (var i_1 = 0, l = event.length; i_1 < l; i_1++) {
  9404. vm.$off(event[i_1], fn);
  9405. }
  9406. return vm;
  9407. }
  9408. // specific event
  9409. var cbs = vm._events[event];
  9410. if (!cbs) {
  9411. return vm;
  9412. }
  9413. if (!fn) {
  9414. vm._events[event] = null;
  9415. return vm;
  9416. }
  9417. // specific handler
  9418. var cb;
  9419. var i = cbs.length;
  9420. while (i--) {
  9421. cb = cbs[i];
  9422. if (cb === fn || cb.fn === fn) {
  9423. cbs.splice(i, 1);
  9424. break;
  9425. }
  9426. }
  9427. return vm;
  9428. };
  9429. Vue.prototype.$emit = function (event) {
  9430. var vm = this;
  9431. if (false) { var lowerCaseEvent; }
  9432. var cbs = vm._events[event];
  9433. if (cbs) {
  9434. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  9435. var args = toArray(arguments, 1);
  9436. var info = "event handler for \"".concat(event, "\"");
  9437. for (var i = 0, l = cbs.length; i < l; i++) {
  9438. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  9439. }
  9440. }
  9441. return vm;
  9442. };
  9443. }
  9444. var activeInstance = null;
  9445. var isUpdatingChildComponent = false;
  9446. function setActiveInstance(vm) {
  9447. var prevActiveInstance = activeInstance;
  9448. activeInstance = vm;
  9449. return function () {
  9450. activeInstance = prevActiveInstance;
  9451. };
  9452. }
  9453. function initLifecycle(vm) {
  9454. var options = vm.$options;
  9455. // locate first non-abstract parent
  9456. var parent = options.parent;
  9457. if (parent && !options.abstract) {
  9458. while (parent.$options.abstract && parent.$parent) {
  9459. parent = parent.$parent;
  9460. }
  9461. parent.$children.push(vm);
  9462. }
  9463. vm.$parent = parent;
  9464. vm.$root = parent ? parent.$root : vm;
  9465. vm.$children = [];
  9466. vm.$refs = {};
  9467. vm._provided = parent ? parent._provided : Object.create(null);
  9468. vm._watcher = null;
  9469. vm._inactive = null;
  9470. vm._directInactive = false;
  9471. vm._isMounted = false;
  9472. vm._isDestroyed = false;
  9473. vm._isBeingDestroyed = false;
  9474. }
  9475. function lifecycleMixin(Vue) {
  9476. Vue.prototype._update = function (vnode, hydrating) {
  9477. var vm = this;
  9478. var prevEl = vm.$el;
  9479. var prevVnode = vm._vnode;
  9480. var restoreActiveInstance = setActiveInstance(vm);
  9481. vm._vnode = vnode;
  9482. // Vue.prototype.__patch__ is injected in entry points
  9483. // based on the rendering backend used.
  9484. if (!prevVnode) {
  9485. // initial render
  9486. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  9487. }
  9488. else {
  9489. // updates
  9490. vm.$el = vm.__patch__(prevVnode, vnode);
  9491. }
  9492. restoreActiveInstance();
  9493. // update __vue__ reference
  9494. if (prevEl) {
  9495. prevEl.__vue__ = null;
  9496. }
  9497. if (vm.$el) {
  9498. vm.$el.__vue__ = vm;
  9499. }
  9500. // if parent is an HOC, update its $el as well
  9501. var wrapper = vm;
  9502. while (wrapper &&
  9503. wrapper.$vnode &&
  9504. wrapper.$parent &&
  9505. wrapper.$vnode === wrapper.$parent._vnode) {
  9506. wrapper.$parent.$el = wrapper.$el;
  9507. wrapper = wrapper.$parent;
  9508. }
  9509. // updated hook is called by the scheduler to ensure that children are
  9510. // updated in a parent's updated hook.
  9511. };
  9512. Vue.prototype.$forceUpdate = function () {
  9513. var vm = this;
  9514. if (vm._watcher) {
  9515. vm._watcher.update();
  9516. }
  9517. };
  9518. Vue.prototype.$destroy = function () {
  9519. var vm = this;
  9520. if (vm._isBeingDestroyed) {
  9521. return;
  9522. }
  9523. callHook$1(vm, 'beforeDestroy');
  9524. vm._isBeingDestroyed = true;
  9525. // remove self from parent
  9526. var parent = vm.$parent;
  9527. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  9528. remove$2(parent.$children, vm);
  9529. }
  9530. // teardown scope. this includes both the render watcher and other
  9531. // watchers created
  9532. vm._scope.stop();
  9533. // remove reference from data ob
  9534. // frozen object may not have observer.
  9535. if (vm._data.__ob__) {
  9536. vm._data.__ob__.vmCount--;
  9537. }
  9538. // call the last hook...
  9539. vm._isDestroyed = true;
  9540. // invoke destroy hooks on current rendered tree
  9541. vm.__patch__(vm._vnode, null);
  9542. // fire destroyed hook
  9543. callHook$1(vm, 'destroyed');
  9544. // turn off all instance listeners.
  9545. vm.$off();
  9546. // remove __vue__ reference
  9547. if (vm.$el) {
  9548. vm.$el.__vue__ = null;
  9549. }
  9550. // release circular reference (#6759)
  9551. if (vm.$vnode) {
  9552. vm.$vnode.parent = null;
  9553. }
  9554. };
  9555. }
  9556. function mountComponent(vm, el, hydrating) {
  9557. vm.$el = el;
  9558. if (!vm.$options.render) {
  9559. // @ts-expect-error invalid type
  9560. vm.$options.render = createEmptyVNode;
  9561. if (false) {}
  9562. }
  9563. callHook$1(vm, 'beforeMount');
  9564. var updateComponent;
  9565. /* istanbul ignore if */
  9566. if (false) {}
  9567. else {
  9568. updateComponent = function () {
  9569. vm._update(vm._render(), hydrating);
  9570. };
  9571. }
  9572. var watcherOptions = {
  9573. before: function () {
  9574. if (vm._isMounted && !vm._isDestroyed) {
  9575. callHook$1(vm, 'beforeUpdate');
  9576. }
  9577. }
  9578. };
  9579. if (false) {}
  9580. // we set this to vm._watcher inside the watcher's constructor
  9581. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  9582. // component's mounted hook), which relies on vm._watcher being already defined
  9583. new Watcher(vm, updateComponent, noop, watcherOptions, true /* isRenderWatcher */);
  9584. hydrating = false;
  9585. // flush buffer for flush: "pre" watchers queued in setup()
  9586. var preWatchers = vm._preWatchers;
  9587. if (preWatchers) {
  9588. for (var i = 0; i < preWatchers.length; i++) {
  9589. preWatchers[i].run();
  9590. }
  9591. }
  9592. // manually mounted instance, call mounted on self
  9593. // mounted is called for render-created child components in its inserted hook
  9594. if (vm.$vnode == null) {
  9595. vm._isMounted = true;
  9596. callHook$1(vm, 'mounted');
  9597. }
  9598. return vm;
  9599. }
  9600. function updateChildComponent(vm, propsData, listeners, parentVnode, renderChildren) {
  9601. if (false) {}
  9602. // determine whether component has slot children
  9603. // we need to do this before overwriting $options._renderChildren.
  9604. // check if there are dynamic scopedSlots (hand-written or compiled but with
  9605. // dynamic slot names). Static scoped slots compiled from template has the
  9606. // "$stable" marker.
  9607. var newScopedSlots = parentVnode.data.scopedSlots;
  9608. var oldScopedSlots = vm.$scopedSlots;
  9609. var hasDynamicScopedSlot = !!((newScopedSlots && !newScopedSlots.$stable) ||
  9610. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  9611. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key) ||
  9612. (!newScopedSlots && vm.$scopedSlots.$key));
  9613. // Any static slot children from the parent may have changed during parent's
  9614. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  9615. // update is necessary to ensure correctness.
  9616. var needsForceUpdate = !!(renderChildren || // has new static slots
  9617. vm.$options._renderChildren || // has old static slots
  9618. hasDynamicScopedSlot);
  9619. var prevVNode = vm.$vnode;
  9620. vm.$options._parentVnode = parentVnode;
  9621. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  9622. if (vm._vnode) {
  9623. // update child tree's parent
  9624. vm._vnode.parent = parentVnode;
  9625. }
  9626. vm.$options._renderChildren = renderChildren;
  9627. // update $attrs and $listeners hash
  9628. // these are also reactive so they may trigger child update if the child
  9629. // used them during render
  9630. var attrs = parentVnode.data.attrs || emptyObject;
  9631. if (vm._attrsProxy) {
  9632. // force update if attrs are accessed and has changed since it may be
  9633. // passed to a child component.
  9634. if (syncSetupProxy(vm._attrsProxy, attrs, (prevVNode.data && prevVNode.data.attrs) || emptyObject, vm, '$attrs')) {
  9635. needsForceUpdate = true;
  9636. }
  9637. }
  9638. vm.$attrs = attrs;
  9639. // update listeners
  9640. listeners = listeners || emptyObject;
  9641. var prevListeners = vm.$options._parentListeners;
  9642. if (vm._listenersProxy) {
  9643. syncSetupProxy(vm._listenersProxy, listeners, prevListeners || emptyObject, vm, '$listeners');
  9644. }
  9645. vm.$listeners = vm.$options._parentListeners = listeners;
  9646. updateComponentListeners(vm, listeners, prevListeners);
  9647. // update props
  9648. if (propsData && vm.$options.props) {
  9649. toggleObserving(false);
  9650. var props = vm._props;
  9651. var propKeys = vm.$options._propKeys || [];
  9652. for (var i = 0; i < propKeys.length; i++) {
  9653. var key = propKeys[i];
  9654. var propOptions = vm.$options.props; // wtf flow?
  9655. props[key] = validateProp(key, propOptions, propsData, vm);
  9656. }
  9657. toggleObserving(true);
  9658. // keep a copy of raw propsData
  9659. vm.$options.propsData = propsData;
  9660. }
  9661. // resolve slots + force update if has children
  9662. if (needsForceUpdate) {
  9663. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  9664. vm.$forceUpdate();
  9665. }
  9666. if (false) {}
  9667. }
  9668. function isInInactiveTree(vm) {
  9669. while (vm && (vm = vm.$parent)) {
  9670. if (vm._inactive)
  9671. return true;
  9672. }
  9673. return false;
  9674. }
  9675. function activateChildComponent(vm, direct) {
  9676. if (direct) {
  9677. vm._directInactive = false;
  9678. if (isInInactiveTree(vm)) {
  9679. return;
  9680. }
  9681. }
  9682. else if (vm._directInactive) {
  9683. return;
  9684. }
  9685. if (vm._inactive || vm._inactive === null) {
  9686. vm._inactive = false;
  9687. for (var i = 0; i < vm.$children.length; i++) {
  9688. activateChildComponent(vm.$children[i]);
  9689. }
  9690. callHook$1(vm, 'activated');
  9691. }
  9692. }
  9693. function deactivateChildComponent(vm, direct) {
  9694. if (direct) {
  9695. vm._directInactive = true;
  9696. if (isInInactiveTree(vm)) {
  9697. return;
  9698. }
  9699. }
  9700. if (!vm._inactive) {
  9701. vm._inactive = true;
  9702. for (var i = 0; i < vm.$children.length; i++) {
  9703. deactivateChildComponent(vm.$children[i]);
  9704. }
  9705. callHook$1(vm, 'deactivated');
  9706. }
  9707. }
  9708. function callHook$1(vm, hook, args, setContext) {
  9709. if (setContext === void 0) { setContext = true; }
  9710. // #7573 disable dep collection when invoking lifecycle hooks
  9711. pushTarget();
  9712. var prevInst = currentInstance;
  9713. var prevScope = getCurrentScope();
  9714. setContext && setCurrentInstance(vm);
  9715. var handlers = vm.$options[hook];
  9716. var info = "".concat(hook, " hook");
  9717. if (handlers) {
  9718. for (var i = 0, j = handlers.length; i < j; i++) {
  9719. invokeWithErrorHandling(handlers[i], vm, args || null, vm, info);
  9720. }
  9721. }
  9722. if (vm._hasHookEvent) {
  9723. vm.$emit('hook:' + hook);
  9724. }
  9725. if (setContext) {
  9726. setCurrentInstance(prevInst);
  9727. prevScope && prevScope.on();
  9728. }
  9729. popTarget();
  9730. }
  9731. var MAX_UPDATE_COUNT = 100;
  9732. var queue = [];
  9733. var activatedChildren = [];
  9734. var has = {};
  9735. var circular = {};
  9736. var waiting = false;
  9737. var flushing = false;
  9738. var index = 0;
  9739. /**
  9740. * Reset the scheduler's state.
  9741. */
  9742. function resetSchedulerState() {
  9743. index = queue.length = activatedChildren.length = 0;
  9744. has = {};
  9745. if (false) {}
  9746. waiting = flushing = false;
  9747. }
  9748. // Async edge case #6566 requires saving the timestamp when event listeners are
  9749. // attached. However, calling performance.now() has a perf overhead especially
  9750. // if the page has thousands of event listeners. Instead, we take a timestamp
  9751. // every time the scheduler flushes and use that for all event listeners
  9752. // attached during that flush.
  9753. var currentFlushTimestamp = 0;
  9754. // Async edge case fix requires storing an event listener's attach timestamp.
  9755. var getNow = Date.now;
  9756. // Determine what event timestamp the browser is using. Annoyingly, the
  9757. // timestamp can either be hi-res (relative to page load) or low-res
  9758. // (relative to UNIX epoch), so in order to compare time we have to use the
  9759. // same timestamp type when saving the flush timestamp.
  9760. // All IE versions use low-res event timestamps, and have problematic clock
  9761. // implementations (#9632)
  9762. if (inBrowser && !isIE) {
  9763. var performance_1 = window.performance;
  9764. if (performance_1 &&
  9765. typeof performance_1.now === 'function' &&
  9766. getNow() > document.createEvent('Event').timeStamp) {
  9767. // if the event timestamp, although evaluated AFTER the Date.now(), is
  9768. // smaller than it, it means the event is using a hi-res timestamp,
  9769. // and we need to use the hi-res version for event listener timestamps as
  9770. // well.
  9771. getNow = function () { return performance_1.now(); };
  9772. }
  9773. }
  9774. var sortCompareFn = function (a, b) {
  9775. if (a.post) {
  9776. if (!b.post)
  9777. return 1;
  9778. }
  9779. else if (b.post) {
  9780. return -1;
  9781. }
  9782. return a.id - b.id;
  9783. };
  9784. /**
  9785. * Flush both queues and run the watchers.
  9786. */
  9787. function flushSchedulerQueue() {
  9788. currentFlushTimestamp = getNow();
  9789. flushing = true;
  9790. var watcher, id;
  9791. // Sort queue before flush.
  9792. // This ensures that:
  9793. // 1. Components are updated from parent to child. (because parent is always
  9794. // created before the child)
  9795. // 2. A component's user watchers are run before its render watcher (because
  9796. // user watchers are created before the render watcher)
  9797. // 3. If a component is destroyed during a parent component's watcher run,
  9798. // its watchers can be skipped.
  9799. queue.sort(sortCompareFn);
  9800. // do not cache length because more watchers might be pushed
  9801. // as we run existing watchers
  9802. for (index = 0; index < queue.length; index++) {
  9803. watcher = queue[index];
  9804. if (watcher.before) {
  9805. watcher.before();
  9806. }
  9807. id = watcher.id;
  9808. has[id] = null;
  9809. watcher.run();
  9810. // in dev build, check and stop circular updates.
  9811. if (false) {}
  9812. }
  9813. // keep copies of post queues before resetting state
  9814. var activatedQueue = activatedChildren.slice();
  9815. var updatedQueue = queue.slice();
  9816. resetSchedulerState();
  9817. // call component updated and activated hooks
  9818. callActivatedHooks(activatedQueue);
  9819. callUpdatedHooks(updatedQueue);
  9820. cleanupDeps();
  9821. // devtool hook
  9822. /* istanbul ignore if */
  9823. if (devtools && config.devtools) {
  9824. devtools.emit('flush');
  9825. }
  9826. }
  9827. function callUpdatedHooks(queue) {
  9828. var i = queue.length;
  9829. while (i--) {
  9830. var watcher = queue[i];
  9831. var vm = watcher.vm;
  9832. if (vm && vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  9833. callHook$1(vm, 'updated');
  9834. }
  9835. }
  9836. }
  9837. /**
  9838. * Queue a kept-alive component that was activated during patch.
  9839. * The queue will be processed after the entire tree has been patched.
  9840. */
  9841. function queueActivatedComponent(vm) {
  9842. // setting _inactive to false here so that a render function can
  9843. // rely on checking whether it's in an inactive tree (e.g. router-view)
  9844. vm._inactive = false;
  9845. activatedChildren.push(vm);
  9846. }
  9847. function callActivatedHooks(queue) {
  9848. for (var i = 0; i < queue.length; i++) {
  9849. queue[i]._inactive = true;
  9850. activateChildComponent(queue[i], true /* true */);
  9851. }
  9852. }
  9853. /**
  9854. * Push a watcher into the watcher queue.
  9855. * Jobs with duplicate IDs will be skipped unless it's
  9856. * pushed when the queue is being flushed.
  9857. */
  9858. function queueWatcher(watcher) {
  9859. var id = watcher.id;
  9860. if (has[id] != null) {
  9861. return;
  9862. }
  9863. if (watcher === Dep.target && watcher.noRecurse) {
  9864. return;
  9865. }
  9866. has[id] = true;
  9867. if (!flushing) {
  9868. queue.push(watcher);
  9869. }
  9870. else {
  9871. // if already flushing, splice the watcher based on its id
  9872. // if already past its id, it will be run next immediately.
  9873. var i = queue.length - 1;
  9874. while (i > index && queue[i].id > watcher.id) {
  9875. i--;
  9876. }
  9877. queue.splice(i + 1, 0, watcher);
  9878. }
  9879. // queue the flush
  9880. if (!waiting) {
  9881. waiting = true;
  9882. if (false) {}
  9883. nextTick(flushSchedulerQueue);
  9884. }
  9885. }
  9886. function initProvide(vm) {
  9887. var provideOption = vm.$options.provide;
  9888. if (provideOption) {
  9889. var provided = isFunction(provideOption)
  9890. ? provideOption.call(vm)
  9891. : provideOption;
  9892. if (!isObject(provided)) {
  9893. return;
  9894. }
  9895. var source = resolveProvided(vm);
  9896. // IE9 doesn't support Object.getOwnPropertyDescriptors so we have to
  9897. // iterate the keys ourselves.
  9898. var keys = hasSymbol ? Reflect.ownKeys(provided) : Object.keys(provided);
  9899. for (var i = 0; i < keys.length; i++) {
  9900. var key = keys[i];
  9901. Object.defineProperty(source, key, Object.getOwnPropertyDescriptor(provided, key));
  9902. }
  9903. }
  9904. }
  9905. function initInjections(vm) {
  9906. var result = resolveInject(vm.$options.inject, vm);
  9907. if (result) {
  9908. toggleObserving(false);
  9909. Object.keys(result).forEach(function (key) {
  9910. /* istanbul ignore else */
  9911. if (false) {}
  9912. else {
  9913. defineReactive(vm, key, result[key]);
  9914. }
  9915. });
  9916. toggleObserving(true);
  9917. }
  9918. }
  9919. function resolveInject(inject, vm) {
  9920. if (inject) {
  9921. // inject is :any because flow is not smart enough to figure out cached
  9922. var result = Object.create(null);
  9923. var keys = hasSymbol ? Reflect.ownKeys(inject) : Object.keys(inject);
  9924. for (var i = 0; i < keys.length; i++) {
  9925. var key = keys[i];
  9926. // #6574 in case the inject object is observed...
  9927. if (key === '__ob__')
  9928. continue;
  9929. var provideKey = inject[key].from;
  9930. if (provideKey in vm._provided) {
  9931. result[key] = vm._provided[provideKey];
  9932. }
  9933. else if ('default' in inject[key]) {
  9934. var provideDefault = inject[key].default;
  9935. result[key] = isFunction(provideDefault)
  9936. ? provideDefault.call(vm)
  9937. : provideDefault;
  9938. }
  9939. else if (false) {}
  9940. }
  9941. return result;
  9942. }
  9943. }
  9944. function FunctionalRenderContext(data, props, children, parent, Ctor) {
  9945. var _this = this;
  9946. var options = Ctor.options;
  9947. // ensure the createElement function in functional components
  9948. // gets a unique context - this is necessary for correct named slot check
  9949. var contextVm;
  9950. if (hasOwn(parent, '_uid')) {
  9951. contextVm = Object.create(parent);
  9952. contextVm._original = parent;
  9953. }
  9954. else {
  9955. // the context vm passed in is a functional context as well.
  9956. // in this case we want to make sure we are able to get a hold to the
  9957. // real context instance.
  9958. contextVm = parent;
  9959. // @ts-ignore
  9960. parent = parent._original;
  9961. }
  9962. var isCompiled = isTrue(options._compiled);
  9963. var needNormalization = !isCompiled;
  9964. this.data = data;
  9965. this.props = props;
  9966. this.children = children;
  9967. this.parent = parent;
  9968. this.listeners = data.on || emptyObject;
  9969. this.injections = resolveInject(options.inject, parent);
  9970. this.slots = function () {
  9971. if (!_this.$slots) {
  9972. normalizeScopedSlots(parent, data.scopedSlots, (_this.$slots = resolveSlots(children, parent)));
  9973. }
  9974. return _this.$slots;
  9975. };
  9976. Object.defineProperty(this, 'scopedSlots', {
  9977. enumerable: true,
  9978. get: function () {
  9979. return normalizeScopedSlots(parent, data.scopedSlots, this.slots());
  9980. }
  9981. });
  9982. // support for compiled functional template
  9983. if (isCompiled) {
  9984. // exposing $options for renderStatic()
  9985. this.$options = options;
  9986. // pre-resolve slots for renderSlot()
  9987. this.$slots = this.slots();
  9988. this.$scopedSlots = normalizeScopedSlots(parent, data.scopedSlots, this.$slots);
  9989. }
  9990. if (options._scopeId) {
  9991. this._c = function (a, b, c, d) {
  9992. var vnode = createElement$1(contextVm, a, b, c, d, needNormalization);
  9993. if (vnode && !isArray(vnode)) {
  9994. vnode.fnScopeId = options._scopeId;
  9995. vnode.fnContext = parent;
  9996. }
  9997. return vnode;
  9998. };
  9999. }
  10000. else {
  10001. this._c = function (a, b, c, d) {
  10002. return createElement$1(contextVm, a, b, c, d, needNormalization);
  10003. };
  10004. }
  10005. }
  10006. installRenderHelpers(FunctionalRenderContext.prototype);
  10007. function createFunctionalComponent(Ctor, propsData, data, contextVm, children) {
  10008. var options = Ctor.options;
  10009. var props = {};
  10010. var propOptions = options.props;
  10011. if (isDef(propOptions)) {
  10012. for (var key in propOptions) {
  10013. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  10014. }
  10015. }
  10016. else {
  10017. if (isDef(data.attrs))
  10018. mergeProps(props, data.attrs);
  10019. if (isDef(data.props))
  10020. mergeProps(props, data.props);
  10021. }
  10022. var renderContext = new FunctionalRenderContext(data, props, children, contextVm, Ctor);
  10023. var vnode = options.render.call(null, renderContext._c, renderContext);
  10024. if (vnode instanceof VNode) {
  10025. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext);
  10026. }
  10027. else if (isArray(vnode)) {
  10028. var vnodes = normalizeChildren(vnode) || [];
  10029. var res = new Array(vnodes.length);
  10030. for (var i = 0; i < vnodes.length; i++) {
  10031. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  10032. }
  10033. return res;
  10034. }
  10035. }
  10036. function cloneAndMarkFunctionalResult(vnode, data, contextVm, options, renderContext) {
  10037. // #7817 clone node before setting fnContext, otherwise if the node is reused
  10038. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  10039. // that should not be matched to match.
  10040. var clone = cloneVNode(vnode);
  10041. clone.fnContext = contextVm;
  10042. clone.fnOptions = options;
  10043. if (false) {}
  10044. if (data.slot) {
  10045. (clone.data || (clone.data = {})).slot = data.slot;
  10046. }
  10047. return clone;
  10048. }
  10049. function mergeProps(to, from) {
  10050. for (var key in from) {
  10051. to[camelize(key)] = from[key];
  10052. }
  10053. }
  10054. function getComponentName(options) {
  10055. return options.name || options.__name || options._componentTag;
  10056. }
  10057. // inline hooks to be invoked on component VNodes during patch
  10058. var componentVNodeHooks = {
  10059. init: function (vnode, hydrating) {
  10060. if (vnode.componentInstance &&
  10061. !vnode.componentInstance._isDestroyed &&
  10062. vnode.data.keepAlive) {
  10063. // kept-alive components, treat as a patch
  10064. var mountedNode = vnode; // work around flow
  10065. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  10066. }
  10067. else {
  10068. var child = (vnode.componentInstance = createComponentInstanceForVnode(vnode, activeInstance));
  10069. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  10070. }
  10071. },
  10072. prepatch: function (oldVnode, vnode) {
  10073. var options = vnode.componentOptions;
  10074. var child = (vnode.componentInstance = oldVnode.componentInstance);
  10075. updateChildComponent(child, options.propsData, // updated props
  10076. options.listeners, // updated listeners
  10077. vnode, // new parent vnode
  10078. options.children // new children
  10079. );
  10080. },
  10081. insert: function (vnode) {
  10082. var context = vnode.context, componentInstance = vnode.componentInstance;
  10083. if (!componentInstance._isMounted) {
  10084. componentInstance._isMounted = true;
  10085. callHook$1(componentInstance, 'mounted');
  10086. }
  10087. if (vnode.data.keepAlive) {
  10088. if (context._isMounted) {
  10089. // vue-router#1212
  10090. // During updates, a kept-alive component's child components may
  10091. // change, so directly walking the tree here may call activated hooks
  10092. // on incorrect children. Instead we push them into a queue which will
  10093. // be processed after the whole patch process ended.
  10094. queueActivatedComponent(componentInstance);
  10095. }
  10096. else {
  10097. activateChildComponent(componentInstance, true /* direct */);
  10098. }
  10099. }
  10100. },
  10101. destroy: function (vnode) {
  10102. var componentInstance = vnode.componentInstance;
  10103. if (!componentInstance._isDestroyed) {
  10104. if (!vnode.data.keepAlive) {
  10105. componentInstance.$destroy();
  10106. }
  10107. else {
  10108. deactivateChildComponent(componentInstance, true /* direct */);
  10109. }
  10110. }
  10111. }
  10112. };
  10113. var hooksToMerge = Object.keys(componentVNodeHooks);
  10114. function createComponent(Ctor, data, context, children, tag) {
  10115. if (isUndef(Ctor)) {
  10116. return;
  10117. }
  10118. var baseCtor = context.$options._base;
  10119. // plain options object: turn it into a constructor
  10120. if (isObject(Ctor)) {
  10121. Ctor = baseCtor.extend(Ctor);
  10122. }
  10123. // if at this stage it's not a constructor or an async component factory,
  10124. // reject.
  10125. if (typeof Ctor !== 'function') {
  10126. if (false) {}
  10127. return;
  10128. }
  10129. // async component
  10130. var asyncFactory;
  10131. // @ts-expect-error
  10132. if (isUndef(Ctor.cid)) {
  10133. asyncFactory = Ctor;
  10134. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  10135. if (Ctor === undefined) {
  10136. // return a placeholder node for async component, which is rendered
  10137. // as a comment node but preserves all the raw information for the node.
  10138. // the information will be used for async server-rendering and hydration.
  10139. return createAsyncPlaceholder(asyncFactory, data, context, children, tag);
  10140. }
  10141. }
  10142. data = data || {};
  10143. // resolve constructor options in case global mixins are applied after
  10144. // component constructor creation
  10145. resolveConstructorOptions(Ctor);
  10146. // transform component v-model data into props & events
  10147. if (isDef(data.model)) {
  10148. // @ts-expect-error
  10149. transformModel(Ctor.options, data);
  10150. }
  10151. // extract props
  10152. // @ts-expect-error
  10153. var propsData = extractPropsFromVNodeData(data, Ctor, tag);
  10154. // functional component
  10155. // @ts-expect-error
  10156. if (isTrue(Ctor.options.functional)) {
  10157. return createFunctionalComponent(Ctor, propsData, data, context, children);
  10158. }
  10159. // extract listeners, since these needs to be treated as
  10160. // child component listeners instead of DOM listeners
  10161. var listeners = data.on;
  10162. // replace with listeners with .native modifier
  10163. // so it gets processed during parent component patch.
  10164. data.on = data.nativeOn;
  10165. // @ts-expect-error
  10166. if (isTrue(Ctor.options.abstract)) {
  10167. // abstract components do not keep anything
  10168. // other than props & listeners & slot
  10169. // work around flow
  10170. var slot = data.slot;
  10171. data = {};
  10172. if (slot) {
  10173. data.slot = slot;
  10174. }
  10175. }
  10176. // install component management hooks onto the placeholder node
  10177. installComponentHooks(data);
  10178. // return a placeholder vnode
  10179. // @ts-expect-error
  10180. var name = getComponentName(Ctor.options) || tag;
  10181. var vnode = new VNode(
  10182. // @ts-expect-error
  10183. "vue-component-".concat(Ctor.cid).concat(name ? "-".concat(name) : ''), data, undefined, undefined, undefined, context,
  10184. // @ts-expect-error
  10185. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }, asyncFactory);
  10186. return vnode;
  10187. }
  10188. function createComponentInstanceForVnode(
  10189. // we know it's MountedComponentVNode but flow doesn't
  10190. vnode,
  10191. // activeInstance in lifecycle state
  10192. parent) {
  10193. var options = {
  10194. _isComponent: true,
  10195. _parentVnode: vnode,
  10196. parent: parent
  10197. };
  10198. // check inline-template render functions
  10199. var inlineTemplate = vnode.data.inlineTemplate;
  10200. if (isDef(inlineTemplate)) {
  10201. options.render = inlineTemplate.render;
  10202. options.staticRenderFns = inlineTemplate.staticRenderFns;
  10203. }
  10204. return new vnode.componentOptions.Ctor(options);
  10205. }
  10206. function installComponentHooks(data) {
  10207. var hooks = data.hook || (data.hook = {});
  10208. for (var i = 0; i < hooksToMerge.length; i++) {
  10209. var key = hooksToMerge[i];
  10210. var existing = hooks[key];
  10211. var toMerge = componentVNodeHooks[key];
  10212. // @ts-expect-error
  10213. if (existing !== toMerge && !(existing && existing._merged)) {
  10214. hooks[key] = existing ? mergeHook(toMerge, existing) : toMerge;
  10215. }
  10216. }
  10217. }
  10218. function mergeHook(f1, f2) {
  10219. var merged = function (a, b) {
  10220. // flow complains about extra args which is why we use any
  10221. f1(a, b);
  10222. f2(a, b);
  10223. };
  10224. merged._merged = true;
  10225. return merged;
  10226. }
  10227. // transform component v-model info (value and callback) into
  10228. // prop and event handler respectively.
  10229. function transformModel(options, data) {
  10230. var prop = (options.model && options.model.prop) || 'value';
  10231. var event = (options.model && options.model.event) || 'input';
  10232. (data.attrs || (data.attrs = {}))[prop] = data.model.value;
  10233. var on = data.on || (data.on = {});
  10234. var existing = on[event];
  10235. var callback = data.model.callback;
  10236. if (isDef(existing)) {
  10237. if (isArray(existing)
  10238. ? existing.indexOf(callback) === -1
  10239. : existing !== callback) {
  10240. on[event] = [callback].concat(existing);
  10241. }
  10242. }
  10243. else {
  10244. on[event] = callback;
  10245. }
  10246. }
  10247. var warn = noop;
  10248. var tip = noop;
  10249. var generateComponentTrace; // work around flow check
  10250. var formatComponentName;
  10251. if (false) { var repeat_1, classify_1, classifyRE_1, hasConsole_1; }
  10252. /**
  10253. * Option overwriting strategies are functions that handle
  10254. * how to merge a parent option value and a child option
  10255. * value into the final value.
  10256. */
  10257. var strats = config.optionMergeStrategies;
  10258. /**
  10259. * Options with restrictions
  10260. */
  10261. if (false) {}
  10262. /**
  10263. * Helper that recursively merges two data objects together.
  10264. */
  10265. function mergeData(to, from, recursive) {
  10266. if (recursive === void 0) { recursive = true; }
  10267. if (!from)
  10268. return to;
  10269. var key, toVal, fromVal;
  10270. var keys = hasSymbol
  10271. ? Reflect.ownKeys(from)
  10272. : Object.keys(from);
  10273. for (var i = 0; i < keys.length; i++) {
  10274. key = keys[i];
  10275. // in case the object is already observed...
  10276. if (key === '__ob__')
  10277. continue;
  10278. toVal = to[key];
  10279. fromVal = from[key];
  10280. if (!recursive || !hasOwn(to, key)) {
  10281. set(to, key, fromVal);
  10282. }
  10283. else if (toVal !== fromVal &&
  10284. isPlainObject(toVal) &&
  10285. isPlainObject(fromVal)) {
  10286. mergeData(toVal, fromVal);
  10287. }
  10288. }
  10289. return to;
  10290. }
  10291. /**
  10292. * Data
  10293. */
  10294. function mergeDataOrFn(parentVal, childVal, vm) {
  10295. if (!vm) {
  10296. // in a Vue.extend merge, both should be functions
  10297. if (!childVal) {
  10298. return parentVal;
  10299. }
  10300. if (!parentVal) {
  10301. return childVal;
  10302. }
  10303. // when parentVal & childVal are both present,
  10304. // we need to return a function that returns the
  10305. // merged result of both functions... no need to
  10306. // check if parentVal is a function here because
  10307. // it has to be a function to pass previous merges.
  10308. return function mergedDataFn() {
  10309. return mergeData(isFunction(childVal) ? childVal.call(this, this) : childVal, isFunction(parentVal) ? parentVal.call(this, this) : parentVal);
  10310. };
  10311. }
  10312. else {
  10313. return function mergedInstanceDataFn() {
  10314. // instance merge
  10315. var instanceData = isFunction(childVal)
  10316. ? childVal.call(vm, vm)
  10317. : childVal;
  10318. var defaultData = isFunction(parentVal)
  10319. ? parentVal.call(vm, vm)
  10320. : parentVal;
  10321. if (instanceData) {
  10322. return mergeData(instanceData, defaultData);
  10323. }
  10324. else {
  10325. return defaultData;
  10326. }
  10327. };
  10328. }
  10329. }
  10330. strats.data = function (parentVal, childVal, vm) {
  10331. if (!vm) {
  10332. if (childVal && typeof childVal !== 'function') {
  10333. false &&
  10334. false;
  10335. return parentVal;
  10336. }
  10337. return mergeDataOrFn(parentVal, childVal);
  10338. }
  10339. return mergeDataOrFn(parentVal, childVal, vm);
  10340. };
  10341. /**
  10342. * Hooks and props are merged as arrays.
  10343. */
  10344. function mergeLifecycleHook(parentVal, childVal) {
  10345. var res = childVal
  10346. ? parentVal
  10347. ? parentVal.concat(childVal)
  10348. : isArray(childVal)
  10349. ? childVal
  10350. : [childVal]
  10351. : parentVal;
  10352. return res ? dedupeHooks(res) : res;
  10353. }
  10354. function dedupeHooks(hooks) {
  10355. var res = [];
  10356. for (var i = 0; i < hooks.length; i++) {
  10357. if (res.indexOf(hooks[i]) === -1) {
  10358. res.push(hooks[i]);
  10359. }
  10360. }
  10361. return res;
  10362. }
  10363. LIFECYCLE_HOOKS.forEach(function (hook) {
  10364. strats[hook] = mergeLifecycleHook;
  10365. });
  10366. /**
  10367. * Assets
  10368. *
  10369. * When a vm is present (instance creation), we need to do
  10370. * a three-way merge between constructor options, instance
  10371. * options and parent options.
  10372. */
  10373. function mergeAssets(parentVal, childVal, vm, key) {
  10374. var res = Object.create(parentVal || null);
  10375. if (childVal) {
  10376. false && false;
  10377. return extend(res, childVal);
  10378. }
  10379. else {
  10380. return res;
  10381. }
  10382. }
  10383. ASSET_TYPES.forEach(function (type) {
  10384. strats[type + 's'] = mergeAssets;
  10385. });
  10386. /**
  10387. * Watchers.
  10388. *
  10389. * Watchers hashes should not overwrite one
  10390. * another, so we merge them as arrays.
  10391. */
  10392. strats.watch = function (parentVal, childVal, vm, key) {
  10393. // work around Firefox's Object.prototype.watch...
  10394. //@ts-expect-error work around
  10395. if (parentVal === nativeWatch)
  10396. parentVal = undefined;
  10397. //@ts-expect-error work around
  10398. if (childVal === nativeWatch)
  10399. childVal = undefined;
  10400. /* istanbul ignore if */
  10401. if (!childVal)
  10402. return Object.create(parentVal || null);
  10403. if (false) {}
  10404. if (!parentVal)
  10405. return childVal;
  10406. var ret = {};
  10407. extend(ret, parentVal);
  10408. for (var key_1 in childVal) {
  10409. var parent_1 = ret[key_1];
  10410. var child = childVal[key_1];
  10411. if (parent_1 && !isArray(parent_1)) {
  10412. parent_1 = [parent_1];
  10413. }
  10414. ret[key_1] = parent_1 ? parent_1.concat(child) : isArray(child) ? child : [child];
  10415. }
  10416. return ret;
  10417. };
  10418. /**
  10419. * Other object hashes.
  10420. */
  10421. strats.props =
  10422. strats.methods =
  10423. strats.inject =
  10424. strats.computed =
  10425. function (parentVal, childVal, vm, key) {
  10426. if (childVal && "production" !== 'production') {
  10427. assertObjectType(key, childVal, vm);
  10428. }
  10429. if (!parentVal)
  10430. return childVal;
  10431. var ret = Object.create(null);
  10432. extend(ret, parentVal);
  10433. if (childVal)
  10434. extend(ret, childVal);
  10435. return ret;
  10436. };
  10437. strats.provide = function (parentVal, childVal) {
  10438. if (!parentVal)
  10439. return childVal;
  10440. return function () {
  10441. var ret = Object.create(null);
  10442. mergeData(ret, isFunction(parentVal) ? parentVal.call(this) : parentVal);
  10443. if (childVal) {
  10444. mergeData(ret, isFunction(childVal) ? childVal.call(this) : childVal, false // non-recursive
  10445. );
  10446. }
  10447. return ret;
  10448. };
  10449. };
  10450. /**
  10451. * Default strategy.
  10452. */
  10453. var defaultStrat = function (parentVal, childVal) {
  10454. return childVal === undefined ? parentVal : childVal;
  10455. };
  10456. /**
  10457. * Validate component names
  10458. */
  10459. function checkComponents(options) {
  10460. for (var key in options.components) {
  10461. validateComponentName(key);
  10462. }
  10463. }
  10464. function validateComponentName(name) {
  10465. if (!new RegExp("^[a-zA-Z][\\-\\.0-9_".concat(unicodeRegExp.source, "]*$")).test(name)) {
  10466. warn('Invalid component name: "' +
  10467. name +
  10468. '". Component names ' +
  10469. 'should conform to valid custom element name in html5 specification.');
  10470. }
  10471. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  10472. warn('Do not use built-in or reserved HTML elements as component ' +
  10473. 'id: ' +
  10474. name);
  10475. }
  10476. }
  10477. /**
  10478. * Ensure all props option syntax are normalized into the
  10479. * Object-based format.
  10480. */
  10481. function normalizeProps(options, vm) {
  10482. var props = options.props;
  10483. if (!props)
  10484. return;
  10485. var res = {};
  10486. var i, val, name;
  10487. if (isArray(props)) {
  10488. i = props.length;
  10489. while (i--) {
  10490. val = props[i];
  10491. if (typeof val === 'string') {
  10492. name = camelize(val);
  10493. res[name] = { type: null };
  10494. }
  10495. else if (false) {}
  10496. }
  10497. }
  10498. else if (isPlainObject(props)) {
  10499. for (var key in props) {
  10500. val = props[key];
  10501. name = camelize(key);
  10502. res[name] = isPlainObject(val) ? val : { type: val };
  10503. }
  10504. }
  10505. else if (false) {}
  10506. options.props = res;
  10507. }
  10508. /**
  10509. * Normalize all injections into Object-based format
  10510. */
  10511. function normalizeInject(options, vm) {
  10512. var inject = options.inject;
  10513. if (!inject)
  10514. return;
  10515. var normalized = (options.inject = {});
  10516. if (isArray(inject)) {
  10517. for (var i = 0; i < inject.length; i++) {
  10518. normalized[inject[i]] = { from: inject[i] };
  10519. }
  10520. }
  10521. else if (isPlainObject(inject)) {
  10522. for (var key in inject) {
  10523. var val = inject[key];
  10524. normalized[key] = isPlainObject(val)
  10525. ? extend({ from: key }, val)
  10526. : { from: val };
  10527. }
  10528. }
  10529. else if (false) {}
  10530. }
  10531. /**
  10532. * Normalize raw function directives into object format.
  10533. */
  10534. function normalizeDirectives$1(options) {
  10535. var dirs = options.directives;
  10536. if (dirs) {
  10537. for (var key in dirs) {
  10538. var def = dirs[key];
  10539. if (isFunction(def)) {
  10540. dirs[key] = { bind: def, update: def };
  10541. }
  10542. }
  10543. }
  10544. }
  10545. function assertObjectType(name, value, vm) {
  10546. if (!isPlainObject(value)) {
  10547. warn("Invalid value for option \"".concat(name, "\": expected an Object, ") +
  10548. "but got ".concat(toRawType(value), "."), vm);
  10549. }
  10550. }
  10551. /**
  10552. * Merge two option objects into a new one.
  10553. * Core utility used in both instantiation and inheritance.
  10554. */
  10555. function mergeOptions(parent, child, vm) {
  10556. if (false) {}
  10557. if (isFunction(child)) {
  10558. // @ts-expect-error
  10559. child = child.options;
  10560. }
  10561. normalizeProps(child, vm);
  10562. normalizeInject(child, vm);
  10563. normalizeDirectives$1(child);
  10564. // Apply extends and mixins on the child options,
  10565. // but only if it is a raw options object that isn't
  10566. // the result of another mergeOptions call.
  10567. // Only merged options has the _base property.
  10568. if (!child._base) {
  10569. if (child.extends) {
  10570. parent = mergeOptions(parent, child.extends, vm);
  10571. }
  10572. if (child.mixins) {
  10573. for (var i = 0, l = child.mixins.length; i < l; i++) {
  10574. parent = mergeOptions(parent, child.mixins[i], vm);
  10575. }
  10576. }
  10577. }
  10578. var options = {};
  10579. var key;
  10580. for (key in parent) {
  10581. mergeField(key);
  10582. }
  10583. for (key in child) {
  10584. if (!hasOwn(parent, key)) {
  10585. mergeField(key);
  10586. }
  10587. }
  10588. function mergeField(key) {
  10589. var strat = strats[key] || defaultStrat;
  10590. options[key] = strat(parent[key], child[key], vm, key);
  10591. }
  10592. return options;
  10593. }
  10594. /**
  10595. * Resolve an asset.
  10596. * This function is used because child instances need access
  10597. * to assets defined in its ancestor chain.
  10598. */
  10599. function resolveAsset(options, type, id, warnMissing) {
  10600. /* istanbul ignore if */
  10601. if (typeof id !== 'string') {
  10602. return;
  10603. }
  10604. var assets = options[type];
  10605. // check local registration variations first
  10606. if (hasOwn(assets, id))
  10607. return assets[id];
  10608. var camelizedId = camelize(id);
  10609. if (hasOwn(assets, camelizedId))
  10610. return assets[camelizedId];
  10611. var PascalCaseId = capitalize(camelizedId);
  10612. if (hasOwn(assets, PascalCaseId))
  10613. return assets[PascalCaseId];
  10614. // fallback to prototype chain
  10615. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  10616. if (false) {}
  10617. return res;
  10618. }
  10619. function validateProp(key, propOptions, propsData, vm) {
  10620. var prop = propOptions[key];
  10621. var absent = !hasOwn(propsData, key);
  10622. var value = propsData[key];
  10623. // boolean casting
  10624. var booleanIndex = getTypeIndex(Boolean, prop.type);
  10625. if (booleanIndex > -1) {
  10626. if (absent && !hasOwn(prop, 'default')) {
  10627. value = false;
  10628. }
  10629. else if (value === '' || value === hyphenate(key)) {
  10630. // only cast empty string / same name to boolean if
  10631. // boolean has higher priority
  10632. var stringIndex = getTypeIndex(String, prop.type);
  10633. if (stringIndex < 0 || booleanIndex < stringIndex) {
  10634. value = true;
  10635. }
  10636. }
  10637. }
  10638. // check default value
  10639. if (value === undefined) {
  10640. value = getPropDefaultValue(vm, prop, key);
  10641. // since the default value is a fresh copy,
  10642. // make sure to observe it.
  10643. var prevShouldObserve = shouldObserve;
  10644. toggleObserving(true);
  10645. observe(value);
  10646. toggleObserving(prevShouldObserve);
  10647. }
  10648. if (false) {}
  10649. return value;
  10650. }
  10651. /**
  10652. * Get the default value of a prop.
  10653. */
  10654. function getPropDefaultValue(vm, prop, key) {
  10655. // no default, return undefined
  10656. if (!hasOwn(prop, 'default')) {
  10657. return undefined;
  10658. }
  10659. var def = prop.default;
  10660. // warn against non-factory defaults for Object & Array
  10661. if (false) {}
  10662. // the raw prop value was also undefined from previous render,
  10663. // return previous default value to avoid unnecessary watcher trigger
  10664. if (vm &&
  10665. vm.$options.propsData &&
  10666. vm.$options.propsData[key] === undefined &&
  10667. vm._props[key] !== undefined) {
  10668. return vm._props[key];
  10669. }
  10670. // call factory function for non-Function types
  10671. // a value is Function if its prototype is function even across different execution context
  10672. return isFunction(def) && getType(prop.type) !== 'Function'
  10673. ? def.call(vm)
  10674. : def;
  10675. }
  10676. /**
  10677. * Assert whether a prop is valid.
  10678. */
  10679. function assertProp(prop, name, value, vm, absent) {
  10680. if (prop.required && absent) {
  10681. warn('Missing required prop: "' + name + '"', vm);
  10682. return;
  10683. }
  10684. if (value == null && !prop.required) {
  10685. return;
  10686. }
  10687. var type = prop.type;
  10688. var valid = !type || type === true;
  10689. var expectedTypes = [];
  10690. if (type) {
  10691. if (!isArray(type)) {
  10692. type = [type];
  10693. }
  10694. for (var i = 0; i < type.length && !valid; i++) {
  10695. var assertedType = assertType(value, type[i], vm);
  10696. expectedTypes.push(assertedType.expectedType || '');
  10697. valid = assertedType.valid;
  10698. }
  10699. }
  10700. var haveExpectedTypes = expectedTypes.some(function (t) { return t; });
  10701. if (!valid && haveExpectedTypes) {
  10702. warn(getInvalidTypeMessage(name, value, expectedTypes), vm);
  10703. return;
  10704. }
  10705. var validator = prop.validator;
  10706. if (validator) {
  10707. if (!validator(value)) {
  10708. warn('Invalid prop: custom validator check failed for prop "' + name + '".', vm);
  10709. }
  10710. }
  10711. }
  10712. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol|BigInt)$/;
  10713. function assertType(value, type, vm) {
  10714. var valid;
  10715. var expectedType = getType(type);
  10716. if (simpleCheckRE.test(expectedType)) {
  10717. var t = typeof value;
  10718. valid = t === expectedType.toLowerCase();
  10719. // for primitive wrapper objects
  10720. if (!valid && t === 'object') {
  10721. valid = value instanceof type;
  10722. }
  10723. }
  10724. else if (expectedType === 'Object') {
  10725. valid = isPlainObject(value);
  10726. }
  10727. else if (expectedType === 'Array') {
  10728. valid = isArray(value);
  10729. }
  10730. else {
  10731. try {
  10732. valid = value instanceof type;
  10733. }
  10734. catch (e) {
  10735. warn('Invalid prop type: "' + String(type) + '" is not a constructor', vm);
  10736. valid = false;
  10737. }
  10738. }
  10739. return {
  10740. valid: valid,
  10741. expectedType: expectedType
  10742. };
  10743. }
  10744. var functionTypeCheckRE = /^\s*function (\w+)/;
  10745. /**
  10746. * Use function string name to check built-in types,
  10747. * because a simple equality check will fail when running
  10748. * across different vms / iframes.
  10749. */
  10750. function getType(fn) {
  10751. var match = fn && fn.toString().match(functionTypeCheckRE);
  10752. return match ? match[1] : '';
  10753. }
  10754. function isSameType(a, b) {
  10755. return getType(a) === getType(b);
  10756. }
  10757. function getTypeIndex(type, expectedTypes) {
  10758. if (!isArray(expectedTypes)) {
  10759. return isSameType(expectedTypes, type) ? 0 : -1;
  10760. }
  10761. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  10762. if (isSameType(expectedTypes[i], type)) {
  10763. return i;
  10764. }
  10765. }
  10766. return -1;
  10767. }
  10768. function getInvalidTypeMessage(name, value, expectedTypes) {
  10769. var message = "Invalid prop: type check failed for prop \"".concat(name, "\".") +
  10770. " Expected ".concat(expectedTypes.map(capitalize).join(', '));
  10771. var expectedType = expectedTypes[0];
  10772. var receivedType = toRawType(value);
  10773. // check if we need to specify expected value
  10774. if (expectedTypes.length === 1 &&
  10775. isExplicable(expectedType) &&
  10776. isExplicable(typeof value) &&
  10777. !isBoolean(expectedType, receivedType)) {
  10778. message += " with value ".concat(styleValue(value, expectedType));
  10779. }
  10780. message += ", got ".concat(receivedType, " ");
  10781. // check if we need to specify received value
  10782. if (isExplicable(receivedType)) {
  10783. message += "with value ".concat(styleValue(value, receivedType), ".");
  10784. }
  10785. return message;
  10786. }
  10787. function styleValue(value, type) {
  10788. if (type === 'String') {
  10789. return "\"".concat(value, "\"");
  10790. }
  10791. else if (type === 'Number') {
  10792. return "".concat(Number(value));
  10793. }
  10794. else {
  10795. return "".concat(value);
  10796. }
  10797. }
  10798. var EXPLICABLE_TYPES = ['string', 'number', 'boolean'];
  10799. function isExplicable(value) {
  10800. return EXPLICABLE_TYPES.some(function (elem) { return value.toLowerCase() === elem; });
  10801. }
  10802. function isBoolean() {
  10803. var args = [];
  10804. for (var _i = 0; _i < arguments.length; _i++) {
  10805. args[_i] = arguments[_i];
  10806. }
  10807. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; });
  10808. }
  10809. /* not type checking this file because flow doesn't play well with Proxy */
  10810. var initProxy;
  10811. if (false) { var getHandler_1, hasHandler_1, isBuiltInModifier_1, hasProxy_1, warnReservedPrefix_1, warnNonPresent_1, allowedGlobals_1; }
  10812. var sharedPropertyDefinition = {
  10813. enumerable: true,
  10814. configurable: true,
  10815. get: noop,
  10816. set: noop
  10817. };
  10818. function proxy(target, sourceKey, key) {
  10819. sharedPropertyDefinition.get = function proxyGetter() {
  10820. return this[sourceKey][key];
  10821. };
  10822. sharedPropertyDefinition.set = function proxySetter(val) {
  10823. this[sourceKey][key] = val;
  10824. };
  10825. Object.defineProperty(target, key, sharedPropertyDefinition);
  10826. }
  10827. function initState(vm) {
  10828. var opts = vm.$options;
  10829. if (opts.props)
  10830. initProps$1(vm, opts.props);
  10831. // Composition API
  10832. initSetup(vm);
  10833. if (opts.methods)
  10834. initMethods(vm, opts.methods);
  10835. if (opts.data) {
  10836. initData(vm);
  10837. }
  10838. else {
  10839. var ob = observe((vm._data = {}));
  10840. ob && ob.vmCount++;
  10841. }
  10842. if (opts.computed)
  10843. initComputed$1(vm, opts.computed);
  10844. if (opts.watch && opts.watch !== nativeWatch) {
  10845. initWatch(vm, opts.watch);
  10846. }
  10847. }
  10848. function initProps$1(vm, propsOptions) {
  10849. var propsData = vm.$options.propsData || {};
  10850. var props = (vm._props = shallowReactive({}));
  10851. // cache prop keys so that future props updates can iterate using Array
  10852. // instead of dynamic object key enumeration.
  10853. var keys = (vm.$options._propKeys = []);
  10854. var isRoot = !vm.$parent;
  10855. // root instance props should be converted
  10856. if (!isRoot) {
  10857. toggleObserving(false);
  10858. }
  10859. var _loop_1 = function (key) {
  10860. keys.push(key);
  10861. var value = validateProp(key, propsOptions, propsData, vm);
  10862. /* istanbul ignore else */
  10863. if (false) { var hyphenatedKey; }
  10864. else {
  10865. defineReactive(props, key, value, undefined, true /* shallow */);
  10866. }
  10867. // static props are already proxied on the component's prototype
  10868. // during Vue.extend(). We only need to proxy props defined at
  10869. // instantiation here.
  10870. if (!(key in vm)) {
  10871. proxy(vm, "_props", key);
  10872. }
  10873. };
  10874. for (var key in propsOptions) {
  10875. _loop_1(key);
  10876. }
  10877. toggleObserving(true);
  10878. }
  10879. function initData(vm) {
  10880. var data = vm.$options.data;
  10881. data = vm._data = isFunction(data) ? getData(data, vm) : data || {};
  10882. if (!isPlainObject(data)) {
  10883. data = {};
  10884. false &&
  10885. false;
  10886. }
  10887. // proxy data on instance
  10888. var keys = Object.keys(data);
  10889. var props = vm.$options.props;
  10890. var methods = vm.$options.methods;
  10891. var i = keys.length;
  10892. while (i--) {
  10893. var key = keys[i];
  10894. if (false) {}
  10895. if (props && hasOwn(props, key)) {
  10896. false &&
  10897. false;
  10898. }
  10899. else if (!isReserved(key)) {
  10900. proxy(vm, "_data", key);
  10901. }
  10902. }
  10903. // observe data
  10904. var ob = observe(data);
  10905. ob && ob.vmCount++;
  10906. }
  10907. function getData(data, vm) {
  10908. // #7573 disable dep collection when invoking data getters
  10909. pushTarget();
  10910. try {
  10911. return data.call(vm, vm);
  10912. }
  10913. catch (e) {
  10914. handleError(e, vm, "data()");
  10915. return {};
  10916. }
  10917. finally {
  10918. popTarget();
  10919. }
  10920. }
  10921. var computedWatcherOptions = { lazy: true };
  10922. function initComputed$1(vm, computed) {
  10923. // $flow-disable-line
  10924. var watchers = (vm._computedWatchers = Object.create(null));
  10925. // computed properties are just getters during SSR
  10926. var isSSR = isServerRendering();
  10927. for (var key in computed) {
  10928. var userDef = computed[key];
  10929. var getter = isFunction(userDef) ? userDef : userDef.get;
  10930. if (false) {}
  10931. if (!isSSR) {
  10932. // create internal watcher for the computed property.
  10933. watchers[key] = new Watcher(vm, getter || noop, noop, computedWatcherOptions);
  10934. }
  10935. // component-defined computed properties are already defined on the
  10936. // component prototype. We only need to define computed properties defined
  10937. // at instantiation here.
  10938. if (!(key in vm)) {
  10939. defineComputed(vm, key, userDef);
  10940. }
  10941. else if (false) {}
  10942. }
  10943. }
  10944. function defineComputed(target, key, userDef) {
  10945. var shouldCache = !isServerRendering();
  10946. if (isFunction(userDef)) {
  10947. sharedPropertyDefinition.get = shouldCache
  10948. ? createComputedGetter(key)
  10949. : createGetterInvoker(userDef);
  10950. sharedPropertyDefinition.set = noop;
  10951. }
  10952. else {
  10953. sharedPropertyDefinition.get = userDef.get
  10954. ? shouldCache && userDef.cache !== false
  10955. ? createComputedGetter(key)
  10956. : createGetterInvoker(userDef.get)
  10957. : noop;
  10958. sharedPropertyDefinition.set = userDef.set || noop;
  10959. }
  10960. if (false) {}
  10961. Object.defineProperty(target, key, sharedPropertyDefinition);
  10962. }
  10963. function createComputedGetter(key) {
  10964. return function computedGetter() {
  10965. var watcher = this._computedWatchers && this._computedWatchers[key];
  10966. if (watcher) {
  10967. if (watcher.dirty) {
  10968. watcher.evaluate();
  10969. }
  10970. if (Dep.target) {
  10971. if (false) {}
  10972. watcher.depend();
  10973. }
  10974. return watcher.value;
  10975. }
  10976. };
  10977. }
  10978. function createGetterInvoker(fn) {
  10979. return function computedGetter() {
  10980. return fn.call(this, this);
  10981. };
  10982. }
  10983. function initMethods(vm, methods) {
  10984. var props = vm.$options.props;
  10985. for (var key in methods) {
  10986. if (false) {}
  10987. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  10988. }
  10989. }
  10990. function initWatch(vm, watch) {
  10991. for (var key in watch) {
  10992. var handler = watch[key];
  10993. if (isArray(handler)) {
  10994. for (var i = 0; i < handler.length; i++) {
  10995. createWatcher(vm, key, handler[i]);
  10996. }
  10997. }
  10998. else {
  10999. createWatcher(vm, key, handler);
  11000. }
  11001. }
  11002. }
  11003. function createWatcher(vm, expOrFn, handler, options) {
  11004. if (isPlainObject(handler)) {
  11005. options = handler;
  11006. handler = handler.handler;
  11007. }
  11008. if (typeof handler === 'string') {
  11009. handler = vm[handler];
  11010. }
  11011. return vm.$watch(expOrFn, handler, options);
  11012. }
  11013. function stateMixin(Vue) {
  11014. // flow somehow has problems with directly declared definition object
  11015. // when using Object.defineProperty, so we have to procedurally build up
  11016. // the object here.
  11017. var dataDef = {};
  11018. dataDef.get = function () {
  11019. return this._data;
  11020. };
  11021. var propsDef = {};
  11022. propsDef.get = function () {
  11023. return this._props;
  11024. };
  11025. if (false) {}
  11026. Object.defineProperty(Vue.prototype, '$data', dataDef);
  11027. Object.defineProperty(Vue.prototype, '$props', propsDef);
  11028. Vue.prototype.$set = set;
  11029. Vue.prototype.$delete = del;
  11030. Vue.prototype.$watch = function (expOrFn, cb, options) {
  11031. var vm = this;
  11032. if (isPlainObject(cb)) {
  11033. return createWatcher(vm, expOrFn, cb, options);
  11034. }
  11035. options = options || {};
  11036. options.user = true;
  11037. var watcher = new Watcher(vm, expOrFn, cb, options);
  11038. if (options.immediate) {
  11039. var info = "callback for immediate watcher \"".concat(watcher.expression, "\"");
  11040. pushTarget();
  11041. invokeWithErrorHandling(cb, vm, [watcher.value], vm, info);
  11042. popTarget();
  11043. }
  11044. return function unwatchFn() {
  11045. watcher.teardown();
  11046. };
  11047. };
  11048. }
  11049. var uid = 0;
  11050. function initMixin$1(Vue) {
  11051. Vue.prototype._init = function (options) {
  11052. var vm = this;
  11053. // a uid
  11054. vm._uid = uid++;
  11055. var startTag, endTag;
  11056. /* istanbul ignore if */
  11057. if (false) {}
  11058. // a flag to mark this as a Vue instance without having to do instanceof
  11059. // check
  11060. vm._isVue = true;
  11061. // avoid instances from being observed
  11062. vm.__v_skip = true;
  11063. // effect scope
  11064. vm._scope = new EffectScope(true /* detached */);
  11065. // #13134 edge case where a child component is manually created during the
  11066. // render of a parent component
  11067. vm._scope.parent = undefined;
  11068. vm._scope._vm = true;
  11069. // merge options
  11070. if (options && options._isComponent) {
  11071. // optimize internal component instantiation
  11072. // since dynamic options merging is pretty slow, and none of the
  11073. // internal component options needs special treatment.
  11074. initInternalComponent(vm, options);
  11075. }
  11076. else {
  11077. vm.$options = mergeOptions(resolveConstructorOptions(vm.constructor), options || {}, vm);
  11078. }
  11079. /* istanbul ignore else */
  11080. if (false) {}
  11081. else {
  11082. vm._renderProxy = vm;
  11083. }
  11084. // expose real self
  11085. vm._self = vm;
  11086. initLifecycle(vm);
  11087. initEvents(vm);
  11088. initRender(vm);
  11089. callHook$1(vm, 'beforeCreate', undefined, false /* setContext */);
  11090. initInjections(vm); // resolve injections before data/props
  11091. initState(vm);
  11092. initProvide(vm); // resolve provide after data/props
  11093. callHook$1(vm, 'created');
  11094. /* istanbul ignore if */
  11095. if (false) {}
  11096. if (vm.$options.el) {
  11097. vm.$mount(vm.$options.el);
  11098. }
  11099. };
  11100. }
  11101. function initInternalComponent(vm, options) {
  11102. var opts = (vm.$options = Object.create(vm.constructor.options));
  11103. // doing this because it's faster than dynamic enumeration.
  11104. var parentVnode = options._parentVnode;
  11105. opts.parent = options.parent;
  11106. opts._parentVnode = parentVnode;
  11107. var vnodeComponentOptions = parentVnode.componentOptions;
  11108. opts.propsData = vnodeComponentOptions.propsData;
  11109. opts._parentListeners = vnodeComponentOptions.listeners;
  11110. opts._renderChildren = vnodeComponentOptions.children;
  11111. opts._componentTag = vnodeComponentOptions.tag;
  11112. if (options.render) {
  11113. opts.render = options.render;
  11114. opts.staticRenderFns = options.staticRenderFns;
  11115. }
  11116. }
  11117. function resolveConstructorOptions(Ctor) {
  11118. var options = Ctor.options;
  11119. if (Ctor.super) {
  11120. var superOptions = resolveConstructorOptions(Ctor.super);
  11121. var cachedSuperOptions = Ctor.superOptions;
  11122. if (superOptions !== cachedSuperOptions) {
  11123. // super option changed,
  11124. // need to resolve new options.
  11125. Ctor.superOptions = superOptions;
  11126. // check if there are any late-modified/attached options (#4976)
  11127. var modifiedOptions = resolveModifiedOptions(Ctor);
  11128. // update base extend options
  11129. if (modifiedOptions) {
  11130. extend(Ctor.extendOptions, modifiedOptions);
  11131. }
  11132. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  11133. if (options.name) {
  11134. options.components[options.name] = Ctor;
  11135. }
  11136. }
  11137. }
  11138. return options;
  11139. }
  11140. function resolveModifiedOptions(Ctor) {
  11141. var modified;
  11142. var latest = Ctor.options;
  11143. var sealed = Ctor.sealedOptions;
  11144. for (var key in latest) {
  11145. if (latest[key] !== sealed[key]) {
  11146. if (!modified)
  11147. modified = {};
  11148. modified[key] = latest[key];
  11149. }
  11150. }
  11151. return modified;
  11152. }
  11153. function Vue(options) {
  11154. if (false) {}
  11155. this._init(options);
  11156. }
  11157. //@ts-expect-error Vue has function type
  11158. initMixin$1(Vue);
  11159. //@ts-expect-error Vue has function type
  11160. stateMixin(Vue);
  11161. //@ts-expect-error Vue has function type
  11162. eventsMixin(Vue);
  11163. //@ts-expect-error Vue has function type
  11164. lifecycleMixin(Vue);
  11165. //@ts-expect-error Vue has function type
  11166. renderMixin(Vue);
  11167. function initUse(Vue) {
  11168. Vue.use = function (plugin) {
  11169. var installedPlugins = this._installedPlugins || (this._installedPlugins = []);
  11170. if (installedPlugins.indexOf(plugin) > -1) {
  11171. return this;
  11172. }
  11173. // additional parameters
  11174. var args = toArray(arguments, 1);
  11175. args.unshift(this);
  11176. if (isFunction(plugin.install)) {
  11177. plugin.install.apply(plugin, args);
  11178. }
  11179. else if (isFunction(plugin)) {
  11180. plugin.apply(null, args);
  11181. }
  11182. installedPlugins.push(plugin);
  11183. return this;
  11184. };
  11185. }
  11186. function initMixin(Vue) {
  11187. Vue.mixin = function (mixin) {
  11188. this.options = mergeOptions(this.options, mixin);
  11189. return this;
  11190. };
  11191. }
  11192. function initExtend(Vue) {
  11193. /**
  11194. * Each instance constructor, including Vue, has a unique
  11195. * cid. This enables us to create wrapped "child
  11196. * constructors" for prototypal inheritance and cache them.
  11197. */
  11198. Vue.cid = 0;
  11199. var cid = 1;
  11200. /**
  11201. * Class inheritance
  11202. */
  11203. Vue.extend = function (extendOptions) {
  11204. extendOptions = extendOptions || {};
  11205. var Super = this;
  11206. var SuperId = Super.cid;
  11207. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  11208. if (cachedCtors[SuperId]) {
  11209. return cachedCtors[SuperId];
  11210. }
  11211. var name = getComponentName(extendOptions) || getComponentName(Super.options);
  11212. if (false) {}
  11213. var Sub = function VueComponent(options) {
  11214. this._init(options);
  11215. };
  11216. Sub.prototype = Object.create(Super.prototype);
  11217. Sub.prototype.constructor = Sub;
  11218. Sub.cid = cid++;
  11219. Sub.options = mergeOptions(Super.options, extendOptions);
  11220. Sub['super'] = Super;
  11221. // For props and computed properties, we define the proxy getters on
  11222. // the Vue instances at extension time, on the extended prototype. This
  11223. // avoids Object.defineProperty calls for each instance created.
  11224. if (Sub.options.props) {
  11225. initProps(Sub);
  11226. }
  11227. if (Sub.options.computed) {
  11228. initComputed(Sub);
  11229. }
  11230. // allow further extension/mixin/plugin usage
  11231. Sub.extend = Super.extend;
  11232. Sub.mixin = Super.mixin;
  11233. Sub.use = Super.use;
  11234. // create asset registers, so extended classes
  11235. // can have their private assets too.
  11236. ASSET_TYPES.forEach(function (type) {
  11237. Sub[type] = Super[type];
  11238. });
  11239. // enable recursive self-lookup
  11240. if (name) {
  11241. Sub.options.components[name] = Sub;
  11242. }
  11243. // keep a reference to the super options at extension time.
  11244. // later at instantiation we can check if Super's options have
  11245. // been updated.
  11246. Sub.superOptions = Super.options;
  11247. Sub.extendOptions = extendOptions;
  11248. Sub.sealedOptions = extend({}, Sub.options);
  11249. // cache constructor
  11250. cachedCtors[SuperId] = Sub;
  11251. return Sub;
  11252. };
  11253. }
  11254. function initProps(Comp) {
  11255. var props = Comp.options.props;
  11256. for (var key in props) {
  11257. proxy(Comp.prototype, "_props", key);
  11258. }
  11259. }
  11260. function initComputed(Comp) {
  11261. var computed = Comp.options.computed;
  11262. for (var key in computed) {
  11263. defineComputed(Comp.prototype, key, computed[key]);
  11264. }
  11265. }
  11266. function initAssetRegisters(Vue) {
  11267. /**
  11268. * Create asset registration methods.
  11269. */
  11270. ASSET_TYPES.forEach(function (type) {
  11271. // @ts-expect-error function is not exact same type
  11272. Vue[type] = function (id, definition) {
  11273. if (!definition) {
  11274. return this.options[type + 's'][id];
  11275. }
  11276. else {
  11277. /* istanbul ignore if */
  11278. if (false) {}
  11279. if (type === 'component' && isPlainObject(definition)) {
  11280. // @ts-expect-error
  11281. definition.name = definition.name || id;
  11282. definition = this.options._base.extend(definition);
  11283. }
  11284. if (type === 'directive' && isFunction(definition)) {
  11285. definition = { bind: definition, update: definition };
  11286. }
  11287. this.options[type + 's'][id] = definition;
  11288. return definition;
  11289. }
  11290. };
  11291. });
  11292. }
  11293. function _getComponentName(opts) {
  11294. return opts && (getComponentName(opts.Ctor.options) || opts.tag);
  11295. }
  11296. function matches(pattern, name) {
  11297. if (isArray(pattern)) {
  11298. return pattern.indexOf(name) > -1;
  11299. }
  11300. else if (typeof pattern === 'string') {
  11301. return pattern.split(',').indexOf(name) > -1;
  11302. }
  11303. else if (isRegExp(pattern)) {
  11304. return pattern.test(name);
  11305. }
  11306. /* istanbul ignore next */
  11307. return false;
  11308. }
  11309. function pruneCache(keepAliveInstance, filter) {
  11310. var cache = keepAliveInstance.cache, keys = keepAliveInstance.keys, _vnode = keepAliveInstance._vnode, $vnode = keepAliveInstance.$vnode;
  11311. for (var key in cache) {
  11312. var entry = cache[key];
  11313. if (entry) {
  11314. var name_1 = entry.name;
  11315. if (name_1 && !filter(name_1)) {
  11316. pruneCacheEntry(cache, key, keys, _vnode);
  11317. }
  11318. }
  11319. }
  11320. $vnode.componentOptions.children = undefined;
  11321. }
  11322. function pruneCacheEntry(cache, key, keys, current) {
  11323. var entry = cache[key];
  11324. if (entry && (!current || entry.tag !== current.tag)) {
  11325. // @ts-expect-error can be undefined
  11326. entry.componentInstance.$destroy();
  11327. }
  11328. cache[key] = null;
  11329. remove$2(keys, key);
  11330. }
  11331. var patternTypes = [String, RegExp, Array];
  11332. // TODO defineComponent
  11333. var KeepAlive = {
  11334. name: 'keep-alive',
  11335. abstract: true,
  11336. props: {
  11337. include: patternTypes,
  11338. exclude: patternTypes,
  11339. max: [String, Number]
  11340. },
  11341. methods: {
  11342. cacheVNode: function () {
  11343. var _a = this, cache = _a.cache, keys = _a.keys, vnodeToCache = _a.vnodeToCache, keyToCache = _a.keyToCache;
  11344. if (vnodeToCache) {
  11345. var tag = vnodeToCache.tag, componentInstance = vnodeToCache.componentInstance, componentOptions = vnodeToCache.componentOptions;
  11346. cache[keyToCache] = {
  11347. name: _getComponentName(componentOptions),
  11348. tag: tag,
  11349. componentInstance: componentInstance
  11350. };
  11351. keys.push(keyToCache);
  11352. // prune oldest entry
  11353. if (this.max && keys.length > parseInt(this.max)) {
  11354. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  11355. }
  11356. this.vnodeToCache = null;
  11357. }
  11358. }
  11359. },
  11360. created: function () {
  11361. this.cache = Object.create(null);
  11362. this.keys = [];
  11363. },
  11364. destroyed: function () {
  11365. for (var key in this.cache) {
  11366. pruneCacheEntry(this.cache, key, this.keys);
  11367. }
  11368. },
  11369. mounted: function () {
  11370. var _this = this;
  11371. this.cacheVNode();
  11372. this.$watch('include', function (val) {
  11373. pruneCache(_this, function (name) { return matches(val, name); });
  11374. });
  11375. this.$watch('exclude', function (val) {
  11376. pruneCache(_this, function (name) { return !matches(val, name); });
  11377. });
  11378. },
  11379. updated: function () {
  11380. this.cacheVNode();
  11381. },
  11382. render: function () {
  11383. var slot = this.$slots.default;
  11384. var vnode = getFirstComponentChild(slot);
  11385. var componentOptions = vnode && vnode.componentOptions;
  11386. if (componentOptions) {
  11387. // check pattern
  11388. var name_2 = _getComponentName(componentOptions);
  11389. var _a = this, include = _a.include, exclude = _a.exclude;
  11390. if (
  11391. // not included
  11392. (include && (!name_2 || !matches(include, name_2))) ||
  11393. // excluded
  11394. (exclude && name_2 && matches(exclude, name_2))) {
  11395. return vnode;
  11396. }
  11397. var _b = this, cache = _b.cache, keys = _b.keys;
  11398. var key = vnode.key == null
  11399. ? // same constructor may get registered as different local components
  11400. // so cid alone is not enough (#3269)
  11401. componentOptions.Ctor.cid +
  11402. (componentOptions.tag ? "::".concat(componentOptions.tag) : '')
  11403. : vnode.key;
  11404. if (cache[key]) {
  11405. vnode.componentInstance = cache[key].componentInstance;
  11406. // make current key freshest
  11407. remove$2(keys, key);
  11408. keys.push(key);
  11409. }
  11410. else {
  11411. // delay setting the cache until update
  11412. this.vnodeToCache = vnode;
  11413. this.keyToCache = key;
  11414. }
  11415. // @ts-expect-error can vnode.data can be undefined
  11416. vnode.data.keepAlive = true;
  11417. }
  11418. return vnode || (slot && slot[0]);
  11419. }
  11420. };
  11421. var builtInComponents = {
  11422. KeepAlive: KeepAlive
  11423. };
  11424. function initGlobalAPI(Vue) {
  11425. // config
  11426. var configDef = {};
  11427. configDef.get = function () { return config; };
  11428. if (false) {}
  11429. Object.defineProperty(Vue, 'config', configDef);
  11430. // exposed util methods.
  11431. // NOTE: these are not considered part of the public API - avoid relying on
  11432. // them unless you are aware of the risk.
  11433. Vue.util = {
  11434. warn: warn,
  11435. extend: extend,
  11436. mergeOptions: mergeOptions,
  11437. defineReactive: defineReactive
  11438. };
  11439. Vue.set = set;
  11440. Vue.delete = del;
  11441. Vue.nextTick = nextTick;
  11442. // 2.6 explicit observable API
  11443. Vue.observable = function (obj) {
  11444. observe(obj);
  11445. return obj;
  11446. };
  11447. Vue.options = Object.create(null);
  11448. ASSET_TYPES.forEach(function (type) {
  11449. Vue.options[type + 's'] = Object.create(null);
  11450. });
  11451. // this is used to identify the "base" constructor to extend all plain-object
  11452. // components with in Weex's multi-instance scenarios.
  11453. Vue.options._base = Vue;
  11454. extend(Vue.options.components, builtInComponents);
  11455. initUse(Vue);
  11456. initMixin(Vue);
  11457. initExtend(Vue);
  11458. initAssetRegisters(Vue);
  11459. }
  11460. initGlobalAPI(Vue);
  11461. Object.defineProperty(Vue.prototype, '$isServer', {
  11462. get: isServerRendering
  11463. });
  11464. Object.defineProperty(Vue.prototype, '$ssrContext', {
  11465. get: function () {
  11466. /* istanbul ignore next */
  11467. return this.$vnode && this.$vnode.ssrContext;
  11468. }
  11469. });
  11470. // expose FunctionalRenderContext for ssr runtime helper installation
  11471. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  11472. value: FunctionalRenderContext
  11473. });
  11474. Vue.version = version;
  11475. // these are reserved for web because they are directly compiled away
  11476. // during template compilation
  11477. var isReservedAttr = makeMap('style,class');
  11478. // attributes that should be using props for binding
  11479. var acceptValue = makeMap('input,textarea,option,select,progress');
  11480. var mustUseProp = function (tag, type, attr) {
  11481. return ((attr === 'value' && acceptValue(tag) && type !== 'button') ||
  11482. (attr === 'selected' && tag === 'option') ||
  11483. (attr === 'checked' && tag === 'input') ||
  11484. (attr === 'muted' && tag === 'video'));
  11485. };
  11486. var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
  11487. var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');
  11488. var convertEnumeratedValue = function (key, value) {
  11489. return isFalsyAttrValue(value) || value === 'false'
  11490. ? 'false'
  11491. : // allow arbitrary string value for contenteditable
  11492. key === 'contenteditable' && isValidContentEditableValue(value)
  11493. ? value
  11494. : 'true';
  11495. };
  11496. var isBooleanAttr = makeMap('allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
  11497. 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
  11498. 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
  11499. 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
  11500. 'required,reversed,scoped,seamless,selected,sortable,' +
  11501. 'truespeed,typemustmatch,visible');
  11502. var xlinkNS = 'http://www.w3.org/1999/xlink';
  11503. var isXlink = function (name) {
  11504. return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink';
  11505. };
  11506. var getXlinkProp = function (name) {
  11507. return isXlink(name) ? name.slice(6, name.length) : '';
  11508. };
  11509. var isFalsyAttrValue = function (val) {
  11510. return val == null || val === false;
  11511. };
  11512. function genClassForVnode(vnode) {
  11513. var data = vnode.data;
  11514. var parentNode = vnode;
  11515. var childNode = vnode;
  11516. while (isDef(childNode.componentInstance)) {
  11517. childNode = childNode.componentInstance._vnode;
  11518. if (childNode && childNode.data) {
  11519. data = mergeClassData(childNode.data, data);
  11520. }
  11521. }
  11522. // @ts-expect-error parentNode.parent not VNodeWithData
  11523. while (isDef((parentNode = parentNode.parent))) {
  11524. if (parentNode && parentNode.data) {
  11525. data = mergeClassData(data, parentNode.data);
  11526. }
  11527. }
  11528. return renderClass(data.staticClass, data.class);
  11529. }
  11530. function mergeClassData(child, parent) {
  11531. return {
  11532. staticClass: concat(child.staticClass, parent.staticClass),
  11533. class: isDef(child.class) ? [child.class, parent.class] : parent.class
  11534. };
  11535. }
  11536. function renderClass(staticClass, dynamicClass) {
  11537. if (isDef(staticClass) || isDef(dynamicClass)) {
  11538. return concat(staticClass, stringifyClass(dynamicClass));
  11539. }
  11540. /* istanbul ignore next */
  11541. return '';
  11542. }
  11543. function concat(a, b) {
  11544. return a ? (b ? a + ' ' + b : a) : b || '';
  11545. }
  11546. function stringifyClass(value) {
  11547. if (Array.isArray(value)) {
  11548. return stringifyArray(value);
  11549. }
  11550. if (isObject(value)) {
  11551. return stringifyObject(value);
  11552. }
  11553. if (typeof value === 'string') {
  11554. return value;
  11555. }
  11556. /* istanbul ignore next */
  11557. return '';
  11558. }
  11559. function stringifyArray(value) {
  11560. var res = '';
  11561. var stringified;
  11562. for (var i = 0, l = value.length; i < l; i++) {
  11563. if (isDef((stringified = stringifyClass(value[i]))) && stringified !== '') {
  11564. if (res)
  11565. res += ' ';
  11566. res += stringified;
  11567. }
  11568. }
  11569. return res;
  11570. }
  11571. function stringifyObject(value) {
  11572. var res = '';
  11573. for (var key in value) {
  11574. if (value[key]) {
  11575. if (res)
  11576. res += ' ';
  11577. res += key;
  11578. }
  11579. }
  11580. return res;
  11581. }
  11582. var namespaceMap = {
  11583. svg: 'http://www.w3.org/2000/svg',
  11584. math: 'http://www.w3.org/1998/Math/MathML'
  11585. };
  11586. var isHTMLTag = makeMap('html,body,base,head,link,meta,style,title,' +
  11587. 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
  11588. 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
  11589. 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
  11590. 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
  11591. 'embed,object,param,source,canvas,script,noscript,del,ins,' +
  11592. 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
  11593. 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
  11594. 'output,progress,select,textarea,' +
  11595. 'details,dialog,menu,menuitem,summary,' +
  11596. 'content,element,shadow,template,blockquote,iframe,tfoot');
  11597. // this map is intentionally selective, only covering SVG elements that may
  11598. // contain child elements.
  11599. var isSVG = makeMap('svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
  11600. 'foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
  11601. 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view', true);
  11602. var isReservedTag = function (tag) {
  11603. return isHTMLTag(tag) || isSVG(tag);
  11604. };
  11605. function getTagNamespace(tag) {
  11606. if (isSVG(tag)) {
  11607. return 'svg';
  11608. }
  11609. // basic support for MathML
  11610. // note it doesn't support other MathML elements being component roots
  11611. if (tag === 'math') {
  11612. return 'math';
  11613. }
  11614. }
  11615. var unknownElementCache = Object.create(null);
  11616. function isUnknownElement(tag) {
  11617. /* istanbul ignore if */
  11618. if (!inBrowser) {
  11619. return true;
  11620. }
  11621. if (isReservedTag(tag)) {
  11622. return false;
  11623. }
  11624. tag = tag.toLowerCase();
  11625. /* istanbul ignore if */
  11626. if (unknownElementCache[tag] != null) {
  11627. return unknownElementCache[tag];
  11628. }
  11629. var el = document.createElement(tag);
  11630. if (tag.indexOf('-') > -1) {
  11631. // https://stackoverflow.com/a/28210364/1070244
  11632. return (unknownElementCache[tag] =
  11633. el.constructor === window.HTMLUnknownElement ||
  11634. el.constructor === window.HTMLElement);
  11635. }
  11636. else {
  11637. return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()));
  11638. }
  11639. }
  11640. var isTextInputType = makeMap('text,number,password,search,email,tel,url');
  11641. /**
  11642. * Query an element selector if it's not an element already.
  11643. */
  11644. function query(el) {
  11645. if (typeof el === 'string') {
  11646. var selected = document.querySelector(el);
  11647. if (!selected) {
  11648. false && false;
  11649. return document.createElement('div');
  11650. }
  11651. return selected;
  11652. }
  11653. else {
  11654. return el;
  11655. }
  11656. }
  11657. function createElement(tagName, vnode) {
  11658. var elm = document.createElement(tagName);
  11659. if (tagName !== 'select') {
  11660. return elm;
  11661. }
  11662. // false or null will remove the attribute but undefined will not
  11663. if (vnode.data &&
  11664. vnode.data.attrs &&
  11665. vnode.data.attrs.multiple !== undefined) {
  11666. elm.setAttribute('multiple', 'multiple');
  11667. }
  11668. return elm;
  11669. }
  11670. function createElementNS(namespace, tagName) {
  11671. return document.createElementNS(namespaceMap[namespace], tagName);
  11672. }
  11673. function createTextNode(text) {
  11674. return document.createTextNode(text);
  11675. }
  11676. function createComment(text) {
  11677. return document.createComment(text);
  11678. }
  11679. function insertBefore(parentNode, newNode, referenceNode) {
  11680. parentNode.insertBefore(newNode, referenceNode);
  11681. }
  11682. function removeChild(node, child) {
  11683. node.removeChild(child);
  11684. }
  11685. function appendChild(node, child) {
  11686. node.appendChild(child);
  11687. }
  11688. function parentNode(node) {
  11689. return node.parentNode;
  11690. }
  11691. function nextSibling(node) {
  11692. return node.nextSibling;
  11693. }
  11694. function tagName(node) {
  11695. return node.tagName;
  11696. }
  11697. function setTextContent(node, text) {
  11698. node.textContent = text;
  11699. }
  11700. function setStyleScope(node, scopeId) {
  11701. node.setAttribute(scopeId, '');
  11702. }
  11703. var nodeOps = /*#__PURE__*/Object.freeze({
  11704. __proto__: null,
  11705. createElement: createElement,
  11706. createElementNS: createElementNS,
  11707. createTextNode: createTextNode,
  11708. createComment: createComment,
  11709. insertBefore: insertBefore,
  11710. removeChild: removeChild,
  11711. appendChild: appendChild,
  11712. parentNode: parentNode,
  11713. nextSibling: nextSibling,
  11714. tagName: tagName,
  11715. setTextContent: setTextContent,
  11716. setStyleScope: setStyleScope
  11717. });
  11718. var ref = {
  11719. create: function (_, vnode) {
  11720. registerRef(vnode);
  11721. },
  11722. update: function (oldVnode, vnode) {
  11723. if (oldVnode.data.ref !== vnode.data.ref) {
  11724. registerRef(oldVnode, true);
  11725. registerRef(vnode);
  11726. }
  11727. },
  11728. destroy: function (vnode) {
  11729. registerRef(vnode, true);
  11730. }
  11731. };
  11732. function registerRef(vnode, isRemoval) {
  11733. var ref = vnode.data.ref;
  11734. if (!isDef(ref))
  11735. return;
  11736. var vm = vnode.context;
  11737. var refValue = vnode.componentInstance || vnode.elm;
  11738. var value = isRemoval ? null : refValue;
  11739. var $refsValue = isRemoval ? undefined : refValue;
  11740. if (isFunction(ref)) {
  11741. invokeWithErrorHandling(ref, vm, [value], vm, "template ref function");
  11742. return;
  11743. }
  11744. var isFor = vnode.data.refInFor;
  11745. var _isString = typeof ref === 'string' || typeof ref === 'number';
  11746. var _isRef = isRef(ref);
  11747. var refs = vm.$refs;
  11748. if (_isString || _isRef) {
  11749. if (isFor) {
  11750. var existing = _isString ? refs[ref] : ref.value;
  11751. if (isRemoval) {
  11752. isArray(existing) && remove$2(existing, refValue);
  11753. }
  11754. else {
  11755. if (!isArray(existing)) {
  11756. if (_isString) {
  11757. refs[ref] = [refValue];
  11758. setSetupRef(vm, ref, refs[ref]);
  11759. }
  11760. else {
  11761. ref.value = [refValue];
  11762. }
  11763. }
  11764. else if (!existing.includes(refValue)) {
  11765. existing.push(refValue);
  11766. }
  11767. }
  11768. }
  11769. else if (_isString) {
  11770. if (isRemoval && refs[ref] !== refValue) {
  11771. return;
  11772. }
  11773. refs[ref] = $refsValue;
  11774. setSetupRef(vm, ref, value);
  11775. }
  11776. else if (_isRef) {
  11777. if (isRemoval && ref.value !== refValue) {
  11778. return;
  11779. }
  11780. ref.value = value;
  11781. }
  11782. else if (false) {}
  11783. }
  11784. }
  11785. function setSetupRef(_a, key, val) {
  11786. var _setupState = _a._setupState;
  11787. if (_setupState && hasOwn(_setupState, key)) {
  11788. if (isRef(_setupState[key])) {
  11789. _setupState[key].value = val;
  11790. }
  11791. else {
  11792. _setupState[key] = val;
  11793. }
  11794. }
  11795. }
  11796. /**
  11797. * Virtual DOM patching algorithm based on Snabbdom by
  11798. * Simon Friis Vindum (@paldepind)
  11799. * Licensed under the MIT License
  11800. * https://github.com/paldepind/snabbdom/blob/master/LICENSE
  11801. *
  11802. * modified by Evan You (@yyx990803)
  11803. *
  11804. * Not type-checking this because this file is perf-critical and the cost
  11805. * of making flow understand it is not worth it.
  11806. */
  11807. var emptyNode = new VNode('', {}, []);
  11808. var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
  11809. function sameVnode(a, b) {
  11810. return (a.key === b.key &&
  11811. a.asyncFactory === b.asyncFactory &&
  11812. ((a.tag === b.tag &&
  11813. a.isComment === b.isComment &&
  11814. isDef(a.data) === isDef(b.data) &&
  11815. sameInputType(a, b)) ||
  11816. (isTrue(a.isAsyncPlaceholder) && isUndef(b.asyncFactory.error))));
  11817. }
  11818. function sameInputType(a, b) {
  11819. if (a.tag !== 'input')
  11820. return true;
  11821. var i;
  11822. var typeA = isDef((i = a.data)) && isDef((i = i.attrs)) && i.type;
  11823. var typeB = isDef((i = b.data)) && isDef((i = i.attrs)) && i.type;
  11824. return typeA === typeB || (isTextInputType(typeA) && isTextInputType(typeB));
  11825. }
  11826. function createKeyToOldIdx(children, beginIdx, endIdx) {
  11827. var i, key;
  11828. var map = {};
  11829. for (i = beginIdx; i <= endIdx; ++i) {
  11830. key = children[i].key;
  11831. if (isDef(key))
  11832. map[key] = i;
  11833. }
  11834. return map;
  11835. }
  11836. function createPatchFunction(backend) {
  11837. var i, j;
  11838. var cbs = {};
  11839. var modules = backend.modules, nodeOps = backend.nodeOps;
  11840. for (i = 0; i < hooks.length; ++i) {
  11841. cbs[hooks[i]] = [];
  11842. for (j = 0; j < modules.length; ++j) {
  11843. if (isDef(modules[j][hooks[i]])) {
  11844. cbs[hooks[i]].push(modules[j][hooks[i]]);
  11845. }
  11846. }
  11847. }
  11848. function emptyNodeAt(elm) {
  11849. return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm);
  11850. }
  11851. function createRmCb(childElm, listeners) {
  11852. function remove() {
  11853. if (--remove.listeners === 0) {
  11854. removeNode(childElm);
  11855. }
  11856. }
  11857. remove.listeners = listeners;
  11858. return remove;
  11859. }
  11860. function removeNode(el) {
  11861. var parent = nodeOps.parentNode(el);
  11862. // element may have already been removed due to v-html / v-text
  11863. if (isDef(parent)) {
  11864. nodeOps.removeChild(parent, el);
  11865. }
  11866. }
  11867. function isUnknownElement(vnode, inVPre) {
  11868. return (!inVPre &&
  11869. !vnode.ns &&
  11870. !(config.ignoredElements.length &&
  11871. config.ignoredElements.some(function (ignore) {
  11872. return isRegExp(ignore)
  11873. ? ignore.test(vnode.tag)
  11874. : ignore === vnode.tag;
  11875. })) &&
  11876. config.isUnknownElement(vnode.tag));
  11877. }
  11878. var creatingElmInVPre = 0;
  11879. function createElm(vnode, insertedVnodeQueue, parentElm, refElm, nested, ownerArray, index) {
  11880. if (isDef(vnode.elm) && isDef(ownerArray)) {
  11881. // This vnode was used in a previous render!
  11882. // now it's used as a new node, overwriting its elm would cause
  11883. // potential patch errors down the road when it's used as an insertion
  11884. // reference node. Instead, we clone the node on-demand before creating
  11885. // associated DOM element for it.
  11886. vnode = ownerArray[index] = cloneVNode(vnode);
  11887. }
  11888. vnode.isRootInsert = !nested; // for transition enter check
  11889. if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
  11890. return;
  11891. }
  11892. var data = vnode.data;
  11893. var children = vnode.children;
  11894. var tag = vnode.tag;
  11895. if (isDef(tag)) {
  11896. if (false) {}
  11897. vnode.elm = vnode.ns
  11898. ? nodeOps.createElementNS(vnode.ns, tag)
  11899. : nodeOps.createElement(tag, vnode);
  11900. setScope(vnode);
  11901. createChildren(vnode, children, insertedVnodeQueue);
  11902. if (isDef(data)) {
  11903. invokeCreateHooks(vnode, insertedVnodeQueue);
  11904. }
  11905. insert(parentElm, vnode.elm, refElm);
  11906. if (false) {}
  11907. }
  11908. else if (isTrue(vnode.isComment)) {
  11909. vnode.elm = nodeOps.createComment(vnode.text);
  11910. insert(parentElm, vnode.elm, refElm);
  11911. }
  11912. else {
  11913. vnode.elm = nodeOps.createTextNode(vnode.text);
  11914. insert(parentElm, vnode.elm, refElm);
  11915. }
  11916. }
  11917. function createComponent(vnode, insertedVnodeQueue, parentElm, refElm) {
  11918. var i = vnode.data;
  11919. if (isDef(i)) {
  11920. var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
  11921. if (isDef((i = i.hook)) && isDef((i = i.init))) {
  11922. i(vnode, false /* hydrating */);
  11923. }
  11924. // after calling the init hook, if the vnode is a child component
  11925. // it should've created a child instance and mounted it. the child
  11926. // component also has set the placeholder vnode's elm.
  11927. // in that case we can just return the element and be done.
  11928. if (isDef(vnode.componentInstance)) {
  11929. initComponent(vnode, insertedVnodeQueue);
  11930. insert(parentElm, vnode.elm, refElm);
  11931. if (isTrue(isReactivated)) {
  11932. reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
  11933. }
  11934. return true;
  11935. }
  11936. }
  11937. }
  11938. function initComponent(vnode, insertedVnodeQueue) {
  11939. if (isDef(vnode.data.pendingInsert)) {
  11940. insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
  11941. vnode.data.pendingInsert = null;
  11942. }
  11943. vnode.elm = vnode.componentInstance.$el;
  11944. if (isPatchable(vnode)) {
  11945. invokeCreateHooks(vnode, insertedVnodeQueue);
  11946. setScope(vnode);
  11947. }
  11948. else {
  11949. // empty component root.
  11950. // skip all element-related modules except for ref (#3455)
  11951. registerRef(vnode);
  11952. // make sure to invoke the insert hook
  11953. insertedVnodeQueue.push(vnode);
  11954. }
  11955. }
  11956. function reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm) {
  11957. var i;
  11958. // hack for #4339: a reactivated component with inner transition
  11959. // does not trigger because the inner node's created hooks are not called
  11960. // again. It's not ideal to involve module-specific logic in here but
  11961. // there doesn't seem to be a better way to do it.
  11962. var innerNode = vnode;
  11963. while (innerNode.componentInstance) {
  11964. innerNode = innerNode.componentInstance._vnode;
  11965. if (isDef((i = innerNode.data)) && isDef((i = i.transition))) {
  11966. for (i = 0; i < cbs.activate.length; ++i) {
  11967. cbs.activate[i](emptyNode, innerNode);
  11968. }
  11969. insertedVnodeQueue.push(innerNode);
  11970. break;
  11971. }
  11972. }
  11973. // unlike a newly created component,
  11974. // a reactivated keep-alive component doesn't insert itself
  11975. insert(parentElm, vnode.elm, refElm);
  11976. }
  11977. function insert(parent, elm, ref) {
  11978. if (isDef(parent)) {
  11979. if (isDef(ref)) {
  11980. if (nodeOps.parentNode(ref) === parent) {
  11981. nodeOps.insertBefore(parent, elm, ref);
  11982. }
  11983. }
  11984. else {
  11985. nodeOps.appendChild(parent, elm);
  11986. }
  11987. }
  11988. }
  11989. function createChildren(vnode, children, insertedVnodeQueue) {
  11990. if (isArray(children)) {
  11991. if (false) {}
  11992. for (var i_1 = 0; i_1 < children.length; ++i_1) {
  11993. createElm(children[i_1], insertedVnodeQueue, vnode.elm, null, true, children, i_1);
  11994. }
  11995. }
  11996. else if (isPrimitive(vnode.text)) {
  11997. nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));
  11998. }
  11999. }
  12000. function isPatchable(vnode) {
  12001. while (vnode.componentInstance) {
  12002. vnode = vnode.componentInstance._vnode;
  12003. }
  12004. return isDef(vnode.tag);
  12005. }
  12006. function invokeCreateHooks(vnode, insertedVnodeQueue) {
  12007. for (var i_2 = 0; i_2 < cbs.create.length; ++i_2) {
  12008. cbs.create[i_2](emptyNode, vnode);
  12009. }
  12010. i = vnode.data.hook; // Reuse variable
  12011. if (isDef(i)) {
  12012. if (isDef(i.create))
  12013. i.create(emptyNode, vnode);
  12014. if (isDef(i.insert))
  12015. insertedVnodeQueue.push(vnode);
  12016. }
  12017. }
  12018. // set scope id attribute for scoped CSS.
  12019. // this is implemented as a special case to avoid the overhead
  12020. // of going through the normal attribute patching process.
  12021. function setScope(vnode) {
  12022. var i;
  12023. if (isDef((i = vnode.fnScopeId))) {
  12024. nodeOps.setStyleScope(vnode.elm, i);
  12025. }
  12026. else {
  12027. var ancestor = vnode;
  12028. while (ancestor) {
  12029. if (isDef((i = ancestor.context)) && isDef((i = i.$options._scopeId))) {
  12030. nodeOps.setStyleScope(vnode.elm, i);
  12031. }
  12032. ancestor = ancestor.parent;
  12033. }
  12034. }
  12035. // for slot content they should also get the scopeId from the host instance.
  12036. if (isDef((i = activeInstance)) &&
  12037. i !== vnode.context &&
  12038. i !== vnode.fnContext &&
  12039. isDef((i = i.$options._scopeId))) {
  12040. nodeOps.setStyleScope(vnode.elm, i);
  12041. }
  12042. }
  12043. function addVnodes(parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
  12044. for (; startIdx <= endIdx; ++startIdx) {
  12045. createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);
  12046. }
  12047. }
  12048. function invokeDestroyHook(vnode) {
  12049. var i, j;
  12050. var data = vnode.data;
  12051. if (isDef(data)) {
  12052. if (isDef((i = data.hook)) && isDef((i = i.destroy)))
  12053. i(vnode);
  12054. for (i = 0; i < cbs.destroy.length; ++i)
  12055. cbs.destroy[i](vnode);
  12056. }
  12057. if (isDef((i = vnode.children))) {
  12058. for (j = 0; j < vnode.children.length; ++j) {
  12059. invokeDestroyHook(vnode.children[j]);
  12060. }
  12061. }
  12062. }
  12063. function removeVnodes(vnodes, startIdx, endIdx) {
  12064. for (; startIdx <= endIdx; ++startIdx) {
  12065. var ch = vnodes[startIdx];
  12066. if (isDef(ch)) {
  12067. if (isDef(ch.tag)) {
  12068. removeAndInvokeRemoveHook(ch);
  12069. invokeDestroyHook(ch);
  12070. }
  12071. else {
  12072. // Text node
  12073. removeNode(ch.elm);
  12074. }
  12075. }
  12076. }
  12077. }
  12078. function removeAndInvokeRemoveHook(vnode, rm) {
  12079. if (isDef(rm) || isDef(vnode.data)) {
  12080. var i_3;
  12081. var listeners = cbs.remove.length + 1;
  12082. if (isDef(rm)) {
  12083. // we have a recursively passed down rm callback
  12084. // increase the listeners count
  12085. rm.listeners += listeners;
  12086. }
  12087. else {
  12088. // directly removing
  12089. rm = createRmCb(vnode.elm, listeners);
  12090. }
  12091. // recursively invoke hooks on child component root node
  12092. if (isDef((i_3 = vnode.componentInstance)) &&
  12093. isDef((i_3 = i_3._vnode)) &&
  12094. isDef(i_3.data)) {
  12095. removeAndInvokeRemoveHook(i_3, rm);
  12096. }
  12097. for (i_3 = 0; i_3 < cbs.remove.length; ++i_3) {
  12098. cbs.remove[i_3](vnode, rm);
  12099. }
  12100. if (isDef((i_3 = vnode.data.hook)) && isDef((i_3 = i_3.remove))) {
  12101. i_3(vnode, rm);
  12102. }
  12103. else {
  12104. rm();
  12105. }
  12106. }
  12107. else {
  12108. removeNode(vnode.elm);
  12109. }
  12110. }
  12111. function updateChildren(parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
  12112. var oldStartIdx = 0;
  12113. var newStartIdx = 0;
  12114. var oldEndIdx = oldCh.length - 1;
  12115. var oldStartVnode = oldCh[0];
  12116. var oldEndVnode = oldCh[oldEndIdx];
  12117. var newEndIdx = newCh.length - 1;
  12118. var newStartVnode = newCh[0];
  12119. var newEndVnode = newCh[newEndIdx];
  12120. var oldKeyToIdx, idxInOld, vnodeToMove, refElm;
  12121. // removeOnly is a special flag used only by <transition-group>
  12122. // to ensure removed elements stay in correct relative positions
  12123. // during leaving transitions
  12124. var canMove = !removeOnly;
  12125. if (false) {}
  12126. while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
  12127. if (isUndef(oldStartVnode)) {
  12128. oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
  12129. }
  12130. else if (isUndef(oldEndVnode)) {
  12131. oldEndVnode = oldCh[--oldEndIdx];
  12132. }
  12133. else if (sameVnode(oldStartVnode, newStartVnode)) {
  12134. patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  12135. oldStartVnode = oldCh[++oldStartIdx];
  12136. newStartVnode = newCh[++newStartIdx];
  12137. }
  12138. else if (sameVnode(oldEndVnode, newEndVnode)) {
  12139. patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
  12140. oldEndVnode = oldCh[--oldEndIdx];
  12141. newEndVnode = newCh[--newEndIdx];
  12142. }
  12143. else if (sameVnode(oldStartVnode, newEndVnode)) {
  12144. // Vnode moved right
  12145. patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
  12146. canMove &&
  12147. nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
  12148. oldStartVnode = oldCh[++oldStartIdx];
  12149. newEndVnode = newCh[--newEndIdx];
  12150. }
  12151. else if (sameVnode(oldEndVnode, newStartVnode)) {
  12152. // Vnode moved left
  12153. patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  12154. canMove &&
  12155. nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
  12156. oldEndVnode = oldCh[--oldEndIdx];
  12157. newStartVnode = newCh[++newStartIdx];
  12158. }
  12159. else {
  12160. if (isUndef(oldKeyToIdx))
  12161. oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);
  12162. idxInOld = isDef(newStartVnode.key)
  12163. ? oldKeyToIdx[newStartVnode.key]
  12164. : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);
  12165. if (isUndef(idxInOld)) {
  12166. // New element
  12167. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
  12168. }
  12169. else {
  12170. vnodeToMove = oldCh[idxInOld];
  12171. if (sameVnode(vnodeToMove, newStartVnode)) {
  12172. patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  12173. oldCh[idxInOld] = undefined;
  12174. canMove &&
  12175. nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);
  12176. }
  12177. else {
  12178. // same key but different element. treat as new element
  12179. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
  12180. }
  12181. }
  12182. newStartVnode = newCh[++newStartIdx];
  12183. }
  12184. }
  12185. if (oldStartIdx > oldEndIdx) {
  12186. refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
  12187. addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
  12188. }
  12189. else if (newStartIdx > newEndIdx) {
  12190. removeVnodes(oldCh, oldStartIdx, oldEndIdx);
  12191. }
  12192. }
  12193. function checkDuplicateKeys(children) {
  12194. var seenKeys = {};
  12195. for (var i_4 = 0; i_4 < children.length; i_4++) {
  12196. var vnode = children[i_4];
  12197. var key = vnode.key;
  12198. if (isDef(key)) {
  12199. if (seenKeys[key]) {
  12200. warn("Duplicate keys detected: '".concat(key, "'. This may cause an update error."), vnode.context);
  12201. }
  12202. else {
  12203. seenKeys[key] = true;
  12204. }
  12205. }
  12206. }
  12207. }
  12208. function findIdxInOld(node, oldCh, start, end) {
  12209. for (var i_5 = start; i_5 < end; i_5++) {
  12210. var c = oldCh[i_5];
  12211. if (isDef(c) && sameVnode(node, c))
  12212. return i_5;
  12213. }
  12214. }
  12215. function patchVnode(oldVnode, vnode, insertedVnodeQueue, ownerArray, index, removeOnly) {
  12216. if (oldVnode === vnode) {
  12217. return;
  12218. }
  12219. if (isDef(vnode.elm) && isDef(ownerArray)) {
  12220. // clone reused vnode
  12221. vnode = ownerArray[index] = cloneVNode(vnode);
  12222. }
  12223. var elm = (vnode.elm = oldVnode.elm);
  12224. if (isTrue(oldVnode.isAsyncPlaceholder)) {
  12225. if (isDef(vnode.asyncFactory.resolved)) {
  12226. hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
  12227. }
  12228. else {
  12229. vnode.isAsyncPlaceholder = true;
  12230. }
  12231. return;
  12232. }
  12233. // reuse element for static trees.
  12234. // note we only do this if the vnode is cloned -
  12235. // if the new node is not cloned it means the render functions have been
  12236. // reset by the hot-reload-api and we need to do a proper re-render.
  12237. if (isTrue(vnode.isStatic) &&
  12238. isTrue(oldVnode.isStatic) &&
  12239. vnode.key === oldVnode.key &&
  12240. (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))) {
  12241. vnode.componentInstance = oldVnode.componentInstance;
  12242. return;
  12243. }
  12244. var i;
  12245. var data = vnode.data;
  12246. if (isDef(data) && isDef((i = data.hook)) && isDef((i = i.prepatch))) {
  12247. i(oldVnode, vnode);
  12248. }
  12249. var oldCh = oldVnode.children;
  12250. var ch = vnode.children;
  12251. if (isDef(data) && isPatchable(vnode)) {
  12252. for (i = 0; i < cbs.update.length; ++i)
  12253. cbs.update[i](oldVnode, vnode);
  12254. if (isDef((i = data.hook)) && isDef((i = i.update)))
  12255. i(oldVnode, vnode);
  12256. }
  12257. if (isUndef(vnode.text)) {
  12258. if (isDef(oldCh) && isDef(ch)) {
  12259. if (oldCh !== ch)
  12260. updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly);
  12261. }
  12262. else if (isDef(ch)) {
  12263. if (false) {}
  12264. if (isDef(oldVnode.text))
  12265. nodeOps.setTextContent(elm, '');
  12266. addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
  12267. }
  12268. else if (isDef(oldCh)) {
  12269. removeVnodes(oldCh, 0, oldCh.length - 1);
  12270. }
  12271. else if (isDef(oldVnode.text)) {
  12272. nodeOps.setTextContent(elm, '');
  12273. }
  12274. }
  12275. else if (oldVnode.text !== vnode.text) {
  12276. nodeOps.setTextContent(elm, vnode.text);
  12277. }
  12278. if (isDef(data)) {
  12279. if (isDef((i = data.hook)) && isDef((i = i.postpatch)))
  12280. i(oldVnode, vnode);
  12281. }
  12282. }
  12283. function invokeInsertHook(vnode, queue, initial) {
  12284. // delay insert hooks for component root nodes, invoke them after the
  12285. // element is really inserted
  12286. if (isTrue(initial) && isDef(vnode.parent)) {
  12287. vnode.parent.data.pendingInsert = queue;
  12288. }
  12289. else {
  12290. for (var i_6 = 0; i_6 < queue.length; ++i_6) {
  12291. queue[i_6].data.hook.insert(queue[i_6]);
  12292. }
  12293. }
  12294. }
  12295. var hydrationBailed = false;
  12296. // list of modules that can skip create hook during hydration because they
  12297. // are already rendered on the client or has no need for initialization
  12298. // Note: style is excluded because it relies on initial clone for future
  12299. // deep updates (#7063).
  12300. var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key');
  12301. // Note: this is a browser-only function so we can assume elms are DOM nodes.
  12302. function hydrate(elm, vnode, insertedVnodeQueue, inVPre) {
  12303. var i;
  12304. var tag = vnode.tag, data = vnode.data, children = vnode.children;
  12305. inVPre = inVPre || (data && data.pre);
  12306. vnode.elm = elm;
  12307. if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
  12308. vnode.isAsyncPlaceholder = true;
  12309. return true;
  12310. }
  12311. // assert node match
  12312. if (false) {}
  12313. if (isDef(data)) {
  12314. if (isDef((i = data.hook)) && isDef((i = i.init)))
  12315. i(vnode, true /* hydrating */);
  12316. if (isDef((i = vnode.componentInstance))) {
  12317. // child component. it should have hydrated its own tree.
  12318. initComponent(vnode, insertedVnodeQueue);
  12319. return true;
  12320. }
  12321. }
  12322. if (isDef(tag)) {
  12323. if (isDef(children)) {
  12324. // empty element, allow client to pick up and populate children
  12325. if (!elm.hasChildNodes()) {
  12326. createChildren(vnode, children, insertedVnodeQueue);
  12327. }
  12328. else {
  12329. // v-html and domProps: innerHTML
  12330. if (isDef((i = data)) &&
  12331. isDef((i = i.domProps)) &&
  12332. isDef((i = i.innerHTML))) {
  12333. if (i !== elm.innerHTML) {
  12334. /* istanbul ignore if */
  12335. if (false) {}
  12336. return false;
  12337. }
  12338. }
  12339. else {
  12340. // iterate and compare children lists
  12341. var childrenMatch = true;
  12342. var childNode = elm.firstChild;
  12343. for (var i_7 = 0; i_7 < children.length; i_7++) {
  12344. if (!childNode ||
  12345. !hydrate(childNode, children[i_7], insertedVnodeQueue, inVPre)) {
  12346. childrenMatch = false;
  12347. break;
  12348. }
  12349. childNode = childNode.nextSibling;
  12350. }
  12351. // if childNode is not null, it means the actual childNodes list is
  12352. // longer than the virtual children list.
  12353. if (!childrenMatch || childNode) {
  12354. /* istanbul ignore if */
  12355. if (false) {}
  12356. return false;
  12357. }
  12358. }
  12359. }
  12360. }
  12361. if (isDef(data)) {
  12362. var fullInvoke = false;
  12363. for (var key in data) {
  12364. if (!isRenderedModule(key)) {
  12365. fullInvoke = true;
  12366. invokeCreateHooks(vnode, insertedVnodeQueue);
  12367. break;
  12368. }
  12369. }
  12370. if (!fullInvoke && data['class']) {
  12371. // ensure collecting deps for deep class bindings for future updates
  12372. traverse(data['class']);
  12373. }
  12374. }
  12375. }
  12376. else if (elm.data !== vnode.text) {
  12377. elm.data = vnode.text;
  12378. }
  12379. return true;
  12380. }
  12381. function assertNodeMatch(node, vnode, inVPre) {
  12382. if (isDef(vnode.tag)) {
  12383. return (vnode.tag.indexOf('vue-component') === 0 ||
  12384. (!isUnknownElement(vnode, inVPre) &&
  12385. vnode.tag.toLowerCase() ===
  12386. (node.tagName && node.tagName.toLowerCase())));
  12387. }
  12388. else {
  12389. return node.nodeType === (vnode.isComment ? 8 : 3);
  12390. }
  12391. }
  12392. return function patch(oldVnode, vnode, hydrating, removeOnly) {
  12393. if (isUndef(vnode)) {
  12394. if (isDef(oldVnode))
  12395. invokeDestroyHook(oldVnode);
  12396. return;
  12397. }
  12398. var isInitialPatch = false;
  12399. var insertedVnodeQueue = [];
  12400. if (isUndef(oldVnode)) {
  12401. // empty mount (likely as component), create new root element
  12402. isInitialPatch = true;
  12403. createElm(vnode, insertedVnodeQueue);
  12404. }
  12405. else {
  12406. var isRealElement = isDef(oldVnode.nodeType);
  12407. if (!isRealElement && sameVnode(oldVnode, vnode)) {
  12408. // patch existing root node
  12409. patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);
  12410. }
  12411. else {
  12412. if (isRealElement) {
  12413. // mounting to a real element
  12414. // check if this is server-rendered content and if we can perform
  12415. // a successful hydration.
  12416. if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
  12417. oldVnode.removeAttribute(SSR_ATTR);
  12418. hydrating = true;
  12419. }
  12420. if (isTrue(hydrating)) {
  12421. if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
  12422. invokeInsertHook(vnode, insertedVnodeQueue, true);
  12423. return oldVnode;
  12424. }
  12425. else if (false) {}
  12426. }
  12427. // either not server-rendered, or hydration failed.
  12428. // create an empty node and replace it
  12429. oldVnode = emptyNodeAt(oldVnode);
  12430. }
  12431. // replacing existing element
  12432. var oldElm = oldVnode.elm;
  12433. var parentElm = nodeOps.parentNode(oldElm);
  12434. // create new node
  12435. createElm(vnode, insertedVnodeQueue,
  12436. // extremely rare edge case: do not insert if old element is in a
  12437. // leaving transition. Only happens when combining transition +
  12438. // keep-alive + HOCs. (#4590)
  12439. oldElm._leaveCb ? null : parentElm, nodeOps.nextSibling(oldElm));
  12440. // update parent placeholder node element, recursively
  12441. if (isDef(vnode.parent)) {
  12442. var ancestor = vnode.parent;
  12443. var patchable = isPatchable(vnode);
  12444. while (ancestor) {
  12445. for (var i_8 = 0; i_8 < cbs.destroy.length; ++i_8) {
  12446. cbs.destroy[i_8](ancestor);
  12447. }
  12448. ancestor.elm = vnode.elm;
  12449. if (patchable) {
  12450. for (var i_9 = 0; i_9 < cbs.create.length; ++i_9) {
  12451. cbs.create[i_9](emptyNode, ancestor);
  12452. }
  12453. // #6513
  12454. // invoke insert hooks that may have been merged by create hooks.
  12455. // e.g. for directives that uses the "inserted" hook.
  12456. var insert_1 = ancestor.data.hook.insert;
  12457. if (insert_1.merged) {
  12458. // start at index 1 to avoid re-invoking component mounted hook
  12459. // clone insert hooks to avoid being mutated during iteration.
  12460. // e.g. for customed directives under transition group.
  12461. var cloned = insert_1.fns.slice(1);
  12462. for (var i_10 = 0; i_10 < cloned.length; i_10++) {
  12463. cloned[i_10]();
  12464. }
  12465. }
  12466. }
  12467. else {
  12468. registerRef(ancestor);
  12469. }
  12470. ancestor = ancestor.parent;
  12471. }
  12472. }
  12473. // destroy old node
  12474. if (isDef(parentElm)) {
  12475. removeVnodes([oldVnode], 0, 0);
  12476. }
  12477. else if (isDef(oldVnode.tag)) {
  12478. invokeDestroyHook(oldVnode);
  12479. }
  12480. }
  12481. }
  12482. invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
  12483. return vnode.elm;
  12484. };
  12485. }
  12486. var directives = {
  12487. create: updateDirectives,
  12488. update: updateDirectives,
  12489. destroy: function unbindDirectives(vnode) {
  12490. // @ts-expect-error emptyNode is not VNodeWithData
  12491. updateDirectives(vnode, emptyNode);
  12492. }
  12493. };
  12494. function updateDirectives(oldVnode, vnode) {
  12495. if (oldVnode.data.directives || vnode.data.directives) {
  12496. _update(oldVnode, vnode);
  12497. }
  12498. }
  12499. function _update(oldVnode, vnode) {
  12500. var isCreate = oldVnode === emptyNode;
  12501. var isDestroy = vnode === emptyNode;
  12502. var oldDirs = normalizeDirectives(oldVnode.data.directives, oldVnode.context);
  12503. var newDirs = normalizeDirectives(vnode.data.directives, vnode.context);
  12504. var dirsWithInsert = [];
  12505. var dirsWithPostpatch = [];
  12506. var key, oldDir, dir;
  12507. for (key in newDirs) {
  12508. oldDir = oldDirs[key];
  12509. dir = newDirs[key];
  12510. if (!oldDir) {
  12511. // new directive, bind
  12512. callHook(dir, 'bind', vnode, oldVnode);
  12513. if (dir.def && dir.def.inserted) {
  12514. dirsWithInsert.push(dir);
  12515. }
  12516. }
  12517. else {
  12518. // existing directive, update
  12519. dir.oldValue = oldDir.value;
  12520. dir.oldArg = oldDir.arg;
  12521. callHook(dir, 'update', vnode, oldVnode);
  12522. if (dir.def && dir.def.componentUpdated) {
  12523. dirsWithPostpatch.push(dir);
  12524. }
  12525. }
  12526. }
  12527. if (dirsWithInsert.length) {
  12528. var callInsert = function () {
  12529. for (var i = 0; i < dirsWithInsert.length; i++) {
  12530. callHook(dirsWithInsert[i], 'inserted', vnode, oldVnode);
  12531. }
  12532. };
  12533. if (isCreate) {
  12534. mergeVNodeHook(vnode, 'insert', callInsert);
  12535. }
  12536. else {
  12537. callInsert();
  12538. }
  12539. }
  12540. if (dirsWithPostpatch.length) {
  12541. mergeVNodeHook(vnode, 'postpatch', function () {
  12542. for (var i = 0; i < dirsWithPostpatch.length; i++) {
  12543. callHook(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
  12544. }
  12545. });
  12546. }
  12547. if (!isCreate) {
  12548. for (key in oldDirs) {
  12549. if (!newDirs[key]) {
  12550. // no longer present, unbind
  12551. callHook(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
  12552. }
  12553. }
  12554. }
  12555. }
  12556. var emptyModifiers = Object.create(null);
  12557. function normalizeDirectives(dirs, vm) {
  12558. var res = Object.create(null);
  12559. if (!dirs) {
  12560. // $flow-disable-line
  12561. return res;
  12562. }
  12563. var i, dir;
  12564. for (i = 0; i < dirs.length; i++) {
  12565. dir = dirs[i];
  12566. if (!dir.modifiers) {
  12567. // $flow-disable-line
  12568. dir.modifiers = emptyModifiers;
  12569. }
  12570. res[getRawDirName(dir)] = dir;
  12571. if (vm._setupState && vm._setupState.__sfc) {
  12572. var setupDef = dir.def || resolveAsset(vm, '_setupState', 'v-' + dir.name);
  12573. if (typeof setupDef === 'function') {
  12574. dir.def = {
  12575. bind: setupDef,
  12576. update: setupDef,
  12577. };
  12578. }
  12579. else {
  12580. dir.def = setupDef;
  12581. }
  12582. }
  12583. dir.def = dir.def || resolveAsset(vm.$options, 'directives', dir.name, true);
  12584. }
  12585. // $flow-disable-line
  12586. return res;
  12587. }
  12588. function getRawDirName(dir) {
  12589. return (dir.rawName || "".concat(dir.name, ".").concat(Object.keys(dir.modifiers || {}).join('.')));
  12590. }
  12591. function callHook(dir, hook, vnode, oldVnode, isDestroy) {
  12592. var fn = dir.def && dir.def[hook];
  12593. if (fn) {
  12594. try {
  12595. fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
  12596. }
  12597. catch (e) {
  12598. handleError(e, vnode.context, "directive ".concat(dir.name, " ").concat(hook, " hook"));
  12599. }
  12600. }
  12601. }
  12602. var baseModules = [ref, directives];
  12603. function updateAttrs(oldVnode, vnode) {
  12604. var opts = vnode.componentOptions;
  12605. if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
  12606. return;
  12607. }
  12608. if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
  12609. return;
  12610. }
  12611. var key, cur, old;
  12612. var elm = vnode.elm;
  12613. var oldAttrs = oldVnode.data.attrs || {};
  12614. var attrs = vnode.data.attrs || {};
  12615. // clone observed objects, as the user probably wants to mutate it
  12616. if (isDef(attrs.__ob__) || isTrue(attrs._v_attr_proxy)) {
  12617. attrs = vnode.data.attrs = extend({}, attrs);
  12618. }
  12619. for (key in attrs) {
  12620. cur = attrs[key];
  12621. old = oldAttrs[key];
  12622. if (old !== cur) {
  12623. setAttr(elm, key, cur, vnode.data.pre);
  12624. }
  12625. }
  12626. // #4391: in IE9, setting type can reset value for input[type=radio]
  12627. // #6666: IE/Edge forces progress value down to 1 before setting a max
  12628. /* istanbul ignore if */
  12629. if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {
  12630. setAttr(elm, 'value', attrs.value);
  12631. }
  12632. for (key in oldAttrs) {
  12633. if (isUndef(attrs[key])) {
  12634. if (isXlink(key)) {
  12635. elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
  12636. }
  12637. else if (!isEnumeratedAttr(key)) {
  12638. elm.removeAttribute(key);
  12639. }
  12640. }
  12641. }
  12642. }
  12643. function setAttr(el, key, value, isInPre) {
  12644. if (isInPre || el.tagName.indexOf('-') > -1) {
  12645. baseSetAttr(el, key, value);
  12646. }
  12647. else if (isBooleanAttr(key)) {
  12648. // set attribute for blank value
  12649. // e.g. <option disabled>Select one</option>
  12650. if (isFalsyAttrValue(value)) {
  12651. el.removeAttribute(key);
  12652. }
  12653. else {
  12654. // technically allowfullscreen is a boolean attribute for <iframe>,
  12655. // but Flash expects a value of "true" when used on <embed> tag
  12656. value = key === 'allowfullscreen' && el.tagName === 'EMBED' ? 'true' : key;
  12657. el.setAttribute(key, value);
  12658. }
  12659. }
  12660. else if (isEnumeratedAttr(key)) {
  12661. el.setAttribute(key, convertEnumeratedValue(key, value));
  12662. }
  12663. else if (isXlink(key)) {
  12664. if (isFalsyAttrValue(value)) {
  12665. el.removeAttributeNS(xlinkNS, getXlinkProp(key));
  12666. }
  12667. else {
  12668. el.setAttributeNS(xlinkNS, key, value);
  12669. }
  12670. }
  12671. else {
  12672. baseSetAttr(el, key, value);
  12673. }
  12674. }
  12675. function baseSetAttr(el, key, value) {
  12676. if (isFalsyAttrValue(value)) {
  12677. el.removeAttribute(key);
  12678. }
  12679. else {
  12680. // #7138: IE10 & 11 fires input event when setting placeholder on
  12681. // <textarea>... block the first input event and remove the blocker
  12682. // immediately.
  12683. /* istanbul ignore if */
  12684. if (isIE &&
  12685. !isIE9 &&
  12686. el.tagName === 'TEXTAREA' &&
  12687. key === 'placeholder' &&
  12688. value !== '' &&
  12689. !el.__ieph) {
  12690. var blocker_1 = function (e) {
  12691. e.stopImmediatePropagation();
  12692. el.removeEventListener('input', blocker_1);
  12693. };
  12694. el.addEventListener('input', blocker_1);
  12695. // $flow-disable-line
  12696. el.__ieph = true; /* IE placeholder patched */
  12697. }
  12698. el.setAttribute(key, value);
  12699. }
  12700. }
  12701. var attrs = {
  12702. create: updateAttrs,
  12703. update: updateAttrs
  12704. };
  12705. function updateClass(oldVnode, vnode) {
  12706. var el = vnode.elm;
  12707. var data = vnode.data;
  12708. var oldData = oldVnode.data;
  12709. if (isUndef(data.staticClass) &&
  12710. isUndef(data.class) &&
  12711. (isUndef(oldData) ||
  12712. (isUndef(oldData.staticClass) && isUndef(oldData.class)))) {
  12713. return;
  12714. }
  12715. var cls = genClassForVnode(vnode);
  12716. // handle transition classes
  12717. var transitionClass = el._transitionClasses;
  12718. if (isDef(transitionClass)) {
  12719. cls = concat(cls, stringifyClass(transitionClass));
  12720. }
  12721. // set the class
  12722. if (cls !== el._prevClass) {
  12723. el.setAttribute('class', cls);
  12724. el._prevClass = cls;
  12725. }
  12726. }
  12727. var klass = {
  12728. create: updateClass,
  12729. update: updateClass
  12730. };
  12731. // in some cases, the event used has to be determined at runtime
  12732. // so we used some reserved tokens during compile.
  12733. var RANGE_TOKEN = '__r';
  12734. var CHECKBOX_RADIO_TOKEN = '__c';
  12735. // normalize v-model event tokens that can only be determined at runtime.
  12736. // it's important to place the event as the first in the array because
  12737. // the whole point is ensuring the v-model callback gets called before
  12738. // user-attached handlers.
  12739. function normalizeEvents(on) {
  12740. /* istanbul ignore if */
  12741. if (isDef(on[RANGE_TOKEN])) {
  12742. // IE input[type=range] only supports `change` event
  12743. var event_1 = isIE ? 'change' : 'input';
  12744. on[event_1] = [].concat(on[RANGE_TOKEN], on[event_1] || []);
  12745. delete on[RANGE_TOKEN];
  12746. }
  12747. // This was originally intended to fix #4521 but no longer necessary
  12748. // after 2.5. Keeping it for backwards compat with generated code from < 2.4
  12749. /* istanbul ignore if */
  12750. if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
  12751. on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);
  12752. delete on[CHECKBOX_RADIO_TOKEN];
  12753. }
  12754. }
  12755. var target;
  12756. function createOnceHandler(event, handler, capture) {
  12757. var _target = target; // save current target element in closure
  12758. return function onceHandler() {
  12759. var res = handler.apply(null, arguments);
  12760. if (res !== null) {
  12761. remove(event, onceHandler, capture, _target);
  12762. }
  12763. };
  12764. }
  12765. // #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp
  12766. // implementation and does not fire microtasks in between event propagation, so
  12767. // safe to exclude.
  12768. var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53);
  12769. function add(name, handler, capture, passive) {
  12770. // async edge case #6566: inner click event triggers patch, event handler
  12771. // attached to outer element during patch, and triggered again. This
  12772. // happens because browsers fire microtask ticks between event propagation.
  12773. // the solution is simple: we save the timestamp when a handler is attached,
  12774. // and the handler would only fire if the event passed to it was fired
  12775. // AFTER it was attached.
  12776. if (useMicrotaskFix) {
  12777. var attachedTimestamp_1 = currentFlushTimestamp;
  12778. var original_1 = handler;
  12779. //@ts-expect-error
  12780. handler = original_1._wrapper = function (e) {
  12781. if (
  12782. // no bubbling, should always fire.
  12783. // this is just a safety net in case event.timeStamp is unreliable in
  12784. // certain weird environments...
  12785. e.target === e.currentTarget ||
  12786. // event is fired after handler attachment
  12787. e.timeStamp >= attachedTimestamp_1 ||
  12788. // bail for environments that have buggy event.timeStamp implementations
  12789. // #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState
  12790. // #9681 QtWebEngine event.timeStamp is negative value
  12791. e.timeStamp <= 0 ||
  12792. // #9448 bail if event is fired in another document in a multi-page
  12793. // electron/nw.js app, since event.timeStamp will be using a different
  12794. // starting reference
  12795. e.target.ownerDocument !== document) {
  12796. return original_1.apply(this, arguments);
  12797. }
  12798. };
  12799. }
  12800. target.addEventListener(name, handler, supportsPassive ? { capture: capture, passive: passive } : capture);
  12801. }
  12802. function remove(name, handler, capture, _target) {
  12803. (_target || target).removeEventListener(name,
  12804. //@ts-expect-error
  12805. handler._wrapper || handler, capture);
  12806. }
  12807. function updateDOMListeners(oldVnode, vnode) {
  12808. if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
  12809. return;
  12810. }
  12811. var on = vnode.data.on || {};
  12812. var oldOn = oldVnode.data.on || {};
  12813. // vnode is empty when removing all listeners,
  12814. // and use old vnode dom element
  12815. target = vnode.elm || oldVnode.elm;
  12816. normalizeEvents(on);
  12817. updateListeners(on, oldOn, add, remove, createOnceHandler, vnode.context);
  12818. target = undefined;
  12819. }
  12820. var events = {
  12821. create: updateDOMListeners,
  12822. update: updateDOMListeners,
  12823. // @ts-expect-error emptyNode has actually data
  12824. destroy: function (vnode) { return updateDOMListeners(vnode, emptyNode); }
  12825. };
  12826. var svgContainer;
  12827. function updateDOMProps(oldVnode, vnode) {
  12828. if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
  12829. return;
  12830. }
  12831. var key, cur;
  12832. var elm = vnode.elm;
  12833. var oldProps = oldVnode.data.domProps || {};
  12834. var props = vnode.data.domProps || {};
  12835. // clone observed objects, as the user probably wants to mutate it
  12836. if (isDef(props.__ob__) || isTrue(props._v_attr_proxy)) {
  12837. props = vnode.data.domProps = extend({}, props);
  12838. }
  12839. for (key in oldProps) {
  12840. if (!(key in props)) {
  12841. elm[key] = '';
  12842. }
  12843. }
  12844. for (key in props) {
  12845. cur = props[key];
  12846. // ignore children if the node has textContent or innerHTML,
  12847. // as these will throw away existing DOM nodes and cause removal errors
  12848. // on subsequent patches (#3360)
  12849. if (key === 'textContent' || key === 'innerHTML') {
  12850. if (vnode.children)
  12851. vnode.children.length = 0;
  12852. if (cur === oldProps[key])
  12853. continue;
  12854. // #6601 work around Chrome version <= 55 bug where single textNode
  12855. // replaced by innerHTML/textContent retains its parentNode property
  12856. if (elm.childNodes.length === 1) {
  12857. elm.removeChild(elm.childNodes[0]);
  12858. }
  12859. }
  12860. if (key === 'value' && elm.tagName !== 'PROGRESS') {
  12861. // store value as _value as well since
  12862. // non-string values will be stringified
  12863. elm._value = cur;
  12864. // avoid resetting cursor position when value is the same
  12865. var strCur = isUndef(cur) ? '' : String(cur);
  12866. if (shouldUpdateValue(elm, strCur)) {
  12867. elm.value = strCur;
  12868. }
  12869. }
  12870. else if (key === 'innerHTML' &&
  12871. isSVG(elm.tagName) &&
  12872. isUndef(elm.innerHTML)) {
  12873. // IE doesn't support innerHTML for SVG elements
  12874. svgContainer = svgContainer || document.createElement('div');
  12875. svgContainer.innerHTML = "<svg>".concat(cur, "</svg>");
  12876. var svg = svgContainer.firstChild;
  12877. while (elm.firstChild) {
  12878. elm.removeChild(elm.firstChild);
  12879. }
  12880. while (svg.firstChild) {
  12881. elm.appendChild(svg.firstChild);
  12882. }
  12883. }
  12884. else if (
  12885. // skip the update if old and new VDOM state is the same.
  12886. // `value` is handled separately because the DOM value may be temporarily
  12887. // out of sync with VDOM state due to focus, composition and modifiers.
  12888. // This #4521 by skipping the unnecessary `checked` update.
  12889. cur !== oldProps[key]) {
  12890. // some property updates can throw
  12891. // e.g. `value` on <progress> w/ non-finite value
  12892. try {
  12893. elm[key] = cur;
  12894. }
  12895. catch (e) { }
  12896. }
  12897. }
  12898. }
  12899. function shouldUpdateValue(elm, checkVal) {
  12900. return (
  12901. //@ts-expect-error
  12902. !elm.composing &&
  12903. (elm.tagName === 'OPTION' ||
  12904. isNotInFocusAndDirty(elm, checkVal) ||
  12905. isDirtyWithModifiers(elm, checkVal)));
  12906. }
  12907. function isNotInFocusAndDirty(elm, checkVal) {
  12908. // return true when textbox (.number and .trim) loses focus and its value is
  12909. // not equal to the updated value
  12910. var notInFocus = true;
  12911. // #6157
  12912. // work around IE bug when accessing document.activeElement in an iframe
  12913. try {
  12914. notInFocus = document.activeElement !== elm;
  12915. }
  12916. catch (e) { }
  12917. return notInFocus && elm.value !== checkVal;
  12918. }
  12919. function isDirtyWithModifiers(elm, newVal) {
  12920. var value = elm.value;
  12921. var modifiers = elm._vModifiers; // injected by v-model runtime
  12922. if (isDef(modifiers)) {
  12923. if (modifiers.number) {
  12924. return toNumber(value) !== toNumber(newVal);
  12925. }
  12926. if (modifiers.trim) {
  12927. return value.trim() !== newVal.trim();
  12928. }
  12929. }
  12930. return value !== newVal;
  12931. }
  12932. var domProps = {
  12933. create: updateDOMProps,
  12934. update: updateDOMProps
  12935. };
  12936. var parseStyleText = cached(function (cssText) {
  12937. var res = {};
  12938. var listDelimiter = /;(?![^(]*\))/g;
  12939. var propertyDelimiter = /:(.+)/;
  12940. cssText.split(listDelimiter).forEach(function (item) {
  12941. if (item) {
  12942. var tmp = item.split(propertyDelimiter);
  12943. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  12944. }
  12945. });
  12946. return res;
  12947. });
  12948. // merge static and dynamic style data on the same vnode
  12949. function normalizeStyleData(data) {
  12950. var style = normalizeStyleBinding(data.style);
  12951. // static style is pre-processed into an object during compilation
  12952. // and is always a fresh object, so it's safe to merge into it
  12953. return data.staticStyle ? extend(data.staticStyle, style) : style;
  12954. }
  12955. // normalize possible array / string values into Object
  12956. function normalizeStyleBinding(bindingStyle) {
  12957. if (Array.isArray(bindingStyle)) {
  12958. return toObject(bindingStyle);
  12959. }
  12960. if (typeof bindingStyle === 'string') {
  12961. return parseStyleText(bindingStyle);
  12962. }
  12963. return bindingStyle;
  12964. }
  12965. /**
  12966. * parent component style should be after child's
  12967. * so that parent component's style could override it
  12968. */
  12969. function getStyle(vnode, checkChild) {
  12970. var res = {};
  12971. var styleData;
  12972. if (checkChild) {
  12973. var childNode = vnode;
  12974. while (childNode.componentInstance) {
  12975. childNode = childNode.componentInstance._vnode;
  12976. if (childNode &&
  12977. childNode.data &&
  12978. (styleData = normalizeStyleData(childNode.data))) {
  12979. extend(res, styleData);
  12980. }
  12981. }
  12982. }
  12983. if ((styleData = normalizeStyleData(vnode.data))) {
  12984. extend(res, styleData);
  12985. }
  12986. var parentNode = vnode;
  12987. // @ts-expect-error parentNode.parent not VNodeWithData
  12988. while ((parentNode = parentNode.parent)) {
  12989. if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
  12990. extend(res, styleData);
  12991. }
  12992. }
  12993. return res;
  12994. }
  12995. var cssVarRE = /^--/;
  12996. var importantRE = /\s*!important$/;
  12997. var setProp = function (el, name, val) {
  12998. /* istanbul ignore if */
  12999. if (cssVarRE.test(name)) {
  13000. el.style.setProperty(name, val);
  13001. }
  13002. else if (importantRE.test(val)) {
  13003. el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');
  13004. }
  13005. else {
  13006. var normalizedName = normalize(name);
  13007. if (Array.isArray(val)) {
  13008. // Support values array created by autoprefixer, e.g.
  13009. // {display: ["-webkit-box", "-ms-flexbox", "flex"]}
  13010. // Set them one by one, and the browser will only set those it can recognize
  13011. for (var i = 0, len = val.length; i < len; i++) {
  13012. el.style[normalizedName] = val[i];
  13013. }
  13014. }
  13015. else {
  13016. el.style[normalizedName] = val;
  13017. }
  13018. }
  13019. };
  13020. var vendorNames = ['Webkit', 'Moz', 'ms'];
  13021. var emptyStyle;
  13022. var normalize = cached(function (prop) {
  13023. emptyStyle = emptyStyle || document.createElement('div').style;
  13024. prop = camelize(prop);
  13025. if (prop !== 'filter' && prop in emptyStyle) {
  13026. return prop;
  13027. }
  13028. var capName = prop.charAt(0).toUpperCase() + prop.slice(1);
  13029. for (var i = 0; i < vendorNames.length; i++) {
  13030. var name_1 = vendorNames[i] + capName;
  13031. if (name_1 in emptyStyle) {
  13032. return name_1;
  13033. }
  13034. }
  13035. });
  13036. function updateStyle(oldVnode, vnode) {
  13037. var data = vnode.data;
  13038. var oldData = oldVnode.data;
  13039. if (isUndef(data.staticStyle) &&
  13040. isUndef(data.style) &&
  13041. isUndef(oldData.staticStyle) &&
  13042. isUndef(oldData.style)) {
  13043. return;
  13044. }
  13045. var cur, name;
  13046. var el = vnode.elm;
  13047. var oldStaticStyle = oldData.staticStyle;
  13048. var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};
  13049. // if static style exists, stylebinding already merged into it when doing normalizeStyleData
  13050. var oldStyle = oldStaticStyle || oldStyleBinding;
  13051. var style = normalizeStyleBinding(vnode.data.style) || {};
  13052. // store normalized style under a different key for next diff
  13053. // make sure to clone it if it's reactive, since the user likely wants
  13054. // to mutate it.
  13055. vnode.data.normalizedStyle = isDef(style.__ob__) ? extend({}, style) : style;
  13056. var newStyle = getStyle(vnode, true);
  13057. for (name in oldStyle) {
  13058. if (isUndef(newStyle[name])) {
  13059. setProp(el, name, '');
  13060. }
  13061. }
  13062. for (name in newStyle) {
  13063. cur = newStyle[name];
  13064. // ie9 setting to null has no effect, must use empty string
  13065. setProp(el, name, cur == null ? '' : cur);
  13066. }
  13067. }
  13068. var style = {
  13069. create: updateStyle,
  13070. update: updateStyle
  13071. };
  13072. var whitespaceRE = /\s+/;
  13073. /**
  13074. * Add class with compatibility for SVG since classList is not supported on
  13075. * SVG elements in IE
  13076. */
  13077. function addClass(el, cls) {
  13078. /* istanbul ignore if */
  13079. if (!cls || !(cls = cls.trim())) {
  13080. return;
  13081. }
  13082. /* istanbul ignore else */
  13083. if (el.classList) {
  13084. if (cls.indexOf(' ') > -1) {
  13085. cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); });
  13086. }
  13087. else {
  13088. el.classList.add(cls);
  13089. }
  13090. }
  13091. else {
  13092. var cur = " ".concat(el.getAttribute('class') || '', " ");
  13093. if (cur.indexOf(' ' + cls + ' ') < 0) {
  13094. el.setAttribute('class', (cur + cls).trim());
  13095. }
  13096. }
  13097. }
  13098. /**
  13099. * Remove class with compatibility for SVG since classList is not supported on
  13100. * SVG elements in IE
  13101. */
  13102. function removeClass(el, cls) {
  13103. /* istanbul ignore if */
  13104. if (!cls || !(cls = cls.trim())) {
  13105. return;
  13106. }
  13107. /* istanbul ignore else */
  13108. if (el.classList) {
  13109. if (cls.indexOf(' ') > -1) {
  13110. cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); });
  13111. }
  13112. else {
  13113. el.classList.remove(cls);
  13114. }
  13115. if (!el.classList.length) {
  13116. el.removeAttribute('class');
  13117. }
  13118. }
  13119. else {
  13120. var cur = " ".concat(el.getAttribute('class') || '', " ");
  13121. var tar = ' ' + cls + ' ';
  13122. while (cur.indexOf(tar) >= 0) {
  13123. cur = cur.replace(tar, ' ');
  13124. }
  13125. cur = cur.trim();
  13126. if (cur) {
  13127. el.setAttribute('class', cur);
  13128. }
  13129. else {
  13130. el.removeAttribute('class');
  13131. }
  13132. }
  13133. }
  13134. function resolveTransition(def) {
  13135. if (!def) {
  13136. return;
  13137. }
  13138. /* istanbul ignore else */
  13139. if (typeof def === 'object') {
  13140. var res = {};
  13141. if (def.css !== false) {
  13142. extend(res, autoCssTransition(def.name || 'v'));
  13143. }
  13144. extend(res, def);
  13145. return res;
  13146. }
  13147. else if (typeof def === 'string') {
  13148. return autoCssTransition(def);
  13149. }
  13150. }
  13151. var autoCssTransition = cached(function (name) {
  13152. return {
  13153. enterClass: "".concat(name, "-enter"),
  13154. enterToClass: "".concat(name, "-enter-to"),
  13155. enterActiveClass: "".concat(name, "-enter-active"),
  13156. leaveClass: "".concat(name, "-leave"),
  13157. leaveToClass: "".concat(name, "-leave-to"),
  13158. leaveActiveClass: "".concat(name, "-leave-active")
  13159. };
  13160. });
  13161. var hasTransition = inBrowser && !isIE9;
  13162. var TRANSITION = 'transition';
  13163. var ANIMATION = 'animation';
  13164. // Transition property/event sniffing
  13165. var transitionProp = 'transition';
  13166. var transitionEndEvent = 'transitionend';
  13167. var animationProp = 'animation';
  13168. var animationEndEvent = 'animationend';
  13169. if (hasTransition) {
  13170. /* istanbul ignore if */
  13171. if (window.ontransitionend === undefined &&
  13172. window.onwebkittransitionend !== undefined) {
  13173. transitionProp = 'WebkitTransition';
  13174. transitionEndEvent = 'webkitTransitionEnd';
  13175. }
  13176. if (window.onanimationend === undefined &&
  13177. window.onwebkitanimationend !== undefined) {
  13178. animationProp = 'WebkitAnimation';
  13179. animationEndEvent = 'webkitAnimationEnd';
  13180. }
  13181. }
  13182. // binding to window is necessary to make hot reload work in IE in strict mode
  13183. var raf = inBrowser
  13184. ? window.requestAnimationFrame
  13185. ? window.requestAnimationFrame.bind(window)
  13186. : setTimeout
  13187. : /* istanbul ignore next */ function (/* istanbul ignore next */ fn) { return fn(); };
  13188. function nextFrame(fn) {
  13189. raf(function () {
  13190. // @ts-expect-error
  13191. raf(fn);
  13192. });
  13193. }
  13194. function addTransitionClass(el, cls) {
  13195. var transitionClasses = el._transitionClasses || (el._transitionClasses = []);
  13196. if (transitionClasses.indexOf(cls) < 0) {
  13197. transitionClasses.push(cls);
  13198. addClass(el, cls);
  13199. }
  13200. }
  13201. function removeTransitionClass(el, cls) {
  13202. if (el._transitionClasses) {
  13203. remove$2(el._transitionClasses, cls);
  13204. }
  13205. removeClass(el, cls);
  13206. }
  13207. function whenTransitionEnds(el, expectedType, cb) {
  13208. var _a = getTransitionInfo(el, expectedType), type = _a.type, timeout = _a.timeout, propCount = _a.propCount;
  13209. if (!type)
  13210. return cb();
  13211. var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
  13212. var ended = 0;
  13213. var end = function () {
  13214. el.removeEventListener(event, onEnd);
  13215. cb();
  13216. };
  13217. var onEnd = function (e) {
  13218. if (e.target === el) {
  13219. if (++ended >= propCount) {
  13220. end();
  13221. }
  13222. }
  13223. };
  13224. setTimeout(function () {
  13225. if (ended < propCount) {
  13226. end();
  13227. }
  13228. }, timeout + 1);
  13229. el.addEventListener(event, onEnd);
  13230. }
  13231. var transformRE = /\b(transform|all)(,|$)/;
  13232. function getTransitionInfo(el, expectedType) {
  13233. var styles = window.getComputedStyle(el);
  13234. // JSDOM may return undefined for transition properties
  13235. var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', ');
  13236. var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', ');
  13237. var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  13238. var animationDelays = (styles[animationProp + 'Delay'] || '').split(', ');
  13239. var animationDurations = (styles[animationProp + 'Duration'] || '').split(', ');
  13240. var animationTimeout = getTimeout(animationDelays, animationDurations);
  13241. var type;
  13242. var timeout = 0;
  13243. var propCount = 0;
  13244. /* istanbul ignore if */
  13245. if (expectedType === TRANSITION) {
  13246. if (transitionTimeout > 0) {
  13247. type = TRANSITION;
  13248. timeout = transitionTimeout;
  13249. propCount = transitionDurations.length;
  13250. }
  13251. }
  13252. else if (expectedType === ANIMATION) {
  13253. if (animationTimeout > 0) {
  13254. type = ANIMATION;
  13255. timeout = animationTimeout;
  13256. propCount = animationDurations.length;
  13257. }
  13258. }
  13259. else {
  13260. timeout = Math.max(transitionTimeout, animationTimeout);
  13261. type =
  13262. timeout > 0
  13263. ? transitionTimeout > animationTimeout
  13264. ? TRANSITION
  13265. : ANIMATION
  13266. : null;
  13267. propCount = type
  13268. ? type === TRANSITION
  13269. ? transitionDurations.length
  13270. : animationDurations.length
  13271. : 0;
  13272. }
  13273. var hasTransform = type === TRANSITION && transformRE.test(styles[transitionProp + 'Property']);
  13274. return {
  13275. type: type,
  13276. timeout: timeout,
  13277. propCount: propCount,
  13278. hasTransform: hasTransform
  13279. };
  13280. }
  13281. function getTimeout(delays, durations) {
  13282. /* istanbul ignore next */
  13283. while (delays.length < durations.length) {
  13284. delays = delays.concat(delays);
  13285. }
  13286. return Math.max.apply(null, durations.map(function (d, i) {
  13287. return toMs(d) + toMs(delays[i]);
  13288. }));
  13289. }
  13290. // Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers
  13291. // in a locale-dependent way, using a comma instead of a dot.
  13292. // If comma is not replaced with a dot, the input will be rounded down (i.e. acting
  13293. // as a floor function) causing unexpected behaviors
  13294. function toMs(s) {
  13295. return Number(s.slice(0, -1).replace(',', '.')) * 1000;
  13296. }
  13297. function enter(vnode, toggleDisplay) {
  13298. var el = vnode.elm;
  13299. // call leave callback now
  13300. if (isDef(el._leaveCb)) {
  13301. el._leaveCb.cancelled = true;
  13302. el._leaveCb();
  13303. }
  13304. var data = resolveTransition(vnode.data.transition);
  13305. if (isUndef(data)) {
  13306. return;
  13307. }
  13308. /* istanbul ignore if */
  13309. if (isDef(el._enterCb) || el.nodeType !== 1) {
  13310. return;
  13311. }
  13312. var css = data.css, type = data.type, enterClass = data.enterClass, enterToClass = data.enterToClass, enterActiveClass = data.enterActiveClass, appearClass = data.appearClass, appearToClass = data.appearToClass, appearActiveClass = data.appearActiveClass, beforeEnter = data.beforeEnter, enter = data.enter, afterEnter = data.afterEnter, enterCancelled = data.enterCancelled, beforeAppear = data.beforeAppear, appear = data.appear, afterAppear = data.afterAppear, appearCancelled = data.appearCancelled, duration = data.duration;
  13313. // activeInstance will always be the <transition> component managing this
  13314. // transition. One edge case to check is when the <transition> is placed
  13315. // as the root node of a child component. In that case we need to check
  13316. // <transition>'s parent for appear check.
  13317. var context = activeInstance;
  13318. var transitionNode = activeInstance.$vnode;
  13319. while (transitionNode && transitionNode.parent) {
  13320. context = transitionNode.context;
  13321. transitionNode = transitionNode.parent;
  13322. }
  13323. var isAppear = !context._isMounted || !vnode.isRootInsert;
  13324. if (isAppear && !appear && appear !== '') {
  13325. return;
  13326. }
  13327. var startClass = isAppear && appearClass ? appearClass : enterClass;
  13328. var activeClass = isAppear && appearActiveClass ? appearActiveClass : enterActiveClass;
  13329. var toClass = isAppear && appearToClass ? appearToClass : enterToClass;
  13330. var beforeEnterHook = isAppear ? beforeAppear || beforeEnter : beforeEnter;
  13331. var enterHook = isAppear ? (isFunction(appear) ? appear : enter) : enter;
  13332. var afterEnterHook = isAppear ? afterAppear || afterEnter : afterEnter;
  13333. var enterCancelledHook = isAppear
  13334. ? appearCancelled || enterCancelled
  13335. : enterCancelled;
  13336. var explicitEnterDuration = toNumber(isObject(duration) ? duration.enter : duration);
  13337. if (false) {}
  13338. var expectsCSS = css !== false && !isIE9;
  13339. var userWantsControl = getHookArgumentsLength(enterHook);
  13340. var cb = (el._enterCb = once(function () {
  13341. if (expectsCSS) {
  13342. removeTransitionClass(el, toClass);
  13343. removeTransitionClass(el, activeClass);
  13344. }
  13345. // @ts-expect-error
  13346. if (cb.cancelled) {
  13347. if (expectsCSS) {
  13348. removeTransitionClass(el, startClass);
  13349. }
  13350. enterCancelledHook && enterCancelledHook(el);
  13351. }
  13352. else {
  13353. afterEnterHook && afterEnterHook(el);
  13354. }
  13355. el._enterCb = null;
  13356. }));
  13357. if (!vnode.data.show) {
  13358. // remove pending leave element on enter by injecting an insert hook
  13359. mergeVNodeHook(vnode, 'insert', function () {
  13360. var parent = el.parentNode;
  13361. var pendingNode = parent && parent._pending && parent._pending[vnode.key];
  13362. if (pendingNode &&
  13363. pendingNode.tag === vnode.tag &&
  13364. pendingNode.elm._leaveCb) {
  13365. pendingNode.elm._leaveCb();
  13366. }
  13367. enterHook && enterHook(el, cb);
  13368. });
  13369. }
  13370. // start enter transition
  13371. beforeEnterHook && beforeEnterHook(el);
  13372. if (expectsCSS) {
  13373. addTransitionClass(el, startClass);
  13374. addTransitionClass(el, activeClass);
  13375. nextFrame(function () {
  13376. removeTransitionClass(el, startClass);
  13377. // @ts-expect-error
  13378. if (!cb.cancelled) {
  13379. addTransitionClass(el, toClass);
  13380. if (!userWantsControl) {
  13381. if (isValidDuration(explicitEnterDuration)) {
  13382. setTimeout(cb, explicitEnterDuration);
  13383. }
  13384. else {
  13385. whenTransitionEnds(el, type, cb);
  13386. }
  13387. }
  13388. }
  13389. });
  13390. }
  13391. if (vnode.data.show) {
  13392. toggleDisplay && toggleDisplay();
  13393. enterHook && enterHook(el, cb);
  13394. }
  13395. if (!expectsCSS && !userWantsControl) {
  13396. cb();
  13397. }
  13398. }
  13399. function leave(vnode, rm) {
  13400. var el = vnode.elm;
  13401. // call enter callback now
  13402. if (isDef(el._enterCb)) {
  13403. el._enterCb.cancelled = true;
  13404. el._enterCb();
  13405. }
  13406. var data = resolveTransition(vnode.data.transition);
  13407. if (isUndef(data) || el.nodeType !== 1) {
  13408. return rm();
  13409. }
  13410. /* istanbul ignore if */
  13411. if (isDef(el._leaveCb)) {
  13412. return;
  13413. }
  13414. var css = data.css, type = data.type, leaveClass = data.leaveClass, leaveToClass = data.leaveToClass, leaveActiveClass = data.leaveActiveClass, beforeLeave = data.beforeLeave, leave = data.leave, afterLeave = data.afterLeave, leaveCancelled = data.leaveCancelled, delayLeave = data.delayLeave, duration = data.duration;
  13415. var expectsCSS = css !== false && !isIE9;
  13416. var userWantsControl = getHookArgumentsLength(leave);
  13417. var explicitLeaveDuration = toNumber(isObject(duration) ? duration.leave : duration);
  13418. if (false) {}
  13419. var cb = (el._leaveCb = once(function () {
  13420. if (el.parentNode && el.parentNode._pending) {
  13421. el.parentNode._pending[vnode.key] = null;
  13422. }
  13423. if (expectsCSS) {
  13424. removeTransitionClass(el, leaveToClass);
  13425. removeTransitionClass(el, leaveActiveClass);
  13426. }
  13427. // @ts-expect-error
  13428. if (cb.cancelled) {
  13429. if (expectsCSS) {
  13430. removeTransitionClass(el, leaveClass);
  13431. }
  13432. leaveCancelled && leaveCancelled(el);
  13433. }
  13434. else {
  13435. rm();
  13436. afterLeave && afterLeave(el);
  13437. }
  13438. el._leaveCb = null;
  13439. }));
  13440. if (delayLeave) {
  13441. delayLeave(performLeave);
  13442. }
  13443. else {
  13444. performLeave();
  13445. }
  13446. function performLeave() {
  13447. // the delayed leave may have already been cancelled
  13448. // @ts-expect-error
  13449. if (cb.cancelled) {
  13450. return;
  13451. }
  13452. // record leaving element
  13453. if (!vnode.data.show && el.parentNode) {
  13454. (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] =
  13455. vnode;
  13456. }
  13457. beforeLeave && beforeLeave(el);
  13458. if (expectsCSS) {
  13459. addTransitionClass(el, leaveClass);
  13460. addTransitionClass(el, leaveActiveClass);
  13461. nextFrame(function () {
  13462. removeTransitionClass(el, leaveClass);
  13463. // @ts-expect-error
  13464. if (!cb.cancelled) {
  13465. addTransitionClass(el, leaveToClass);
  13466. if (!userWantsControl) {
  13467. if (isValidDuration(explicitLeaveDuration)) {
  13468. setTimeout(cb, explicitLeaveDuration);
  13469. }
  13470. else {
  13471. whenTransitionEnds(el, type, cb);
  13472. }
  13473. }
  13474. }
  13475. });
  13476. }
  13477. leave && leave(el, cb);
  13478. if (!expectsCSS && !userWantsControl) {
  13479. cb();
  13480. }
  13481. }
  13482. }
  13483. // only used in dev mode
  13484. function checkDuration(val, name, vnode) {
  13485. if (typeof val !== 'number') {
  13486. warn("<transition> explicit ".concat(name, " duration is not a valid number - ") +
  13487. "got ".concat(JSON.stringify(val), "."), vnode.context);
  13488. }
  13489. else if (isNaN(val)) {
  13490. warn("<transition> explicit ".concat(name, " duration is NaN - ") +
  13491. 'the duration expression might be incorrect.', vnode.context);
  13492. }
  13493. }
  13494. function isValidDuration(val) {
  13495. return typeof val === 'number' && !isNaN(val);
  13496. }
  13497. /**
  13498. * Normalize a transition hook's argument length. The hook may be:
  13499. * - a merged hook (invoker) with the original in .fns
  13500. * - a wrapped component method (check ._length)
  13501. * - a plain function (.length)
  13502. */
  13503. function getHookArgumentsLength(fn) {
  13504. if (isUndef(fn)) {
  13505. return false;
  13506. }
  13507. // @ts-expect-error
  13508. var invokerFns = fn.fns;
  13509. if (isDef(invokerFns)) {
  13510. // invoker
  13511. return getHookArgumentsLength(Array.isArray(invokerFns) ? invokerFns[0] : invokerFns);
  13512. }
  13513. else {
  13514. // @ts-expect-error
  13515. return (fn._length || fn.length) > 1;
  13516. }
  13517. }
  13518. function _enter(_, vnode) {
  13519. if (vnode.data.show !== true) {
  13520. enter(vnode);
  13521. }
  13522. }
  13523. var transition = inBrowser
  13524. ? {
  13525. create: _enter,
  13526. activate: _enter,
  13527. remove: function (vnode, rm) {
  13528. /* istanbul ignore else */
  13529. if (vnode.data.show !== true) {
  13530. // @ts-expect-error
  13531. leave(vnode, rm);
  13532. }
  13533. else {
  13534. rm();
  13535. }
  13536. }
  13537. }
  13538. : {};
  13539. var platformModules = [attrs, klass, events, domProps, style, transition];
  13540. // the directive module should be applied last, after all
  13541. // built-in modules have been applied.
  13542. var modules = platformModules.concat(baseModules);
  13543. var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });
  13544. /**
  13545. * Not type checking this file because flow doesn't like attaching
  13546. * properties to Elements.
  13547. */
  13548. /* istanbul ignore if */
  13549. if (isIE9) {
  13550. // http://www.matts411.com/post/internet-explorer-9-oninput/
  13551. document.addEventListener('selectionchange', function () {
  13552. var el = document.activeElement;
  13553. // @ts-expect-error
  13554. if (el && el.vmodel) {
  13555. trigger(el, 'input');
  13556. }
  13557. });
  13558. }
  13559. var directive = {
  13560. inserted: function (el, binding, vnode, oldVnode) {
  13561. if (vnode.tag === 'select') {
  13562. // #6903
  13563. if (oldVnode.elm && !oldVnode.elm._vOptions) {
  13564. mergeVNodeHook(vnode, 'postpatch', function () {
  13565. directive.componentUpdated(el, binding, vnode);
  13566. });
  13567. }
  13568. else {
  13569. setSelected(el, binding, vnode.context);
  13570. }
  13571. el._vOptions = [].map.call(el.options, getValue);
  13572. }
  13573. else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
  13574. el._vModifiers = binding.modifiers;
  13575. if (!binding.modifiers.lazy) {
  13576. el.addEventListener('compositionstart', onCompositionStart);
  13577. el.addEventListener('compositionend', onCompositionEnd);
  13578. // Safari < 10.2 & UIWebView doesn't fire compositionend when
  13579. // switching focus before confirming composition choice
  13580. // this also fixes the issue where some browsers e.g. iOS Chrome
  13581. // fires "change" instead of "input" on autocomplete.
  13582. el.addEventListener('change', onCompositionEnd);
  13583. /* istanbul ignore if */
  13584. if (isIE9) {
  13585. el.vmodel = true;
  13586. }
  13587. }
  13588. }
  13589. },
  13590. componentUpdated: function (el, binding, vnode) {
  13591. if (vnode.tag === 'select') {
  13592. setSelected(el, binding, vnode.context);
  13593. // in case the options rendered by v-for have changed,
  13594. // it's possible that the value is out-of-sync with the rendered options.
  13595. // detect such cases and filter out values that no longer has a matching
  13596. // option in the DOM.
  13597. var prevOptions_1 = el._vOptions;
  13598. var curOptions_1 = (el._vOptions = [].map.call(el.options, getValue));
  13599. if (curOptions_1.some(function (o, i) { return !looseEqual(o, prevOptions_1[i]); })) {
  13600. // trigger change event if
  13601. // no matching option found for at least one value
  13602. var needReset = el.multiple
  13603. ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions_1); })
  13604. : binding.value !== binding.oldValue &&
  13605. hasNoMatchingOption(binding.value, curOptions_1);
  13606. if (needReset) {
  13607. trigger(el, 'change');
  13608. }
  13609. }
  13610. }
  13611. }
  13612. };
  13613. function setSelected(el, binding, vm) {
  13614. actuallySetSelected(el, binding, vm);
  13615. /* istanbul ignore if */
  13616. if (isIE || isEdge) {
  13617. setTimeout(function () {
  13618. actuallySetSelected(el, binding, vm);
  13619. }, 0);
  13620. }
  13621. }
  13622. function actuallySetSelected(el, binding, vm) {
  13623. var value = binding.value;
  13624. var isMultiple = el.multiple;
  13625. if (isMultiple && !Array.isArray(value)) {
  13626. false &&
  13627. false;
  13628. return;
  13629. }
  13630. var selected, option;
  13631. for (var i = 0, l = el.options.length; i < l; i++) {
  13632. option = el.options[i];
  13633. if (isMultiple) {
  13634. selected = looseIndexOf(value, getValue(option)) > -1;
  13635. if (option.selected !== selected) {
  13636. option.selected = selected;
  13637. }
  13638. }
  13639. else {
  13640. if (looseEqual(getValue(option), value)) {
  13641. if (el.selectedIndex !== i) {
  13642. el.selectedIndex = i;
  13643. }
  13644. return;
  13645. }
  13646. }
  13647. }
  13648. if (!isMultiple) {
  13649. el.selectedIndex = -1;
  13650. }
  13651. }
  13652. function hasNoMatchingOption(value, options) {
  13653. return options.every(function (o) { return !looseEqual(o, value); });
  13654. }
  13655. function getValue(option) {
  13656. return '_value' in option ? option._value : option.value;
  13657. }
  13658. function onCompositionStart(e) {
  13659. e.target.composing = true;
  13660. }
  13661. function onCompositionEnd(e) {
  13662. // prevent triggering an input event for no reason
  13663. if (!e.target.composing)
  13664. return;
  13665. e.target.composing = false;
  13666. trigger(e.target, 'input');
  13667. }
  13668. function trigger(el, type) {
  13669. var e = document.createEvent('HTMLEvents');
  13670. e.initEvent(type, true, true);
  13671. el.dispatchEvent(e);
  13672. }
  13673. // recursively search for possible transition defined inside the component root
  13674. function locateNode(vnode) {
  13675. // @ts-expect-error
  13676. return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
  13677. ? locateNode(vnode.componentInstance._vnode)
  13678. : vnode;
  13679. }
  13680. var show = {
  13681. bind: function (el, _a, vnode) {
  13682. var value = _a.value;
  13683. vnode = locateNode(vnode);
  13684. var transition = vnode.data && vnode.data.transition;
  13685. var originalDisplay = (el.__vOriginalDisplay =
  13686. el.style.display === 'none' ? '' : el.style.display);
  13687. if (value && transition) {
  13688. vnode.data.show = true;
  13689. enter(vnode, function () {
  13690. el.style.display = originalDisplay;
  13691. });
  13692. }
  13693. else {
  13694. el.style.display = value ? originalDisplay : 'none';
  13695. }
  13696. },
  13697. update: function (el, _a, vnode) {
  13698. var value = _a.value, oldValue = _a.oldValue;
  13699. /* istanbul ignore if */
  13700. if (!value === !oldValue)
  13701. return;
  13702. vnode = locateNode(vnode);
  13703. var transition = vnode.data && vnode.data.transition;
  13704. if (transition) {
  13705. vnode.data.show = true;
  13706. if (value) {
  13707. enter(vnode, function () {
  13708. el.style.display = el.__vOriginalDisplay;
  13709. });
  13710. }
  13711. else {
  13712. leave(vnode, function () {
  13713. el.style.display = 'none';
  13714. });
  13715. }
  13716. }
  13717. else {
  13718. el.style.display = value ? el.__vOriginalDisplay : 'none';
  13719. }
  13720. },
  13721. unbind: function (el, binding, vnode, oldVnode, isDestroy) {
  13722. if (!isDestroy) {
  13723. el.style.display = el.__vOriginalDisplay;
  13724. }
  13725. }
  13726. };
  13727. var platformDirectives = {
  13728. model: directive,
  13729. show: show
  13730. };
  13731. // Provides transition support for a single element/component.
  13732. var transitionProps = {
  13733. name: String,
  13734. appear: Boolean,
  13735. css: Boolean,
  13736. mode: String,
  13737. type: String,
  13738. enterClass: String,
  13739. leaveClass: String,
  13740. enterToClass: String,
  13741. leaveToClass: String,
  13742. enterActiveClass: String,
  13743. leaveActiveClass: String,
  13744. appearClass: String,
  13745. appearActiveClass: String,
  13746. appearToClass: String,
  13747. duration: [Number, String, Object]
  13748. };
  13749. // in case the child is also an abstract component, e.g. <keep-alive>
  13750. // we want to recursively retrieve the real component to be rendered
  13751. function getRealChild(vnode) {
  13752. var compOptions = vnode && vnode.componentOptions;
  13753. if (compOptions && compOptions.Ctor.options.abstract) {
  13754. return getRealChild(getFirstComponentChild(compOptions.children));
  13755. }
  13756. else {
  13757. return vnode;
  13758. }
  13759. }
  13760. function extractTransitionData(comp) {
  13761. var data = {};
  13762. var options = comp.$options;
  13763. // props
  13764. for (var key in options.propsData) {
  13765. data[key] = comp[key];
  13766. }
  13767. // events.
  13768. // extract listeners and pass them directly to the transition methods
  13769. var listeners = options._parentListeners;
  13770. for (var key in listeners) {
  13771. data[camelize(key)] = listeners[key];
  13772. }
  13773. return data;
  13774. }
  13775. function placeholder(h, rawChild) {
  13776. // @ts-expect-error
  13777. if (/\d-keep-alive$/.test(rawChild.tag)) {
  13778. return h('keep-alive', {
  13779. props: rawChild.componentOptions.propsData
  13780. });
  13781. }
  13782. }
  13783. function hasParentTransition(vnode) {
  13784. while ((vnode = vnode.parent)) {
  13785. if (vnode.data.transition) {
  13786. return true;
  13787. }
  13788. }
  13789. }
  13790. function isSameChild(child, oldChild) {
  13791. return oldChild.key === child.key && oldChild.tag === child.tag;
  13792. }
  13793. var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); };
  13794. var isVShowDirective = function (d) { return d.name === 'show'; };
  13795. var Transition = {
  13796. name: 'transition',
  13797. props: transitionProps,
  13798. abstract: true,
  13799. render: function (h) {
  13800. var _this = this;
  13801. var children = this.$slots.default;
  13802. if (!children) {
  13803. return;
  13804. }
  13805. // filter out text nodes (possible whitespaces)
  13806. children = children.filter(isNotTextNode);
  13807. /* istanbul ignore if */
  13808. if (!children.length) {
  13809. return;
  13810. }
  13811. // warn multiple elements
  13812. if (false) {}
  13813. var mode = this.mode;
  13814. // warn invalid mode
  13815. if (false) {}
  13816. var rawChild = children[0];
  13817. // if this is a component root node and the component's
  13818. // parent container node also has transition, skip.
  13819. if (hasParentTransition(this.$vnode)) {
  13820. return rawChild;
  13821. }
  13822. // apply transition data to child
  13823. // use getRealChild() to ignore abstract components e.g. keep-alive
  13824. var child = getRealChild(rawChild);
  13825. /* istanbul ignore if */
  13826. if (!child) {
  13827. return rawChild;
  13828. }
  13829. if (this._leaving) {
  13830. return placeholder(h, rawChild);
  13831. }
  13832. // ensure a key that is unique to the vnode type and to this transition
  13833. // component instance. This key will be used to remove pending leaving nodes
  13834. // during entering.
  13835. var id = "__transition-".concat(this._uid, "-");
  13836. child.key =
  13837. child.key == null
  13838. ? child.isComment
  13839. ? id + 'comment'
  13840. : id + child.tag
  13841. : isPrimitive(child.key)
  13842. ? String(child.key).indexOf(id) === 0
  13843. ? child.key
  13844. : id + child.key
  13845. : child.key;
  13846. var data = ((child.data || (child.data = {})).transition =
  13847. extractTransitionData(this));
  13848. var oldRawChild = this._vnode;
  13849. var oldChild = getRealChild(oldRawChild);
  13850. // mark v-show
  13851. // so that the transition module can hand over the control to the directive
  13852. if (child.data.directives && child.data.directives.some(isVShowDirective)) {
  13853. child.data.show = true;
  13854. }
  13855. if (oldChild &&
  13856. oldChild.data &&
  13857. !isSameChild(child, oldChild) &&
  13858. !isAsyncPlaceholder(oldChild) &&
  13859. // #6687 component root is a comment node
  13860. !(oldChild.componentInstance &&
  13861. oldChild.componentInstance._vnode.isComment)) {
  13862. // replace old child transition data with fresh one
  13863. // important for dynamic transitions!
  13864. var oldData = (oldChild.data.transition = extend({}, data));
  13865. // handle transition mode
  13866. if (mode === 'out-in') {
  13867. // return placeholder node and queue update when leave finishes
  13868. this._leaving = true;
  13869. mergeVNodeHook(oldData, 'afterLeave', function () {
  13870. _this._leaving = false;
  13871. _this.$forceUpdate();
  13872. });
  13873. return placeholder(h, rawChild);
  13874. }
  13875. else if (mode === 'in-out') {
  13876. if (isAsyncPlaceholder(child)) {
  13877. return oldRawChild;
  13878. }
  13879. var delayedLeave_1;
  13880. var performLeave = function () {
  13881. delayedLeave_1();
  13882. };
  13883. mergeVNodeHook(data, 'afterEnter', performLeave);
  13884. mergeVNodeHook(data, 'enterCancelled', performLeave);
  13885. mergeVNodeHook(oldData, 'delayLeave', function (leave) {
  13886. delayedLeave_1 = leave;
  13887. });
  13888. }
  13889. }
  13890. return rawChild;
  13891. }
  13892. };
  13893. // Provides transition support for list items.
  13894. var props = extend({
  13895. tag: String,
  13896. moveClass: String
  13897. }, transitionProps);
  13898. delete props.mode;
  13899. var TransitionGroup = {
  13900. props: props,
  13901. beforeMount: function () {
  13902. var _this = this;
  13903. var update = this._update;
  13904. this._update = function (vnode, hydrating) {
  13905. var restoreActiveInstance = setActiveInstance(_this);
  13906. // force removing pass
  13907. _this.__patch__(_this._vnode, _this.kept, false, // hydrating
  13908. true // removeOnly (!important, avoids unnecessary moves)
  13909. );
  13910. _this._vnode = _this.kept;
  13911. restoreActiveInstance();
  13912. update.call(_this, vnode, hydrating);
  13913. };
  13914. },
  13915. render: function (h) {
  13916. var tag = this.tag || this.$vnode.data.tag || 'span';
  13917. var map = Object.create(null);
  13918. var prevChildren = (this.prevChildren = this.children);
  13919. var rawChildren = this.$slots.default || [];
  13920. var children = (this.children = []);
  13921. var transitionData = extractTransitionData(this);
  13922. for (var i = 0; i < rawChildren.length; i++) {
  13923. var c = rawChildren[i];
  13924. if (c.tag) {
  13925. if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
  13926. children.push(c);
  13927. map[c.key] = c;
  13928. (c.data || (c.data = {})).transition = transitionData;
  13929. }
  13930. else if (false) { var name_1, opts; }
  13931. }
  13932. }
  13933. if (prevChildren) {
  13934. var kept = [];
  13935. var removed = [];
  13936. for (var i = 0; i < prevChildren.length; i++) {
  13937. var c = prevChildren[i];
  13938. c.data.transition = transitionData;
  13939. // @ts-expect-error .getBoundingClientRect is not typed in Node
  13940. c.data.pos = c.elm.getBoundingClientRect();
  13941. if (map[c.key]) {
  13942. kept.push(c);
  13943. }
  13944. else {
  13945. removed.push(c);
  13946. }
  13947. }
  13948. this.kept = h(tag, null, kept);
  13949. this.removed = removed;
  13950. }
  13951. return h(tag, null, children);
  13952. },
  13953. updated: function () {
  13954. var children = this.prevChildren;
  13955. var moveClass = this.moveClass || (this.name || 'v') + '-move';
  13956. if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
  13957. return;
  13958. }
  13959. // we divide the work into three loops to avoid mixing DOM reads and writes
  13960. // in each iteration - which helps prevent layout thrashing.
  13961. children.forEach(callPendingCbs);
  13962. children.forEach(recordPosition);
  13963. children.forEach(applyTranslation);
  13964. // force reflow to put everything in position
  13965. // assign to this to avoid being removed in tree-shaking
  13966. // $flow-disable-line
  13967. this._reflow = document.body.offsetHeight;
  13968. children.forEach(function (c) {
  13969. if (c.data.moved) {
  13970. var el_1 = c.elm;
  13971. var s = el_1.style;
  13972. addTransitionClass(el_1, moveClass);
  13973. s.transform = s.WebkitTransform = s.transitionDuration = '';
  13974. el_1.addEventListener(transitionEndEvent, (el_1._moveCb = function cb(e) {
  13975. if (e && e.target !== el_1) {
  13976. return;
  13977. }
  13978. if (!e || /transform$/.test(e.propertyName)) {
  13979. el_1.removeEventListener(transitionEndEvent, cb);
  13980. el_1._moveCb = null;
  13981. removeTransitionClass(el_1, moveClass);
  13982. }
  13983. }));
  13984. }
  13985. });
  13986. },
  13987. methods: {
  13988. hasMove: function (el, moveClass) {
  13989. /* istanbul ignore if */
  13990. if (!hasTransition) {
  13991. return false;
  13992. }
  13993. /* istanbul ignore if */
  13994. if (this._hasMove) {
  13995. return this._hasMove;
  13996. }
  13997. // Detect whether an element with the move class applied has
  13998. // CSS transitions. Since the element may be inside an entering
  13999. // transition at this very moment, we make a clone of it and remove
  14000. // all other transition classes applied to ensure only the move class
  14001. // is applied.
  14002. var clone = el.cloneNode();
  14003. if (el._transitionClasses) {
  14004. el._transitionClasses.forEach(function (cls) {
  14005. removeClass(clone, cls);
  14006. });
  14007. }
  14008. addClass(clone, moveClass);
  14009. clone.style.display = 'none';
  14010. this.$el.appendChild(clone);
  14011. var info = getTransitionInfo(clone);
  14012. this.$el.removeChild(clone);
  14013. return (this._hasMove = info.hasTransform);
  14014. }
  14015. }
  14016. };
  14017. function callPendingCbs(c) {
  14018. /* istanbul ignore if */
  14019. if (c.elm._moveCb) {
  14020. c.elm._moveCb();
  14021. }
  14022. /* istanbul ignore if */
  14023. if (c.elm._enterCb) {
  14024. c.elm._enterCb();
  14025. }
  14026. }
  14027. function recordPosition(c) {
  14028. c.data.newPos = c.elm.getBoundingClientRect();
  14029. }
  14030. function applyTranslation(c) {
  14031. var oldPos = c.data.pos;
  14032. var newPos = c.data.newPos;
  14033. var dx = oldPos.left - newPos.left;
  14034. var dy = oldPos.top - newPos.top;
  14035. if (dx || dy) {
  14036. c.data.moved = true;
  14037. var s = c.elm.style;
  14038. s.transform = s.WebkitTransform = "translate(".concat(dx, "px,").concat(dy, "px)");
  14039. s.transitionDuration = '0s';
  14040. }
  14041. }
  14042. var platformComponents = {
  14043. Transition: Transition,
  14044. TransitionGroup: TransitionGroup
  14045. };
  14046. // install platform specific utils
  14047. Vue.config.mustUseProp = mustUseProp;
  14048. Vue.config.isReservedTag = isReservedTag;
  14049. Vue.config.isReservedAttr = isReservedAttr;
  14050. Vue.config.getTagNamespace = getTagNamespace;
  14051. Vue.config.isUnknownElement = isUnknownElement;
  14052. // install platform runtime directives & components
  14053. extend(Vue.options.directives, platformDirectives);
  14054. extend(Vue.options.components, platformComponents);
  14055. // install platform patch function
  14056. Vue.prototype.__patch__ = inBrowser ? patch : noop;
  14057. // public mount method
  14058. Vue.prototype.$mount = function (el, hydrating) {
  14059. el = el && inBrowser ? query(el) : undefined;
  14060. return mountComponent(this, el, hydrating);
  14061. };
  14062. // devtools global hook
  14063. /* istanbul ignore next */
  14064. if (inBrowser) {
  14065. setTimeout(function () {
  14066. if (config.devtools) {
  14067. if (devtools) {
  14068. devtools.emit('init', Vue);
  14069. }
  14070. else if (false) {}
  14071. }
  14072. if (false) {}
  14073. }, 0);
  14074. }
  14075. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(9), __webpack_require__(35).setImmediate))
  14076. /***/ }),
  14077. /***/ 6:
  14078. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14079. "use strict";
  14080. /* WEBPACK VAR INJECTION */(function(Buffer) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return clone; });
  14081. // Clone deep utility for cloning initial state of the store
  14082. // REFERENCE: https://github.com/pvorb/clone
  14083. var NativeMap
  14084. try {
  14085. NativeMap = Map
  14086. } catch (_) {
  14087. // maybe a reference error because no `Map`. Give it a dummy value that no
  14088. // value will ever be an instanceof.
  14089. NativeMap = function () {}
  14090. }
  14091. var NativeSet
  14092. try {
  14093. NativeSet = Set
  14094. } catch (_) {
  14095. NativeSet = function () {}
  14096. }
  14097. var NativePromise
  14098. try {
  14099. NativePromise = Promise
  14100. } catch (_) {
  14101. NativePromise = function () {}
  14102. }
  14103. function clone (parent, ref) {
  14104. if ( ref === void 0 ) ref = {};
  14105. var circular = ref.circular; if ( circular === void 0 ) circular = true;
  14106. var depth = ref.depth; if ( depth === void 0 ) depth = Infinity;
  14107. var prototype = ref.prototype;
  14108. var includeNonEnumerable = ref.includeNonEnumerable;
  14109. // maintain two arrays for circular references, where corresponding parents
  14110. // and children have the same index
  14111. var allParents = []
  14112. var allChildren = []
  14113. var useBuffer = typeof Buffer !== 'undefined' && typeof Buffer.isBuffer === 'function'
  14114. var isBuffer = typeof window !== 'undefined' ? browserIsBuffer : Buffer.isBuffer
  14115. // recurse this function so we don't reset allParents and allChildren
  14116. function _clone (parent, depth) {
  14117. // cloning null always returns null
  14118. if (parent === null) { return null }
  14119. if (depth === 0) { return parent }
  14120. var child
  14121. var proto
  14122. if (typeof parent !== 'object') {
  14123. return parent
  14124. }
  14125. if (_instanceof(parent, NativeMap)) {
  14126. child = new NativeMap()
  14127. } else if (_instanceof(parent, NativeSet)) {
  14128. child = new NativeSet()
  14129. } else if (_instanceof(parent, NativePromise)) {
  14130. child = new NativePromise(function (resolve, reject) {
  14131. parent.then(function (value) {
  14132. resolve(_clone(value, depth - 1))
  14133. }, function (err) {
  14134. reject(_clone(err, depth - 1))
  14135. })
  14136. })
  14137. } else if (clone.__isArray(parent)) {
  14138. child = []
  14139. } else if (clone.__isRegExp(parent)) {
  14140. child = new RegExp(parent.source, __getRegExpFlags(parent))
  14141. if (parent.lastIndex) { child.lastIndex = parent.lastIndex }
  14142. } else if (clone.__isDate(parent)) {
  14143. child = new Date(parent.getTime())
  14144. } else if (useBuffer && isBuffer(parent)) {
  14145. if (Buffer.from) {
  14146. // Node.js >= 5.10.0
  14147. child = Buffer.from(parent)
  14148. } else {
  14149. // Older Node.js versions
  14150. // eslint-disable-next-line node/no-deprecated-api
  14151. child = new Buffer(parent.length)
  14152. parent.copy(child)
  14153. }
  14154. return child
  14155. } else if (_instanceof(parent, Error)) {
  14156. child = Object.create(parent)
  14157. } else {
  14158. if (typeof prototype === 'undefined') {
  14159. proto = Object.getPrototypeOf(parent)
  14160. child = Object.create(proto)
  14161. } else {
  14162. child = Object.create(prototype)
  14163. proto = prototype
  14164. }
  14165. }
  14166. if (circular) {
  14167. var index = allParents.indexOf(parent)
  14168. if (index !== -1) {
  14169. return allChildren[index]
  14170. }
  14171. allParents.push(parent)
  14172. allChildren.push(child)
  14173. }
  14174. if (_instanceof(parent, NativeMap)) {
  14175. parent.forEach(function (value, key) {
  14176. var keyChild = _clone(key, depth - 1)
  14177. var valueChild = _clone(value, depth - 1)
  14178. child.set(keyChild, valueChild)
  14179. })
  14180. }
  14181. if (_instanceof(parent, NativeSet)) {
  14182. parent.forEach(function (value) {
  14183. var entryChild = _clone(value, depth - 1)
  14184. child.add(entryChild)
  14185. })
  14186. }
  14187. for (var i in parent) {
  14188. var attrs = Object.getOwnPropertyDescriptor(parent, i)
  14189. if (attrs) {
  14190. if (attrs.hasOwnProperty('get') && attrs.get.name === 'computedGetter') {
  14191. Object.defineProperty(child, i, attrs)
  14192. continue
  14193. }
  14194. child[i] = _clone(parent[i], depth - 1)
  14195. }
  14196. }
  14197. if (Object.getOwnPropertySymbols) {
  14198. var symbols = Object.getOwnPropertySymbols(parent)
  14199. for (var i$1 = 0; i$1 < symbols.length; i$1++) {
  14200. // Don't need to worry about cloning a symbol because it is a primitive,
  14201. // like a number or string.
  14202. var symbol = symbols[i$1]
  14203. var descriptor = Object.getOwnPropertyDescriptor(parent, symbol)
  14204. if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {
  14205. continue
  14206. }
  14207. child[symbol] = _clone(parent[symbol], depth - 1)
  14208. Object.defineProperty(child, symbol, descriptor)
  14209. }
  14210. }
  14211. if (includeNonEnumerable) {
  14212. var allPropertyNames = Object.getOwnPropertyNames(parent)
  14213. for (var i$2 = 0; i$2 < allPropertyNames.length; i$2++) {
  14214. var propertyName = allPropertyNames[i$2]
  14215. var descriptor$1 = Object.getOwnPropertyDescriptor(parent, propertyName)
  14216. if (descriptor$1 && descriptor$1.enumerable) {
  14217. continue
  14218. }
  14219. child[propertyName] = _clone(parent[propertyName], depth - 1)
  14220. Object.defineProperty(child, propertyName, descriptor$1)
  14221. }
  14222. }
  14223. return child
  14224. }
  14225. return _clone(parent, depth)
  14226. }
  14227. // private utility functions
  14228. function __objToStr (o) {
  14229. return Object.prototype.toString.call(o)
  14230. }
  14231. clone.__objToStr = __objToStr
  14232. function __isDate (o) {
  14233. return typeof o === 'object' && __objToStr(o) === '[object Date]'
  14234. }
  14235. clone.__isDate = __isDate
  14236. function __isArray (o) {
  14237. return typeof o === 'object' && __objToStr(o) === '[object Array]'
  14238. }
  14239. clone.__isArray = __isArray
  14240. function __isRegExp (o) {
  14241. return typeof o === 'object' && __objToStr(o) === '[object RegExp]'
  14242. }
  14243. clone.__isRegExp = __isRegExp
  14244. function __getRegExpFlags (re) {
  14245. var flags = ''
  14246. if (re.global) { flags += 'g' }
  14247. if (re.ignoreCase) { flags += 'i' }
  14248. if (re.multiline) { flags += 'm' }
  14249. return flags
  14250. }
  14251. clone.__getRegExpFlags = __getRegExpFlags
  14252. function _instanceof (obj, type) {
  14253. return type != null && obj instanceof type
  14254. }
  14255. function browserIsBuffer (b) {
  14256. return !!(b != null && '_isBuffer' in b && b._isBuffer)
  14257. }
  14258. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(17).Buffer))
  14259. /***/ }),
  14260. /***/ 9:
  14261. /***/ (function(module, exports) {
  14262. var g;
  14263. // This works in non-strict mode
  14264. g = (function() {
  14265. return this;
  14266. })();
  14267. try {
  14268. // This works if eval is allowed (see CSP)
  14269. g = g || new Function("return this")();
  14270. } catch (e) {
  14271. // This works if the window reference is available
  14272. if (typeof window === "object") g = window;
  14273. }
  14274. // g can still be undefined, but nothing to do about it...
  14275. // We return undefined, instead of nothing here, so it's
  14276. // easier to handle this case. if(!global) { ...}
  14277. module.exports = g;
  14278. /***/ })
  14279. /******/ });