vendor.js 269 KB

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