vendor.js 283 KB

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