vendor.js 293 KB

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