vendor.js 285 KB

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