vendor.js 211 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!************************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  5. \************************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(n);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}
  10. var _toString = Object.prototype.toString;
  11. var hasOwnProperty = Object.prototype.hasOwnProperty;
  12. function isFn(fn) {
  13. return typeof fn === 'function';
  14. }
  15. function isStr(str) {
  16. return typeof str === 'string';
  17. }
  18. function isPlainObject(obj) {
  19. return _toString.call(obj) === '[object Object]';
  20. }
  21. function hasOwn(obj, key) {
  22. return hasOwnProperty.call(obj, key);
  23. }
  24. function noop() {}
  25. /**
  26. * Create a cached version of a pure function.
  27. */
  28. function cached(fn) {
  29. var cache = Object.create(null);
  30. return function cachedFn(str) {
  31. var hit = cache[str];
  32. return hit || (cache[str] = fn(str));
  33. };
  34. }
  35. /**
  36. * Camelize a hyphen-delimited string.
  37. */
  38. var camelizeRE = /-(\w)/g;
  39. var camelize = cached(function (str) {
  40. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  41. });
  42. var HOOKS = [
  43. 'invoke',
  44. 'success',
  45. 'fail',
  46. 'complete',
  47. 'returnValue'];
  48. var globalInterceptors = {};
  49. var scopedInterceptors = {};
  50. function mergeHook(parentVal, childVal) {
  51. var res = childVal ?
  52. parentVal ?
  53. parentVal.concat(childVal) :
  54. Array.isArray(childVal) ?
  55. childVal : [childVal] :
  56. parentVal;
  57. return res ?
  58. dedupeHooks(res) :
  59. res;
  60. }
  61. function dedupeHooks(hooks) {
  62. var res = [];
  63. for (var i = 0; i < hooks.length; i++) {
  64. if (res.indexOf(hooks[i]) === -1) {
  65. res.push(hooks[i]);
  66. }
  67. }
  68. return res;
  69. }
  70. function removeHook(hooks, hook) {
  71. var index = hooks.indexOf(hook);
  72. if (index !== -1) {
  73. hooks.splice(index, 1);
  74. }
  75. }
  76. function mergeInterceptorHook(interceptor, option) {
  77. Object.keys(option).forEach(function (hook) {
  78. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  79. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  80. }
  81. });
  82. }
  83. function removeInterceptorHook(interceptor, option) {
  84. if (!interceptor || !option) {
  85. return;
  86. }
  87. Object.keys(option).forEach(function (hook) {
  88. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  89. removeHook(interceptor[hook], option[hook]);
  90. }
  91. });
  92. }
  93. function addInterceptor(method, option) {
  94. if (typeof method === 'string' && isPlainObject(option)) {
  95. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  96. } else if (isPlainObject(method)) {
  97. mergeInterceptorHook(globalInterceptors, method);
  98. }
  99. }
  100. function removeInterceptor(method, option) {
  101. if (typeof method === 'string') {
  102. if (isPlainObject(option)) {
  103. removeInterceptorHook(scopedInterceptors[method], option);
  104. } else {
  105. delete scopedInterceptors[method];
  106. }
  107. } else if (isPlainObject(method)) {
  108. removeInterceptorHook(globalInterceptors, method);
  109. }
  110. }
  111. function wrapperHook(hook) {
  112. return function (data) {
  113. return hook(data) || data;
  114. };
  115. }
  116. function isPromise(obj) {
  117. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  118. }
  119. function queue(hooks, data) {
  120. var promise = false;
  121. for (var i = 0; i < hooks.length; i++) {
  122. var hook = hooks[i];
  123. if (promise) {
  124. promise = Promise.resolve(wrapperHook(hook));
  125. } else {
  126. var res = hook(data);
  127. if (isPromise(res)) {
  128. promise = Promise.resolve(res);
  129. }
  130. if (res === false) {
  131. return {
  132. then: function then() {} };
  133. }
  134. }
  135. }
  136. return promise || {
  137. then: function then(callback) {
  138. return callback(data);
  139. } };
  140. }
  141. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  142. ['success', 'fail', 'complete'].forEach(function (name) {
  143. if (Array.isArray(interceptor[name])) {
  144. var oldCallback = options[name];
  145. options[name] = function callbackInterceptor(res) {
  146. queue(interceptor[name], res).then(function (res) {
  147. /* eslint-disable no-mixed-operators */
  148. return isFn(oldCallback) && oldCallback(res) || res;
  149. });
  150. };
  151. }
  152. });
  153. return options;
  154. }
  155. function wrapperReturnValue(method, returnValue) {
  156. var returnValueHooks = [];
  157. if (Array.isArray(globalInterceptors.returnValue)) {
  158. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  159. }
  160. var interceptor = scopedInterceptors[method];
  161. if (interceptor && Array.isArray(interceptor.returnValue)) {
  162. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  163. }
  164. returnValueHooks.forEach(function (hook) {
  165. returnValue = hook(returnValue) || returnValue;
  166. });
  167. return returnValue;
  168. }
  169. function getApiInterceptorHooks(method) {
  170. var interceptor = Object.create(null);
  171. Object.keys(globalInterceptors).forEach(function (hook) {
  172. if (hook !== 'returnValue') {
  173. interceptor[hook] = globalInterceptors[hook].slice();
  174. }
  175. });
  176. var scopedInterceptor = scopedInterceptors[method];
  177. if (scopedInterceptor) {
  178. Object.keys(scopedInterceptor).forEach(function (hook) {
  179. if (hook !== 'returnValue') {
  180. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  181. }
  182. });
  183. }
  184. return interceptor;
  185. }
  186. function invokeApi(method, api, options) {for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {params[_key - 3] = arguments[_key];}
  187. var interceptor = getApiInterceptorHooks(method);
  188. if (interceptor && Object.keys(interceptor).length) {
  189. if (Array.isArray(interceptor.invoke)) {
  190. var res = queue(interceptor.invoke, options);
  191. return res.then(function (options) {
  192. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  193. });
  194. } else {
  195. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  196. }
  197. }
  198. return api.apply(void 0, [options].concat(params));
  199. }
  200. var promiseInterceptor = {
  201. returnValue: function returnValue(res) {
  202. if (!isPromise(res)) {
  203. return res;
  204. }
  205. return res.then(function (res) {
  206. return res[1];
  207. }).catch(function (res) {
  208. return res[0];
  209. });
  210. } };
  211. var SYNC_API_RE =
  212. /^\$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
  213. var CONTEXT_API_RE = /^create|Manager$/;
  214. // Context例外情况
  215. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  216. // 同步例外情况
  217. var ASYNC_API = ['createBLEConnection'];
  218. var CALLBACK_API_RE = /^on|^off/;
  219. function isContextApi(name) {
  220. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  221. }
  222. function isSyncApi(name) {
  223. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  224. }
  225. function isCallbackApi(name) {
  226. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  227. }
  228. function handlePromise(promise) {
  229. return promise.then(function (data) {
  230. return [null, data];
  231. }).
  232. catch(function (err) {return [err];});
  233. }
  234. function shouldPromise(name) {
  235. if (
  236. isContextApi(name) ||
  237. isSyncApi(name) ||
  238. isCallbackApi(name))
  239. {
  240. return false;
  241. }
  242. return true;
  243. }
  244. /* eslint-disable no-extend-native */
  245. if (!Promise.prototype.finally) {
  246. Promise.prototype.finally = function (callback) {
  247. var promise = this.constructor;
  248. return this.then(
  249. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  250. function (reason) {return promise.resolve(callback()).then(function () {
  251. throw reason;
  252. });});
  253. };
  254. }
  255. function promisify(name, api) {
  256. if (!shouldPromise(name)) {
  257. return api;
  258. }
  259. return function promiseApi() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {params[_key2 - 1] = arguments[_key2];}
  260. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  261. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  262. }
  263. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  264. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  265. success: resolve,
  266. fail: reject })].concat(
  267. params));
  268. })));
  269. };
  270. }
  271. var EPS = 1e-4;
  272. var BASE_DEVICE_WIDTH = 750;
  273. var isIOS = false;
  274. var deviceWidth = 0;
  275. var deviceDPR = 0;
  276. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  277. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  278. deviceWidth = windowWidth;
  279. deviceDPR = pixelRatio;
  280. isIOS = platform === 'ios';
  281. }
  282. function upx2px(number, newDeviceWidth) {
  283. if (deviceWidth === 0) {
  284. checkDeviceWidth();
  285. }
  286. number = Number(number);
  287. if (number === 0) {
  288. return 0;
  289. }
  290. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  291. if (result < 0) {
  292. result = -result;
  293. }
  294. result = Math.floor(result + EPS);
  295. if (result === 0) {
  296. if (deviceDPR === 1 || !isIOS) {
  297. result = 1;
  298. } else {
  299. result = 0.5;
  300. }
  301. }
  302. return number < 0 ? -result : result;
  303. }
  304. var interceptors = {
  305. promiseInterceptor: promiseInterceptor };
  306. var baseApi = /*#__PURE__*/Object.freeze({
  307. __proto__: null,
  308. upx2px: upx2px,
  309. addInterceptor: addInterceptor,
  310. removeInterceptor: removeInterceptor,
  311. interceptors: interceptors });
  312. var previewImage = {
  313. args: function args(fromArgs) {
  314. var currentIndex = parseInt(fromArgs.current);
  315. if (isNaN(currentIndex)) {
  316. return;
  317. }
  318. var urls = fromArgs.urls;
  319. if (!Array.isArray(urls)) {
  320. return;
  321. }
  322. var len = urls.length;
  323. if (!len) {
  324. return;
  325. }
  326. if (currentIndex < 0) {
  327. currentIndex = 0;
  328. } else if (currentIndex >= len) {
  329. currentIndex = len - 1;
  330. }
  331. if (currentIndex > 0) {
  332. fromArgs.current = urls[currentIndex];
  333. fromArgs.urls = urls.filter(
  334. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  335. } else {
  336. fromArgs.current = urls[0];
  337. }
  338. return {
  339. indicator: false,
  340. loop: false };
  341. } };
  342. function addSafeAreaInsets(result) {
  343. if (result.safeArea) {
  344. var safeArea = result.safeArea;
  345. result.safeAreaInsets = {
  346. top: safeArea.top,
  347. left: safeArea.left,
  348. right: result.windowWidth - safeArea.right,
  349. bottom: result.windowHeight - safeArea.bottom };
  350. }
  351. }
  352. var protocols = {
  353. previewImage: previewImage,
  354. getSystemInfo: {
  355. returnValue: addSafeAreaInsets },
  356. getSystemInfoSync: {
  357. returnValue: addSafeAreaInsets } };
  358. var todos = [
  359. 'vibrate',
  360. 'preloadPage',
  361. 'unPreloadPage',
  362. 'loadSubPackage'];
  363. var canIUses = [];
  364. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  365. function processCallback(methodName, method, returnValue) {
  366. return function (res) {
  367. return method(processReturnValue(methodName, res, returnValue));
  368. };
  369. }
  370. function processArgs(methodName, fromArgs) {var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  371. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  372. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  373. if (isFn(argsOption)) {
  374. argsOption = argsOption(fromArgs, toArgs) || {};
  375. }
  376. for (var key in fromArgs) {
  377. if (hasOwn(argsOption, key)) {
  378. var keyOption = argsOption[key];
  379. if (isFn(keyOption)) {
  380. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  381. }
  382. if (!keyOption) {// 不支持的参数
  383. console.warn("\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F ".concat(methodName, "\u6682\u4E0D\u652F\u6301").concat(key));
  384. } else if (isStr(keyOption)) {// 重写参数 key
  385. toArgs[keyOption] = fromArgs[key];
  386. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  387. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  388. }
  389. } else if (CALLBACKS.indexOf(key) !== -1) {
  390. if (isFn(fromArgs[key])) {
  391. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  392. }
  393. } else {
  394. if (!keepFromArgs) {
  395. toArgs[key] = fromArgs[key];
  396. }
  397. }
  398. }
  399. return toArgs;
  400. } else if (isFn(fromArgs)) {
  401. fromArgs = processCallback(methodName, fromArgs, returnValue);
  402. }
  403. return fromArgs;
  404. }
  405. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  406. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  407. res = protocols.returnValue(methodName, res);
  408. }
  409. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  410. }
  411. function wrapper(methodName, method) {
  412. if (hasOwn(protocols, methodName)) {
  413. var protocol = protocols[methodName];
  414. if (!protocol) {// 暂不支持的 api
  415. return function () {
  416. console.error("\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F \u6682\u4E0D\u652F\u6301".concat(methodName));
  417. };
  418. }
  419. return function (arg1, arg2) {// 目前 api 最多两个参数
  420. var options = protocol;
  421. if (isFn(protocol)) {
  422. options = protocol(arg1);
  423. }
  424. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  425. var args = [arg1];
  426. if (typeof arg2 !== 'undefined') {
  427. args.push(arg2);
  428. }
  429. var returnValue = wx[options.name || methodName].apply(wx, args);
  430. if (isSyncApi(methodName)) {// 同步 api
  431. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  432. }
  433. return returnValue;
  434. };
  435. }
  436. return method;
  437. }
  438. var todoApis = Object.create(null);
  439. var TODOS = [
  440. 'onTabBarMidButtonTap',
  441. 'subscribePush',
  442. 'unsubscribePush',
  443. 'onPush',
  444. 'offPush',
  445. 'share'];
  446. function createTodoApi(name) {
  447. return function todoApi(_ref)
  448. {var fail = _ref.fail,complete = _ref.complete;
  449. var res = {
  450. errMsg: "".concat(name, ":fail:\u6682\u4E0D\u652F\u6301 ").concat(name, " \u65B9\u6CD5") };
  451. isFn(fail) && fail(res);
  452. isFn(complete) && complete(res);
  453. };
  454. }
  455. TODOS.forEach(function (name) {
  456. todoApis[name] = createTodoApi(name);
  457. });
  458. var providers = {
  459. oauth: ['weixin'],
  460. share: ['weixin'],
  461. payment: ['wxpay'],
  462. push: ['weixin'] };
  463. function getProvider(_ref2)
  464. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  465. var res = false;
  466. if (providers[service]) {
  467. res = {
  468. errMsg: 'getProvider:ok',
  469. service: service,
  470. provider: providers[service] };
  471. isFn(success) && success(res);
  472. } else {
  473. res = {
  474. errMsg: 'getProvider:fail:服务[' + service + ']不存在' };
  475. isFn(fail) && fail(res);
  476. }
  477. isFn(complete) && complete(res);
  478. }
  479. var extraApi = /*#__PURE__*/Object.freeze({
  480. __proto__: null,
  481. getProvider: getProvider });
  482. var getEmitter = function () {
  483. var Emitter;
  484. return function getUniEmitter() {
  485. if (!Emitter) {
  486. Emitter = new _vue.default();
  487. }
  488. return Emitter;
  489. };
  490. }();
  491. function apply(ctx, method, args) {
  492. return ctx[method].apply(ctx, args);
  493. }
  494. function $on() {
  495. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  496. }
  497. function $off() {
  498. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  499. }
  500. function $once() {
  501. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  502. }
  503. function $emit() {
  504. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  505. }
  506. var eventApi = /*#__PURE__*/Object.freeze({
  507. __proto__: null,
  508. $on: $on,
  509. $off: $off,
  510. $once: $once,
  511. $emit: $emit });
  512. var api = /*#__PURE__*/Object.freeze({
  513. __proto__: null });
  514. var MPPage = Page;
  515. var MPComponent = Component;
  516. var customizeRE = /:/g;
  517. var customize = cached(function (str) {
  518. return camelize(str.replace(customizeRE, '-'));
  519. });
  520. function initTriggerEvent(mpInstance) {
  521. {
  522. if (!wx.canIUse('nextTick')) {
  523. return;
  524. }
  525. }
  526. var oldTriggerEvent = mpInstance.triggerEvent;
  527. mpInstance.triggerEvent = function (event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  528. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  529. };
  530. }
  531. function initHook(name, options) {
  532. var oldHook = options[name];
  533. if (!oldHook) {
  534. options[name] = function () {
  535. initTriggerEvent(this);
  536. };
  537. } else {
  538. options[name] = function () {
  539. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  540. return oldHook.apply(this, args);
  541. };
  542. }
  543. }
  544. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  545. initHook('onLoad', options);
  546. return MPPage(options);
  547. };
  548. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  549. initHook('created', options);
  550. return MPComponent(options);
  551. };
  552. var PAGE_EVENT_HOOKS = [
  553. 'onPullDownRefresh',
  554. 'onReachBottom',
  555. 'onAddToFavorites',
  556. 'onShareTimeline',
  557. 'onShareAppMessage',
  558. 'onPageScroll',
  559. 'onResize',
  560. 'onTabItemTap'];
  561. function initMocks(vm, mocks) {
  562. var mpInstance = vm.$mp[vm.mpType];
  563. mocks.forEach(function (mock) {
  564. if (hasOwn(mpInstance, mock)) {
  565. vm[mock] = mpInstance[mock];
  566. }
  567. });
  568. }
  569. function hasHook(hook, vueOptions) {
  570. if (!vueOptions) {
  571. return true;
  572. }
  573. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  574. return true;
  575. }
  576. vueOptions = vueOptions.default || vueOptions;
  577. if (isFn(vueOptions)) {
  578. if (isFn(vueOptions.extendOptions[hook])) {
  579. return true;
  580. }
  581. if (vueOptions.super &&
  582. vueOptions.super.options &&
  583. Array.isArray(vueOptions.super.options[hook])) {
  584. return true;
  585. }
  586. return false;
  587. }
  588. if (isFn(vueOptions[hook])) {
  589. return true;
  590. }
  591. var mixins = vueOptions.mixins;
  592. if (Array.isArray(mixins)) {
  593. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  594. }
  595. }
  596. function initHooks(mpOptions, hooks, vueOptions) {
  597. hooks.forEach(function (hook) {
  598. if (hasHook(hook, vueOptions)) {
  599. mpOptions[hook] = function (args) {
  600. return this.$vm && this.$vm.__call_hook(hook, args);
  601. };
  602. }
  603. });
  604. }
  605. function initVueComponent(Vue, vueOptions) {
  606. vueOptions = vueOptions.default || vueOptions;
  607. var VueComponent;
  608. if (isFn(vueOptions)) {
  609. VueComponent = vueOptions;
  610. } else {
  611. VueComponent = Vue.extend(vueOptions);
  612. }
  613. vueOptions = VueComponent.options;
  614. return [VueComponent, vueOptions];
  615. }
  616. function initSlots(vm, vueSlots) {
  617. if (Array.isArray(vueSlots) && vueSlots.length) {
  618. var $slots = Object.create(null);
  619. vueSlots.forEach(function (slotName) {
  620. $slots[slotName] = true;
  621. });
  622. vm.$scopedSlots = vm.$slots = $slots;
  623. }
  624. }
  625. function initVueIds(vueIds, mpInstance) {
  626. vueIds = (vueIds || '').split(',');
  627. var len = vueIds.length;
  628. if (len === 1) {
  629. mpInstance._$vueId = vueIds[0];
  630. } else if (len === 2) {
  631. mpInstance._$vueId = vueIds[0];
  632. mpInstance._$vuePid = vueIds[1];
  633. }
  634. }
  635. function initData(vueOptions, context) {
  636. var data = vueOptions.data || {};
  637. var methods = vueOptions.methods || {};
  638. if (typeof data === 'function') {
  639. try {
  640. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  641. } catch (e) {
  642. if (Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  643. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  644. }
  645. }
  646. } else {
  647. try {
  648. // 对 data 格式化
  649. data = JSON.parse(JSON.stringify(data));
  650. } catch (e) {}
  651. }
  652. if (!isPlainObject(data)) {
  653. data = {};
  654. }
  655. Object.keys(methods).forEach(function (methodName) {
  656. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  657. data[methodName] = methods[methodName];
  658. }
  659. });
  660. return data;
  661. }
  662. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  663. function createObserver(name) {
  664. return function observer(newVal, oldVal) {
  665. if (this.$vm) {
  666. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  667. }
  668. };
  669. }
  670. function initBehaviors(vueOptions, initBehavior) {
  671. var vueBehaviors = vueOptions.behaviors;
  672. var vueExtends = vueOptions.extends;
  673. var vueMixins = vueOptions.mixins;
  674. var vueProps = vueOptions.props;
  675. if (!vueProps) {
  676. vueOptions.props = vueProps = [];
  677. }
  678. var behaviors = [];
  679. if (Array.isArray(vueBehaviors)) {
  680. vueBehaviors.forEach(function (behavior) {
  681. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  682. if (behavior === 'uni://form-field') {
  683. if (Array.isArray(vueProps)) {
  684. vueProps.push('name');
  685. vueProps.push('value');
  686. } else {
  687. vueProps.name = {
  688. type: String,
  689. default: '' };
  690. vueProps.value = {
  691. type: [String, Number, Boolean, Array, Object, Date],
  692. default: '' };
  693. }
  694. }
  695. });
  696. }
  697. if (isPlainObject(vueExtends) && vueExtends.props) {
  698. behaviors.push(
  699. initBehavior({
  700. properties: initProperties(vueExtends.props, true) }));
  701. }
  702. if (Array.isArray(vueMixins)) {
  703. vueMixins.forEach(function (vueMixin) {
  704. if (isPlainObject(vueMixin) && vueMixin.props) {
  705. behaviors.push(
  706. initBehavior({
  707. properties: initProperties(vueMixin.props, true) }));
  708. }
  709. });
  710. }
  711. return behaviors;
  712. }
  713. function parsePropType(key, type, defaultValue, file) {
  714. // [String]=>String
  715. if (Array.isArray(type) && type.length === 1) {
  716. return type[0];
  717. }
  718. return type;
  719. }
  720. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  721. var properties = {};
  722. if (!isBehavior) {
  723. properties.vueId = {
  724. type: String,
  725. value: '' };
  726. // 用于字节跳动小程序模拟抽象节点
  727. properties.generic = {
  728. type: Object,
  729. value: null };
  730. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  731. type: null,
  732. value: [],
  733. observer: function observer(newVal, oldVal) {
  734. var $slots = Object.create(null);
  735. newVal.forEach(function (slotName) {
  736. $slots[slotName] = true;
  737. });
  738. this.setData({
  739. $slots: $slots });
  740. } };
  741. }
  742. if (Array.isArray(props)) {// ['title']
  743. props.forEach(function (key) {
  744. properties[key] = {
  745. type: null,
  746. observer: createObserver(key) };
  747. });
  748. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  749. Object.keys(props).forEach(function (key) {
  750. var opts = props[key];
  751. if (isPlainObject(opts)) {// title:{type:String,default:''}
  752. var value = opts.default;
  753. if (isFn(value)) {
  754. value = value();
  755. }
  756. opts.type = parsePropType(key, opts.type);
  757. properties[key] = {
  758. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  759. value: value,
  760. observer: createObserver(key) };
  761. } else {// content:String
  762. var type = parsePropType(key, opts);
  763. properties[key] = {
  764. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  765. observer: createObserver(key) };
  766. }
  767. });
  768. }
  769. return properties;
  770. }
  771. function wrapper$1(event) {
  772. // TODO 又得兼容 mpvue 的 mp 对象
  773. try {
  774. event.mp = JSON.parse(JSON.stringify(event));
  775. } catch (e) {}
  776. event.stopPropagation = noop;
  777. event.preventDefault = noop;
  778. event.target = event.target || {};
  779. if (!hasOwn(event, 'detail')) {
  780. event.detail = {};
  781. }
  782. if (hasOwn(event, 'markerId')) {
  783. event.detail = typeof event.detail === 'object' ? event.detail : {};
  784. event.detail.markerId = event.markerId;
  785. }
  786. if (isPlainObject(event.detail)) {
  787. event.target = Object.assign({}, event.target, event.detail);
  788. }
  789. return event;
  790. }
  791. function getExtraValue(vm, dataPathsArray) {
  792. var context = vm;
  793. dataPathsArray.forEach(function (dataPathArray) {
  794. var dataPath = dataPathArray[0];
  795. var value = dataPathArray[2];
  796. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  797. var propPath = dataPathArray[1];
  798. var valuePath = dataPathArray[3];
  799. var vFor;
  800. if (Number.isInteger(dataPath)) {
  801. vFor = dataPath;
  802. } else if (!dataPath) {
  803. vFor = context;
  804. } else if (typeof dataPath === 'string' && dataPath) {
  805. if (dataPath.indexOf('#s#') === 0) {
  806. vFor = dataPath.substr(3);
  807. } else {
  808. vFor = vm.__get_value(dataPath, context);
  809. }
  810. }
  811. if (Number.isInteger(vFor)) {
  812. context = value;
  813. } else if (!propPath) {
  814. context = vFor[value];
  815. } else {
  816. if (Array.isArray(vFor)) {
  817. context = vFor.find(function (vForItem) {
  818. return vm.__get_value(propPath, vForItem) === value;
  819. });
  820. } else if (isPlainObject(vFor)) {
  821. context = Object.keys(vFor).find(function (vForKey) {
  822. return vm.__get_value(propPath, vFor[vForKey]) === value;
  823. });
  824. } else {
  825. console.error('v-for 暂不支持循环数据:', vFor);
  826. }
  827. }
  828. if (valuePath) {
  829. context = vm.__get_value(valuePath, context);
  830. }
  831. }
  832. });
  833. return context;
  834. }
  835. function processEventExtra(vm, extra, event) {
  836. var extraObj = {};
  837. if (Array.isArray(extra) && extra.length) {
  838. /**
  839. *[
  840. * ['data.items', 'data.id', item.data.id],
  841. * ['metas', 'id', meta.id]
  842. *],
  843. *[
  844. * ['data.items', 'data.id', item.data.id],
  845. * ['metas', 'id', meta.id]
  846. *],
  847. *'test'
  848. */
  849. extra.forEach(function (dataPath, index) {
  850. if (typeof dataPath === 'string') {
  851. if (!dataPath) {// model,prop.sync
  852. extraObj['$' + index] = vm;
  853. } else {
  854. if (dataPath === '$event') {// $event
  855. extraObj['$' + index] = event;
  856. } else if (dataPath === 'arguments') {
  857. if (event.detail && event.detail.__args__) {
  858. extraObj['$' + index] = event.detail.__args__;
  859. } else {
  860. extraObj['$' + index] = [event];
  861. }
  862. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  863. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  864. } else {
  865. extraObj['$' + index] = vm.__get_value(dataPath);
  866. }
  867. }
  868. } else {
  869. extraObj['$' + index] = getExtraValue(vm, dataPath);
  870. }
  871. });
  872. }
  873. return extraObj;
  874. }
  875. function getObjByArray(arr) {
  876. var obj = {};
  877. for (var i = 1; i < arr.length; i++) {
  878. var element = arr[i];
  879. obj[element[0]] = element[1];
  880. }
  881. return obj;
  882. }
  883. function processEventArgs(vm, event) {var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];var isCustom = arguments.length > 4 ? arguments[4] : undefined;var methodName = arguments.length > 5 ? arguments[5] : undefined;
  884. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  885. if (isCustom) {// 自定义事件
  886. isCustomMPEvent = event.currentTarget &&
  887. event.currentTarget.dataset &&
  888. event.currentTarget.dataset.comType === 'wx';
  889. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  890. if (isCustomMPEvent) {
  891. return [event];
  892. }
  893. return event.detail.__args__ || event.detail;
  894. }
  895. }
  896. var extraObj = processEventExtra(vm, extra, event);
  897. var ret = [];
  898. args.forEach(function (arg) {
  899. if (arg === '$event') {
  900. if (methodName === '__set_model' && !isCustom) {// input v-model value
  901. ret.push(event.target.value);
  902. } else {
  903. if (isCustom && !isCustomMPEvent) {
  904. ret.push(event.detail.__args__[0]);
  905. } else {// wxcomponent 组件或内置组件
  906. ret.push(event);
  907. }
  908. }
  909. } else {
  910. if (Array.isArray(arg) && arg[0] === 'o') {
  911. ret.push(getObjByArray(arg));
  912. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  913. ret.push(extraObj[arg]);
  914. } else {
  915. ret.push(arg);
  916. }
  917. }
  918. });
  919. return ret;
  920. }
  921. var ONCE = '~';
  922. var CUSTOM = '^';
  923. function isMatchEventType(eventType, optType) {
  924. return eventType === optType ||
  925. optType === 'regionchange' && (
  926. eventType === 'begin' ||
  927. eventType === 'end');
  928. }
  929. function getContextVm(vm) {
  930. var $parent = vm.$parent;
  931. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  932. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  933. $parent = $parent.$parent;
  934. }
  935. return $parent && $parent.$parent;
  936. }
  937. function handleEvent(event) {var _this = this;
  938. event = wrapper$1(event);
  939. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  940. var dataset = (event.currentTarget || event.target).dataset;
  941. if (!dataset) {
  942. return console.warn('事件信息不存在');
  943. }
  944. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  945. if (!eventOpts) {
  946. return console.warn('事件信息不存在');
  947. }
  948. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  949. var eventType = event.type;
  950. var ret = [];
  951. eventOpts.forEach(function (eventOpt) {
  952. var type = eventOpt[0];
  953. var eventsArray = eventOpt[1];
  954. var isCustom = type.charAt(0) === CUSTOM;
  955. type = isCustom ? type.slice(1) : type;
  956. var isOnce = type.charAt(0) === ONCE;
  957. type = isOnce ? type.slice(1) : type;
  958. if (eventsArray && isMatchEventType(eventType, type)) {
  959. eventsArray.forEach(function (eventArray) {
  960. var methodName = eventArray[0];
  961. if (methodName) {
  962. var handlerCtx = _this.$vm;
  963. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  964. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  965. }
  966. if (methodName === '$emit') {
  967. handlerCtx.$emit.apply(handlerCtx,
  968. processEventArgs(
  969. _this.$vm,
  970. event,
  971. eventArray[1],
  972. eventArray[2],
  973. isCustom,
  974. methodName));
  975. return;
  976. }
  977. var handler = handlerCtx[methodName];
  978. if (!isFn(handler)) {
  979. throw new Error(" _vm.".concat(methodName, " is not a function"));
  980. }
  981. if (isOnce) {
  982. if (handler.once) {
  983. return;
  984. }
  985. handler.once = true;
  986. }
  987. var params = processEventArgs(
  988. _this.$vm,
  989. event,
  990. eventArray[1],
  991. eventArray[2],
  992. isCustom,
  993. methodName);
  994. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  995. // eslint-disable-next-line no-sparse-arrays
  996. ret.push(handler.apply(handlerCtx, (Array.isArray(params) ? params : []).concat([,,,,,,,,,, event])));
  997. }
  998. });
  999. }
  1000. });
  1001. if (
  1002. eventType === 'input' &&
  1003. ret.length === 1 &&
  1004. typeof ret[0] !== 'undefined')
  1005. {
  1006. return ret[0];
  1007. }
  1008. }
  1009. var hooks = [
  1010. 'onShow',
  1011. 'onHide',
  1012. 'onError',
  1013. 'onPageNotFound',
  1014. 'onThemeChange',
  1015. 'onUnhandledRejection'];
  1016. function parseBaseApp(vm, _ref3)
  1017. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1018. if (vm.$options.store) {
  1019. _vue.default.prototype.$store = vm.$options.store;
  1020. }
  1021. _vue.default.prototype.mpHost = "mp-weixin";
  1022. _vue.default.mixin({
  1023. beforeCreate: function beforeCreate() {
  1024. if (!this.$options.mpType) {
  1025. return;
  1026. }
  1027. this.mpType = this.$options.mpType;
  1028. this.$mp = _defineProperty({
  1029. data: {} },
  1030. this.mpType, this.$options.mpInstance);
  1031. this.$scope = this.$options.mpInstance;
  1032. delete this.$options.mpType;
  1033. delete this.$options.mpInstance;
  1034. if (this.mpType !== 'app') {
  1035. initRefs(this);
  1036. initMocks(this, mocks);
  1037. }
  1038. } });
  1039. var appOptions = {
  1040. onLaunch: function onLaunch(args) {
  1041. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1042. return;
  1043. }
  1044. {
  1045. if (!wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1046. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1047. }
  1048. }
  1049. this.$vm = vm;
  1050. this.$vm.$mp = {
  1051. app: this };
  1052. this.$vm.$scope = this;
  1053. // vm 上也挂载 globalData
  1054. this.$vm.globalData = this.globalData;
  1055. this.$vm._isMounted = true;
  1056. this.$vm.__call_hook('mounted', args);
  1057. this.$vm.__call_hook('onLaunch', args);
  1058. } };
  1059. // 兼容旧版本 globalData
  1060. appOptions.globalData = vm.$options.globalData || {};
  1061. // 将 methods 中的方法挂在 getApp() 中
  1062. var methods = vm.$options.methods;
  1063. if (methods) {
  1064. Object.keys(methods).forEach(function (name) {
  1065. appOptions[name] = methods[name];
  1066. });
  1067. }
  1068. initHooks(appOptions, hooks);
  1069. return appOptions;
  1070. }
  1071. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1072. function findVmByVueId(vm, vuePid) {
  1073. var $children = vm.$children;
  1074. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1075. for (var i = $children.length - 1; i >= 0; i--) {
  1076. var childVm = $children[i];
  1077. if (childVm.$scope._$vueId === vuePid) {
  1078. return childVm;
  1079. }
  1080. }
  1081. // 反向递归查找
  1082. var parentVm;
  1083. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1084. parentVm = findVmByVueId($children[_i], vuePid);
  1085. if (parentVm) {
  1086. return parentVm;
  1087. }
  1088. }
  1089. }
  1090. function initBehavior(options) {
  1091. return Behavior(options);
  1092. }
  1093. function isPage() {
  1094. return !!this.route;
  1095. }
  1096. function initRelation(detail) {
  1097. this.triggerEvent('__l', detail);
  1098. }
  1099. function initRefs(vm) {
  1100. var mpInstance = vm.$scope;
  1101. Object.defineProperty(vm, '$refs', {
  1102. get: function get() {
  1103. var $refs = {};
  1104. var components = mpInstance.selectAllComponents('.vue-ref');
  1105. components.forEach(function (component) {
  1106. var ref = component.dataset.ref;
  1107. $refs[ref] = component.$vm || component;
  1108. });
  1109. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1110. forComponents.forEach(function (component) {
  1111. var ref = component.dataset.ref;
  1112. if (!$refs[ref]) {
  1113. $refs[ref] = [];
  1114. }
  1115. $refs[ref].push(component.$vm || component);
  1116. });
  1117. return $refs;
  1118. } });
  1119. }
  1120. function handleLink(event) {var _ref4 =
  1121. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1122. var parentVm;
  1123. if (vuePid) {
  1124. parentVm = findVmByVueId(this.$vm, vuePid);
  1125. }
  1126. if (!parentVm) {
  1127. parentVm = this.$vm;
  1128. }
  1129. vueOptions.parent = parentVm;
  1130. }
  1131. function parseApp(vm) {
  1132. return parseBaseApp(vm, {
  1133. mocks: mocks,
  1134. initRefs: initRefs });
  1135. }
  1136. function createApp(vm) {
  1137. App(parseApp(vm));
  1138. return vm;
  1139. }
  1140. function parseBaseComponent(vueComponentOptions)
  1141. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1142. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1143. var options = _objectSpread({
  1144. multipleSlots: true,
  1145. addGlobalClass: true },
  1146. vueOptions.options || {});
  1147. {
  1148. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1149. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1150. Object.assign(options, vueOptions['mp-weixin'].options);
  1151. }
  1152. }
  1153. var componentOptions = {
  1154. options: options,
  1155. data: initData(vueOptions, _vue.default.prototype),
  1156. behaviors: initBehaviors(vueOptions, initBehavior),
  1157. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1158. lifetimes: {
  1159. attached: function attached() {
  1160. var properties = this.properties;
  1161. var options = {
  1162. mpType: isPage.call(this) ? 'page' : 'component',
  1163. mpInstance: this,
  1164. propsData: properties };
  1165. initVueIds(properties.vueId, this);
  1166. // 处理父子关系
  1167. initRelation.call(this, {
  1168. vuePid: this._$vuePid,
  1169. vueOptions: options });
  1170. // 初始化 vue 实例
  1171. this.$vm = new VueComponent(options);
  1172. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1173. initSlots(this.$vm, properties.vueSlots);
  1174. // 触发首次 setData
  1175. this.$vm.$mount();
  1176. },
  1177. ready: function ready() {
  1178. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1179. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1180. if (this.$vm) {
  1181. this.$vm._isMounted = true;
  1182. this.$vm.__call_hook('mounted');
  1183. this.$vm.__call_hook('onReady');
  1184. }
  1185. },
  1186. detached: function detached() {
  1187. this.$vm && this.$vm.$destroy();
  1188. } },
  1189. pageLifetimes: {
  1190. show: function show(args) {
  1191. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1192. },
  1193. hide: function hide() {
  1194. this.$vm && this.$vm.__call_hook('onPageHide');
  1195. },
  1196. resize: function resize(size) {
  1197. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1198. } },
  1199. methods: {
  1200. __l: handleLink,
  1201. __e: handleEvent } };
  1202. // externalClasses
  1203. if (vueOptions.externalClasses) {
  1204. componentOptions.externalClasses = vueOptions.externalClasses;
  1205. }
  1206. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1207. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1208. componentOptions.methods[callMethod] = function (args) {
  1209. return this.$vm[callMethod](args);
  1210. };
  1211. });
  1212. }
  1213. if (isPage) {
  1214. return componentOptions;
  1215. }
  1216. return [componentOptions, VueComponent];
  1217. }
  1218. function parseComponent(vueComponentOptions) {
  1219. return parseBaseComponent(vueComponentOptions, {
  1220. isPage: isPage,
  1221. initRelation: initRelation });
  1222. }
  1223. var hooks$1 = [
  1224. 'onShow',
  1225. 'onHide',
  1226. 'onUnload'];
  1227. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1228. function parseBasePage(vuePageOptions, _ref6)
  1229. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1230. var pageOptions = parseComponent(vuePageOptions);
  1231. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1232. pageOptions.methods.onLoad = function (args) {
  1233. this.$vm.$mp.query = args; // 兼容 mpvue
  1234. this.$vm.__call_hook('onLoad', args);
  1235. };
  1236. return pageOptions;
  1237. }
  1238. function parsePage(vuePageOptions) {
  1239. return parseBasePage(vuePageOptions, {
  1240. isPage: isPage,
  1241. initRelation: initRelation });
  1242. }
  1243. function createPage(vuePageOptions) {
  1244. {
  1245. return Component(parsePage(vuePageOptions));
  1246. }
  1247. }
  1248. function createComponent(vueOptions) {
  1249. {
  1250. return Component(parseComponent(vueOptions));
  1251. }
  1252. }
  1253. todos.forEach(function (todoApi) {
  1254. protocols[todoApi] = false;
  1255. });
  1256. canIUses.forEach(function (canIUseApi) {
  1257. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1258. canIUseApi;
  1259. if (!wx.canIUse(apiName)) {
  1260. protocols[canIUseApi] = false;
  1261. }
  1262. });
  1263. var uni = {};
  1264. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1265. uni = new Proxy({}, {
  1266. get: function get(target, name) {
  1267. if (hasOwn(target, name)) {
  1268. return target[name];
  1269. }
  1270. if (baseApi[name]) {
  1271. return baseApi[name];
  1272. }
  1273. if (api[name]) {
  1274. return promisify(name, api[name]);
  1275. }
  1276. {
  1277. if (extraApi[name]) {
  1278. return promisify(name, extraApi[name]);
  1279. }
  1280. if (todoApis[name]) {
  1281. return promisify(name, todoApis[name]);
  1282. }
  1283. }
  1284. if (eventApi[name]) {
  1285. return eventApi[name];
  1286. }
  1287. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1288. return;
  1289. }
  1290. return promisify(name, wrapper(name, wx[name]));
  1291. },
  1292. set: function set(target, name, value) {
  1293. target[name] = value;
  1294. return true;
  1295. } });
  1296. } else {
  1297. Object.keys(baseApi).forEach(function (name) {
  1298. uni[name] = baseApi[name];
  1299. });
  1300. {
  1301. Object.keys(todoApis).forEach(function (name) {
  1302. uni[name] = promisify(name, todoApis[name]);
  1303. });
  1304. Object.keys(extraApi).forEach(function (name) {
  1305. uni[name] = promisify(name, todoApis[name]);
  1306. });
  1307. }
  1308. Object.keys(eventApi).forEach(function (name) {
  1309. uni[name] = eventApi[name];
  1310. });
  1311. Object.keys(api).forEach(function (name) {
  1312. uni[name] = promisify(name, api[name]);
  1313. });
  1314. Object.keys(wx).forEach(function (name) {
  1315. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1316. uni[name] = promisify(name, wrapper(name, wx[name]));
  1317. }
  1318. });
  1319. }
  1320. wx.createApp = createApp;
  1321. wx.createPage = createPage;
  1322. wx.createComponent = createComponent;
  1323. var uni$1 = uni;var _default =
  1324. uni$1;exports.default = _default;
  1325. /***/ }),
  1326. /***/ 10:
  1327. /*!**********************************************************************************************************!*\
  1328. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  1329. \**********************************************************************************************************/
  1330. /*! exports provided: default */
  1331. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1332. "use strict";
  1333. __webpack_require__.r(__webpack_exports__);
  1334. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  1335. /* globals __VUE_SSR_CONTEXT__ */
  1336. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  1337. // This module is a runtime utility for cleaner component module output and will
  1338. // be included in the final webpack user bundle.
  1339. function normalizeComponent (
  1340. scriptExports,
  1341. render,
  1342. staticRenderFns,
  1343. functionalTemplate,
  1344. injectStyles,
  1345. scopeId,
  1346. moduleIdentifier, /* server only */
  1347. shadowMode, /* vue-cli only */
  1348. components, // fixed by xxxxxx auto components
  1349. renderjs // fixed by xxxxxx renderjs
  1350. ) {
  1351. // Vue.extend constructor export interop
  1352. var options = typeof scriptExports === 'function'
  1353. ? scriptExports.options
  1354. : scriptExports
  1355. // fixed by xxxxxx auto components
  1356. if (components) {
  1357. if (!options.components) {
  1358. options.components = {}
  1359. }
  1360. var hasOwn = Object.prototype.hasOwnProperty
  1361. for (var name in components) {
  1362. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  1363. options.components[name] = components[name]
  1364. }
  1365. }
  1366. }
  1367. // fixed by xxxxxx renderjs
  1368. if (renderjs) {
  1369. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  1370. this[renderjs.__module] = this
  1371. });
  1372. (options.mixins || (options.mixins = [])).push(renderjs)
  1373. }
  1374. // render functions
  1375. if (render) {
  1376. options.render = render
  1377. options.staticRenderFns = staticRenderFns
  1378. options._compiled = true
  1379. }
  1380. // functional template
  1381. if (functionalTemplate) {
  1382. options.functional = true
  1383. }
  1384. // scopedId
  1385. if (scopeId) {
  1386. options._scopeId = 'data-v-' + scopeId
  1387. }
  1388. var hook
  1389. if (moduleIdentifier) { // server build
  1390. hook = function (context) {
  1391. // 2.3 injection
  1392. context =
  1393. context || // cached call
  1394. (this.$vnode && this.$vnode.ssrContext) || // stateful
  1395. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  1396. // 2.2 with runInNewContext: true
  1397. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  1398. context = __VUE_SSR_CONTEXT__
  1399. }
  1400. // inject component styles
  1401. if (injectStyles) {
  1402. injectStyles.call(this, context)
  1403. }
  1404. // register component module identifier for async chunk inferrence
  1405. if (context && context._registeredComponents) {
  1406. context._registeredComponents.add(moduleIdentifier)
  1407. }
  1408. }
  1409. // used by ssr in case component is cached and beforeCreate
  1410. // never gets called
  1411. options._ssrRegister = hook
  1412. } else if (injectStyles) {
  1413. hook = shadowMode
  1414. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  1415. : injectStyles
  1416. }
  1417. if (hook) {
  1418. if (options.functional) {
  1419. // for template-only hot-reload because in that case the render fn doesn't
  1420. // go through the normalizer
  1421. options._injectStyles = hook
  1422. // register for functioal component in vue file
  1423. var originalRender = options.render
  1424. options.render = function renderWithStyleInjection (h, context) {
  1425. hook.call(context)
  1426. return originalRender(h, context)
  1427. }
  1428. } else {
  1429. // inject component registration as beforeCreate hook
  1430. var existing = options.beforeCreate
  1431. options.beforeCreate = existing
  1432. ? [].concat(existing, hook)
  1433. : [hook]
  1434. }
  1435. }
  1436. return {
  1437. exports: scriptExports,
  1438. options: options
  1439. }
  1440. }
  1441. /***/ }),
  1442. /***/ 11:
  1443. /*!******************************************************!*\
  1444. !*** /Users/lhch/other/muzhuang-android/unit/api.js ***!
  1445. \******************************************************/
  1446. /*! no static exports found */
  1447. /***/ (function(module, exports, __webpack_require__) {
  1448. "use strict";
  1449. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.fetchRequest = fetchRequest;exports.default = void 0;var _config = _interopRequireDefault(__webpack_require__(/*! ./config */ 12));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  1450. var BASE_URL = _config.default.BASE_URL;
  1451. function buildURL(url, needaccess_token) {
  1452. var access_token = uni.getStorageSync('access_token');
  1453. access_token = '1a23qwer';
  1454. if (!needaccess_token) {
  1455. return access_token ? url + (url.indexOf('?') > -1 ? "&token=" : "?token=") + access_token : url;
  1456. }
  1457. if (!access_token) {
  1458. return false;
  1459. }
  1460. return url + (url.indexOf('?') > -1 ? "&token=" : "?token=") + access_token;
  1461. }
  1462. function fetchRequest(url, params, type, needToken) {
  1463. console.log(url, params);
  1464. url = buildURL(url, needToken);
  1465. if (!url) {
  1466. return new Promise(function (resolve, reject) {
  1467. reject();
  1468. return;
  1469. });
  1470. return;
  1471. }
  1472. return new Promise(function (resolve, reject) {
  1473. uni.request({
  1474. url: BASE_URL + url,
  1475. data: params,
  1476. method: type,
  1477. header: {
  1478. 'content-type': 'application/x-www-form-urlencoded' },
  1479. success: function success(res) {
  1480. console.log('网络请求成功', res);
  1481. if (res.data.code == 0) {
  1482. resolve(res.data);
  1483. } else {
  1484. uni.showToast({
  1485. icon: 'none',
  1486. title: res.data.msg });
  1487. reject(res);
  1488. }
  1489. },
  1490. fail: function fail(res) {
  1491. console.log('网络请求失败', res);
  1492. uni.showToast({
  1493. icon: 'none',
  1494. title: '网络错误' });
  1495. reject(res);
  1496. } });
  1497. });
  1498. }var _default =
  1499. {
  1500. // 获取轮播图或者广告
  1501. bannerList: function bannerList(params) {
  1502. return fetchRequest('/banner/list', params, 'GET', false);
  1503. },
  1504. // 常用信息配置
  1505. commonAboutus: function commonAboutus(params) {
  1506. return fetchRequest('/common/aboutus', params, 'GET', false);
  1507. },
  1508. // 帮助中心
  1509. commonHelpList: function commonHelpList(params) {
  1510. return fetchRequest('/common/help/list', params, 'GET', false);
  1511. },
  1512. // 根据设备编号获取设备详情
  1513. deviceInfo: function deviceInfo(params) {
  1514. return fetchRequest('/device/info', params, 'GET', false);
  1515. },
  1516. // 发送验证码
  1517. commonSmsSend: function commonSmsSend(params) {
  1518. return fetchRequest('/common/sms/send', params, 'POST', false);
  1519. },
  1520. // 短信验证
  1521. commonSmsValidate: function commonSmsValidate(params) {
  1522. return fetchRequest('/common/sms/validate', params, "POST", false);
  1523. },
  1524. // 创建线下订单
  1525. offorderCreateOffline: function offorderCreateOffline(params) {
  1526. return fetchRequest('/offorder/create/offline', params, 'POST', false);
  1527. } };exports.default = _default;
  1528. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  1529. /***/ }),
  1530. /***/ 12:
  1531. /*!*********************************************************!*\
  1532. !*** /Users/lhch/other/muzhuang-android/unit/config.js ***!
  1533. \*********************************************************/
  1534. /*! no static exports found */
  1535. /***/ (function(module, exports, __webpack_require__) {
  1536. "use strict";
  1537. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  1538. BASE_URL: 'https://api.mzlockers.com/api',
  1539. version: '1.0.0' };exports.default = _default;
  1540. /***/ }),
  1541. /***/ 13:
  1542. /*!********************************************************!*\
  1543. !*** /Users/lhch/other/muzhuang-android/unit/tools.js ***!
  1544. \********************************************************/
  1545. /*! no static exports found */
  1546. /***/ (function(module, exports, __webpack_require__) {
  1547. "use strict";
  1548. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  1549. /**
  1550. * 单秒倒计时
  1551. * @param {Number} initialTime 起始时间
  1552. * @param {Function} call 倒计时回调
  1553. */
  1554. countDownForSecond: function countDownForSecond(initialTime, call) {
  1555. initialTime--;
  1556. call(initialTime);
  1557. var timer = setInterval(function () {
  1558. if (initialTime == 0) {
  1559. clearInterval(timer);
  1560. } else {
  1561. initialTime--;
  1562. call(initialTime, timer);
  1563. }
  1564. }, 1000);
  1565. return timer;
  1566. } };exports.default = _default;
  1567. /***/ }),
  1568. /***/ 2:
  1569. /*!******************************************************************************************!*\
  1570. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  1571. \******************************************************************************************/
  1572. /*! exports provided: default */
  1573. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1574. "use strict";
  1575. __webpack_require__.r(__webpack_exports__);
  1576. /* WEBPACK VAR INJECTION */(function(global) {/*!
  1577. * Vue.js v2.6.11
  1578. * (c) 2014-2020 Evan You
  1579. * Released under the MIT License.
  1580. */
  1581. /* */
  1582. var emptyObject = Object.freeze({});
  1583. // These helpers produce better VM code in JS engines due to their
  1584. // explicitness and function inlining.
  1585. function isUndef (v) {
  1586. return v === undefined || v === null
  1587. }
  1588. function isDef (v) {
  1589. return v !== undefined && v !== null
  1590. }
  1591. function isTrue (v) {
  1592. return v === true
  1593. }
  1594. function isFalse (v) {
  1595. return v === false
  1596. }
  1597. /**
  1598. * Check if value is primitive.
  1599. */
  1600. function isPrimitive (value) {
  1601. return (
  1602. typeof value === 'string' ||
  1603. typeof value === 'number' ||
  1604. // $flow-disable-line
  1605. typeof value === 'symbol' ||
  1606. typeof value === 'boolean'
  1607. )
  1608. }
  1609. /**
  1610. * Quick object check - this is primarily used to tell
  1611. * Objects from primitive values when we know the value
  1612. * is a JSON-compliant type.
  1613. */
  1614. function isObject (obj) {
  1615. return obj !== null && typeof obj === 'object'
  1616. }
  1617. /**
  1618. * Get the raw type string of a value, e.g., [object Object].
  1619. */
  1620. var _toString = Object.prototype.toString;
  1621. function toRawType (value) {
  1622. return _toString.call(value).slice(8, -1)
  1623. }
  1624. /**
  1625. * Strict object type check. Only returns true
  1626. * for plain JavaScript objects.
  1627. */
  1628. function isPlainObject (obj) {
  1629. return _toString.call(obj) === '[object Object]'
  1630. }
  1631. function isRegExp (v) {
  1632. return _toString.call(v) === '[object RegExp]'
  1633. }
  1634. /**
  1635. * Check if val is a valid array index.
  1636. */
  1637. function isValidArrayIndex (val) {
  1638. var n = parseFloat(String(val));
  1639. return n >= 0 && Math.floor(n) === n && isFinite(val)
  1640. }
  1641. function isPromise (val) {
  1642. return (
  1643. isDef(val) &&
  1644. typeof val.then === 'function' &&
  1645. typeof val.catch === 'function'
  1646. )
  1647. }
  1648. /**
  1649. * Convert a value to a string that is actually rendered.
  1650. */
  1651. function toString (val) {
  1652. return val == null
  1653. ? ''
  1654. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  1655. ? JSON.stringify(val, null, 2)
  1656. : String(val)
  1657. }
  1658. /**
  1659. * Convert an input value to a number for persistence.
  1660. * If the conversion fails, return original string.
  1661. */
  1662. function toNumber (val) {
  1663. var n = parseFloat(val);
  1664. return isNaN(n) ? val : n
  1665. }
  1666. /**
  1667. * Make a map and return a function for checking if a key
  1668. * is in that map.
  1669. */
  1670. function makeMap (
  1671. str,
  1672. expectsLowerCase
  1673. ) {
  1674. var map = Object.create(null);
  1675. var list = str.split(',');
  1676. for (var i = 0; i < list.length; i++) {
  1677. map[list[i]] = true;
  1678. }
  1679. return expectsLowerCase
  1680. ? function (val) { return map[val.toLowerCase()]; }
  1681. : function (val) { return map[val]; }
  1682. }
  1683. /**
  1684. * Check if a tag is a built-in tag.
  1685. */
  1686. var isBuiltInTag = makeMap('slot,component', true);
  1687. /**
  1688. * Check if an attribute is a reserved attribute.
  1689. */
  1690. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  1691. /**
  1692. * Remove an item from an array.
  1693. */
  1694. function remove (arr, item) {
  1695. if (arr.length) {
  1696. var index = arr.indexOf(item);
  1697. if (index > -1) {
  1698. return arr.splice(index, 1)
  1699. }
  1700. }
  1701. }
  1702. /**
  1703. * Check whether an object has the property.
  1704. */
  1705. var hasOwnProperty = Object.prototype.hasOwnProperty;
  1706. function hasOwn (obj, key) {
  1707. return hasOwnProperty.call(obj, key)
  1708. }
  1709. /**
  1710. * Create a cached version of a pure function.
  1711. */
  1712. function cached (fn) {
  1713. var cache = Object.create(null);
  1714. return (function cachedFn (str) {
  1715. var hit = cache[str];
  1716. return hit || (cache[str] = fn(str))
  1717. })
  1718. }
  1719. /**
  1720. * Camelize a hyphen-delimited string.
  1721. */
  1722. var camelizeRE = /-(\w)/g;
  1723. var camelize = cached(function (str) {
  1724. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  1725. });
  1726. /**
  1727. * Capitalize a string.
  1728. */
  1729. var capitalize = cached(function (str) {
  1730. return str.charAt(0).toUpperCase() + str.slice(1)
  1731. });
  1732. /**
  1733. * Hyphenate a camelCase string.
  1734. */
  1735. var hyphenateRE = /\B([A-Z])/g;
  1736. var hyphenate = cached(function (str) {
  1737. return str.replace(hyphenateRE, '-$1').toLowerCase()
  1738. });
  1739. /**
  1740. * Simple bind polyfill for environments that do not support it,
  1741. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  1742. * since native bind is now performant enough in most browsers.
  1743. * But removing it would mean breaking code that was able to run in
  1744. * PhantomJS 1.x, so this must be kept for backward compatibility.
  1745. */
  1746. /* istanbul ignore next */
  1747. function polyfillBind (fn, ctx) {
  1748. function boundFn (a) {
  1749. var l = arguments.length;
  1750. return l
  1751. ? l > 1
  1752. ? fn.apply(ctx, arguments)
  1753. : fn.call(ctx, a)
  1754. : fn.call(ctx)
  1755. }
  1756. boundFn._length = fn.length;
  1757. return boundFn
  1758. }
  1759. function nativeBind (fn, ctx) {
  1760. return fn.bind(ctx)
  1761. }
  1762. var bind = Function.prototype.bind
  1763. ? nativeBind
  1764. : polyfillBind;
  1765. /**
  1766. * Convert an Array-like object to a real Array.
  1767. */
  1768. function toArray (list, start) {
  1769. start = start || 0;
  1770. var i = list.length - start;
  1771. var ret = new Array(i);
  1772. while (i--) {
  1773. ret[i] = list[i + start];
  1774. }
  1775. return ret
  1776. }
  1777. /**
  1778. * Mix properties into target object.
  1779. */
  1780. function extend (to, _from) {
  1781. for (var key in _from) {
  1782. to[key] = _from[key];
  1783. }
  1784. return to
  1785. }
  1786. /**
  1787. * Merge an Array of Objects into a single Object.
  1788. */
  1789. function toObject (arr) {
  1790. var res = {};
  1791. for (var i = 0; i < arr.length; i++) {
  1792. if (arr[i]) {
  1793. extend(res, arr[i]);
  1794. }
  1795. }
  1796. return res
  1797. }
  1798. /* eslint-disable no-unused-vars */
  1799. /**
  1800. * Perform no operation.
  1801. * Stubbing args to make Flow happy without leaving useless transpiled code
  1802. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  1803. */
  1804. function noop (a, b, c) {}
  1805. /**
  1806. * Always return false.
  1807. */
  1808. var no = function (a, b, c) { return false; };
  1809. /* eslint-enable no-unused-vars */
  1810. /**
  1811. * Return the same value.
  1812. */
  1813. var identity = function (_) { return _; };
  1814. /**
  1815. * Check if two values are loosely equal - that is,
  1816. * if they are plain objects, do they have the same shape?
  1817. */
  1818. function looseEqual (a, b) {
  1819. if (a === b) { return true }
  1820. var isObjectA = isObject(a);
  1821. var isObjectB = isObject(b);
  1822. if (isObjectA && isObjectB) {
  1823. try {
  1824. var isArrayA = Array.isArray(a);
  1825. var isArrayB = Array.isArray(b);
  1826. if (isArrayA && isArrayB) {
  1827. return a.length === b.length && a.every(function (e, i) {
  1828. return looseEqual(e, b[i])
  1829. })
  1830. } else if (a instanceof Date && b instanceof Date) {
  1831. return a.getTime() === b.getTime()
  1832. } else if (!isArrayA && !isArrayB) {
  1833. var keysA = Object.keys(a);
  1834. var keysB = Object.keys(b);
  1835. return keysA.length === keysB.length && keysA.every(function (key) {
  1836. return looseEqual(a[key], b[key])
  1837. })
  1838. } else {
  1839. /* istanbul ignore next */
  1840. return false
  1841. }
  1842. } catch (e) {
  1843. /* istanbul ignore next */
  1844. return false
  1845. }
  1846. } else if (!isObjectA && !isObjectB) {
  1847. return String(a) === String(b)
  1848. } else {
  1849. return false
  1850. }
  1851. }
  1852. /**
  1853. * Return the first index at which a loosely equal value can be
  1854. * found in the array (if value is a plain object, the array must
  1855. * contain an object of the same shape), or -1 if it is not present.
  1856. */
  1857. function looseIndexOf (arr, val) {
  1858. for (var i = 0; i < arr.length; i++) {
  1859. if (looseEqual(arr[i], val)) { return i }
  1860. }
  1861. return -1
  1862. }
  1863. /**
  1864. * Ensure a function is called only once.
  1865. */
  1866. function once (fn) {
  1867. var called = false;
  1868. return function () {
  1869. if (!called) {
  1870. called = true;
  1871. fn.apply(this, arguments);
  1872. }
  1873. }
  1874. }
  1875. var ASSET_TYPES = [
  1876. 'component',
  1877. 'directive',
  1878. 'filter'
  1879. ];
  1880. var LIFECYCLE_HOOKS = [
  1881. 'beforeCreate',
  1882. 'created',
  1883. 'beforeMount',
  1884. 'mounted',
  1885. 'beforeUpdate',
  1886. 'updated',
  1887. 'beforeDestroy',
  1888. 'destroyed',
  1889. 'activated',
  1890. 'deactivated',
  1891. 'errorCaptured',
  1892. 'serverPrefetch'
  1893. ];
  1894. /* */
  1895. var config = ({
  1896. /**
  1897. * Option merge strategies (used in core/util/options)
  1898. */
  1899. // $flow-disable-line
  1900. optionMergeStrategies: Object.create(null),
  1901. /**
  1902. * Whether to suppress warnings.
  1903. */
  1904. silent: false,
  1905. /**
  1906. * Show production mode tip message on boot?
  1907. */
  1908. productionTip: "development" !== 'production',
  1909. /**
  1910. * Whether to enable devtools
  1911. */
  1912. devtools: "development" !== 'production',
  1913. /**
  1914. * Whether to record perf
  1915. */
  1916. performance: false,
  1917. /**
  1918. * Error handler for watcher errors
  1919. */
  1920. errorHandler: null,
  1921. /**
  1922. * Warn handler for watcher warns
  1923. */
  1924. warnHandler: null,
  1925. /**
  1926. * Ignore certain custom elements
  1927. */
  1928. ignoredElements: [],
  1929. /**
  1930. * Custom user key aliases for v-on
  1931. */
  1932. // $flow-disable-line
  1933. keyCodes: Object.create(null),
  1934. /**
  1935. * Check if a tag is reserved so that it cannot be registered as a
  1936. * component. This is platform-dependent and may be overwritten.
  1937. */
  1938. isReservedTag: no,
  1939. /**
  1940. * Check if an attribute is reserved so that it cannot be used as a component
  1941. * prop. This is platform-dependent and may be overwritten.
  1942. */
  1943. isReservedAttr: no,
  1944. /**
  1945. * Check if a tag is an unknown element.
  1946. * Platform-dependent.
  1947. */
  1948. isUnknownElement: no,
  1949. /**
  1950. * Get the namespace of an element
  1951. */
  1952. getTagNamespace: noop,
  1953. /**
  1954. * Parse the real tag name for the specific platform.
  1955. */
  1956. parsePlatformTagName: identity,
  1957. /**
  1958. * Check if an attribute must be bound using property, e.g. value
  1959. * Platform-dependent.
  1960. */
  1961. mustUseProp: no,
  1962. /**
  1963. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  1964. * This will significantly reduce performance if set to false.
  1965. */
  1966. async: true,
  1967. /**
  1968. * Exposed for legacy reasons
  1969. */
  1970. _lifecycleHooks: LIFECYCLE_HOOKS
  1971. });
  1972. /* */
  1973. /**
  1974. * unicode letters used for parsing html tags, component names and property paths.
  1975. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  1976. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  1977. */
  1978. 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/;
  1979. /**
  1980. * Check if a string starts with $ or _
  1981. */
  1982. function isReserved (str) {
  1983. var c = (str + '').charCodeAt(0);
  1984. return c === 0x24 || c === 0x5F
  1985. }
  1986. /**
  1987. * Define a property.
  1988. */
  1989. function def (obj, key, val, enumerable) {
  1990. Object.defineProperty(obj, key, {
  1991. value: val,
  1992. enumerable: !!enumerable,
  1993. writable: true,
  1994. configurable: true
  1995. });
  1996. }
  1997. /**
  1998. * Parse simple path.
  1999. */
  2000. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  2001. function parsePath (path) {
  2002. if (bailRE.test(path)) {
  2003. return
  2004. }
  2005. var segments = path.split('.');
  2006. return function (obj) {
  2007. for (var i = 0; i < segments.length; i++) {
  2008. if (!obj) { return }
  2009. obj = obj[segments[i]];
  2010. }
  2011. return obj
  2012. }
  2013. }
  2014. /* */
  2015. // can we use __proto__?
  2016. var hasProto = '__proto__' in {};
  2017. // Browser environment sniffing
  2018. var inBrowser = typeof window !== 'undefined';
  2019. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  2020. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  2021. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  2022. var isIE = UA && /msie|trident/.test(UA);
  2023. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  2024. var isEdge = UA && UA.indexOf('edge/') > 0;
  2025. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  2026. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  2027. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  2028. var isPhantomJS = UA && /phantomjs/.test(UA);
  2029. var isFF = UA && UA.match(/firefox\/(\d+)/);
  2030. // Firefox has a "watch" function on Object.prototype...
  2031. var nativeWatch = ({}).watch;
  2032. if (inBrowser) {
  2033. try {
  2034. var opts = {};
  2035. Object.defineProperty(opts, 'passive', ({
  2036. get: function get () {
  2037. }
  2038. })); // https://github.com/facebook/flow/issues/285
  2039. window.addEventListener('test-passive', null, opts);
  2040. } catch (e) {}
  2041. }
  2042. // this needs to be lazy-evaled because vue may be required before
  2043. // vue-server-renderer can set VUE_ENV
  2044. var _isServer;
  2045. var isServerRendering = function () {
  2046. if (_isServer === undefined) {
  2047. /* istanbul ignore if */
  2048. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  2049. // detect presence of vue-server-renderer and avoid
  2050. // Webpack shimming the process
  2051. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  2052. } else {
  2053. _isServer = false;
  2054. }
  2055. }
  2056. return _isServer
  2057. };
  2058. // detect devtools
  2059. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  2060. /* istanbul ignore next */
  2061. function isNative (Ctor) {
  2062. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  2063. }
  2064. var hasSymbol =
  2065. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  2066. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  2067. var _Set;
  2068. /* istanbul ignore if */ // $flow-disable-line
  2069. if (typeof Set !== 'undefined' && isNative(Set)) {
  2070. // use native Set when available.
  2071. _Set = Set;
  2072. } else {
  2073. // a non-standard Set polyfill that only works with primitive keys.
  2074. _Set = /*@__PURE__*/(function () {
  2075. function Set () {
  2076. this.set = Object.create(null);
  2077. }
  2078. Set.prototype.has = function has (key) {
  2079. return this.set[key] === true
  2080. };
  2081. Set.prototype.add = function add (key) {
  2082. this.set[key] = true;
  2083. };
  2084. Set.prototype.clear = function clear () {
  2085. this.set = Object.create(null);
  2086. };
  2087. return Set;
  2088. }());
  2089. }
  2090. /* */
  2091. var warn = noop;
  2092. var tip = noop;
  2093. var generateComponentTrace = (noop); // work around flow check
  2094. var formatComponentName = (noop);
  2095. if (true) {
  2096. var hasConsole = typeof console !== 'undefined';
  2097. var classifyRE = /(?:^|[-_])(\w)/g;
  2098. var classify = function (str) { return str
  2099. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  2100. .replace(/[-_]/g, ''); };
  2101. warn = function (msg, vm) {
  2102. var trace = vm ? generateComponentTrace(vm) : '';
  2103. if (config.warnHandler) {
  2104. config.warnHandler.call(null, msg, vm, trace);
  2105. } else if (hasConsole && (!config.silent)) {
  2106. console.error(("[Vue warn]: " + msg + trace));
  2107. }
  2108. };
  2109. tip = function (msg, vm) {
  2110. if (hasConsole && (!config.silent)) {
  2111. console.warn("[Vue tip]: " + msg + (
  2112. vm ? generateComponentTrace(vm) : ''
  2113. ));
  2114. }
  2115. };
  2116. formatComponentName = function (vm, includeFile) {
  2117. if (vm.$root === vm) {
  2118. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  2119. return ('') + vm.$options.__file
  2120. }
  2121. return '<Root>'
  2122. }
  2123. var options = typeof vm === 'function' && vm.cid != null
  2124. ? vm.options
  2125. : vm._isVue
  2126. ? vm.$options || vm.constructor.options
  2127. : vm;
  2128. var name = options.name || options._componentTag;
  2129. var file = options.__file;
  2130. if (!name && file) {
  2131. var match = file.match(/([^/\\]+)\.vue$/);
  2132. name = match && match[1];
  2133. }
  2134. return (
  2135. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  2136. (file && includeFile !== false ? (" at " + file) : '')
  2137. )
  2138. };
  2139. var repeat = function (str, n) {
  2140. var res = '';
  2141. while (n) {
  2142. if (n % 2 === 1) { res += str; }
  2143. if (n > 1) { str += str; }
  2144. n >>= 1;
  2145. }
  2146. return res
  2147. };
  2148. generateComponentTrace = function (vm) {
  2149. if (vm._isVue && vm.$parent) {
  2150. var tree = [];
  2151. var currentRecursiveSequence = 0;
  2152. while (vm && vm.$options.name !== 'PageBody') {
  2153. if (tree.length > 0) {
  2154. var last = tree[tree.length - 1];
  2155. if (last.constructor === vm.constructor) {
  2156. currentRecursiveSequence++;
  2157. vm = vm.$parent;
  2158. continue
  2159. } else if (currentRecursiveSequence > 0) {
  2160. tree[tree.length - 1] = [last, currentRecursiveSequence];
  2161. currentRecursiveSequence = 0;
  2162. }
  2163. }
  2164. !vm.$options.isReserved && tree.push(vm);
  2165. vm = vm.$parent;
  2166. }
  2167. return '\n\nfound in\n\n' + tree
  2168. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  2169. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  2170. : formatComponentName(vm))); })
  2171. .join('\n')
  2172. } else {
  2173. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  2174. }
  2175. };
  2176. }
  2177. /* */
  2178. var uid = 0;
  2179. /**
  2180. * A dep is an observable that can have multiple
  2181. * directives subscribing to it.
  2182. */
  2183. var Dep = function Dep () {
  2184. this.id = uid++;
  2185. this.subs = [];
  2186. };
  2187. Dep.prototype.addSub = function addSub (sub) {
  2188. this.subs.push(sub);
  2189. };
  2190. Dep.prototype.removeSub = function removeSub (sub) {
  2191. remove(this.subs, sub);
  2192. };
  2193. Dep.prototype.depend = function depend () {
  2194. if (Dep.SharedObject.target) {
  2195. Dep.SharedObject.target.addDep(this);
  2196. }
  2197. };
  2198. Dep.prototype.notify = function notify () {
  2199. // stabilize the subscriber list first
  2200. var subs = this.subs.slice();
  2201. if ( true && !config.async) {
  2202. // subs aren't sorted in scheduler if not running async
  2203. // we need to sort them now to make sure they fire in correct
  2204. // order
  2205. subs.sort(function (a, b) { return a.id - b.id; });
  2206. }
  2207. for (var i = 0, l = subs.length; i < l; i++) {
  2208. subs[i].update();
  2209. }
  2210. };
  2211. // The current target watcher being evaluated.
  2212. // This is globally unique because only one watcher
  2213. // can be evaluated at a time.
  2214. // fixed by xxxxxx (nvue shared vuex)
  2215. /* eslint-disable no-undef */
  2216. Dep.SharedObject = {};
  2217. Dep.SharedObject.target = null;
  2218. Dep.SharedObject.targetStack = [];
  2219. function pushTarget (target) {
  2220. Dep.SharedObject.targetStack.push(target);
  2221. Dep.SharedObject.target = target;
  2222. }
  2223. function popTarget () {
  2224. Dep.SharedObject.targetStack.pop();
  2225. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  2226. }
  2227. /* */
  2228. var VNode = function VNode (
  2229. tag,
  2230. data,
  2231. children,
  2232. text,
  2233. elm,
  2234. context,
  2235. componentOptions,
  2236. asyncFactory
  2237. ) {
  2238. this.tag = tag;
  2239. this.data = data;
  2240. this.children = children;
  2241. this.text = text;
  2242. this.elm = elm;
  2243. this.ns = undefined;
  2244. this.context = context;
  2245. this.fnContext = undefined;
  2246. this.fnOptions = undefined;
  2247. this.fnScopeId = undefined;
  2248. this.key = data && data.key;
  2249. this.componentOptions = componentOptions;
  2250. this.componentInstance = undefined;
  2251. this.parent = undefined;
  2252. this.raw = false;
  2253. this.isStatic = false;
  2254. this.isRootInsert = true;
  2255. this.isComment = false;
  2256. this.isCloned = false;
  2257. this.isOnce = false;
  2258. this.asyncFactory = asyncFactory;
  2259. this.asyncMeta = undefined;
  2260. this.isAsyncPlaceholder = false;
  2261. };
  2262. var prototypeAccessors = { child: { configurable: true } };
  2263. // DEPRECATED: alias for componentInstance for backwards compat.
  2264. /* istanbul ignore next */
  2265. prototypeAccessors.child.get = function () {
  2266. return this.componentInstance
  2267. };
  2268. Object.defineProperties( VNode.prototype, prototypeAccessors );
  2269. var createEmptyVNode = function (text) {
  2270. if ( text === void 0 ) text = '';
  2271. var node = new VNode();
  2272. node.text = text;
  2273. node.isComment = true;
  2274. return node
  2275. };
  2276. function createTextVNode (val) {
  2277. return new VNode(undefined, undefined, undefined, String(val))
  2278. }
  2279. // optimized shallow clone
  2280. // used for static nodes and slot nodes because they may be reused across
  2281. // multiple renders, cloning them avoids errors when DOM manipulations rely
  2282. // on their elm reference.
  2283. function cloneVNode (vnode) {
  2284. var cloned = new VNode(
  2285. vnode.tag,
  2286. vnode.data,
  2287. // #7975
  2288. // clone children array to avoid mutating original in case of cloning
  2289. // a child.
  2290. vnode.children && vnode.children.slice(),
  2291. vnode.text,
  2292. vnode.elm,
  2293. vnode.context,
  2294. vnode.componentOptions,
  2295. vnode.asyncFactory
  2296. );
  2297. cloned.ns = vnode.ns;
  2298. cloned.isStatic = vnode.isStatic;
  2299. cloned.key = vnode.key;
  2300. cloned.isComment = vnode.isComment;
  2301. cloned.fnContext = vnode.fnContext;
  2302. cloned.fnOptions = vnode.fnOptions;
  2303. cloned.fnScopeId = vnode.fnScopeId;
  2304. cloned.asyncMeta = vnode.asyncMeta;
  2305. cloned.isCloned = true;
  2306. return cloned
  2307. }
  2308. /*
  2309. * not type checking this file because flow doesn't play well with
  2310. * dynamically accessing methods on Array prototype
  2311. */
  2312. var arrayProto = Array.prototype;
  2313. var arrayMethods = Object.create(arrayProto);
  2314. var methodsToPatch = [
  2315. 'push',
  2316. 'pop',
  2317. 'shift',
  2318. 'unshift',
  2319. 'splice',
  2320. 'sort',
  2321. 'reverse'
  2322. ];
  2323. /**
  2324. * Intercept mutating methods and emit events
  2325. */
  2326. methodsToPatch.forEach(function (method) {
  2327. // cache original method
  2328. var original = arrayProto[method];
  2329. def(arrayMethods, method, function mutator () {
  2330. var args = [], len = arguments.length;
  2331. while ( len-- ) args[ len ] = arguments[ len ];
  2332. var result = original.apply(this, args);
  2333. var ob = this.__ob__;
  2334. var inserted;
  2335. switch (method) {
  2336. case 'push':
  2337. case 'unshift':
  2338. inserted = args;
  2339. break
  2340. case 'splice':
  2341. inserted = args.slice(2);
  2342. break
  2343. }
  2344. if (inserted) { ob.observeArray(inserted); }
  2345. // notify change
  2346. ob.dep.notify();
  2347. return result
  2348. });
  2349. });
  2350. /* */
  2351. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  2352. /**
  2353. * In some cases we may want to disable observation inside a component's
  2354. * update computation.
  2355. */
  2356. var shouldObserve = true;
  2357. function toggleObserving (value) {
  2358. shouldObserve = value;
  2359. }
  2360. /**
  2361. * Observer class that is attached to each observed
  2362. * object. Once attached, the observer converts the target
  2363. * object's property keys into getter/setters that
  2364. * collect dependencies and dispatch updates.
  2365. */
  2366. var Observer = function Observer (value) {
  2367. this.value = value;
  2368. this.dep = new Dep();
  2369. this.vmCount = 0;
  2370. def(value, '__ob__', this);
  2371. if (Array.isArray(value)) {
  2372. if (hasProto) {
  2373. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  2374. if(value.push !== value.__proto__.push){
  2375. copyAugment(value, arrayMethods, arrayKeys);
  2376. } else {
  2377. protoAugment(value, arrayMethods);
  2378. }
  2379. }
  2380. } else {
  2381. copyAugment(value, arrayMethods, arrayKeys);
  2382. }
  2383. this.observeArray(value);
  2384. } else {
  2385. this.walk(value);
  2386. }
  2387. };
  2388. /**
  2389. * Walk through all properties and convert them into
  2390. * getter/setters. This method should only be called when
  2391. * value type is Object.
  2392. */
  2393. Observer.prototype.walk = function walk (obj) {
  2394. var keys = Object.keys(obj);
  2395. for (var i = 0; i < keys.length; i++) {
  2396. defineReactive$$1(obj, keys[i]);
  2397. }
  2398. };
  2399. /**
  2400. * Observe a list of Array items.
  2401. */
  2402. Observer.prototype.observeArray = function observeArray (items) {
  2403. for (var i = 0, l = items.length; i < l; i++) {
  2404. observe(items[i]);
  2405. }
  2406. };
  2407. // helpers
  2408. /**
  2409. * Augment a target Object or Array by intercepting
  2410. * the prototype chain using __proto__
  2411. */
  2412. function protoAugment (target, src) {
  2413. /* eslint-disable no-proto */
  2414. target.__proto__ = src;
  2415. /* eslint-enable no-proto */
  2416. }
  2417. /**
  2418. * Augment a target Object or Array by defining
  2419. * hidden properties.
  2420. */
  2421. /* istanbul ignore next */
  2422. function copyAugment (target, src, keys) {
  2423. for (var i = 0, l = keys.length; i < l; i++) {
  2424. var key = keys[i];
  2425. def(target, key, src[key]);
  2426. }
  2427. }
  2428. /**
  2429. * Attempt to create an observer instance for a value,
  2430. * returns the new observer if successfully observed,
  2431. * or the existing observer if the value already has one.
  2432. */
  2433. function observe (value, asRootData) {
  2434. if (!isObject(value) || value instanceof VNode) {
  2435. return
  2436. }
  2437. var ob;
  2438. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  2439. ob = value.__ob__;
  2440. } else if (
  2441. shouldObserve &&
  2442. !isServerRendering() &&
  2443. (Array.isArray(value) || isPlainObject(value)) &&
  2444. Object.isExtensible(value) &&
  2445. !value._isVue
  2446. ) {
  2447. ob = new Observer(value);
  2448. }
  2449. if (asRootData && ob) {
  2450. ob.vmCount++;
  2451. }
  2452. return ob
  2453. }
  2454. /**
  2455. * Define a reactive property on an Object.
  2456. */
  2457. function defineReactive$$1 (
  2458. obj,
  2459. key,
  2460. val,
  2461. customSetter,
  2462. shallow
  2463. ) {
  2464. var dep = new Dep();
  2465. var property = Object.getOwnPropertyDescriptor(obj, key);
  2466. if (property && property.configurable === false) {
  2467. return
  2468. }
  2469. // cater for pre-defined getter/setters
  2470. var getter = property && property.get;
  2471. var setter = property && property.set;
  2472. if ((!getter || setter) && arguments.length === 2) {
  2473. val = obj[key];
  2474. }
  2475. var childOb = !shallow && observe(val);
  2476. Object.defineProperty(obj, key, {
  2477. enumerable: true,
  2478. configurable: true,
  2479. get: function reactiveGetter () {
  2480. var value = getter ? getter.call(obj) : val;
  2481. if (Dep.SharedObject.target) { // fixed by xxxxxx
  2482. dep.depend();
  2483. if (childOb) {
  2484. childOb.dep.depend();
  2485. if (Array.isArray(value)) {
  2486. dependArray(value);
  2487. }
  2488. }
  2489. }
  2490. return value
  2491. },
  2492. set: function reactiveSetter (newVal) {
  2493. var value = getter ? getter.call(obj) : val;
  2494. /* eslint-disable no-self-compare */
  2495. if (newVal === value || (newVal !== newVal && value !== value)) {
  2496. return
  2497. }
  2498. /* eslint-enable no-self-compare */
  2499. if ( true && customSetter) {
  2500. customSetter();
  2501. }
  2502. // #7981: for accessor properties without setter
  2503. if (getter && !setter) { return }
  2504. if (setter) {
  2505. setter.call(obj, newVal);
  2506. } else {
  2507. val = newVal;
  2508. }
  2509. childOb = !shallow && observe(newVal);
  2510. dep.notify();
  2511. }
  2512. });
  2513. }
  2514. /**
  2515. * Set a property on an object. Adds the new property and
  2516. * triggers change notification if the property doesn't
  2517. * already exist.
  2518. */
  2519. function set (target, key, val) {
  2520. if ( true &&
  2521. (isUndef(target) || isPrimitive(target))
  2522. ) {
  2523. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  2524. }
  2525. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2526. target.length = Math.max(target.length, key);
  2527. target.splice(key, 1, val);
  2528. return val
  2529. }
  2530. if (key in target && !(key in Object.prototype)) {
  2531. target[key] = val;
  2532. return val
  2533. }
  2534. var ob = (target).__ob__;
  2535. if (target._isVue || (ob && ob.vmCount)) {
  2536. true && warn(
  2537. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  2538. 'at runtime - declare it upfront in the data option.'
  2539. );
  2540. return val
  2541. }
  2542. if (!ob) {
  2543. target[key] = val;
  2544. return val
  2545. }
  2546. defineReactive$$1(ob.value, key, val);
  2547. ob.dep.notify();
  2548. return val
  2549. }
  2550. /**
  2551. * Delete a property and trigger change if necessary.
  2552. */
  2553. function del (target, key) {
  2554. if ( true &&
  2555. (isUndef(target) || isPrimitive(target))
  2556. ) {
  2557. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  2558. }
  2559. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2560. target.splice(key, 1);
  2561. return
  2562. }
  2563. var ob = (target).__ob__;
  2564. if (target._isVue || (ob && ob.vmCount)) {
  2565. true && warn(
  2566. 'Avoid deleting properties on a Vue instance or its root $data ' +
  2567. '- just set it to null.'
  2568. );
  2569. return
  2570. }
  2571. if (!hasOwn(target, key)) {
  2572. return
  2573. }
  2574. delete target[key];
  2575. if (!ob) {
  2576. return
  2577. }
  2578. ob.dep.notify();
  2579. }
  2580. /**
  2581. * Collect dependencies on array elements when the array is touched, since
  2582. * we cannot intercept array element access like property getters.
  2583. */
  2584. function dependArray (value) {
  2585. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  2586. e = value[i];
  2587. e && e.__ob__ && e.__ob__.dep.depend();
  2588. if (Array.isArray(e)) {
  2589. dependArray(e);
  2590. }
  2591. }
  2592. }
  2593. /* */
  2594. /**
  2595. * Option overwriting strategies are functions that handle
  2596. * how to merge a parent option value and a child option
  2597. * value into the final value.
  2598. */
  2599. var strats = config.optionMergeStrategies;
  2600. /**
  2601. * Options with restrictions
  2602. */
  2603. if (true) {
  2604. strats.el = strats.propsData = function (parent, child, vm, key) {
  2605. if (!vm) {
  2606. warn(
  2607. "option \"" + key + "\" can only be used during instance " +
  2608. 'creation with the `new` keyword.'
  2609. );
  2610. }
  2611. return defaultStrat(parent, child)
  2612. };
  2613. }
  2614. /**
  2615. * Helper that recursively merges two data objects together.
  2616. */
  2617. function mergeData (to, from) {
  2618. if (!from) { return to }
  2619. var key, toVal, fromVal;
  2620. var keys = hasSymbol
  2621. ? Reflect.ownKeys(from)
  2622. : Object.keys(from);
  2623. for (var i = 0; i < keys.length; i++) {
  2624. key = keys[i];
  2625. // in case the object is already observed...
  2626. if (key === '__ob__') { continue }
  2627. toVal = to[key];
  2628. fromVal = from[key];
  2629. if (!hasOwn(to, key)) {
  2630. set(to, key, fromVal);
  2631. } else if (
  2632. toVal !== fromVal &&
  2633. isPlainObject(toVal) &&
  2634. isPlainObject(fromVal)
  2635. ) {
  2636. mergeData(toVal, fromVal);
  2637. }
  2638. }
  2639. return to
  2640. }
  2641. /**
  2642. * Data
  2643. */
  2644. function mergeDataOrFn (
  2645. parentVal,
  2646. childVal,
  2647. vm
  2648. ) {
  2649. if (!vm) {
  2650. // in a Vue.extend merge, both should be functions
  2651. if (!childVal) {
  2652. return parentVal
  2653. }
  2654. if (!parentVal) {
  2655. return childVal
  2656. }
  2657. // when parentVal & childVal are both present,
  2658. // we need to return a function that returns the
  2659. // merged result of both functions... no need to
  2660. // check if parentVal is a function here because
  2661. // it has to be a function to pass previous merges.
  2662. return function mergedDataFn () {
  2663. return mergeData(
  2664. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  2665. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  2666. )
  2667. }
  2668. } else {
  2669. return function mergedInstanceDataFn () {
  2670. // instance merge
  2671. var instanceData = typeof childVal === 'function'
  2672. ? childVal.call(vm, vm)
  2673. : childVal;
  2674. var defaultData = typeof parentVal === 'function'
  2675. ? parentVal.call(vm, vm)
  2676. : parentVal;
  2677. if (instanceData) {
  2678. return mergeData(instanceData, defaultData)
  2679. } else {
  2680. return defaultData
  2681. }
  2682. }
  2683. }
  2684. }
  2685. strats.data = function (
  2686. parentVal,
  2687. childVal,
  2688. vm
  2689. ) {
  2690. if (!vm) {
  2691. if (childVal && typeof childVal !== 'function') {
  2692. true && warn(
  2693. 'The "data" option should be a function ' +
  2694. 'that returns a per-instance value in component ' +
  2695. 'definitions.',
  2696. vm
  2697. );
  2698. return parentVal
  2699. }
  2700. return mergeDataOrFn(parentVal, childVal)
  2701. }
  2702. return mergeDataOrFn(parentVal, childVal, vm)
  2703. };
  2704. /**
  2705. * Hooks and props are merged as arrays.
  2706. */
  2707. function mergeHook (
  2708. parentVal,
  2709. childVal
  2710. ) {
  2711. var res = childVal
  2712. ? parentVal
  2713. ? parentVal.concat(childVal)
  2714. : Array.isArray(childVal)
  2715. ? childVal
  2716. : [childVal]
  2717. : parentVal;
  2718. return res
  2719. ? dedupeHooks(res)
  2720. : res
  2721. }
  2722. function dedupeHooks (hooks) {
  2723. var res = [];
  2724. for (var i = 0; i < hooks.length; i++) {
  2725. if (res.indexOf(hooks[i]) === -1) {
  2726. res.push(hooks[i]);
  2727. }
  2728. }
  2729. return res
  2730. }
  2731. LIFECYCLE_HOOKS.forEach(function (hook) {
  2732. strats[hook] = mergeHook;
  2733. });
  2734. /**
  2735. * Assets
  2736. *
  2737. * When a vm is present (instance creation), we need to do
  2738. * a three-way merge between constructor options, instance
  2739. * options and parent options.
  2740. */
  2741. function mergeAssets (
  2742. parentVal,
  2743. childVal,
  2744. vm,
  2745. key
  2746. ) {
  2747. var res = Object.create(parentVal || null);
  2748. if (childVal) {
  2749. true && assertObjectType(key, childVal, vm);
  2750. return extend(res, childVal)
  2751. } else {
  2752. return res
  2753. }
  2754. }
  2755. ASSET_TYPES.forEach(function (type) {
  2756. strats[type + 's'] = mergeAssets;
  2757. });
  2758. /**
  2759. * Watchers.
  2760. *
  2761. * Watchers hashes should not overwrite one
  2762. * another, so we merge them as arrays.
  2763. */
  2764. strats.watch = function (
  2765. parentVal,
  2766. childVal,
  2767. vm,
  2768. key
  2769. ) {
  2770. // work around Firefox's Object.prototype.watch...
  2771. if (parentVal === nativeWatch) { parentVal = undefined; }
  2772. if (childVal === nativeWatch) { childVal = undefined; }
  2773. /* istanbul ignore if */
  2774. if (!childVal) { return Object.create(parentVal || null) }
  2775. if (true) {
  2776. assertObjectType(key, childVal, vm);
  2777. }
  2778. if (!parentVal) { return childVal }
  2779. var ret = {};
  2780. extend(ret, parentVal);
  2781. for (var key$1 in childVal) {
  2782. var parent = ret[key$1];
  2783. var child = childVal[key$1];
  2784. if (parent && !Array.isArray(parent)) {
  2785. parent = [parent];
  2786. }
  2787. ret[key$1] = parent
  2788. ? parent.concat(child)
  2789. : Array.isArray(child) ? child : [child];
  2790. }
  2791. return ret
  2792. };
  2793. /**
  2794. * Other object hashes.
  2795. */
  2796. strats.props =
  2797. strats.methods =
  2798. strats.inject =
  2799. strats.computed = function (
  2800. parentVal,
  2801. childVal,
  2802. vm,
  2803. key
  2804. ) {
  2805. if (childVal && "development" !== 'production') {
  2806. assertObjectType(key, childVal, vm);
  2807. }
  2808. if (!parentVal) { return childVal }
  2809. var ret = Object.create(null);
  2810. extend(ret, parentVal);
  2811. if (childVal) { extend(ret, childVal); }
  2812. return ret
  2813. };
  2814. strats.provide = mergeDataOrFn;
  2815. /**
  2816. * Default strategy.
  2817. */
  2818. var defaultStrat = function (parentVal, childVal) {
  2819. return childVal === undefined
  2820. ? parentVal
  2821. : childVal
  2822. };
  2823. /**
  2824. * Validate component names
  2825. */
  2826. function checkComponents (options) {
  2827. for (var key in options.components) {
  2828. validateComponentName(key);
  2829. }
  2830. }
  2831. function validateComponentName (name) {
  2832. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  2833. warn(
  2834. 'Invalid component name: "' + name + '". Component names ' +
  2835. 'should conform to valid custom element name in html5 specification.'
  2836. );
  2837. }
  2838. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  2839. warn(
  2840. 'Do not use built-in or reserved HTML elements as component ' +
  2841. 'id: ' + name
  2842. );
  2843. }
  2844. }
  2845. /**
  2846. * Ensure all props option syntax are normalized into the
  2847. * Object-based format.
  2848. */
  2849. function normalizeProps (options, vm) {
  2850. var props = options.props;
  2851. if (!props) { return }
  2852. var res = {};
  2853. var i, val, name;
  2854. if (Array.isArray(props)) {
  2855. i = props.length;
  2856. while (i--) {
  2857. val = props[i];
  2858. if (typeof val === 'string') {
  2859. name = camelize(val);
  2860. res[name] = { type: null };
  2861. } else if (true) {
  2862. warn('props must be strings when using array syntax.');
  2863. }
  2864. }
  2865. } else if (isPlainObject(props)) {
  2866. for (var key in props) {
  2867. val = props[key];
  2868. name = camelize(key);
  2869. res[name] = isPlainObject(val)
  2870. ? val
  2871. : { type: val };
  2872. }
  2873. } else if (true) {
  2874. warn(
  2875. "Invalid value for option \"props\": expected an Array or an Object, " +
  2876. "but got " + (toRawType(props)) + ".",
  2877. vm
  2878. );
  2879. }
  2880. options.props = res;
  2881. }
  2882. /**
  2883. * Normalize all injections into Object-based format
  2884. */
  2885. function normalizeInject (options, vm) {
  2886. var inject = options.inject;
  2887. if (!inject) { return }
  2888. var normalized = options.inject = {};
  2889. if (Array.isArray(inject)) {
  2890. for (var i = 0; i < inject.length; i++) {
  2891. normalized[inject[i]] = { from: inject[i] };
  2892. }
  2893. } else if (isPlainObject(inject)) {
  2894. for (var key in inject) {
  2895. var val = inject[key];
  2896. normalized[key] = isPlainObject(val)
  2897. ? extend({ from: key }, val)
  2898. : { from: val };
  2899. }
  2900. } else if (true) {
  2901. warn(
  2902. "Invalid value for option \"inject\": expected an Array or an Object, " +
  2903. "but got " + (toRawType(inject)) + ".",
  2904. vm
  2905. );
  2906. }
  2907. }
  2908. /**
  2909. * Normalize raw function directives into object format.
  2910. */
  2911. function normalizeDirectives (options) {
  2912. var dirs = options.directives;
  2913. if (dirs) {
  2914. for (var key in dirs) {
  2915. var def$$1 = dirs[key];
  2916. if (typeof def$$1 === 'function') {
  2917. dirs[key] = { bind: def$$1, update: def$$1 };
  2918. }
  2919. }
  2920. }
  2921. }
  2922. function assertObjectType (name, value, vm) {
  2923. if (!isPlainObject(value)) {
  2924. warn(
  2925. "Invalid value for option \"" + name + "\": expected an Object, " +
  2926. "but got " + (toRawType(value)) + ".",
  2927. vm
  2928. );
  2929. }
  2930. }
  2931. /**
  2932. * Merge two option objects into a new one.
  2933. * Core utility used in both instantiation and inheritance.
  2934. */
  2935. function mergeOptions (
  2936. parent,
  2937. child,
  2938. vm
  2939. ) {
  2940. if (true) {
  2941. checkComponents(child);
  2942. }
  2943. if (typeof child === 'function') {
  2944. child = child.options;
  2945. }
  2946. normalizeProps(child, vm);
  2947. normalizeInject(child, vm);
  2948. normalizeDirectives(child);
  2949. // Apply extends and mixins on the child options,
  2950. // but only if it is a raw options object that isn't
  2951. // the result of another mergeOptions call.
  2952. // Only merged options has the _base property.
  2953. if (!child._base) {
  2954. if (child.extends) {
  2955. parent = mergeOptions(parent, child.extends, vm);
  2956. }
  2957. if (child.mixins) {
  2958. for (var i = 0, l = child.mixins.length; i < l; i++) {
  2959. parent = mergeOptions(parent, child.mixins[i], vm);
  2960. }
  2961. }
  2962. }
  2963. var options = {};
  2964. var key;
  2965. for (key in parent) {
  2966. mergeField(key);
  2967. }
  2968. for (key in child) {
  2969. if (!hasOwn(parent, key)) {
  2970. mergeField(key);
  2971. }
  2972. }
  2973. function mergeField (key) {
  2974. var strat = strats[key] || defaultStrat;
  2975. options[key] = strat(parent[key], child[key], vm, key);
  2976. }
  2977. return options
  2978. }
  2979. /**
  2980. * Resolve an asset.
  2981. * This function is used because child instances need access
  2982. * to assets defined in its ancestor chain.
  2983. */
  2984. function resolveAsset (
  2985. options,
  2986. type,
  2987. id,
  2988. warnMissing
  2989. ) {
  2990. /* istanbul ignore if */
  2991. if (typeof id !== 'string') {
  2992. return
  2993. }
  2994. var assets = options[type];
  2995. // check local registration variations first
  2996. if (hasOwn(assets, id)) { return assets[id] }
  2997. var camelizedId = camelize(id);
  2998. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  2999. var PascalCaseId = capitalize(camelizedId);
  3000. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  3001. // fallback to prototype chain
  3002. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  3003. if ( true && warnMissing && !res) {
  3004. warn(
  3005. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  3006. options
  3007. );
  3008. }
  3009. return res
  3010. }
  3011. /* */
  3012. function validateProp (
  3013. key,
  3014. propOptions,
  3015. propsData,
  3016. vm
  3017. ) {
  3018. var prop = propOptions[key];
  3019. var absent = !hasOwn(propsData, key);
  3020. var value = propsData[key];
  3021. // boolean casting
  3022. var booleanIndex = getTypeIndex(Boolean, prop.type);
  3023. if (booleanIndex > -1) {
  3024. if (absent && !hasOwn(prop, 'default')) {
  3025. value = false;
  3026. } else if (value === '' || value === hyphenate(key)) {
  3027. // only cast empty string / same name to boolean if
  3028. // boolean has higher priority
  3029. var stringIndex = getTypeIndex(String, prop.type);
  3030. if (stringIndex < 0 || booleanIndex < stringIndex) {
  3031. value = true;
  3032. }
  3033. }
  3034. }
  3035. // check default value
  3036. if (value === undefined) {
  3037. value = getPropDefaultValue(vm, prop, key);
  3038. // since the default value is a fresh copy,
  3039. // make sure to observe it.
  3040. var prevShouldObserve = shouldObserve;
  3041. toggleObserving(true);
  3042. observe(value);
  3043. toggleObserving(prevShouldObserve);
  3044. }
  3045. if (
  3046. true
  3047. ) {
  3048. assertProp(prop, key, value, vm, absent);
  3049. }
  3050. return value
  3051. }
  3052. /**
  3053. * Get the default value of a prop.
  3054. */
  3055. function getPropDefaultValue (vm, prop, key) {
  3056. // no default, return undefined
  3057. if (!hasOwn(prop, 'default')) {
  3058. return undefined
  3059. }
  3060. var def = prop.default;
  3061. // warn against non-factory defaults for Object & Array
  3062. if ( true && isObject(def)) {
  3063. warn(
  3064. 'Invalid default value for prop "' + key + '": ' +
  3065. 'Props with type Object/Array must use a factory function ' +
  3066. 'to return the default value.',
  3067. vm
  3068. );
  3069. }
  3070. // the raw prop value was also undefined from previous render,
  3071. // return previous default value to avoid unnecessary watcher trigger
  3072. if (vm && vm.$options.propsData &&
  3073. vm.$options.propsData[key] === undefined &&
  3074. vm._props[key] !== undefined
  3075. ) {
  3076. return vm._props[key]
  3077. }
  3078. // call factory function for non-Function types
  3079. // a value is Function if its prototype is function even across different execution context
  3080. return typeof def === 'function' && getType(prop.type) !== 'Function'
  3081. ? def.call(vm)
  3082. : def
  3083. }
  3084. /**
  3085. * Assert whether a prop is valid.
  3086. */
  3087. function assertProp (
  3088. prop,
  3089. name,
  3090. value,
  3091. vm,
  3092. absent
  3093. ) {
  3094. if (prop.required && absent) {
  3095. warn(
  3096. 'Missing required prop: "' + name + '"',
  3097. vm
  3098. );
  3099. return
  3100. }
  3101. if (value == null && !prop.required) {
  3102. return
  3103. }
  3104. var type = prop.type;
  3105. var valid = !type || type === true;
  3106. var expectedTypes = [];
  3107. if (type) {
  3108. if (!Array.isArray(type)) {
  3109. type = [type];
  3110. }
  3111. for (var i = 0; i < type.length && !valid; i++) {
  3112. var assertedType = assertType(value, type[i]);
  3113. expectedTypes.push(assertedType.expectedType || '');
  3114. valid = assertedType.valid;
  3115. }
  3116. }
  3117. if (!valid) {
  3118. warn(
  3119. getInvalidTypeMessage(name, value, expectedTypes),
  3120. vm
  3121. );
  3122. return
  3123. }
  3124. var validator = prop.validator;
  3125. if (validator) {
  3126. if (!validator(value)) {
  3127. warn(
  3128. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  3129. vm
  3130. );
  3131. }
  3132. }
  3133. }
  3134. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  3135. function assertType (value, type) {
  3136. var valid;
  3137. var expectedType = getType(type);
  3138. if (simpleCheckRE.test(expectedType)) {
  3139. var t = typeof value;
  3140. valid = t === expectedType.toLowerCase();
  3141. // for primitive wrapper objects
  3142. if (!valid && t === 'object') {
  3143. valid = value instanceof type;
  3144. }
  3145. } else if (expectedType === 'Object') {
  3146. valid = isPlainObject(value);
  3147. } else if (expectedType === 'Array') {
  3148. valid = Array.isArray(value);
  3149. } else {
  3150. valid = value instanceof type;
  3151. }
  3152. return {
  3153. valid: valid,
  3154. expectedType: expectedType
  3155. }
  3156. }
  3157. /**
  3158. * Use function string name to check built-in types,
  3159. * because a simple equality check will fail when running
  3160. * across different vms / iframes.
  3161. */
  3162. function getType (fn) {
  3163. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  3164. return match ? match[1] : ''
  3165. }
  3166. function isSameType (a, b) {
  3167. return getType(a) === getType(b)
  3168. }
  3169. function getTypeIndex (type, expectedTypes) {
  3170. if (!Array.isArray(expectedTypes)) {
  3171. return isSameType(expectedTypes, type) ? 0 : -1
  3172. }
  3173. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  3174. if (isSameType(expectedTypes[i], type)) {
  3175. return i
  3176. }
  3177. }
  3178. return -1
  3179. }
  3180. function getInvalidTypeMessage (name, value, expectedTypes) {
  3181. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  3182. " Expected " + (expectedTypes.map(capitalize).join(', '));
  3183. var expectedType = expectedTypes[0];
  3184. var receivedType = toRawType(value);
  3185. var expectedValue = styleValue(value, expectedType);
  3186. var receivedValue = styleValue(value, receivedType);
  3187. // check if we need to specify expected value
  3188. if (expectedTypes.length === 1 &&
  3189. isExplicable(expectedType) &&
  3190. !isBoolean(expectedType, receivedType)) {
  3191. message += " with value " + expectedValue;
  3192. }
  3193. message += ", got " + receivedType + " ";
  3194. // check if we need to specify received value
  3195. if (isExplicable(receivedType)) {
  3196. message += "with value " + receivedValue + ".";
  3197. }
  3198. return message
  3199. }
  3200. function styleValue (value, type) {
  3201. if (type === 'String') {
  3202. return ("\"" + value + "\"")
  3203. } else if (type === 'Number') {
  3204. return ("" + (Number(value)))
  3205. } else {
  3206. return ("" + value)
  3207. }
  3208. }
  3209. function isExplicable (value) {
  3210. var explicitTypes = ['string', 'number', 'boolean'];
  3211. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  3212. }
  3213. function isBoolean () {
  3214. var args = [], len = arguments.length;
  3215. while ( len-- ) args[ len ] = arguments[ len ];
  3216. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  3217. }
  3218. /* */
  3219. function handleError (err, vm, info) {
  3220. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  3221. // See: https://github.com/vuejs/vuex/issues/1505
  3222. pushTarget();
  3223. try {
  3224. if (vm) {
  3225. var cur = vm;
  3226. while ((cur = cur.$parent)) {
  3227. var hooks = cur.$options.errorCaptured;
  3228. if (hooks) {
  3229. for (var i = 0; i < hooks.length; i++) {
  3230. try {
  3231. var capture = hooks[i].call(cur, err, vm, info) === false;
  3232. if (capture) { return }
  3233. } catch (e) {
  3234. globalHandleError(e, cur, 'errorCaptured hook');
  3235. }
  3236. }
  3237. }
  3238. }
  3239. }
  3240. globalHandleError(err, vm, info);
  3241. } finally {
  3242. popTarget();
  3243. }
  3244. }
  3245. function invokeWithErrorHandling (
  3246. handler,
  3247. context,
  3248. args,
  3249. vm,
  3250. info
  3251. ) {
  3252. var res;
  3253. try {
  3254. res = args ? handler.apply(context, args) : handler.call(context);
  3255. if (res && !res._isVue && isPromise(res) && !res._handled) {
  3256. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  3257. // issue #9511
  3258. // avoid catch triggering multiple times when nested calls
  3259. res._handled = true;
  3260. }
  3261. } catch (e) {
  3262. handleError(e, vm, info);
  3263. }
  3264. return res
  3265. }
  3266. function globalHandleError (err, vm, info) {
  3267. if (config.errorHandler) {
  3268. try {
  3269. return config.errorHandler.call(null, err, vm, info)
  3270. } catch (e) {
  3271. // if the user intentionally throws the original error in the handler,
  3272. // do not log it twice
  3273. if (e !== err) {
  3274. logError(e, null, 'config.errorHandler');
  3275. }
  3276. }
  3277. }
  3278. logError(err, vm, info);
  3279. }
  3280. function logError (err, vm, info) {
  3281. if (true) {
  3282. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  3283. }
  3284. /* istanbul ignore else */
  3285. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  3286. console.error(err);
  3287. } else {
  3288. throw err
  3289. }
  3290. }
  3291. /* */
  3292. var callbacks = [];
  3293. var pending = false;
  3294. function flushCallbacks () {
  3295. pending = false;
  3296. var copies = callbacks.slice(0);
  3297. callbacks.length = 0;
  3298. for (var i = 0; i < copies.length; i++) {
  3299. copies[i]();
  3300. }
  3301. }
  3302. // Here we have async deferring wrappers using microtasks.
  3303. // In 2.5 we used (macro) tasks (in combination with microtasks).
  3304. // However, it has subtle problems when state is changed right before repaint
  3305. // (e.g. #6813, out-in transitions).
  3306. // Also, using (macro) tasks in event handler would cause some weird behaviors
  3307. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  3308. // So we now use microtasks everywhere, again.
  3309. // A major drawback of this tradeoff is that there are some scenarios
  3310. // where microtasks have too high a priority and fire in between supposedly
  3311. // sequential events (e.g. #4521, #6690, which have workarounds)
  3312. // or even between bubbling of the same event (#6566).
  3313. var timerFunc;
  3314. // The nextTick behavior leverages the microtask queue, which can be accessed
  3315. // via either native Promise.then or MutationObserver.
  3316. // MutationObserver has wider support, however it is seriously bugged in
  3317. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  3318. // completely stops working after triggering a few times... so, if native
  3319. // Promise is available, we will use it:
  3320. /* istanbul ignore next, $flow-disable-line */
  3321. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  3322. var p = Promise.resolve();
  3323. timerFunc = function () {
  3324. p.then(flushCallbacks);
  3325. // In problematic UIWebViews, Promise.then doesn't completely break, but
  3326. // it can get stuck in a weird state where callbacks are pushed into the
  3327. // microtask queue but the queue isn't being flushed, until the browser
  3328. // needs to do some other work, e.g. handle a timer. Therefore we can
  3329. // "force" the microtask queue to be flushed by adding an empty timer.
  3330. if (isIOS) { setTimeout(noop); }
  3331. };
  3332. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  3333. isNative(MutationObserver) ||
  3334. // PhantomJS and iOS 7.x
  3335. MutationObserver.toString() === '[object MutationObserverConstructor]'
  3336. )) {
  3337. // Use MutationObserver where native Promise is not available,
  3338. // e.g. PhantomJS, iOS7, Android 4.4
  3339. // (#6466 MutationObserver is unreliable in IE11)
  3340. var counter = 1;
  3341. var observer = new MutationObserver(flushCallbacks);
  3342. var textNode = document.createTextNode(String(counter));
  3343. observer.observe(textNode, {
  3344. characterData: true
  3345. });
  3346. timerFunc = function () {
  3347. counter = (counter + 1) % 2;
  3348. textNode.data = String(counter);
  3349. };
  3350. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  3351. // Fallback to setImmediate.
  3352. // Technically it leverages the (macro) task queue,
  3353. // but it is still a better choice than setTimeout.
  3354. timerFunc = function () {
  3355. setImmediate(flushCallbacks);
  3356. };
  3357. } else {
  3358. // Fallback to setTimeout.
  3359. timerFunc = function () {
  3360. setTimeout(flushCallbacks, 0);
  3361. };
  3362. }
  3363. function nextTick (cb, ctx) {
  3364. var _resolve;
  3365. callbacks.push(function () {
  3366. if (cb) {
  3367. try {
  3368. cb.call(ctx);
  3369. } catch (e) {
  3370. handleError(e, ctx, 'nextTick');
  3371. }
  3372. } else if (_resolve) {
  3373. _resolve(ctx);
  3374. }
  3375. });
  3376. if (!pending) {
  3377. pending = true;
  3378. timerFunc();
  3379. }
  3380. // $flow-disable-line
  3381. if (!cb && typeof Promise !== 'undefined') {
  3382. return new Promise(function (resolve) {
  3383. _resolve = resolve;
  3384. })
  3385. }
  3386. }
  3387. /* */
  3388. /* not type checking this file because flow doesn't play well with Proxy */
  3389. var initProxy;
  3390. if (true) {
  3391. var allowedGlobals = makeMap(
  3392. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  3393. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  3394. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  3395. 'require' // for Webpack/Browserify
  3396. );
  3397. var warnNonPresent = function (target, key) {
  3398. warn(
  3399. "Property or method \"" + key + "\" is not defined on the instance but " +
  3400. 'referenced during render. Make sure that this property is reactive, ' +
  3401. 'either in the data option, or for class-based components, by ' +
  3402. 'initializing the property. ' +
  3403. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  3404. target
  3405. );
  3406. };
  3407. var warnReservedPrefix = function (target, key) {
  3408. warn(
  3409. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  3410. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  3411. 'prevent conflicts with Vue internals. ' +
  3412. 'See: https://vuejs.org/v2/api/#data',
  3413. target
  3414. );
  3415. };
  3416. var hasProxy =
  3417. typeof Proxy !== 'undefined' && isNative(Proxy);
  3418. if (hasProxy) {
  3419. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  3420. config.keyCodes = new Proxy(config.keyCodes, {
  3421. set: function set (target, key, value) {
  3422. if (isBuiltInModifier(key)) {
  3423. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  3424. return false
  3425. } else {
  3426. target[key] = value;
  3427. return true
  3428. }
  3429. }
  3430. });
  3431. }
  3432. var hasHandler = {
  3433. has: function has (target, key) {
  3434. var has = key in target;
  3435. var isAllowed = allowedGlobals(key) ||
  3436. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  3437. if (!has && !isAllowed) {
  3438. if (key in target.$data) { warnReservedPrefix(target, key); }
  3439. else { warnNonPresent(target, key); }
  3440. }
  3441. return has || !isAllowed
  3442. }
  3443. };
  3444. var getHandler = {
  3445. get: function get (target, key) {
  3446. if (typeof key === 'string' && !(key in target)) {
  3447. if (key in target.$data) { warnReservedPrefix(target, key); }
  3448. else { warnNonPresent(target, key); }
  3449. }
  3450. return target[key]
  3451. }
  3452. };
  3453. initProxy = function initProxy (vm) {
  3454. if (hasProxy) {
  3455. // determine which proxy handler to use
  3456. var options = vm.$options;
  3457. var handlers = options.render && options.render._withStripped
  3458. ? getHandler
  3459. : hasHandler;
  3460. vm._renderProxy = new Proxy(vm, handlers);
  3461. } else {
  3462. vm._renderProxy = vm;
  3463. }
  3464. };
  3465. }
  3466. /* */
  3467. var seenObjects = new _Set();
  3468. /**
  3469. * Recursively traverse an object to evoke all converted
  3470. * getters, so that every nested property inside the object
  3471. * is collected as a "deep" dependency.
  3472. */
  3473. function traverse (val) {
  3474. _traverse(val, seenObjects);
  3475. seenObjects.clear();
  3476. }
  3477. function _traverse (val, seen) {
  3478. var i, keys;
  3479. var isA = Array.isArray(val);
  3480. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  3481. return
  3482. }
  3483. if (val.__ob__) {
  3484. var depId = val.__ob__.dep.id;
  3485. if (seen.has(depId)) {
  3486. return
  3487. }
  3488. seen.add(depId);
  3489. }
  3490. if (isA) {
  3491. i = val.length;
  3492. while (i--) { _traverse(val[i], seen); }
  3493. } else {
  3494. keys = Object.keys(val);
  3495. i = keys.length;
  3496. while (i--) { _traverse(val[keys[i]], seen); }
  3497. }
  3498. }
  3499. var mark;
  3500. var measure;
  3501. if (true) {
  3502. var perf = inBrowser && window.performance;
  3503. /* istanbul ignore if */
  3504. if (
  3505. perf &&
  3506. perf.mark &&
  3507. perf.measure &&
  3508. perf.clearMarks &&
  3509. perf.clearMeasures
  3510. ) {
  3511. mark = function (tag) { return perf.mark(tag); };
  3512. measure = function (name, startTag, endTag) {
  3513. perf.measure(name, startTag, endTag);
  3514. perf.clearMarks(startTag);
  3515. perf.clearMarks(endTag);
  3516. // perf.clearMeasures(name)
  3517. };
  3518. }
  3519. }
  3520. /* */
  3521. var normalizeEvent = cached(function (name) {
  3522. var passive = name.charAt(0) === '&';
  3523. name = passive ? name.slice(1) : name;
  3524. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  3525. name = once$$1 ? name.slice(1) : name;
  3526. var capture = name.charAt(0) === '!';
  3527. name = capture ? name.slice(1) : name;
  3528. return {
  3529. name: name,
  3530. once: once$$1,
  3531. capture: capture,
  3532. passive: passive
  3533. }
  3534. });
  3535. function createFnInvoker (fns, vm) {
  3536. function invoker () {
  3537. var arguments$1 = arguments;
  3538. var fns = invoker.fns;
  3539. if (Array.isArray(fns)) {
  3540. var cloned = fns.slice();
  3541. for (var i = 0; i < cloned.length; i++) {
  3542. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  3543. }
  3544. } else {
  3545. // return handler return value for single handlers
  3546. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  3547. }
  3548. }
  3549. invoker.fns = fns;
  3550. return invoker
  3551. }
  3552. function updateListeners (
  3553. on,
  3554. oldOn,
  3555. add,
  3556. remove$$1,
  3557. createOnceHandler,
  3558. vm
  3559. ) {
  3560. var name, def$$1, cur, old, event;
  3561. for (name in on) {
  3562. def$$1 = cur = on[name];
  3563. old = oldOn[name];
  3564. event = normalizeEvent(name);
  3565. if (isUndef(cur)) {
  3566. true && warn(
  3567. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  3568. vm
  3569. );
  3570. } else if (isUndef(old)) {
  3571. if (isUndef(cur.fns)) {
  3572. cur = on[name] = createFnInvoker(cur, vm);
  3573. }
  3574. if (isTrue(event.once)) {
  3575. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  3576. }
  3577. add(event.name, cur, event.capture, event.passive, event.params);
  3578. } else if (cur !== old) {
  3579. old.fns = cur;
  3580. on[name] = old;
  3581. }
  3582. }
  3583. for (name in oldOn) {
  3584. if (isUndef(on[name])) {
  3585. event = normalizeEvent(name);
  3586. remove$$1(event.name, oldOn[name], event.capture);
  3587. }
  3588. }
  3589. }
  3590. /* */
  3591. /* */
  3592. // fixed by xxxxxx (mp properties)
  3593. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  3594. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  3595. if (isUndef(propOptions)) {
  3596. return res
  3597. }
  3598. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  3599. var attrs = data.attrs;
  3600. var props = data.props;
  3601. if (isDef(attrs) || isDef(props)) {
  3602. for (var key in propOptions) {
  3603. var altKey = hyphenate(key);
  3604. var result = checkProp(res, props, key, altKey, true) ||
  3605. checkProp(res, attrs, key, altKey, false);
  3606. // externalClass
  3607. if (
  3608. result &&
  3609. res[key] &&
  3610. externalClasses.indexOf(altKey) !== -1 &&
  3611. context[camelize(res[key])]
  3612. ) {
  3613. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  3614. res[key] = context[camelize(res[key])];
  3615. }
  3616. }
  3617. }
  3618. return res
  3619. }
  3620. function extractPropsFromVNodeData (
  3621. data,
  3622. Ctor,
  3623. tag,
  3624. context// fixed by xxxxxx
  3625. ) {
  3626. // we are only extracting raw values here.
  3627. // validation and default values are handled in the child
  3628. // component itself.
  3629. var propOptions = Ctor.options.props;
  3630. if (isUndef(propOptions)) {
  3631. // fixed by xxxxxx
  3632. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  3633. }
  3634. var res = {};
  3635. var attrs = data.attrs;
  3636. var props = data.props;
  3637. if (isDef(attrs) || isDef(props)) {
  3638. for (var key in propOptions) {
  3639. var altKey = hyphenate(key);
  3640. if (true) {
  3641. var keyInLowerCase = key.toLowerCase();
  3642. if (
  3643. key !== keyInLowerCase &&
  3644. attrs && hasOwn(attrs, keyInLowerCase)
  3645. ) {
  3646. tip(
  3647. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  3648. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  3649. " \"" + key + "\". " +
  3650. "Note that HTML attributes are case-insensitive and camelCased " +
  3651. "props need to use their kebab-case equivalents when using in-DOM " +
  3652. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  3653. );
  3654. }
  3655. }
  3656. checkProp(res, props, key, altKey, true) ||
  3657. checkProp(res, attrs, key, altKey, false);
  3658. }
  3659. }
  3660. // fixed by xxxxxx
  3661. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  3662. }
  3663. function checkProp (
  3664. res,
  3665. hash,
  3666. key,
  3667. altKey,
  3668. preserve
  3669. ) {
  3670. if (isDef(hash)) {
  3671. if (hasOwn(hash, key)) {
  3672. res[key] = hash[key];
  3673. if (!preserve) {
  3674. delete hash[key];
  3675. }
  3676. return true
  3677. } else if (hasOwn(hash, altKey)) {
  3678. res[key] = hash[altKey];
  3679. if (!preserve) {
  3680. delete hash[altKey];
  3681. }
  3682. return true
  3683. }
  3684. }
  3685. return false
  3686. }
  3687. /* */
  3688. // The template compiler attempts to minimize the need for normalization by
  3689. // statically analyzing the template at compile time.
  3690. //
  3691. // For plain HTML markup, normalization can be completely skipped because the
  3692. // generated render function is guaranteed to return Array<VNode>. There are
  3693. // two cases where extra normalization is needed:
  3694. // 1. When the children contains components - because a functional component
  3695. // may return an Array instead of a single root. In this case, just a simple
  3696. // normalization is needed - if any child is an Array, we flatten the whole
  3697. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  3698. // because functional components already normalize their own children.
  3699. function simpleNormalizeChildren (children) {
  3700. for (var i = 0; i < children.length; i++) {
  3701. if (Array.isArray(children[i])) {
  3702. return Array.prototype.concat.apply([], children)
  3703. }
  3704. }
  3705. return children
  3706. }
  3707. // 2. When the children contains constructs that always generated nested Arrays,
  3708. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  3709. // with hand-written render functions / JSX. In such cases a full normalization
  3710. // is needed to cater to all possible types of children values.
  3711. function normalizeChildren (children) {
  3712. return isPrimitive(children)
  3713. ? [createTextVNode(children)]
  3714. : Array.isArray(children)
  3715. ? normalizeArrayChildren(children)
  3716. : undefined
  3717. }
  3718. function isTextNode (node) {
  3719. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  3720. }
  3721. function normalizeArrayChildren (children, nestedIndex) {
  3722. var res = [];
  3723. var i, c, lastIndex, last;
  3724. for (i = 0; i < children.length; i++) {
  3725. c = children[i];
  3726. if (isUndef(c) || typeof c === 'boolean') { continue }
  3727. lastIndex = res.length - 1;
  3728. last = res[lastIndex];
  3729. // nested
  3730. if (Array.isArray(c)) {
  3731. if (c.length > 0) {
  3732. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  3733. // merge adjacent text nodes
  3734. if (isTextNode(c[0]) && isTextNode(last)) {
  3735. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  3736. c.shift();
  3737. }
  3738. res.push.apply(res, c);
  3739. }
  3740. } else if (isPrimitive(c)) {
  3741. if (isTextNode(last)) {
  3742. // merge adjacent text nodes
  3743. // this is necessary for SSR hydration because text nodes are
  3744. // essentially merged when rendered to HTML strings
  3745. res[lastIndex] = createTextVNode(last.text + c);
  3746. } else if (c !== '') {
  3747. // convert primitive to vnode
  3748. res.push(createTextVNode(c));
  3749. }
  3750. } else {
  3751. if (isTextNode(c) && isTextNode(last)) {
  3752. // merge adjacent text nodes
  3753. res[lastIndex] = createTextVNode(last.text + c.text);
  3754. } else {
  3755. // default key for nested array children (likely generated by v-for)
  3756. if (isTrue(children._isVList) &&
  3757. isDef(c.tag) &&
  3758. isUndef(c.key) &&
  3759. isDef(nestedIndex)) {
  3760. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  3761. }
  3762. res.push(c);
  3763. }
  3764. }
  3765. }
  3766. return res
  3767. }
  3768. /* */
  3769. function initProvide (vm) {
  3770. var provide = vm.$options.provide;
  3771. if (provide) {
  3772. vm._provided = typeof provide === 'function'
  3773. ? provide.call(vm)
  3774. : provide;
  3775. }
  3776. }
  3777. function initInjections (vm) {
  3778. var result = resolveInject(vm.$options.inject, vm);
  3779. if (result) {
  3780. toggleObserving(false);
  3781. Object.keys(result).forEach(function (key) {
  3782. /* istanbul ignore else */
  3783. if (true) {
  3784. defineReactive$$1(vm, key, result[key], function () {
  3785. warn(
  3786. "Avoid mutating an injected value directly since the changes will be " +
  3787. "overwritten whenever the provided component re-renders. " +
  3788. "injection being mutated: \"" + key + "\"",
  3789. vm
  3790. );
  3791. });
  3792. } else {}
  3793. });
  3794. toggleObserving(true);
  3795. }
  3796. }
  3797. function resolveInject (inject, vm) {
  3798. if (inject) {
  3799. // inject is :any because flow is not smart enough to figure out cached
  3800. var result = Object.create(null);
  3801. var keys = hasSymbol
  3802. ? Reflect.ownKeys(inject)
  3803. : Object.keys(inject);
  3804. for (var i = 0; i < keys.length; i++) {
  3805. var key = keys[i];
  3806. // #6574 in case the inject object is observed...
  3807. if (key === '__ob__') { continue }
  3808. var provideKey = inject[key].from;
  3809. var source = vm;
  3810. while (source) {
  3811. if (source._provided && hasOwn(source._provided, provideKey)) {
  3812. result[key] = source._provided[provideKey];
  3813. break
  3814. }
  3815. source = source.$parent;
  3816. }
  3817. if (!source) {
  3818. if ('default' in inject[key]) {
  3819. var provideDefault = inject[key].default;
  3820. result[key] = typeof provideDefault === 'function'
  3821. ? provideDefault.call(vm)
  3822. : provideDefault;
  3823. } else if (true) {
  3824. warn(("Injection \"" + key + "\" not found"), vm);
  3825. }
  3826. }
  3827. }
  3828. return result
  3829. }
  3830. }
  3831. /* */
  3832. /**
  3833. * Runtime helper for resolving raw children VNodes into a slot object.
  3834. */
  3835. function resolveSlots (
  3836. children,
  3837. context
  3838. ) {
  3839. if (!children || !children.length) {
  3840. return {}
  3841. }
  3842. var slots = {};
  3843. for (var i = 0, l = children.length; i < l; i++) {
  3844. var child = children[i];
  3845. var data = child.data;
  3846. // remove slot attribute if the node is resolved as a Vue slot node
  3847. if (data && data.attrs && data.attrs.slot) {
  3848. delete data.attrs.slot;
  3849. }
  3850. // named slots should only be respected if the vnode was rendered in the
  3851. // same context.
  3852. if ((child.context === context || child.fnContext === context) &&
  3853. data && data.slot != null
  3854. ) {
  3855. var name = data.slot;
  3856. var slot = (slots[name] || (slots[name] = []));
  3857. if (child.tag === 'template') {
  3858. slot.push.apply(slot, child.children || []);
  3859. } else {
  3860. slot.push(child);
  3861. }
  3862. } else {
  3863. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  3864. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  3865. (slots['page'] || (slots['page'] = [])).push(child);
  3866. }else{
  3867. (slots.default || (slots.default = [])).push(child);
  3868. }
  3869. }
  3870. }
  3871. // ignore slots that contains only whitespace
  3872. for (var name$1 in slots) {
  3873. if (slots[name$1].every(isWhitespace)) {
  3874. delete slots[name$1];
  3875. }
  3876. }
  3877. return slots
  3878. }
  3879. function isWhitespace (node) {
  3880. return (node.isComment && !node.asyncFactory) || node.text === ' '
  3881. }
  3882. /* */
  3883. function normalizeScopedSlots (
  3884. slots,
  3885. normalSlots,
  3886. prevSlots
  3887. ) {
  3888. var res;
  3889. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  3890. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  3891. var key = slots && slots.$key;
  3892. if (!slots) {
  3893. res = {};
  3894. } else if (slots._normalized) {
  3895. // fast path 1: child component re-render only, parent did not change
  3896. return slots._normalized
  3897. } else if (
  3898. isStable &&
  3899. prevSlots &&
  3900. prevSlots !== emptyObject &&
  3901. key === prevSlots.$key &&
  3902. !hasNormalSlots &&
  3903. !prevSlots.$hasNormal
  3904. ) {
  3905. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  3906. // only need to normalize once
  3907. return prevSlots
  3908. } else {
  3909. res = {};
  3910. for (var key$1 in slots) {
  3911. if (slots[key$1] && key$1[0] !== '$') {
  3912. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  3913. }
  3914. }
  3915. }
  3916. // expose normal slots on scopedSlots
  3917. for (var key$2 in normalSlots) {
  3918. if (!(key$2 in res)) {
  3919. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  3920. }
  3921. }
  3922. // avoriaz seems to mock a non-extensible $scopedSlots object
  3923. // and when that is passed down this would cause an error
  3924. if (slots && Object.isExtensible(slots)) {
  3925. (slots)._normalized = res;
  3926. }
  3927. def(res, '$stable', isStable);
  3928. def(res, '$key', key);
  3929. def(res, '$hasNormal', hasNormalSlots);
  3930. return res
  3931. }
  3932. function normalizeScopedSlot(normalSlots, key, fn) {
  3933. var normalized = function () {
  3934. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  3935. res = res && typeof res === 'object' && !Array.isArray(res)
  3936. ? [res] // single vnode
  3937. : normalizeChildren(res);
  3938. return res && (
  3939. res.length === 0 ||
  3940. (res.length === 1 && res[0].isComment) // #9658
  3941. ) ? undefined
  3942. : res
  3943. };
  3944. // this is a slot using the new v-slot syntax without scope. although it is
  3945. // compiled as a scoped slot, render fn users would expect it to be present
  3946. // on this.$slots because the usage is semantically a normal slot.
  3947. if (fn.proxy) {
  3948. Object.defineProperty(normalSlots, key, {
  3949. get: normalized,
  3950. enumerable: true,
  3951. configurable: true
  3952. });
  3953. }
  3954. return normalized
  3955. }
  3956. function proxyNormalSlot(slots, key) {
  3957. return function () { return slots[key]; }
  3958. }
  3959. /* */
  3960. /**
  3961. * Runtime helper for rendering v-for lists.
  3962. */
  3963. function renderList (
  3964. val,
  3965. render
  3966. ) {
  3967. var ret, i, l, keys, key;
  3968. if (Array.isArray(val) || typeof val === 'string') {
  3969. ret = new Array(val.length);
  3970. for (i = 0, l = val.length; i < l; i++) {
  3971. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  3972. }
  3973. } else if (typeof val === 'number') {
  3974. ret = new Array(val);
  3975. for (i = 0; i < val; i++) {
  3976. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  3977. }
  3978. } else if (isObject(val)) {
  3979. if (hasSymbol && val[Symbol.iterator]) {
  3980. ret = [];
  3981. var iterator = val[Symbol.iterator]();
  3982. var result = iterator.next();
  3983. while (!result.done) {
  3984. ret.push(render(result.value, ret.length, i++, i)); // fixed by xxxxxx
  3985. result = iterator.next();
  3986. }
  3987. } else {
  3988. keys = Object.keys(val);
  3989. ret = new Array(keys.length);
  3990. for (i = 0, l = keys.length; i < l; i++) {
  3991. key = keys[i];
  3992. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  3993. }
  3994. }
  3995. }
  3996. if (!isDef(ret)) {
  3997. ret = [];
  3998. }
  3999. (ret)._isVList = true;
  4000. return ret
  4001. }
  4002. /* */
  4003. /**
  4004. * Runtime helper for rendering <slot>
  4005. */
  4006. function renderSlot (
  4007. name,
  4008. fallback,
  4009. props,
  4010. bindObject
  4011. ) {
  4012. var scopedSlotFn = this.$scopedSlots[name];
  4013. var nodes;
  4014. if (scopedSlotFn) { // scoped slot
  4015. props = props || {};
  4016. if (bindObject) {
  4017. if ( true && !isObject(bindObject)) {
  4018. warn(
  4019. 'slot v-bind without argument expects an Object',
  4020. this
  4021. );
  4022. }
  4023. props = extend(extend({}, bindObject), props);
  4024. }
  4025. // fixed by xxxxxx app-plus scopedSlot
  4026. nodes = scopedSlotFn(props, this, props._i) || fallback;
  4027. } else {
  4028. nodes = this.$slots[name] || fallback;
  4029. }
  4030. var target = props && props.slot;
  4031. if (target) {
  4032. return this.$createElement('template', { slot: target }, nodes)
  4033. } else {
  4034. return nodes
  4035. }
  4036. }
  4037. /* */
  4038. /**
  4039. * Runtime helper for resolving filters
  4040. */
  4041. function resolveFilter (id) {
  4042. return resolveAsset(this.$options, 'filters', id, true) || identity
  4043. }
  4044. /* */
  4045. function isKeyNotMatch (expect, actual) {
  4046. if (Array.isArray(expect)) {
  4047. return expect.indexOf(actual) === -1
  4048. } else {
  4049. return expect !== actual
  4050. }
  4051. }
  4052. /**
  4053. * Runtime helper for checking keyCodes from config.
  4054. * exposed as Vue.prototype._k
  4055. * passing in eventKeyName as last argument separately for backwards compat
  4056. */
  4057. function checkKeyCodes (
  4058. eventKeyCode,
  4059. key,
  4060. builtInKeyCode,
  4061. eventKeyName,
  4062. builtInKeyName
  4063. ) {
  4064. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  4065. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  4066. return isKeyNotMatch(builtInKeyName, eventKeyName)
  4067. } else if (mappedKeyCode) {
  4068. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  4069. } else if (eventKeyName) {
  4070. return hyphenate(eventKeyName) !== key
  4071. }
  4072. }
  4073. /* */
  4074. /**
  4075. * Runtime helper for merging v-bind="object" into a VNode's data.
  4076. */
  4077. function bindObjectProps (
  4078. data,
  4079. tag,
  4080. value,
  4081. asProp,
  4082. isSync
  4083. ) {
  4084. if (value) {
  4085. if (!isObject(value)) {
  4086. true && warn(
  4087. 'v-bind without argument expects an Object or Array value',
  4088. this
  4089. );
  4090. } else {
  4091. if (Array.isArray(value)) {
  4092. value = toObject(value);
  4093. }
  4094. var hash;
  4095. var loop = function ( key ) {
  4096. if (
  4097. key === 'class' ||
  4098. key === 'style' ||
  4099. isReservedAttribute(key)
  4100. ) {
  4101. hash = data;
  4102. } else {
  4103. var type = data.attrs && data.attrs.type;
  4104. hash = asProp || config.mustUseProp(tag, type, key)
  4105. ? data.domProps || (data.domProps = {})
  4106. : data.attrs || (data.attrs = {});
  4107. }
  4108. var camelizedKey = camelize(key);
  4109. var hyphenatedKey = hyphenate(key);
  4110. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  4111. hash[key] = value[key];
  4112. if (isSync) {
  4113. var on = data.on || (data.on = {});
  4114. on[("update:" + key)] = function ($event) {
  4115. value[key] = $event;
  4116. };
  4117. }
  4118. }
  4119. };
  4120. for (var key in value) loop( key );
  4121. }
  4122. }
  4123. return data
  4124. }
  4125. /* */
  4126. /**
  4127. * Runtime helper for rendering static trees.
  4128. */
  4129. function renderStatic (
  4130. index,
  4131. isInFor
  4132. ) {
  4133. var cached = this._staticTrees || (this._staticTrees = []);
  4134. var tree = cached[index];
  4135. // if has already-rendered static tree and not inside v-for,
  4136. // we can reuse the same tree.
  4137. if (tree && !isInFor) {
  4138. return tree
  4139. }
  4140. // otherwise, render a fresh tree.
  4141. tree = cached[index] = this.$options.staticRenderFns[index].call(
  4142. this._renderProxy,
  4143. null,
  4144. this // for render fns generated for functional component templates
  4145. );
  4146. markStatic(tree, ("__static__" + index), false);
  4147. return tree
  4148. }
  4149. /**
  4150. * Runtime helper for v-once.
  4151. * Effectively it means marking the node as static with a unique key.
  4152. */
  4153. function markOnce (
  4154. tree,
  4155. index,
  4156. key
  4157. ) {
  4158. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  4159. return tree
  4160. }
  4161. function markStatic (
  4162. tree,
  4163. key,
  4164. isOnce
  4165. ) {
  4166. if (Array.isArray(tree)) {
  4167. for (var i = 0; i < tree.length; i++) {
  4168. if (tree[i] && typeof tree[i] !== 'string') {
  4169. markStaticNode(tree[i], (key + "_" + i), isOnce);
  4170. }
  4171. }
  4172. } else {
  4173. markStaticNode(tree, key, isOnce);
  4174. }
  4175. }
  4176. function markStaticNode (node, key, isOnce) {
  4177. node.isStatic = true;
  4178. node.key = key;
  4179. node.isOnce = isOnce;
  4180. }
  4181. /* */
  4182. function bindObjectListeners (data, value) {
  4183. if (value) {
  4184. if (!isPlainObject(value)) {
  4185. true && warn(
  4186. 'v-on without argument expects an Object value',
  4187. this
  4188. );
  4189. } else {
  4190. var on = data.on = data.on ? extend({}, data.on) : {};
  4191. for (var key in value) {
  4192. var existing = on[key];
  4193. var ours = value[key];
  4194. on[key] = existing ? [].concat(existing, ours) : ours;
  4195. }
  4196. }
  4197. }
  4198. return data
  4199. }
  4200. /* */
  4201. function resolveScopedSlots (
  4202. fns, // see flow/vnode
  4203. res,
  4204. // the following are added in 2.6
  4205. hasDynamicKeys,
  4206. contentHashKey
  4207. ) {
  4208. res = res || { $stable: !hasDynamicKeys };
  4209. for (var i = 0; i < fns.length; i++) {
  4210. var slot = fns[i];
  4211. if (Array.isArray(slot)) {
  4212. resolveScopedSlots(slot, res, hasDynamicKeys);
  4213. } else if (slot) {
  4214. // marker for reverse proxying v-slot without scope on this.$slots
  4215. if (slot.proxy) {
  4216. slot.fn.proxy = true;
  4217. }
  4218. res[slot.key] = slot.fn;
  4219. }
  4220. }
  4221. if (contentHashKey) {
  4222. (res).$key = contentHashKey;
  4223. }
  4224. return res
  4225. }
  4226. /* */
  4227. function bindDynamicKeys (baseObj, values) {
  4228. for (var i = 0; i < values.length; i += 2) {
  4229. var key = values[i];
  4230. if (typeof key === 'string' && key) {
  4231. baseObj[values[i]] = values[i + 1];
  4232. } else if ( true && key !== '' && key !== null) {
  4233. // null is a special value for explicitly removing a binding
  4234. warn(
  4235. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  4236. this
  4237. );
  4238. }
  4239. }
  4240. return baseObj
  4241. }
  4242. // helper to dynamically append modifier runtime markers to event names.
  4243. // ensure only append when value is already string, otherwise it will be cast
  4244. // to string and cause the type check to miss.
  4245. function prependModifier (value, symbol) {
  4246. return typeof value === 'string' ? symbol + value : value
  4247. }
  4248. /* */
  4249. function installRenderHelpers (target) {
  4250. target._o = markOnce;
  4251. target._n = toNumber;
  4252. target._s = toString;
  4253. target._l = renderList;
  4254. target._t = renderSlot;
  4255. target._q = looseEqual;
  4256. target._i = looseIndexOf;
  4257. target._m = renderStatic;
  4258. target._f = resolveFilter;
  4259. target._k = checkKeyCodes;
  4260. target._b = bindObjectProps;
  4261. target._v = createTextVNode;
  4262. target._e = createEmptyVNode;
  4263. target._u = resolveScopedSlots;
  4264. target._g = bindObjectListeners;
  4265. target._d = bindDynamicKeys;
  4266. target._p = prependModifier;
  4267. }
  4268. /* */
  4269. function FunctionalRenderContext (
  4270. data,
  4271. props,
  4272. children,
  4273. parent,
  4274. Ctor
  4275. ) {
  4276. var this$1 = this;
  4277. var options = Ctor.options;
  4278. // ensure the createElement function in functional components
  4279. // gets a unique context - this is necessary for correct named slot check
  4280. var contextVm;
  4281. if (hasOwn(parent, '_uid')) {
  4282. contextVm = Object.create(parent);
  4283. // $flow-disable-line
  4284. contextVm._original = parent;
  4285. } else {
  4286. // the context vm passed in is a functional context as well.
  4287. // in this case we want to make sure we are able to get a hold to the
  4288. // real context instance.
  4289. contextVm = parent;
  4290. // $flow-disable-line
  4291. parent = parent._original;
  4292. }
  4293. var isCompiled = isTrue(options._compiled);
  4294. var needNormalization = !isCompiled;
  4295. this.data = data;
  4296. this.props = props;
  4297. this.children = children;
  4298. this.parent = parent;
  4299. this.listeners = data.on || emptyObject;
  4300. this.injections = resolveInject(options.inject, parent);
  4301. this.slots = function () {
  4302. if (!this$1.$slots) {
  4303. normalizeScopedSlots(
  4304. data.scopedSlots,
  4305. this$1.$slots = resolveSlots(children, parent)
  4306. );
  4307. }
  4308. return this$1.$slots
  4309. };
  4310. Object.defineProperty(this, 'scopedSlots', ({
  4311. enumerable: true,
  4312. get: function get () {
  4313. return normalizeScopedSlots(data.scopedSlots, this.slots())
  4314. }
  4315. }));
  4316. // support for compiled functional template
  4317. if (isCompiled) {
  4318. // exposing $options for renderStatic()
  4319. this.$options = options;
  4320. // pre-resolve slots for renderSlot()
  4321. this.$slots = this.slots();
  4322. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  4323. }
  4324. if (options._scopeId) {
  4325. this._c = function (a, b, c, d) {
  4326. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  4327. if (vnode && !Array.isArray(vnode)) {
  4328. vnode.fnScopeId = options._scopeId;
  4329. vnode.fnContext = parent;
  4330. }
  4331. return vnode
  4332. };
  4333. } else {
  4334. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  4335. }
  4336. }
  4337. installRenderHelpers(FunctionalRenderContext.prototype);
  4338. function createFunctionalComponent (
  4339. Ctor,
  4340. propsData,
  4341. data,
  4342. contextVm,
  4343. children
  4344. ) {
  4345. var options = Ctor.options;
  4346. var props = {};
  4347. var propOptions = options.props;
  4348. if (isDef(propOptions)) {
  4349. for (var key in propOptions) {
  4350. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  4351. }
  4352. } else {
  4353. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  4354. if (isDef(data.props)) { mergeProps(props, data.props); }
  4355. }
  4356. var renderContext = new FunctionalRenderContext(
  4357. data,
  4358. props,
  4359. children,
  4360. contextVm,
  4361. Ctor
  4362. );
  4363. var vnode = options.render.call(null, renderContext._c, renderContext);
  4364. if (vnode instanceof VNode) {
  4365. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  4366. } else if (Array.isArray(vnode)) {
  4367. var vnodes = normalizeChildren(vnode) || [];
  4368. var res = new Array(vnodes.length);
  4369. for (var i = 0; i < vnodes.length; i++) {
  4370. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  4371. }
  4372. return res
  4373. }
  4374. }
  4375. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  4376. // #7817 clone node before setting fnContext, otherwise if the node is reused
  4377. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  4378. // that should not be matched to match.
  4379. var clone = cloneVNode(vnode);
  4380. clone.fnContext = contextVm;
  4381. clone.fnOptions = options;
  4382. if (true) {
  4383. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  4384. }
  4385. if (data.slot) {
  4386. (clone.data || (clone.data = {})).slot = data.slot;
  4387. }
  4388. return clone
  4389. }
  4390. function mergeProps (to, from) {
  4391. for (var key in from) {
  4392. to[camelize(key)] = from[key];
  4393. }
  4394. }
  4395. /* */
  4396. /* */
  4397. /* */
  4398. /* */
  4399. // inline hooks to be invoked on component VNodes during patch
  4400. var componentVNodeHooks = {
  4401. init: function init (vnode, hydrating) {
  4402. if (
  4403. vnode.componentInstance &&
  4404. !vnode.componentInstance._isDestroyed &&
  4405. vnode.data.keepAlive
  4406. ) {
  4407. // kept-alive components, treat as a patch
  4408. var mountedNode = vnode; // work around flow
  4409. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  4410. } else {
  4411. var child = vnode.componentInstance = createComponentInstanceForVnode(
  4412. vnode,
  4413. activeInstance
  4414. );
  4415. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  4416. }
  4417. },
  4418. prepatch: function prepatch (oldVnode, vnode) {
  4419. var options = vnode.componentOptions;
  4420. var child = vnode.componentInstance = oldVnode.componentInstance;
  4421. updateChildComponent(
  4422. child,
  4423. options.propsData, // updated props
  4424. options.listeners, // updated listeners
  4425. vnode, // new parent vnode
  4426. options.children // new children
  4427. );
  4428. },
  4429. insert: function insert (vnode) {
  4430. var context = vnode.context;
  4431. var componentInstance = vnode.componentInstance;
  4432. if (!componentInstance._isMounted) {
  4433. callHook(componentInstance, 'onServiceCreated');
  4434. callHook(componentInstance, 'onServiceAttached');
  4435. componentInstance._isMounted = true;
  4436. callHook(componentInstance, 'mounted');
  4437. }
  4438. if (vnode.data.keepAlive) {
  4439. if (context._isMounted) {
  4440. // vue-router#1212
  4441. // During updates, a kept-alive component's child components may
  4442. // change, so directly walking the tree here may call activated hooks
  4443. // on incorrect children. Instead we push them into a queue which will
  4444. // be processed after the whole patch process ended.
  4445. queueActivatedComponent(componentInstance);
  4446. } else {
  4447. activateChildComponent(componentInstance, true /* direct */);
  4448. }
  4449. }
  4450. },
  4451. destroy: function destroy (vnode) {
  4452. var componentInstance = vnode.componentInstance;
  4453. if (!componentInstance._isDestroyed) {
  4454. if (!vnode.data.keepAlive) {
  4455. componentInstance.$destroy();
  4456. } else {
  4457. deactivateChildComponent(componentInstance, true /* direct */);
  4458. }
  4459. }
  4460. }
  4461. };
  4462. var hooksToMerge = Object.keys(componentVNodeHooks);
  4463. function createComponent (
  4464. Ctor,
  4465. data,
  4466. context,
  4467. children,
  4468. tag
  4469. ) {
  4470. if (isUndef(Ctor)) {
  4471. return
  4472. }
  4473. var baseCtor = context.$options._base;
  4474. // plain options object: turn it into a constructor
  4475. if (isObject(Ctor)) {
  4476. Ctor = baseCtor.extend(Ctor);
  4477. }
  4478. // if at this stage it's not a constructor or an async component factory,
  4479. // reject.
  4480. if (typeof Ctor !== 'function') {
  4481. if (true) {
  4482. warn(("Invalid Component definition: " + (String(Ctor))), context);
  4483. }
  4484. return
  4485. }
  4486. // async component
  4487. var asyncFactory;
  4488. if (isUndef(Ctor.cid)) {
  4489. asyncFactory = Ctor;
  4490. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  4491. if (Ctor === undefined) {
  4492. // return a placeholder node for async component, which is rendered
  4493. // as a comment node but preserves all the raw information for the node.
  4494. // the information will be used for async server-rendering and hydration.
  4495. return createAsyncPlaceholder(
  4496. asyncFactory,
  4497. data,
  4498. context,
  4499. children,
  4500. tag
  4501. )
  4502. }
  4503. }
  4504. data = data || {};
  4505. // resolve constructor options in case global mixins are applied after
  4506. // component constructor creation
  4507. resolveConstructorOptions(Ctor);
  4508. // transform component v-model data into props & events
  4509. if (isDef(data.model)) {
  4510. transformModel(Ctor.options, data);
  4511. }
  4512. // extract props
  4513. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  4514. // functional component
  4515. if (isTrue(Ctor.options.functional)) {
  4516. return createFunctionalComponent(Ctor, propsData, data, context, children)
  4517. }
  4518. // extract listeners, since these needs to be treated as
  4519. // child component listeners instead of DOM listeners
  4520. var listeners = data.on;
  4521. // replace with listeners with .native modifier
  4522. // so it gets processed during parent component patch.
  4523. data.on = data.nativeOn;
  4524. if (isTrue(Ctor.options.abstract)) {
  4525. // abstract components do not keep anything
  4526. // other than props & listeners & slot
  4527. // work around flow
  4528. var slot = data.slot;
  4529. data = {};
  4530. if (slot) {
  4531. data.slot = slot;
  4532. }
  4533. }
  4534. // install component management hooks onto the placeholder node
  4535. installComponentHooks(data);
  4536. // return a placeholder vnode
  4537. var name = Ctor.options.name || tag;
  4538. var vnode = new VNode(
  4539. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  4540. data, undefined, undefined, undefined, context,
  4541. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  4542. asyncFactory
  4543. );
  4544. return vnode
  4545. }
  4546. function createComponentInstanceForVnode (
  4547. vnode, // we know it's MountedComponentVNode but flow doesn't
  4548. parent // activeInstance in lifecycle state
  4549. ) {
  4550. var options = {
  4551. _isComponent: true,
  4552. _parentVnode: vnode,
  4553. parent: parent
  4554. };
  4555. // check inline-template render functions
  4556. var inlineTemplate = vnode.data.inlineTemplate;
  4557. if (isDef(inlineTemplate)) {
  4558. options.render = inlineTemplate.render;
  4559. options.staticRenderFns = inlineTemplate.staticRenderFns;
  4560. }
  4561. return new vnode.componentOptions.Ctor(options)
  4562. }
  4563. function installComponentHooks (data) {
  4564. var hooks = data.hook || (data.hook = {});
  4565. for (var i = 0; i < hooksToMerge.length; i++) {
  4566. var key = hooksToMerge[i];
  4567. var existing = hooks[key];
  4568. var toMerge = componentVNodeHooks[key];
  4569. if (existing !== toMerge && !(existing && existing._merged)) {
  4570. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  4571. }
  4572. }
  4573. }
  4574. function mergeHook$1 (f1, f2) {
  4575. var merged = function (a, b) {
  4576. // flow complains about extra args which is why we use any
  4577. f1(a, b);
  4578. f2(a, b);
  4579. };
  4580. merged._merged = true;
  4581. return merged
  4582. }
  4583. // transform component v-model info (value and callback) into
  4584. // prop and event handler respectively.
  4585. function transformModel (options, data) {
  4586. var prop = (options.model && options.model.prop) || 'value';
  4587. var event = (options.model && options.model.event) || 'input'
  4588. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  4589. var on = data.on || (data.on = {});
  4590. var existing = on[event];
  4591. var callback = data.model.callback;
  4592. if (isDef(existing)) {
  4593. if (
  4594. Array.isArray(existing)
  4595. ? existing.indexOf(callback) === -1
  4596. : existing !== callback
  4597. ) {
  4598. on[event] = [callback].concat(existing);
  4599. }
  4600. } else {
  4601. on[event] = callback;
  4602. }
  4603. }
  4604. /* */
  4605. var SIMPLE_NORMALIZE = 1;
  4606. var ALWAYS_NORMALIZE = 2;
  4607. // wrapper function for providing a more flexible interface
  4608. // without getting yelled at by flow
  4609. function createElement (
  4610. context,
  4611. tag,
  4612. data,
  4613. children,
  4614. normalizationType,
  4615. alwaysNormalize
  4616. ) {
  4617. if (Array.isArray(data) || isPrimitive(data)) {
  4618. normalizationType = children;
  4619. children = data;
  4620. data = undefined;
  4621. }
  4622. if (isTrue(alwaysNormalize)) {
  4623. normalizationType = ALWAYS_NORMALIZE;
  4624. }
  4625. return _createElement(context, tag, data, children, normalizationType)
  4626. }
  4627. function _createElement (
  4628. context,
  4629. tag,
  4630. data,
  4631. children,
  4632. normalizationType
  4633. ) {
  4634. if (isDef(data) && isDef((data).__ob__)) {
  4635. true && warn(
  4636. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  4637. 'Always create fresh vnode data objects in each render!',
  4638. context
  4639. );
  4640. return createEmptyVNode()
  4641. }
  4642. // object syntax in v-bind
  4643. if (isDef(data) && isDef(data.is)) {
  4644. tag = data.is;
  4645. }
  4646. if (!tag) {
  4647. // in case of component :is set to falsy value
  4648. return createEmptyVNode()
  4649. }
  4650. // warn against non-primitive key
  4651. if ( true &&
  4652. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  4653. ) {
  4654. {
  4655. warn(
  4656. 'Avoid using non-primitive value as key, ' +
  4657. 'use string/number value instead.',
  4658. context
  4659. );
  4660. }
  4661. }
  4662. // support single function children as default scoped slot
  4663. if (Array.isArray(children) &&
  4664. typeof children[0] === 'function'
  4665. ) {
  4666. data = data || {};
  4667. data.scopedSlots = { default: children[0] };
  4668. children.length = 0;
  4669. }
  4670. if (normalizationType === ALWAYS_NORMALIZE) {
  4671. children = normalizeChildren(children);
  4672. } else if (normalizationType === SIMPLE_NORMALIZE) {
  4673. children = simpleNormalizeChildren(children);
  4674. }
  4675. var vnode, ns;
  4676. if (typeof tag === 'string') {
  4677. var Ctor;
  4678. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  4679. if (config.isReservedTag(tag)) {
  4680. // platform built-in elements
  4681. if ( true && isDef(data) && isDef(data.nativeOn)) {
  4682. warn(
  4683. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  4684. context
  4685. );
  4686. }
  4687. vnode = new VNode(
  4688. config.parsePlatformTagName(tag), data, children,
  4689. undefined, undefined, context
  4690. );
  4691. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  4692. // component
  4693. vnode = createComponent(Ctor, data, context, children, tag);
  4694. } else {
  4695. // unknown or unlisted namespaced elements
  4696. // check at runtime because it may get assigned a namespace when its
  4697. // parent normalizes children
  4698. vnode = new VNode(
  4699. tag, data, children,
  4700. undefined, undefined, context
  4701. );
  4702. }
  4703. } else {
  4704. // direct component options / constructor
  4705. vnode = createComponent(tag, data, context, children);
  4706. }
  4707. if (Array.isArray(vnode)) {
  4708. return vnode
  4709. } else if (isDef(vnode)) {
  4710. if (isDef(ns)) { applyNS(vnode, ns); }
  4711. if (isDef(data)) { registerDeepBindings(data); }
  4712. return vnode
  4713. } else {
  4714. return createEmptyVNode()
  4715. }
  4716. }
  4717. function applyNS (vnode, ns, force) {
  4718. vnode.ns = ns;
  4719. if (vnode.tag === 'foreignObject') {
  4720. // use default namespace inside foreignObject
  4721. ns = undefined;
  4722. force = true;
  4723. }
  4724. if (isDef(vnode.children)) {
  4725. for (var i = 0, l = vnode.children.length; i < l; i++) {
  4726. var child = vnode.children[i];
  4727. if (isDef(child.tag) && (
  4728. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  4729. applyNS(child, ns, force);
  4730. }
  4731. }
  4732. }
  4733. }
  4734. // ref #5318
  4735. // necessary to ensure parent re-render when deep bindings like :style and
  4736. // :class are used on slot nodes
  4737. function registerDeepBindings (data) {
  4738. if (isObject(data.style)) {
  4739. traverse(data.style);
  4740. }
  4741. if (isObject(data.class)) {
  4742. traverse(data.class);
  4743. }
  4744. }
  4745. /* */
  4746. function initRender (vm) {
  4747. vm._vnode = null; // the root of the child tree
  4748. vm._staticTrees = null; // v-once cached trees
  4749. var options = vm.$options;
  4750. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  4751. var renderContext = parentVnode && parentVnode.context;
  4752. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  4753. vm.$scopedSlots = emptyObject;
  4754. // bind the createElement fn to this instance
  4755. // so that we get proper render context inside it.
  4756. // args order: tag, data, children, normalizationType, alwaysNormalize
  4757. // internal version is used by render functions compiled from templates
  4758. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  4759. // normalization is always applied for the public version, used in
  4760. // user-written render functions.
  4761. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  4762. // $attrs & $listeners are exposed for easier HOC creation.
  4763. // they need to be reactive so that HOCs using them are always updated
  4764. var parentData = parentVnode && parentVnode.data;
  4765. /* istanbul ignore else */
  4766. if (true) {
  4767. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  4768. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  4769. }, true);
  4770. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  4771. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  4772. }, true);
  4773. } else {}
  4774. }
  4775. var currentRenderingInstance = null;
  4776. function renderMixin (Vue) {
  4777. // install runtime convenience helpers
  4778. installRenderHelpers(Vue.prototype);
  4779. Vue.prototype.$nextTick = function (fn) {
  4780. return nextTick(fn, this)
  4781. };
  4782. Vue.prototype._render = function () {
  4783. var vm = this;
  4784. var ref = vm.$options;
  4785. var render = ref.render;
  4786. var _parentVnode = ref._parentVnode;
  4787. if (_parentVnode) {
  4788. vm.$scopedSlots = normalizeScopedSlots(
  4789. _parentVnode.data.scopedSlots,
  4790. vm.$slots,
  4791. vm.$scopedSlots
  4792. );
  4793. }
  4794. // set parent vnode. this allows render functions to have access
  4795. // to the data on the placeholder node.
  4796. vm.$vnode = _parentVnode;
  4797. // render self
  4798. var vnode;
  4799. try {
  4800. // There's no need to maintain a stack because all render fns are called
  4801. // separately from one another. Nested component's render fns are called
  4802. // when parent component is patched.
  4803. currentRenderingInstance = vm;
  4804. vnode = render.call(vm._renderProxy, vm.$createElement);
  4805. } catch (e) {
  4806. handleError(e, vm, "render");
  4807. // return error render result,
  4808. // or previous vnode to prevent render error causing blank component
  4809. /* istanbul ignore else */
  4810. if ( true && vm.$options.renderError) {
  4811. try {
  4812. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  4813. } catch (e) {
  4814. handleError(e, vm, "renderError");
  4815. vnode = vm._vnode;
  4816. }
  4817. } else {
  4818. vnode = vm._vnode;
  4819. }
  4820. } finally {
  4821. currentRenderingInstance = null;
  4822. }
  4823. // if the returned array contains only a single node, allow it
  4824. if (Array.isArray(vnode) && vnode.length === 1) {
  4825. vnode = vnode[0];
  4826. }
  4827. // return empty vnode in case the render function errored out
  4828. if (!(vnode instanceof VNode)) {
  4829. if ( true && Array.isArray(vnode)) {
  4830. warn(
  4831. 'Multiple root nodes returned from render function. Render function ' +
  4832. 'should return a single root node.',
  4833. vm
  4834. );
  4835. }
  4836. vnode = createEmptyVNode();
  4837. }
  4838. // set parent
  4839. vnode.parent = _parentVnode;
  4840. return vnode
  4841. };
  4842. }
  4843. /* */
  4844. function ensureCtor (comp, base) {
  4845. if (
  4846. comp.__esModule ||
  4847. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  4848. ) {
  4849. comp = comp.default;
  4850. }
  4851. return isObject(comp)
  4852. ? base.extend(comp)
  4853. : comp
  4854. }
  4855. function createAsyncPlaceholder (
  4856. factory,
  4857. data,
  4858. context,
  4859. children,
  4860. tag
  4861. ) {
  4862. var node = createEmptyVNode();
  4863. node.asyncFactory = factory;
  4864. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  4865. return node
  4866. }
  4867. function resolveAsyncComponent (
  4868. factory,
  4869. baseCtor
  4870. ) {
  4871. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  4872. return factory.errorComp
  4873. }
  4874. if (isDef(factory.resolved)) {
  4875. return factory.resolved
  4876. }
  4877. var owner = currentRenderingInstance;
  4878. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  4879. // already pending
  4880. factory.owners.push(owner);
  4881. }
  4882. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  4883. return factory.loadingComp
  4884. }
  4885. if (owner && !isDef(factory.owners)) {
  4886. var owners = factory.owners = [owner];
  4887. var sync = true;
  4888. var timerLoading = null;
  4889. var timerTimeout = null
  4890. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  4891. var forceRender = function (renderCompleted) {
  4892. for (var i = 0, l = owners.length; i < l; i++) {
  4893. (owners[i]).$forceUpdate();
  4894. }
  4895. if (renderCompleted) {
  4896. owners.length = 0;
  4897. if (timerLoading !== null) {
  4898. clearTimeout(timerLoading);
  4899. timerLoading = null;
  4900. }
  4901. if (timerTimeout !== null) {
  4902. clearTimeout(timerTimeout);
  4903. timerTimeout = null;
  4904. }
  4905. }
  4906. };
  4907. var resolve = once(function (res) {
  4908. // cache resolved
  4909. factory.resolved = ensureCtor(res, baseCtor);
  4910. // invoke callbacks only if this is not a synchronous resolve
  4911. // (async resolves are shimmed as synchronous during SSR)
  4912. if (!sync) {
  4913. forceRender(true);
  4914. } else {
  4915. owners.length = 0;
  4916. }
  4917. });
  4918. var reject = once(function (reason) {
  4919. true && warn(
  4920. "Failed to resolve async component: " + (String(factory)) +
  4921. (reason ? ("\nReason: " + reason) : '')
  4922. );
  4923. if (isDef(factory.errorComp)) {
  4924. factory.error = true;
  4925. forceRender(true);
  4926. }
  4927. });
  4928. var res = factory(resolve, reject);
  4929. if (isObject(res)) {
  4930. if (isPromise(res)) {
  4931. // () => Promise
  4932. if (isUndef(factory.resolved)) {
  4933. res.then(resolve, reject);
  4934. }
  4935. } else if (isPromise(res.component)) {
  4936. res.component.then(resolve, reject);
  4937. if (isDef(res.error)) {
  4938. factory.errorComp = ensureCtor(res.error, baseCtor);
  4939. }
  4940. if (isDef(res.loading)) {
  4941. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  4942. if (res.delay === 0) {
  4943. factory.loading = true;
  4944. } else {
  4945. timerLoading = setTimeout(function () {
  4946. timerLoading = null;
  4947. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  4948. factory.loading = true;
  4949. forceRender(false);
  4950. }
  4951. }, res.delay || 200);
  4952. }
  4953. }
  4954. if (isDef(res.timeout)) {
  4955. timerTimeout = setTimeout(function () {
  4956. timerTimeout = null;
  4957. if (isUndef(factory.resolved)) {
  4958. reject(
  4959. true
  4960. ? ("timeout (" + (res.timeout) + "ms)")
  4961. : undefined
  4962. );
  4963. }
  4964. }, res.timeout);
  4965. }
  4966. }
  4967. }
  4968. sync = false;
  4969. // return in case resolved synchronously
  4970. return factory.loading
  4971. ? factory.loadingComp
  4972. : factory.resolved
  4973. }
  4974. }
  4975. /* */
  4976. function isAsyncPlaceholder (node) {
  4977. return node.isComment && node.asyncFactory
  4978. }
  4979. /* */
  4980. function getFirstComponentChild (children) {
  4981. if (Array.isArray(children)) {
  4982. for (var i = 0; i < children.length; i++) {
  4983. var c = children[i];
  4984. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  4985. return c
  4986. }
  4987. }
  4988. }
  4989. }
  4990. /* */
  4991. /* */
  4992. function initEvents (vm) {
  4993. vm._events = Object.create(null);
  4994. vm._hasHookEvent = false;
  4995. // init parent attached events
  4996. var listeners = vm.$options._parentListeners;
  4997. if (listeners) {
  4998. updateComponentListeners(vm, listeners);
  4999. }
  5000. }
  5001. var target;
  5002. function add (event, fn) {
  5003. target.$on(event, fn);
  5004. }
  5005. function remove$1 (event, fn) {
  5006. target.$off(event, fn);
  5007. }
  5008. function createOnceHandler (event, fn) {
  5009. var _target = target;
  5010. return function onceHandler () {
  5011. var res = fn.apply(null, arguments);
  5012. if (res !== null) {
  5013. _target.$off(event, onceHandler);
  5014. }
  5015. }
  5016. }
  5017. function updateComponentListeners (
  5018. vm,
  5019. listeners,
  5020. oldListeners
  5021. ) {
  5022. target = vm;
  5023. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  5024. target = undefined;
  5025. }
  5026. function eventsMixin (Vue) {
  5027. var hookRE = /^hook:/;
  5028. Vue.prototype.$on = function (event, fn) {
  5029. var vm = this;
  5030. if (Array.isArray(event)) {
  5031. for (var i = 0, l = event.length; i < l; i++) {
  5032. vm.$on(event[i], fn);
  5033. }
  5034. } else {
  5035. (vm._events[event] || (vm._events[event] = [])).push(fn);
  5036. // optimize hook:event cost by using a boolean flag marked at registration
  5037. // instead of a hash lookup
  5038. if (hookRE.test(event)) {
  5039. vm._hasHookEvent = true;
  5040. }
  5041. }
  5042. return vm
  5043. };
  5044. Vue.prototype.$once = function (event, fn) {
  5045. var vm = this;
  5046. function on () {
  5047. vm.$off(event, on);
  5048. fn.apply(vm, arguments);
  5049. }
  5050. on.fn = fn;
  5051. vm.$on(event, on);
  5052. return vm
  5053. };
  5054. Vue.prototype.$off = function (event, fn) {
  5055. var vm = this;
  5056. // all
  5057. if (!arguments.length) {
  5058. vm._events = Object.create(null);
  5059. return vm
  5060. }
  5061. // array of events
  5062. if (Array.isArray(event)) {
  5063. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  5064. vm.$off(event[i$1], fn);
  5065. }
  5066. return vm
  5067. }
  5068. // specific event
  5069. var cbs = vm._events[event];
  5070. if (!cbs) {
  5071. return vm
  5072. }
  5073. if (!fn) {
  5074. vm._events[event] = null;
  5075. return vm
  5076. }
  5077. // specific handler
  5078. var cb;
  5079. var i = cbs.length;
  5080. while (i--) {
  5081. cb = cbs[i];
  5082. if (cb === fn || cb.fn === fn) {
  5083. cbs.splice(i, 1);
  5084. break
  5085. }
  5086. }
  5087. return vm
  5088. };
  5089. Vue.prototype.$emit = function (event) {
  5090. var vm = this;
  5091. if (true) {
  5092. var lowerCaseEvent = event.toLowerCase();
  5093. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  5094. tip(
  5095. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  5096. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  5097. "Note that HTML attributes are case-insensitive and you cannot use " +
  5098. "v-on to listen to camelCase events when using in-DOM templates. " +
  5099. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  5100. );
  5101. }
  5102. }
  5103. var cbs = vm._events[event];
  5104. if (cbs) {
  5105. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  5106. var args = toArray(arguments, 1);
  5107. var info = "event handler for \"" + event + "\"";
  5108. for (var i = 0, l = cbs.length; i < l; i++) {
  5109. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  5110. }
  5111. }
  5112. return vm
  5113. };
  5114. }
  5115. /* */
  5116. var activeInstance = null;
  5117. var isUpdatingChildComponent = false;
  5118. function setActiveInstance(vm) {
  5119. var prevActiveInstance = activeInstance;
  5120. activeInstance = vm;
  5121. return function () {
  5122. activeInstance = prevActiveInstance;
  5123. }
  5124. }
  5125. function initLifecycle (vm) {
  5126. var options = vm.$options;
  5127. // locate first non-abstract parent
  5128. var parent = options.parent;
  5129. if (parent && !options.abstract) {
  5130. while (parent.$options.abstract && parent.$parent) {
  5131. parent = parent.$parent;
  5132. }
  5133. parent.$children.push(vm);
  5134. }
  5135. vm.$parent = parent;
  5136. vm.$root = parent ? parent.$root : vm;
  5137. vm.$children = [];
  5138. vm.$refs = {};
  5139. vm._watcher = null;
  5140. vm._inactive = null;
  5141. vm._directInactive = false;
  5142. vm._isMounted = false;
  5143. vm._isDestroyed = false;
  5144. vm._isBeingDestroyed = false;
  5145. }
  5146. function lifecycleMixin (Vue) {
  5147. Vue.prototype._update = function (vnode, hydrating) {
  5148. var vm = this;
  5149. var prevEl = vm.$el;
  5150. var prevVnode = vm._vnode;
  5151. var restoreActiveInstance = setActiveInstance(vm);
  5152. vm._vnode = vnode;
  5153. // Vue.prototype.__patch__ is injected in entry points
  5154. // based on the rendering backend used.
  5155. if (!prevVnode) {
  5156. // initial render
  5157. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  5158. } else {
  5159. // updates
  5160. vm.$el = vm.__patch__(prevVnode, vnode);
  5161. }
  5162. restoreActiveInstance();
  5163. // update __vue__ reference
  5164. if (prevEl) {
  5165. prevEl.__vue__ = null;
  5166. }
  5167. if (vm.$el) {
  5168. vm.$el.__vue__ = vm;
  5169. }
  5170. // if parent is an HOC, update its $el as well
  5171. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  5172. vm.$parent.$el = vm.$el;
  5173. }
  5174. // updated hook is called by the scheduler to ensure that children are
  5175. // updated in a parent's updated hook.
  5176. };
  5177. Vue.prototype.$forceUpdate = function () {
  5178. var vm = this;
  5179. if (vm._watcher) {
  5180. vm._watcher.update();
  5181. }
  5182. };
  5183. Vue.prototype.$destroy = function () {
  5184. var vm = this;
  5185. if (vm._isBeingDestroyed) {
  5186. return
  5187. }
  5188. callHook(vm, 'beforeDestroy');
  5189. vm._isBeingDestroyed = true;
  5190. // remove self from parent
  5191. var parent = vm.$parent;
  5192. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  5193. remove(parent.$children, vm);
  5194. }
  5195. // teardown watchers
  5196. if (vm._watcher) {
  5197. vm._watcher.teardown();
  5198. }
  5199. var i = vm._watchers.length;
  5200. while (i--) {
  5201. vm._watchers[i].teardown();
  5202. }
  5203. // remove reference from data ob
  5204. // frozen object may not have observer.
  5205. if (vm._data.__ob__) {
  5206. vm._data.__ob__.vmCount--;
  5207. }
  5208. // call the last hook...
  5209. vm._isDestroyed = true;
  5210. // invoke destroy hooks on current rendered tree
  5211. vm.__patch__(vm._vnode, null);
  5212. // fire destroyed hook
  5213. callHook(vm, 'destroyed');
  5214. // turn off all instance listeners.
  5215. vm.$off();
  5216. // remove __vue__ reference
  5217. if (vm.$el) {
  5218. vm.$el.__vue__ = null;
  5219. }
  5220. // release circular reference (#6759)
  5221. if (vm.$vnode) {
  5222. vm.$vnode.parent = null;
  5223. }
  5224. };
  5225. }
  5226. function updateChildComponent (
  5227. vm,
  5228. propsData,
  5229. listeners,
  5230. parentVnode,
  5231. renderChildren
  5232. ) {
  5233. if (true) {
  5234. isUpdatingChildComponent = true;
  5235. }
  5236. // determine whether component has slot children
  5237. // we need to do this before overwriting $options._renderChildren.
  5238. // check if there are dynamic scopedSlots (hand-written or compiled but with
  5239. // dynamic slot names). Static scoped slots compiled from template has the
  5240. // "$stable" marker.
  5241. var newScopedSlots = parentVnode.data.scopedSlots;
  5242. var oldScopedSlots = vm.$scopedSlots;
  5243. var hasDynamicScopedSlot = !!(
  5244. (newScopedSlots && !newScopedSlots.$stable) ||
  5245. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  5246. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  5247. );
  5248. // Any static slot children from the parent may have changed during parent's
  5249. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  5250. // update is necessary to ensure correctness.
  5251. var needsForceUpdate = !!(
  5252. renderChildren || // has new static slots
  5253. vm.$options._renderChildren || // has old static slots
  5254. hasDynamicScopedSlot
  5255. );
  5256. vm.$options._parentVnode = parentVnode;
  5257. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  5258. if (vm._vnode) { // update child tree's parent
  5259. vm._vnode.parent = parentVnode;
  5260. }
  5261. vm.$options._renderChildren = renderChildren;
  5262. // update $attrs and $listeners hash
  5263. // these are also reactive so they may trigger child update if the child
  5264. // used them during render
  5265. vm.$attrs = parentVnode.data.attrs || emptyObject;
  5266. vm.$listeners = listeners || emptyObject;
  5267. // update props
  5268. if (propsData && vm.$options.props) {
  5269. toggleObserving(false);
  5270. var props = vm._props;
  5271. var propKeys = vm.$options._propKeys || [];
  5272. for (var i = 0; i < propKeys.length; i++) {
  5273. var key = propKeys[i];
  5274. var propOptions = vm.$options.props; // wtf flow?
  5275. props[key] = validateProp(key, propOptions, propsData, vm);
  5276. }
  5277. toggleObserving(true);
  5278. // keep a copy of raw propsData
  5279. vm.$options.propsData = propsData;
  5280. }
  5281. // fixed by xxxxxx update properties(mp runtime)
  5282. vm._$updateProperties && vm._$updateProperties(vm);
  5283. // update listeners
  5284. listeners = listeners || emptyObject;
  5285. var oldListeners = vm.$options._parentListeners;
  5286. vm.$options._parentListeners = listeners;
  5287. updateComponentListeners(vm, listeners, oldListeners);
  5288. // resolve slots + force update if has children
  5289. if (needsForceUpdate) {
  5290. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  5291. vm.$forceUpdate();
  5292. }
  5293. if (true) {
  5294. isUpdatingChildComponent = false;
  5295. }
  5296. }
  5297. function isInInactiveTree (vm) {
  5298. while (vm && (vm = vm.$parent)) {
  5299. if (vm._inactive) { return true }
  5300. }
  5301. return false
  5302. }
  5303. function activateChildComponent (vm, direct) {
  5304. if (direct) {
  5305. vm._directInactive = false;
  5306. if (isInInactiveTree(vm)) {
  5307. return
  5308. }
  5309. } else if (vm._directInactive) {
  5310. return
  5311. }
  5312. if (vm._inactive || vm._inactive === null) {
  5313. vm._inactive = false;
  5314. for (var i = 0; i < vm.$children.length; i++) {
  5315. activateChildComponent(vm.$children[i]);
  5316. }
  5317. callHook(vm, 'activated');
  5318. }
  5319. }
  5320. function deactivateChildComponent (vm, direct) {
  5321. if (direct) {
  5322. vm._directInactive = true;
  5323. if (isInInactiveTree(vm)) {
  5324. return
  5325. }
  5326. }
  5327. if (!vm._inactive) {
  5328. vm._inactive = true;
  5329. for (var i = 0; i < vm.$children.length; i++) {
  5330. deactivateChildComponent(vm.$children[i]);
  5331. }
  5332. callHook(vm, 'deactivated');
  5333. }
  5334. }
  5335. function callHook (vm, hook) {
  5336. // #7573 disable dep collection when invoking lifecycle hooks
  5337. pushTarget();
  5338. var handlers = vm.$options[hook];
  5339. var info = hook + " hook";
  5340. if (handlers) {
  5341. for (var i = 0, j = handlers.length; i < j; i++) {
  5342. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  5343. }
  5344. }
  5345. if (vm._hasHookEvent) {
  5346. vm.$emit('hook:' + hook);
  5347. }
  5348. popTarget();
  5349. }
  5350. /* */
  5351. var MAX_UPDATE_COUNT = 100;
  5352. var queue = [];
  5353. var activatedChildren = [];
  5354. var has = {};
  5355. var circular = {};
  5356. var waiting = false;
  5357. var flushing = false;
  5358. var index = 0;
  5359. /**
  5360. * Reset the scheduler's state.
  5361. */
  5362. function resetSchedulerState () {
  5363. index = queue.length = activatedChildren.length = 0;
  5364. has = {};
  5365. if (true) {
  5366. circular = {};
  5367. }
  5368. waiting = flushing = false;
  5369. }
  5370. // Async edge case #6566 requires saving the timestamp when event listeners are
  5371. // attached. However, calling performance.now() has a perf overhead especially
  5372. // if the page has thousands of event listeners. Instead, we take a timestamp
  5373. // every time the scheduler flushes and use that for all event listeners
  5374. // attached during that flush.
  5375. var currentFlushTimestamp = 0;
  5376. // Async edge case fix requires storing an event listener's attach timestamp.
  5377. var getNow = Date.now;
  5378. // Determine what event timestamp the browser is using. Annoyingly, the
  5379. // timestamp can either be hi-res (relative to page load) or low-res
  5380. // (relative to UNIX epoch), so in order to compare time we have to use the
  5381. // same timestamp type when saving the flush timestamp.
  5382. // All IE versions use low-res event timestamps, and have problematic clock
  5383. // implementations (#9632)
  5384. if (inBrowser && !isIE) {
  5385. var performance = window.performance;
  5386. if (
  5387. performance &&
  5388. typeof performance.now === 'function' &&
  5389. getNow() > document.createEvent('Event').timeStamp
  5390. ) {
  5391. // if the event timestamp, although evaluated AFTER the Date.now(), is
  5392. // smaller than it, it means the event is using a hi-res timestamp,
  5393. // and we need to use the hi-res version for event listener timestamps as
  5394. // well.
  5395. getNow = function () { return performance.now(); };
  5396. }
  5397. }
  5398. /**
  5399. * Flush both queues and run the watchers.
  5400. */
  5401. function flushSchedulerQueue () {
  5402. currentFlushTimestamp = getNow();
  5403. flushing = true;
  5404. var watcher, id;
  5405. // Sort queue before flush.
  5406. // This ensures that:
  5407. // 1. Components are updated from parent to child. (because parent is always
  5408. // created before the child)
  5409. // 2. A component's user watchers are run before its render watcher (because
  5410. // user watchers are created before the render watcher)
  5411. // 3. If a component is destroyed during a parent component's watcher run,
  5412. // its watchers can be skipped.
  5413. queue.sort(function (a, b) { return a.id - b.id; });
  5414. // do not cache length because more watchers might be pushed
  5415. // as we run existing watchers
  5416. for (index = 0; index < queue.length; index++) {
  5417. watcher = queue[index];
  5418. if (watcher.before) {
  5419. watcher.before();
  5420. }
  5421. id = watcher.id;
  5422. has[id] = null;
  5423. watcher.run();
  5424. // in dev build, check and stop circular updates.
  5425. if ( true && has[id] != null) {
  5426. circular[id] = (circular[id] || 0) + 1;
  5427. if (circular[id] > MAX_UPDATE_COUNT) {
  5428. warn(
  5429. 'You may have an infinite update loop ' + (
  5430. watcher.user
  5431. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  5432. : "in a component render function."
  5433. ),
  5434. watcher.vm
  5435. );
  5436. break
  5437. }
  5438. }
  5439. }
  5440. // keep copies of post queues before resetting state
  5441. var activatedQueue = activatedChildren.slice();
  5442. var updatedQueue = queue.slice();
  5443. resetSchedulerState();
  5444. // call component updated and activated hooks
  5445. callActivatedHooks(activatedQueue);
  5446. callUpdatedHooks(updatedQueue);
  5447. // devtool hook
  5448. /* istanbul ignore if */
  5449. if (devtools && config.devtools) {
  5450. devtools.emit('flush');
  5451. }
  5452. }
  5453. function callUpdatedHooks (queue) {
  5454. var i = queue.length;
  5455. while (i--) {
  5456. var watcher = queue[i];
  5457. var vm = watcher.vm;
  5458. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  5459. callHook(vm, 'updated');
  5460. }
  5461. }
  5462. }
  5463. /**
  5464. * Queue a kept-alive component that was activated during patch.
  5465. * The queue will be processed after the entire tree has been patched.
  5466. */
  5467. function queueActivatedComponent (vm) {
  5468. // setting _inactive to false here so that a render function can
  5469. // rely on checking whether it's in an inactive tree (e.g. router-view)
  5470. vm._inactive = false;
  5471. activatedChildren.push(vm);
  5472. }
  5473. function callActivatedHooks (queue) {
  5474. for (var i = 0; i < queue.length; i++) {
  5475. queue[i]._inactive = true;
  5476. activateChildComponent(queue[i], true /* true */);
  5477. }
  5478. }
  5479. /**
  5480. * Push a watcher into the watcher queue.
  5481. * Jobs with duplicate IDs will be skipped unless it's
  5482. * pushed when the queue is being flushed.
  5483. */
  5484. function queueWatcher (watcher) {
  5485. var id = watcher.id;
  5486. if (has[id] == null) {
  5487. has[id] = true;
  5488. if (!flushing) {
  5489. queue.push(watcher);
  5490. } else {
  5491. // if already flushing, splice the watcher based on its id
  5492. // if already past its id, it will be run next immediately.
  5493. var i = queue.length - 1;
  5494. while (i > index && queue[i].id > watcher.id) {
  5495. i--;
  5496. }
  5497. queue.splice(i + 1, 0, watcher);
  5498. }
  5499. // queue the flush
  5500. if (!waiting) {
  5501. waiting = true;
  5502. if ( true && !config.async) {
  5503. flushSchedulerQueue();
  5504. return
  5505. }
  5506. nextTick(flushSchedulerQueue);
  5507. }
  5508. }
  5509. }
  5510. /* */
  5511. var uid$2 = 0;
  5512. /**
  5513. * A watcher parses an expression, collects dependencies,
  5514. * and fires callback when the expression value changes.
  5515. * This is used for both the $watch() api and directives.
  5516. */
  5517. var Watcher = function Watcher (
  5518. vm,
  5519. expOrFn,
  5520. cb,
  5521. options,
  5522. isRenderWatcher
  5523. ) {
  5524. this.vm = vm;
  5525. if (isRenderWatcher) {
  5526. vm._watcher = this;
  5527. }
  5528. vm._watchers.push(this);
  5529. // options
  5530. if (options) {
  5531. this.deep = !!options.deep;
  5532. this.user = !!options.user;
  5533. this.lazy = !!options.lazy;
  5534. this.sync = !!options.sync;
  5535. this.before = options.before;
  5536. } else {
  5537. this.deep = this.user = this.lazy = this.sync = false;
  5538. }
  5539. this.cb = cb;
  5540. this.id = ++uid$2; // uid for batching
  5541. this.active = true;
  5542. this.dirty = this.lazy; // for lazy watchers
  5543. this.deps = [];
  5544. this.newDeps = [];
  5545. this.depIds = new _Set();
  5546. this.newDepIds = new _Set();
  5547. this.expression = true
  5548. ? expOrFn.toString()
  5549. : undefined;
  5550. // parse expression for getter
  5551. if (typeof expOrFn === 'function') {
  5552. this.getter = expOrFn;
  5553. } else {
  5554. this.getter = parsePath(expOrFn);
  5555. if (!this.getter) {
  5556. this.getter = noop;
  5557. true && warn(
  5558. "Failed watching path: \"" + expOrFn + "\" " +
  5559. 'Watcher only accepts simple dot-delimited paths. ' +
  5560. 'For full control, use a function instead.',
  5561. vm
  5562. );
  5563. }
  5564. }
  5565. this.value = this.lazy
  5566. ? undefined
  5567. : this.get();
  5568. };
  5569. /**
  5570. * Evaluate the getter, and re-collect dependencies.
  5571. */
  5572. Watcher.prototype.get = function get () {
  5573. pushTarget(this);
  5574. var value;
  5575. var vm = this.vm;
  5576. try {
  5577. value = this.getter.call(vm, vm);
  5578. } catch (e) {
  5579. if (this.user) {
  5580. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  5581. } else {
  5582. throw e
  5583. }
  5584. } finally {
  5585. // "touch" every property so they are all tracked as
  5586. // dependencies for deep watching
  5587. if (this.deep) {
  5588. traverse(value);
  5589. }
  5590. popTarget();
  5591. this.cleanupDeps();
  5592. }
  5593. return value
  5594. };
  5595. /**
  5596. * Add a dependency to this directive.
  5597. */
  5598. Watcher.prototype.addDep = function addDep (dep) {
  5599. var id = dep.id;
  5600. if (!this.newDepIds.has(id)) {
  5601. this.newDepIds.add(id);
  5602. this.newDeps.push(dep);
  5603. if (!this.depIds.has(id)) {
  5604. dep.addSub(this);
  5605. }
  5606. }
  5607. };
  5608. /**
  5609. * Clean up for dependency collection.
  5610. */
  5611. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  5612. var i = this.deps.length;
  5613. while (i--) {
  5614. var dep = this.deps[i];
  5615. if (!this.newDepIds.has(dep.id)) {
  5616. dep.removeSub(this);
  5617. }
  5618. }
  5619. var tmp = this.depIds;
  5620. this.depIds = this.newDepIds;
  5621. this.newDepIds = tmp;
  5622. this.newDepIds.clear();
  5623. tmp = this.deps;
  5624. this.deps = this.newDeps;
  5625. this.newDeps = tmp;
  5626. this.newDeps.length = 0;
  5627. };
  5628. /**
  5629. * Subscriber interface.
  5630. * Will be called when a dependency changes.
  5631. */
  5632. Watcher.prototype.update = function update () {
  5633. /* istanbul ignore else */
  5634. if (this.lazy) {
  5635. this.dirty = true;
  5636. } else if (this.sync) {
  5637. this.run();
  5638. } else {
  5639. queueWatcher(this);
  5640. }
  5641. };
  5642. /**
  5643. * Scheduler job interface.
  5644. * Will be called by the scheduler.
  5645. */
  5646. Watcher.prototype.run = function run () {
  5647. if (this.active) {
  5648. var value = this.get();
  5649. if (
  5650. value !== this.value ||
  5651. // Deep watchers and watchers on Object/Arrays should fire even
  5652. // when the value is the same, because the value may
  5653. // have mutated.
  5654. isObject(value) ||
  5655. this.deep
  5656. ) {
  5657. // set new value
  5658. var oldValue = this.value;
  5659. this.value = value;
  5660. if (this.user) {
  5661. try {
  5662. this.cb.call(this.vm, value, oldValue);
  5663. } catch (e) {
  5664. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  5665. }
  5666. } else {
  5667. this.cb.call(this.vm, value, oldValue);
  5668. }
  5669. }
  5670. }
  5671. };
  5672. /**
  5673. * Evaluate the value of the watcher.
  5674. * This only gets called for lazy watchers.
  5675. */
  5676. Watcher.prototype.evaluate = function evaluate () {
  5677. this.value = this.get();
  5678. this.dirty = false;
  5679. };
  5680. /**
  5681. * Depend on all deps collected by this watcher.
  5682. */
  5683. Watcher.prototype.depend = function depend () {
  5684. var i = this.deps.length;
  5685. while (i--) {
  5686. this.deps[i].depend();
  5687. }
  5688. };
  5689. /**
  5690. * Remove self from all dependencies' subscriber list.
  5691. */
  5692. Watcher.prototype.teardown = function teardown () {
  5693. if (this.active) {
  5694. // remove self from vm's watcher list
  5695. // this is a somewhat expensive operation so we skip it
  5696. // if the vm is being destroyed.
  5697. if (!this.vm._isBeingDestroyed) {
  5698. remove(this.vm._watchers, this);
  5699. }
  5700. var i = this.deps.length;
  5701. while (i--) {
  5702. this.deps[i].removeSub(this);
  5703. }
  5704. this.active = false;
  5705. }
  5706. };
  5707. /* */
  5708. var sharedPropertyDefinition = {
  5709. enumerable: true,
  5710. configurable: true,
  5711. get: noop,
  5712. set: noop
  5713. };
  5714. function proxy (target, sourceKey, key) {
  5715. sharedPropertyDefinition.get = function proxyGetter () {
  5716. return this[sourceKey][key]
  5717. };
  5718. sharedPropertyDefinition.set = function proxySetter (val) {
  5719. this[sourceKey][key] = val;
  5720. };
  5721. Object.defineProperty(target, key, sharedPropertyDefinition);
  5722. }
  5723. function initState (vm) {
  5724. vm._watchers = [];
  5725. var opts = vm.$options;
  5726. if (opts.props) { initProps(vm, opts.props); }
  5727. if (opts.methods) { initMethods(vm, opts.methods); }
  5728. if (opts.data) {
  5729. initData(vm);
  5730. } else {
  5731. observe(vm._data = {}, true /* asRootData */);
  5732. }
  5733. if (opts.computed) { initComputed(vm, opts.computed); }
  5734. if (opts.watch && opts.watch !== nativeWatch) {
  5735. initWatch(vm, opts.watch);
  5736. }
  5737. }
  5738. function initProps (vm, propsOptions) {
  5739. var propsData = vm.$options.propsData || {};
  5740. var props = vm._props = {};
  5741. // cache prop keys so that future props updates can iterate using Array
  5742. // instead of dynamic object key enumeration.
  5743. var keys = vm.$options._propKeys = [];
  5744. var isRoot = !vm.$parent;
  5745. // root instance props should be converted
  5746. if (!isRoot) {
  5747. toggleObserving(false);
  5748. }
  5749. var loop = function ( key ) {
  5750. keys.push(key);
  5751. var value = validateProp(key, propsOptions, propsData, vm);
  5752. /* istanbul ignore else */
  5753. if (true) {
  5754. var hyphenatedKey = hyphenate(key);
  5755. if (isReservedAttribute(hyphenatedKey) ||
  5756. config.isReservedAttr(hyphenatedKey)) {
  5757. warn(
  5758. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  5759. vm
  5760. );
  5761. }
  5762. defineReactive$$1(props, key, value, function () {
  5763. if (!isRoot && !isUpdatingChildComponent) {
  5764. {
  5765. if(vm.mpHost === 'mp-baidu'){//百度 observer 在 setData callback 之后触发,直接忽略该 warn
  5766. return
  5767. }
  5768. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  5769. if(
  5770. key === 'value' &&
  5771. Array.isArray(vm.$options.behaviors) &&
  5772. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  5773. ){
  5774. return
  5775. }
  5776. if(vm._getFormData){
  5777. return
  5778. }
  5779. var $parent = vm.$parent;
  5780. while($parent){
  5781. if($parent.__next_tick_pending){
  5782. return
  5783. }
  5784. $parent = $parent.$parent;
  5785. }
  5786. }
  5787. warn(
  5788. "Avoid mutating a prop directly since the value will be " +
  5789. "overwritten whenever the parent component re-renders. " +
  5790. "Instead, use a data or computed property based on the prop's " +
  5791. "value. Prop being mutated: \"" + key + "\"",
  5792. vm
  5793. );
  5794. }
  5795. });
  5796. } else {}
  5797. // static props are already proxied on the component's prototype
  5798. // during Vue.extend(). We only need to proxy props defined at
  5799. // instantiation here.
  5800. if (!(key in vm)) {
  5801. proxy(vm, "_props", key);
  5802. }
  5803. };
  5804. for (var key in propsOptions) loop( key );
  5805. toggleObserving(true);
  5806. }
  5807. function initData (vm) {
  5808. var data = vm.$options.data;
  5809. data = vm._data = typeof data === 'function'
  5810. ? getData(data, vm)
  5811. : data || {};
  5812. if (!isPlainObject(data)) {
  5813. data = {};
  5814. true && warn(
  5815. 'data functions should return an object:\n' +
  5816. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  5817. vm
  5818. );
  5819. }
  5820. // proxy data on instance
  5821. var keys = Object.keys(data);
  5822. var props = vm.$options.props;
  5823. var methods = vm.$options.methods;
  5824. var i = keys.length;
  5825. while (i--) {
  5826. var key = keys[i];
  5827. if (true) {
  5828. if (methods && hasOwn(methods, key)) {
  5829. warn(
  5830. ("Method \"" + key + "\" has already been defined as a data property."),
  5831. vm
  5832. );
  5833. }
  5834. }
  5835. if (props && hasOwn(props, key)) {
  5836. true && warn(
  5837. "The data property \"" + key + "\" is already declared as a prop. " +
  5838. "Use prop default value instead.",
  5839. vm
  5840. );
  5841. } else if (!isReserved(key)) {
  5842. proxy(vm, "_data", key);
  5843. }
  5844. }
  5845. // observe data
  5846. observe(data, true /* asRootData */);
  5847. }
  5848. function getData (data, vm) {
  5849. // #7573 disable dep collection when invoking data getters
  5850. pushTarget();
  5851. try {
  5852. return data.call(vm, vm)
  5853. } catch (e) {
  5854. handleError(e, vm, "data()");
  5855. return {}
  5856. } finally {
  5857. popTarget();
  5858. }
  5859. }
  5860. var computedWatcherOptions = { lazy: true };
  5861. function initComputed (vm, computed) {
  5862. // $flow-disable-line
  5863. var watchers = vm._computedWatchers = Object.create(null);
  5864. // computed properties are just getters during SSR
  5865. var isSSR = isServerRendering();
  5866. for (var key in computed) {
  5867. var userDef = computed[key];
  5868. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  5869. if ( true && getter == null) {
  5870. warn(
  5871. ("Getter is missing for computed property \"" + key + "\"."),
  5872. vm
  5873. );
  5874. }
  5875. if (!isSSR) {
  5876. // create internal watcher for the computed property.
  5877. watchers[key] = new Watcher(
  5878. vm,
  5879. getter || noop,
  5880. noop,
  5881. computedWatcherOptions
  5882. );
  5883. }
  5884. // component-defined computed properties are already defined on the
  5885. // component prototype. We only need to define computed properties defined
  5886. // at instantiation here.
  5887. if (!(key in vm)) {
  5888. defineComputed(vm, key, userDef);
  5889. } else if (true) {
  5890. if (key in vm.$data) {
  5891. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  5892. } else if (vm.$options.props && key in vm.$options.props) {
  5893. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  5894. }
  5895. }
  5896. }
  5897. }
  5898. function defineComputed (
  5899. target,
  5900. key,
  5901. userDef
  5902. ) {
  5903. var shouldCache = !isServerRendering();
  5904. if (typeof userDef === 'function') {
  5905. sharedPropertyDefinition.get = shouldCache
  5906. ? createComputedGetter(key)
  5907. : createGetterInvoker(userDef);
  5908. sharedPropertyDefinition.set = noop;
  5909. } else {
  5910. sharedPropertyDefinition.get = userDef.get
  5911. ? shouldCache && userDef.cache !== false
  5912. ? createComputedGetter(key)
  5913. : createGetterInvoker(userDef.get)
  5914. : noop;
  5915. sharedPropertyDefinition.set = userDef.set || noop;
  5916. }
  5917. if ( true &&
  5918. sharedPropertyDefinition.set === noop) {
  5919. sharedPropertyDefinition.set = function () {
  5920. warn(
  5921. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  5922. this
  5923. );
  5924. };
  5925. }
  5926. Object.defineProperty(target, key, sharedPropertyDefinition);
  5927. }
  5928. function createComputedGetter (key) {
  5929. return function computedGetter () {
  5930. var watcher = this._computedWatchers && this._computedWatchers[key];
  5931. if (watcher) {
  5932. if (watcher.dirty) {
  5933. watcher.evaluate();
  5934. }
  5935. if (Dep.SharedObject.target) {// fixed by xxxxxx
  5936. watcher.depend();
  5937. }
  5938. return watcher.value
  5939. }
  5940. }
  5941. }
  5942. function createGetterInvoker(fn) {
  5943. return function computedGetter () {
  5944. return fn.call(this, this)
  5945. }
  5946. }
  5947. function initMethods (vm, methods) {
  5948. var props = vm.$options.props;
  5949. for (var key in methods) {
  5950. if (true) {
  5951. if (typeof methods[key] !== 'function') {
  5952. warn(
  5953. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  5954. "Did you reference the function correctly?",
  5955. vm
  5956. );
  5957. }
  5958. if (props && hasOwn(props, key)) {
  5959. warn(
  5960. ("Method \"" + key + "\" has already been defined as a prop."),
  5961. vm
  5962. );
  5963. }
  5964. if ((key in vm) && isReserved(key)) {
  5965. warn(
  5966. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  5967. "Avoid defining component methods that start with _ or $."
  5968. );
  5969. }
  5970. }
  5971. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  5972. }
  5973. }
  5974. function initWatch (vm, watch) {
  5975. for (var key in watch) {
  5976. var handler = watch[key];
  5977. if (Array.isArray(handler)) {
  5978. for (var i = 0; i < handler.length; i++) {
  5979. createWatcher(vm, key, handler[i]);
  5980. }
  5981. } else {
  5982. createWatcher(vm, key, handler);
  5983. }
  5984. }
  5985. }
  5986. function createWatcher (
  5987. vm,
  5988. expOrFn,
  5989. handler,
  5990. options
  5991. ) {
  5992. if (isPlainObject(handler)) {
  5993. options = handler;
  5994. handler = handler.handler;
  5995. }
  5996. if (typeof handler === 'string') {
  5997. handler = vm[handler];
  5998. }
  5999. return vm.$watch(expOrFn, handler, options)
  6000. }
  6001. function stateMixin (Vue) {
  6002. // flow somehow has problems with directly declared definition object
  6003. // when using Object.defineProperty, so we have to procedurally build up
  6004. // the object here.
  6005. var dataDef = {};
  6006. dataDef.get = function () { return this._data };
  6007. var propsDef = {};
  6008. propsDef.get = function () { return this._props };
  6009. if (true) {
  6010. dataDef.set = function () {
  6011. warn(
  6012. 'Avoid replacing instance root $data. ' +
  6013. 'Use nested data properties instead.',
  6014. this
  6015. );
  6016. };
  6017. propsDef.set = function () {
  6018. warn("$props is readonly.", this);
  6019. };
  6020. }
  6021. Object.defineProperty(Vue.prototype, '$data', dataDef);
  6022. Object.defineProperty(Vue.prototype, '$props', propsDef);
  6023. Vue.prototype.$set = set;
  6024. Vue.prototype.$delete = del;
  6025. Vue.prototype.$watch = function (
  6026. expOrFn,
  6027. cb,
  6028. options
  6029. ) {
  6030. var vm = this;
  6031. if (isPlainObject(cb)) {
  6032. return createWatcher(vm, expOrFn, cb, options)
  6033. }
  6034. options = options || {};
  6035. options.user = true;
  6036. var watcher = new Watcher(vm, expOrFn, cb, options);
  6037. if (options.immediate) {
  6038. try {
  6039. cb.call(vm, watcher.value);
  6040. } catch (error) {
  6041. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  6042. }
  6043. }
  6044. return function unwatchFn () {
  6045. watcher.teardown();
  6046. }
  6047. };
  6048. }
  6049. /* */
  6050. var uid$3 = 0;
  6051. function initMixin (Vue) {
  6052. Vue.prototype._init = function (options) {
  6053. var vm = this;
  6054. // a uid
  6055. vm._uid = uid$3++;
  6056. var startTag, endTag;
  6057. /* istanbul ignore if */
  6058. if ( true && config.performance && mark) {
  6059. startTag = "vue-perf-start:" + (vm._uid);
  6060. endTag = "vue-perf-end:" + (vm._uid);
  6061. mark(startTag);
  6062. }
  6063. // a flag to avoid this being observed
  6064. vm._isVue = true;
  6065. // merge options
  6066. if (options && options._isComponent) {
  6067. // optimize internal component instantiation
  6068. // since dynamic options merging is pretty slow, and none of the
  6069. // internal component options needs special treatment.
  6070. initInternalComponent(vm, options);
  6071. } else {
  6072. vm.$options = mergeOptions(
  6073. resolveConstructorOptions(vm.constructor),
  6074. options || {},
  6075. vm
  6076. );
  6077. }
  6078. /* istanbul ignore else */
  6079. if (true) {
  6080. initProxy(vm);
  6081. } else {}
  6082. // expose real self
  6083. vm._self = vm;
  6084. initLifecycle(vm);
  6085. initEvents(vm);
  6086. initRender(vm);
  6087. callHook(vm, 'beforeCreate');
  6088. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  6089. initState(vm);
  6090. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  6091. !vm._$fallback && callHook(vm, 'created');
  6092. /* istanbul ignore if */
  6093. if ( true && config.performance && mark) {
  6094. vm._name = formatComponentName(vm, false);
  6095. mark(endTag);
  6096. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  6097. }
  6098. if (vm.$options.el) {
  6099. vm.$mount(vm.$options.el);
  6100. }
  6101. };
  6102. }
  6103. function initInternalComponent (vm, options) {
  6104. var opts = vm.$options = Object.create(vm.constructor.options);
  6105. // doing this because it's faster than dynamic enumeration.
  6106. var parentVnode = options._parentVnode;
  6107. opts.parent = options.parent;
  6108. opts._parentVnode = parentVnode;
  6109. var vnodeComponentOptions = parentVnode.componentOptions;
  6110. opts.propsData = vnodeComponentOptions.propsData;
  6111. opts._parentListeners = vnodeComponentOptions.listeners;
  6112. opts._renderChildren = vnodeComponentOptions.children;
  6113. opts._componentTag = vnodeComponentOptions.tag;
  6114. if (options.render) {
  6115. opts.render = options.render;
  6116. opts.staticRenderFns = options.staticRenderFns;
  6117. }
  6118. }
  6119. function resolveConstructorOptions (Ctor) {
  6120. var options = Ctor.options;
  6121. if (Ctor.super) {
  6122. var superOptions = resolveConstructorOptions(Ctor.super);
  6123. var cachedSuperOptions = Ctor.superOptions;
  6124. if (superOptions !== cachedSuperOptions) {
  6125. // super option changed,
  6126. // need to resolve new options.
  6127. Ctor.superOptions = superOptions;
  6128. // check if there are any late-modified/attached options (#4976)
  6129. var modifiedOptions = resolveModifiedOptions(Ctor);
  6130. // update base extend options
  6131. if (modifiedOptions) {
  6132. extend(Ctor.extendOptions, modifiedOptions);
  6133. }
  6134. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  6135. if (options.name) {
  6136. options.components[options.name] = Ctor;
  6137. }
  6138. }
  6139. }
  6140. return options
  6141. }
  6142. function resolveModifiedOptions (Ctor) {
  6143. var modified;
  6144. var latest = Ctor.options;
  6145. var sealed = Ctor.sealedOptions;
  6146. for (var key in latest) {
  6147. if (latest[key] !== sealed[key]) {
  6148. if (!modified) { modified = {}; }
  6149. modified[key] = latest[key];
  6150. }
  6151. }
  6152. return modified
  6153. }
  6154. function Vue (options) {
  6155. if ( true &&
  6156. !(this instanceof Vue)
  6157. ) {
  6158. warn('Vue is a constructor and should be called with the `new` keyword');
  6159. }
  6160. this._init(options);
  6161. }
  6162. initMixin(Vue);
  6163. stateMixin(Vue);
  6164. eventsMixin(Vue);
  6165. lifecycleMixin(Vue);
  6166. renderMixin(Vue);
  6167. /* */
  6168. function initUse (Vue) {
  6169. Vue.use = function (plugin) {
  6170. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  6171. if (installedPlugins.indexOf(plugin) > -1) {
  6172. return this
  6173. }
  6174. // additional parameters
  6175. var args = toArray(arguments, 1);
  6176. args.unshift(this);
  6177. if (typeof plugin.install === 'function') {
  6178. plugin.install.apply(plugin, args);
  6179. } else if (typeof plugin === 'function') {
  6180. plugin.apply(null, args);
  6181. }
  6182. installedPlugins.push(plugin);
  6183. return this
  6184. };
  6185. }
  6186. /* */
  6187. function initMixin$1 (Vue) {
  6188. Vue.mixin = function (mixin) {
  6189. this.options = mergeOptions(this.options, mixin);
  6190. return this
  6191. };
  6192. }
  6193. /* */
  6194. function initExtend (Vue) {
  6195. /**
  6196. * Each instance constructor, including Vue, has a unique
  6197. * cid. This enables us to create wrapped "child
  6198. * constructors" for prototypal inheritance and cache them.
  6199. */
  6200. Vue.cid = 0;
  6201. var cid = 1;
  6202. /**
  6203. * Class inheritance
  6204. */
  6205. Vue.extend = function (extendOptions) {
  6206. extendOptions = extendOptions || {};
  6207. var Super = this;
  6208. var SuperId = Super.cid;
  6209. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  6210. if (cachedCtors[SuperId]) {
  6211. return cachedCtors[SuperId]
  6212. }
  6213. var name = extendOptions.name || Super.options.name;
  6214. if ( true && name) {
  6215. validateComponentName(name);
  6216. }
  6217. var Sub = function VueComponent (options) {
  6218. this._init(options);
  6219. };
  6220. Sub.prototype = Object.create(Super.prototype);
  6221. Sub.prototype.constructor = Sub;
  6222. Sub.cid = cid++;
  6223. Sub.options = mergeOptions(
  6224. Super.options,
  6225. extendOptions
  6226. );
  6227. Sub['super'] = Super;
  6228. // For props and computed properties, we define the proxy getters on
  6229. // the Vue instances at extension time, on the extended prototype. This
  6230. // avoids Object.defineProperty calls for each instance created.
  6231. if (Sub.options.props) {
  6232. initProps$1(Sub);
  6233. }
  6234. if (Sub.options.computed) {
  6235. initComputed$1(Sub);
  6236. }
  6237. // allow further extension/mixin/plugin usage
  6238. Sub.extend = Super.extend;
  6239. Sub.mixin = Super.mixin;
  6240. Sub.use = Super.use;
  6241. // create asset registers, so extended classes
  6242. // can have their private assets too.
  6243. ASSET_TYPES.forEach(function (type) {
  6244. Sub[type] = Super[type];
  6245. });
  6246. // enable recursive self-lookup
  6247. if (name) {
  6248. Sub.options.components[name] = Sub;
  6249. }
  6250. // keep a reference to the super options at extension time.
  6251. // later at instantiation we can check if Super's options have
  6252. // been updated.
  6253. Sub.superOptions = Super.options;
  6254. Sub.extendOptions = extendOptions;
  6255. Sub.sealedOptions = extend({}, Sub.options);
  6256. // cache constructor
  6257. cachedCtors[SuperId] = Sub;
  6258. return Sub
  6259. };
  6260. }
  6261. function initProps$1 (Comp) {
  6262. var props = Comp.options.props;
  6263. for (var key in props) {
  6264. proxy(Comp.prototype, "_props", key);
  6265. }
  6266. }
  6267. function initComputed$1 (Comp) {
  6268. var computed = Comp.options.computed;
  6269. for (var key in computed) {
  6270. defineComputed(Comp.prototype, key, computed[key]);
  6271. }
  6272. }
  6273. /* */
  6274. function initAssetRegisters (Vue) {
  6275. /**
  6276. * Create asset registration methods.
  6277. */
  6278. ASSET_TYPES.forEach(function (type) {
  6279. Vue[type] = function (
  6280. id,
  6281. definition
  6282. ) {
  6283. if (!definition) {
  6284. return this.options[type + 's'][id]
  6285. } else {
  6286. /* istanbul ignore if */
  6287. if ( true && type === 'component') {
  6288. validateComponentName(id);
  6289. }
  6290. if (type === 'component' && isPlainObject(definition)) {
  6291. definition.name = definition.name || id;
  6292. definition = this.options._base.extend(definition);
  6293. }
  6294. if (type === 'directive' && typeof definition === 'function') {
  6295. definition = { bind: definition, update: definition };
  6296. }
  6297. this.options[type + 's'][id] = definition;
  6298. return definition
  6299. }
  6300. };
  6301. });
  6302. }
  6303. /* */
  6304. function getComponentName (opts) {
  6305. return opts && (opts.Ctor.options.name || opts.tag)
  6306. }
  6307. function matches (pattern, name) {
  6308. if (Array.isArray(pattern)) {
  6309. return pattern.indexOf(name) > -1
  6310. } else if (typeof pattern === 'string') {
  6311. return pattern.split(',').indexOf(name) > -1
  6312. } else if (isRegExp(pattern)) {
  6313. return pattern.test(name)
  6314. }
  6315. /* istanbul ignore next */
  6316. return false
  6317. }
  6318. function pruneCache (keepAliveInstance, filter) {
  6319. var cache = keepAliveInstance.cache;
  6320. var keys = keepAliveInstance.keys;
  6321. var _vnode = keepAliveInstance._vnode;
  6322. for (var key in cache) {
  6323. var cachedNode = cache[key];
  6324. if (cachedNode) {
  6325. var name = getComponentName(cachedNode.componentOptions);
  6326. if (name && !filter(name)) {
  6327. pruneCacheEntry(cache, key, keys, _vnode);
  6328. }
  6329. }
  6330. }
  6331. }
  6332. function pruneCacheEntry (
  6333. cache,
  6334. key,
  6335. keys,
  6336. current
  6337. ) {
  6338. var cached$$1 = cache[key];
  6339. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  6340. cached$$1.componentInstance.$destroy();
  6341. }
  6342. cache[key] = null;
  6343. remove(keys, key);
  6344. }
  6345. var patternTypes = [String, RegExp, Array];
  6346. var KeepAlive = {
  6347. name: 'keep-alive',
  6348. abstract: true,
  6349. props: {
  6350. include: patternTypes,
  6351. exclude: patternTypes,
  6352. max: [String, Number]
  6353. },
  6354. created: function created () {
  6355. this.cache = Object.create(null);
  6356. this.keys = [];
  6357. },
  6358. destroyed: function destroyed () {
  6359. for (var key in this.cache) {
  6360. pruneCacheEntry(this.cache, key, this.keys);
  6361. }
  6362. },
  6363. mounted: function mounted () {
  6364. var this$1 = this;
  6365. this.$watch('include', function (val) {
  6366. pruneCache(this$1, function (name) { return matches(val, name); });
  6367. });
  6368. this.$watch('exclude', function (val) {
  6369. pruneCache(this$1, function (name) { return !matches(val, name); });
  6370. });
  6371. },
  6372. render: function render () {
  6373. var slot = this.$slots.default;
  6374. var vnode = getFirstComponentChild(slot);
  6375. var componentOptions = vnode && vnode.componentOptions;
  6376. if (componentOptions) {
  6377. // check pattern
  6378. var name = getComponentName(componentOptions);
  6379. var ref = this;
  6380. var include = ref.include;
  6381. var exclude = ref.exclude;
  6382. if (
  6383. // not included
  6384. (include && (!name || !matches(include, name))) ||
  6385. // excluded
  6386. (exclude && name && matches(exclude, name))
  6387. ) {
  6388. return vnode
  6389. }
  6390. var ref$1 = this;
  6391. var cache = ref$1.cache;
  6392. var keys = ref$1.keys;
  6393. var key = vnode.key == null
  6394. // same constructor may get registered as different local components
  6395. // so cid alone is not enough (#3269)
  6396. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  6397. : vnode.key;
  6398. if (cache[key]) {
  6399. vnode.componentInstance = cache[key].componentInstance;
  6400. // make current key freshest
  6401. remove(keys, key);
  6402. keys.push(key);
  6403. } else {
  6404. cache[key] = vnode;
  6405. keys.push(key);
  6406. // prune oldest entry
  6407. if (this.max && keys.length > parseInt(this.max)) {
  6408. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  6409. }
  6410. }
  6411. vnode.data.keepAlive = true;
  6412. }
  6413. return vnode || (slot && slot[0])
  6414. }
  6415. };
  6416. var builtInComponents = {
  6417. KeepAlive: KeepAlive
  6418. };
  6419. /* */
  6420. function initGlobalAPI (Vue) {
  6421. // config
  6422. var configDef = {};
  6423. configDef.get = function () { return config; };
  6424. if (true) {
  6425. configDef.set = function () {
  6426. warn(
  6427. 'Do not replace the Vue.config object, set individual fields instead.'
  6428. );
  6429. };
  6430. }
  6431. Object.defineProperty(Vue, 'config', configDef);
  6432. // exposed util methods.
  6433. // NOTE: these are not considered part of the public API - avoid relying on
  6434. // them unless you are aware of the risk.
  6435. Vue.util = {
  6436. warn: warn,
  6437. extend: extend,
  6438. mergeOptions: mergeOptions,
  6439. defineReactive: defineReactive$$1
  6440. };
  6441. Vue.set = set;
  6442. Vue.delete = del;
  6443. Vue.nextTick = nextTick;
  6444. // 2.6 explicit observable API
  6445. Vue.observable = function (obj) {
  6446. observe(obj);
  6447. return obj
  6448. };
  6449. Vue.options = Object.create(null);
  6450. ASSET_TYPES.forEach(function (type) {
  6451. Vue.options[type + 's'] = Object.create(null);
  6452. });
  6453. // this is used to identify the "base" constructor to extend all plain-object
  6454. // components with in Weex's multi-instance scenarios.
  6455. Vue.options._base = Vue;
  6456. extend(Vue.options.components, builtInComponents);
  6457. initUse(Vue);
  6458. initMixin$1(Vue);
  6459. initExtend(Vue);
  6460. initAssetRegisters(Vue);
  6461. }
  6462. initGlobalAPI(Vue);
  6463. Object.defineProperty(Vue.prototype, '$isServer', {
  6464. get: isServerRendering
  6465. });
  6466. Object.defineProperty(Vue.prototype, '$ssrContext', {
  6467. get: function get () {
  6468. /* istanbul ignore next */
  6469. return this.$vnode && this.$vnode.ssrContext
  6470. }
  6471. });
  6472. // expose FunctionalRenderContext for ssr runtime helper installation
  6473. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  6474. value: FunctionalRenderContext
  6475. });
  6476. Vue.version = '2.6.11';
  6477. /**
  6478. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  6479. */
  6480. var ARRAYTYPE = '[object Array]';
  6481. var OBJECTTYPE = '[object Object]';
  6482. // const FUNCTIONTYPE = '[object Function]'
  6483. function diff(current, pre) {
  6484. var result = {};
  6485. syncKeys(current, pre);
  6486. _diff(current, pre, '', result);
  6487. return result
  6488. }
  6489. function syncKeys(current, pre) {
  6490. if (current === pre) { return }
  6491. var rootCurrentType = type(current);
  6492. var rootPreType = type(pre);
  6493. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  6494. if(Object.keys(current).length >= Object.keys(pre).length){
  6495. for (var key in pre) {
  6496. var currentValue = current[key];
  6497. if (currentValue === undefined) {
  6498. current[key] = null;
  6499. } else {
  6500. syncKeys(currentValue, pre[key]);
  6501. }
  6502. }
  6503. }
  6504. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  6505. if (current.length >= pre.length) {
  6506. pre.forEach(function (item, index) {
  6507. syncKeys(current[index], item);
  6508. });
  6509. }
  6510. }
  6511. }
  6512. function _diff(current, pre, path, result) {
  6513. if (current === pre) { return }
  6514. var rootCurrentType = type(current);
  6515. var rootPreType = type(pre);
  6516. if (rootCurrentType == OBJECTTYPE) {
  6517. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  6518. setResult(result, path, current);
  6519. } else {
  6520. var loop = function ( key ) {
  6521. var currentValue = current[key];
  6522. var preValue = pre[key];
  6523. var currentType = type(currentValue);
  6524. var preType = type(preValue);
  6525. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  6526. if (currentValue != pre[key]) {
  6527. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6528. }
  6529. } else if (currentType == ARRAYTYPE) {
  6530. if (preType != ARRAYTYPE) {
  6531. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6532. } else {
  6533. if (currentValue.length < preValue.length) {
  6534. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6535. } else {
  6536. currentValue.forEach(function (item, index) {
  6537. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  6538. });
  6539. }
  6540. }
  6541. } else if (currentType == OBJECTTYPE) {
  6542. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  6543. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6544. } else {
  6545. for (var subKey in currentValue) {
  6546. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  6547. }
  6548. }
  6549. }
  6550. };
  6551. for (var key in current) loop( key );
  6552. }
  6553. } else if (rootCurrentType == ARRAYTYPE) {
  6554. if (rootPreType != ARRAYTYPE) {
  6555. setResult(result, path, current);
  6556. } else {
  6557. if (current.length < pre.length) {
  6558. setResult(result, path, current);
  6559. } else {
  6560. current.forEach(function (item, index) {
  6561. _diff(item, pre[index], path + '[' + index + ']', result);
  6562. });
  6563. }
  6564. }
  6565. } else {
  6566. setResult(result, path, current);
  6567. }
  6568. }
  6569. function setResult(result, k, v) {
  6570. // if (type(v) != FUNCTIONTYPE) {
  6571. result[k] = v;
  6572. // }
  6573. }
  6574. function type(obj) {
  6575. return Object.prototype.toString.call(obj)
  6576. }
  6577. /* */
  6578. function flushCallbacks$1(vm) {
  6579. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  6580. if (Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6581. var mpInstance = vm.$scope;
  6582. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6583. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  6584. }
  6585. var copies = vm.__next_tick_callbacks.slice(0);
  6586. vm.__next_tick_callbacks.length = 0;
  6587. for (var i = 0; i < copies.length; i++) {
  6588. copies[i]();
  6589. }
  6590. }
  6591. }
  6592. function hasRenderWatcher(vm) {
  6593. return queue.find(function (watcher) { return vm._watcher === watcher; })
  6594. }
  6595. function nextTick$1(vm, cb) {
  6596. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  6597. //2.nextTick 之前存在 render watcher
  6598. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  6599. if(Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  6600. var mpInstance = vm.$scope;
  6601. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6602. ']:nextVueTick');
  6603. }
  6604. return nextTick(cb, vm)
  6605. }else{
  6606. if(Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  6607. var mpInstance$1 = vm.$scope;
  6608. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  6609. ']:nextMPTick');
  6610. }
  6611. }
  6612. var _resolve;
  6613. if (!vm.__next_tick_callbacks) {
  6614. vm.__next_tick_callbacks = [];
  6615. }
  6616. vm.__next_tick_callbacks.push(function () {
  6617. if (cb) {
  6618. try {
  6619. cb.call(vm);
  6620. } catch (e) {
  6621. handleError(e, vm, 'nextTick');
  6622. }
  6623. } else if (_resolve) {
  6624. _resolve(vm);
  6625. }
  6626. });
  6627. // $flow-disable-line
  6628. if (!cb && typeof Promise !== 'undefined') {
  6629. return new Promise(function (resolve) {
  6630. _resolve = resolve;
  6631. })
  6632. }
  6633. }
  6634. /* */
  6635. function cloneWithData(vm) {
  6636. // 确保当前 vm 所有数据被同步
  6637. var ret = Object.create(null);
  6638. var dataKeys = [].concat(
  6639. Object.keys(vm._data || {}),
  6640. Object.keys(vm._computedWatchers || {}));
  6641. dataKeys.reduce(function(ret, key) {
  6642. ret[key] = vm[key];
  6643. return ret
  6644. }, ret);
  6645. // vue-composition-api
  6646. var rawBindings = vm.__secret_vfa_state__ && vm.__secret_vfa_state__.rawBindings;
  6647. if (rawBindings) {
  6648. Object.keys(rawBindings).forEach(function (key) {
  6649. ret[key] = vm[key];
  6650. });
  6651. }
  6652. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  6653. Object.assign(ret, vm.$mp.data || {});
  6654. if (
  6655. Array.isArray(vm.$options.behaviors) &&
  6656. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  6657. ) { //form-field
  6658. ret['name'] = vm.name;
  6659. ret['value'] = vm.value;
  6660. }
  6661. return JSON.parse(JSON.stringify(ret))
  6662. }
  6663. var patch = function(oldVnode, vnode) {
  6664. var this$1 = this;
  6665. if (vnode === null) { //destroy
  6666. return
  6667. }
  6668. if (this.mpType === 'page' || this.mpType === 'component') {
  6669. var mpInstance = this.$scope;
  6670. var data = Object.create(null);
  6671. try {
  6672. data = cloneWithData(this);
  6673. } catch (err) {
  6674. console.error(err);
  6675. }
  6676. data.__webviewId__ = mpInstance.data.__webviewId__;
  6677. var mpData = Object.create(null);
  6678. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  6679. mpData[key] = mpInstance.data[key];
  6680. });
  6681. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  6682. if (Object.keys(diffData).length) {
  6683. if (Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6684. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  6685. ']差量更新',
  6686. JSON.stringify(diffData));
  6687. }
  6688. this.__next_tick_pending = true;
  6689. mpInstance.setData(diffData, function () {
  6690. this$1.__next_tick_pending = false;
  6691. flushCallbacks$1(this$1);
  6692. });
  6693. } else {
  6694. flushCallbacks$1(this);
  6695. }
  6696. }
  6697. };
  6698. /* */
  6699. function createEmptyRender() {
  6700. }
  6701. function mountComponent$1(
  6702. vm,
  6703. el,
  6704. hydrating
  6705. ) {
  6706. if (!vm.mpType) {//main.js 中的 new Vue
  6707. return vm
  6708. }
  6709. if (vm.mpType === 'app') {
  6710. vm.$options.render = createEmptyRender;
  6711. }
  6712. if (!vm.$options.render) {
  6713. vm.$options.render = createEmptyRender;
  6714. if (true) {
  6715. /* istanbul ignore if */
  6716. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  6717. vm.$options.el || el) {
  6718. warn(
  6719. 'You are using the runtime-only build of Vue where the template ' +
  6720. 'compiler is not available. Either pre-compile the templates into ' +
  6721. 'render functions, or use the compiler-included build.',
  6722. vm
  6723. );
  6724. } else {
  6725. warn(
  6726. 'Failed to mount component: template or render function not defined.',
  6727. vm
  6728. );
  6729. }
  6730. }
  6731. }
  6732. !vm._$fallback && callHook(vm, 'beforeMount');
  6733. var updateComponent = function () {
  6734. vm._update(vm._render(), hydrating);
  6735. };
  6736. // we set this to vm._watcher inside the watcher's constructor
  6737. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  6738. // component's mounted hook), which relies on vm._watcher being already defined
  6739. new Watcher(vm, updateComponent, noop, {
  6740. before: function before() {
  6741. if (vm._isMounted && !vm._isDestroyed) {
  6742. callHook(vm, 'beforeUpdate');
  6743. }
  6744. }
  6745. }, true /* isRenderWatcher */);
  6746. hydrating = false;
  6747. return vm
  6748. }
  6749. /* */
  6750. function renderClass (
  6751. staticClass,
  6752. dynamicClass
  6753. ) {
  6754. if (isDef(staticClass) || isDef(dynamicClass)) {
  6755. return concat(staticClass, stringifyClass(dynamicClass))
  6756. }
  6757. /* istanbul ignore next */
  6758. return ''
  6759. }
  6760. function concat (a, b) {
  6761. return a ? b ? (a + ' ' + b) : a : (b || '')
  6762. }
  6763. function stringifyClass (value) {
  6764. if (Array.isArray(value)) {
  6765. return stringifyArray(value)
  6766. }
  6767. if (isObject(value)) {
  6768. return stringifyObject(value)
  6769. }
  6770. if (typeof value === 'string') {
  6771. return value
  6772. }
  6773. /* istanbul ignore next */
  6774. return ''
  6775. }
  6776. function stringifyArray (value) {
  6777. var res = '';
  6778. var stringified;
  6779. for (var i = 0, l = value.length; i < l; i++) {
  6780. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  6781. if (res) { res += ' '; }
  6782. res += stringified;
  6783. }
  6784. }
  6785. return res
  6786. }
  6787. function stringifyObject (value) {
  6788. var res = '';
  6789. for (var key in value) {
  6790. if (value[key]) {
  6791. if (res) { res += ' '; }
  6792. res += key;
  6793. }
  6794. }
  6795. return res
  6796. }
  6797. /* */
  6798. var parseStyleText = cached(function (cssText) {
  6799. var res = {};
  6800. var listDelimiter = /;(?![^(]*\))/g;
  6801. var propertyDelimiter = /:(.+)/;
  6802. cssText.split(listDelimiter).forEach(function (item) {
  6803. if (item) {
  6804. var tmp = item.split(propertyDelimiter);
  6805. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  6806. }
  6807. });
  6808. return res
  6809. });
  6810. // normalize possible array / string values into Object
  6811. function normalizeStyleBinding (bindingStyle) {
  6812. if (Array.isArray(bindingStyle)) {
  6813. return toObject(bindingStyle)
  6814. }
  6815. if (typeof bindingStyle === 'string') {
  6816. return parseStyleText(bindingStyle)
  6817. }
  6818. return bindingStyle
  6819. }
  6820. /* */
  6821. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  6822. function getTarget(obj, path) {
  6823. var parts = path.split('.');
  6824. var key = parts[0];
  6825. if (key.indexOf('__$n') === 0) { //number index
  6826. key = parseInt(key.replace('__$n', ''));
  6827. }
  6828. if (parts.length === 1) {
  6829. return obj[key]
  6830. }
  6831. return getTarget(obj[key], parts.slice(1).join('.'))
  6832. }
  6833. function internalMixin(Vue) {
  6834. Vue.config.errorHandler = function(err, vm, info) {
  6835. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  6836. console.error(err);
  6837. /* eslint-disable no-undef */
  6838. var app = getApp();
  6839. if (app && app.onError) {
  6840. app.onError(err);
  6841. }
  6842. };
  6843. var oldEmit = Vue.prototype.$emit;
  6844. Vue.prototype.$emit = function(event) {
  6845. if (this.$scope && event) {
  6846. this.$scope['triggerEvent'](event, {
  6847. __args__: toArray(arguments, 1)
  6848. });
  6849. }
  6850. return oldEmit.apply(this, arguments)
  6851. };
  6852. Vue.prototype.$nextTick = function(fn) {
  6853. return nextTick$1(this, fn)
  6854. };
  6855. MP_METHODS.forEach(function (method) {
  6856. Vue.prototype[method] = function(args) {
  6857. if (this.$scope && this.$scope[method]) {
  6858. return this.$scope[method](args)
  6859. }
  6860. // mp-alipay
  6861. if (typeof my === 'undefined') {
  6862. return
  6863. }
  6864. if (method === 'createSelectorQuery') {
  6865. /* eslint-disable no-undef */
  6866. return my.createSelectorQuery(args)
  6867. } else if (method === 'createIntersectionObserver') {
  6868. /* eslint-disable no-undef */
  6869. return my.createIntersectionObserver(args)
  6870. }
  6871. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  6872. };
  6873. });
  6874. Vue.prototype.__init_provide = initProvide;
  6875. Vue.prototype.__init_injections = initInjections;
  6876. Vue.prototype.__call_hook = function(hook, args) {
  6877. var vm = this;
  6878. // #7573 disable dep collection when invoking lifecycle hooks
  6879. pushTarget();
  6880. var handlers = vm.$options[hook];
  6881. var info = hook + " hook";
  6882. var ret;
  6883. if (handlers) {
  6884. for (var i = 0, j = handlers.length; i < j; i++) {
  6885. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  6886. }
  6887. }
  6888. if (vm._hasHookEvent) {
  6889. vm.$emit('hook:' + hook, args);
  6890. }
  6891. popTarget();
  6892. return ret
  6893. };
  6894. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  6895. if (Array.isArray(modifiers)) {
  6896. if (modifiers.indexOf('trim') !== -1) {
  6897. value = value.trim();
  6898. }
  6899. if (modifiers.indexOf('number') !== -1) {
  6900. value = this._n(value);
  6901. }
  6902. }
  6903. if (!target) {
  6904. target = this;
  6905. }
  6906. target[key] = value;
  6907. };
  6908. Vue.prototype.__set_sync = function(target, key, value) {
  6909. if (!target) {
  6910. target = this;
  6911. }
  6912. target[key] = value;
  6913. };
  6914. Vue.prototype.__get_orig = function(item) {
  6915. if (isPlainObject(item)) {
  6916. return item['$orig'] || item
  6917. }
  6918. return item
  6919. };
  6920. Vue.prototype.__get_value = function(dataPath, target) {
  6921. return getTarget(target || this, dataPath)
  6922. };
  6923. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  6924. return renderClass(staticClass, dynamicClass)
  6925. };
  6926. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  6927. if (!dynamicStyle && !staticStyle) {
  6928. return ''
  6929. }
  6930. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  6931. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  6932. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  6933. };
  6934. Vue.prototype.__map = function(val, iteratee) {
  6935. //TODO 暂不考虑 string
  6936. var ret, i, l, keys, key;
  6937. if (Array.isArray(val)) {
  6938. ret = new Array(val.length);
  6939. for (i = 0, l = val.length; i < l; i++) {
  6940. ret[i] = iteratee(val[i], i);
  6941. }
  6942. return ret
  6943. } else if (isObject(val)) {
  6944. keys = Object.keys(val);
  6945. ret = Object.create(null);
  6946. for (i = 0, l = keys.length; i < l; i++) {
  6947. key = keys[i];
  6948. ret[key] = iteratee(val[key], key, i);
  6949. }
  6950. return ret
  6951. } else if (typeof val === 'number') {
  6952. ret = new Array(val);
  6953. for (i = 0, l = val; i < l; i++) {
  6954. // 第一个参数暂时仍和小程序一致
  6955. ret[i] = iteratee(i, i);
  6956. }
  6957. return ret
  6958. }
  6959. return []
  6960. };
  6961. }
  6962. /* */
  6963. var LIFECYCLE_HOOKS$1 = [
  6964. //App
  6965. 'onLaunch',
  6966. 'onShow',
  6967. 'onHide',
  6968. 'onUniNViewMessage',
  6969. 'onPageNotFound',
  6970. 'onThemeChange',
  6971. 'onError',
  6972. 'onUnhandledRejection',
  6973. //Page
  6974. 'onLoad',
  6975. // 'onShow',
  6976. 'onReady',
  6977. // 'onHide',
  6978. 'onUnload',
  6979. 'onPullDownRefresh',
  6980. 'onReachBottom',
  6981. 'onTabItemTap',
  6982. 'onAddToFavorites',
  6983. 'onShareTimeline',
  6984. 'onShareAppMessage',
  6985. 'onResize',
  6986. 'onPageScroll',
  6987. 'onNavigationBarButtonTap',
  6988. 'onBackPress',
  6989. 'onNavigationBarSearchInputChanged',
  6990. 'onNavigationBarSearchInputConfirmed',
  6991. 'onNavigationBarSearchInputClicked',
  6992. //Component
  6993. // 'onReady', // 兼容旧版本,应该移除该事件
  6994. 'onPageShow',
  6995. 'onPageHide',
  6996. 'onPageResize'
  6997. ];
  6998. function lifecycleMixin$1(Vue) {
  6999. //fixed vue-class-component
  7000. var oldExtend = Vue.extend;
  7001. Vue.extend = function(extendOptions) {
  7002. extendOptions = extendOptions || {};
  7003. var methods = extendOptions.methods;
  7004. if (methods) {
  7005. Object.keys(methods).forEach(function (methodName) {
  7006. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  7007. extendOptions[methodName] = methods[methodName];
  7008. delete methods[methodName];
  7009. }
  7010. });
  7011. }
  7012. return oldExtend.call(this, extendOptions)
  7013. };
  7014. var strategies = Vue.config.optionMergeStrategies;
  7015. var mergeHook = strategies.created;
  7016. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  7017. strategies[hook] = mergeHook;
  7018. });
  7019. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  7020. }
  7021. /* */
  7022. // install platform patch function
  7023. Vue.prototype.__patch__ = patch;
  7024. // public mount method
  7025. Vue.prototype.$mount = function(
  7026. el ,
  7027. hydrating
  7028. ) {
  7029. return mountComponent$1(this, el, hydrating)
  7030. };
  7031. lifecycleMixin$1(Vue);
  7032. internalMixin(Vue);
  7033. /* */
  7034. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  7035. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  7036. /***/ }),
  7037. /***/ 3:
  7038. /*!***********************************!*\
  7039. !*** (webpack)/buildin/global.js ***!
  7040. \***********************************/
  7041. /*! no static exports found */
  7042. /***/ (function(module, exports) {
  7043. var g;
  7044. // This works in non-strict mode
  7045. g = (function() {
  7046. return this;
  7047. })();
  7048. try {
  7049. // This works if eval is allowed (see CSP)
  7050. g = g || new Function("return this")();
  7051. } catch (e) {
  7052. // This works if the window reference is available
  7053. if (typeof window === "object") g = window;
  7054. }
  7055. // g can still be undefined, but nothing to do about it...
  7056. // We return undefined, instead of nothing here, so it's
  7057. // easier to handle this case. if(!global) { ...}
  7058. module.exports = g;
  7059. /***/ }),
  7060. /***/ 4:
  7061. /*!*****************************************************!*\
  7062. !*** /Users/lhch/other/muzhuang-android/pages.json ***!
  7063. \*****************************************************/
  7064. /*! no static exports found */
  7065. /***/ (function(module, exports) {
  7066. /***/ }),
  7067. /***/ 74:
  7068. /*!************************************************************************!*\
  7069. !*** /Users/lhch/other/muzhuang-android/components/uni-popup/popup.js ***!
  7070. \************************************************************************/
  7071. /*! no static exports found */
  7072. /***/ (function(module, exports, __webpack_require__) {
  7073. "use strict";
  7074. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _message = _interopRequireDefault(__webpack_require__(/*! ./message.js */ 75));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  7075. // 定义 type 类型:弹出类型:top/bottom/center
  7076. var config = {
  7077. // 顶部弹出
  7078. top: 'top',
  7079. // 底部弹出
  7080. bottom: 'bottom',
  7081. // 居中弹出
  7082. center: 'center',
  7083. // 消息提示
  7084. message: 'top',
  7085. // 对话框
  7086. dialog: 'center',
  7087. // 分享
  7088. share: 'bottom' };var _default =
  7089. {
  7090. data: function data() {
  7091. return {
  7092. config: config };
  7093. },
  7094. mixins: [_message.default] };exports.default = _default;
  7095. /***/ }),
  7096. /***/ 75:
  7097. /*!**************************************************************************!*\
  7098. !*** /Users/lhch/other/muzhuang-android/components/uni-popup/message.js ***!
  7099. \**************************************************************************/
  7100. /*! no static exports found */
  7101. /***/ (function(module, exports, __webpack_require__) {
  7102. "use strict";
  7103. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  7104. created: function created() {
  7105. if (this.type === 'message') {
  7106. // 不显示遮罩
  7107. this.maskShow = false;
  7108. // 获取子组件对象
  7109. this.childrenMsg = null;
  7110. }
  7111. },
  7112. methods: {
  7113. customOpen: function customOpen() {
  7114. if (this.childrenMsg) {
  7115. this.childrenMsg.open();
  7116. }
  7117. },
  7118. customClose: function customClose() {
  7119. if (this.childrenMsg) {
  7120. this.childrenMsg.close();
  7121. }
  7122. } } };exports.default = _default;
  7123. /***/ })
  7124. }]);
  7125. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map