vendor.js 246 KB

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