vendor.js 264 KB

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