vendor.js 259 KB

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